Index: ssts-web/src/main/webapp/disinfectsystem/config/ljsrmyy/config.js =================================================================== diff -u -r15309 -r15337 --- ssts-web/src/main/webapp/disinfectsystem/config/ljsrmyy/config.js (.../config.js) (revision 15309) +++ ssts-web/src/main/webapp/disinfectsystem/config/ljsrmyy/config.js (.../config.js) (revision 15337) @@ -43,5 +43,7 @@ //回收人默认用登录用户 recyclingUserDefault:false, //批量打印发货单,打印消毒物品和器械包是否分开为两个按钮,如果为true,表示分开为两个按钮,如果为false或者没有配置,都是合并为一个按钮 - splitTousseAndDisinfectInvoiceBtn:true + splitTousseAndDisinfectInvoiceBtn:true, + //公司名称 "dingxiang"显示主页显示丁香的logo,不配置或者配为"forgon",显示孚峻的logo + companyName : "dingxiang" } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/config/zsxlrmyy/config.js =================================================================== diff -u -r15276 -r15337 --- ssts-web/src/main/webapp/disinfectsystem/config/zsxlrmyy/config.js (.../config.js) (revision 15276) +++ ssts-web/src/main/webapp/disinfectsystem/config/zsxlrmyy/config.js (.../config.js) (revision 15337) @@ -60,9 +60,21 @@ moneyDigitCount:4, //隐藏档案管理 hideStaffArchive : false, +//灭菌完成输入完成确认人 + needFinishComfirmer : true, //器械包定义的大小下拉框选项配置及默认大小 pageSizeArrayConfig : [['标准包'],['超大包'],['超重包'],['超大超重包']], defaultPackageSize : '标准包', //是否隐藏加急数量,默认为隐藏,未配置或配置不为false时则隐藏,配置为false才不隐藏 - isHideUrgentAmount: false + isHideUrgentAmount: false, + // 清洗机是否有位置 + haveRinserPosition : false, + // 清洗记录是否强制扫描位置 + wrRecordScanPosition : false, + // 灭菌炉是否有位置 + haveSterilizerPosition : true, + // 灭菌记录是否强制扫描位置 + stRecordScanPosition : false, + // 公司名称 + companyName : "dingxiang" } \ No newline at end of file Index: ssts-web/src/main/webapp/disinfectsystem/config/gysdermyy/config.js =================================================================== diff -u -r15309 -r15337 --- ssts-web/src/main/webapp/disinfectsystem/config/gysdermyy/config.js (.../config.js) (revision 15309) +++ ssts-web/src/main/webapp/disinfectsystem/config/gysdermyy/config.js (.../config.js) (revision 15337) @@ -43,5 +43,8 @@ //回收人默认用登录用户 recyclingUserDefault:false, //批量打印发货单,打印消毒物品和器械包是否分开为两个按钮,如果为true,表示分开为两个按钮,如果为false或者没有配置,都是合并为一个按钮 - splitTousseAndDisinfectInvoiceBtn:true + splitTousseAndDisinfectInvoiceBtn:true, + //公司名称 "dingxiang"显示主页显示丁香的logo,不配置或者配为"forgon",显示孚峻的logo + companyName : "dingxiang" + } \ No newline at end of file Index: ssts-web/src/main/webapp/themes/portalPage/img/logo_dingxiangsoft.png =================================================================== diff -u Binary files differ Index: ssts-web/src/main/webapp/logon.jsp =================================================================== diff -u -r14060 -r15337 --- ssts-web/src/main/webapp/logon.jsp (.../logon.jsp) (revision 14060) +++ ssts-web/src/main/webapp/logon.jsp (.../logon.jsp) (revision 15337) @@ -1,6 +1,7 @@ <%@ page contentType="text/html; charset=UTF-8"%> <%@ include file="/common/taglibs.jsp" %> <%@page import="com.forgon.disinfectsystem.common.*"%> +<%@page import="net.sf.json.JSONObject" %> <%@page import="java.io.File" %> <% @@ -23,6 +24,16 @@ if(WebConstants.ENABLE_FILE_SYSTEM_OBJECT.equals(flag)){ session.setAttribute(WebConstants.ACCESS_FILE_SYSTEM_OBJECT_FLAG, flag); } + +String companyName = CssdUtils.getSystemSetConfigByName("companyName"); +String companyNameStr = ""; +if(companyName == null || companyName.equals("forgon")){ + companyNameStr = "@2012 广州孚峻信息技术有限公司 版权所有"; +}else if(companyName.equals("dingxiang")){ + companyNameStr = "@2016 广州丁香软件有限公司 版权所有"; +} +session.setAttribute("companyName", companyNameStr); + String project = CssdUtils.getConfigProperty("project"); session.setAttribute("profile", project); @@ -32,7 +43,11 @@ if(file.exists()){ request.setAttribute("logoPath",imgPath); }else{ - request.setAttribute("logoPath","themes/portalPage/img/logo_Forgon.png"); + if(companyName == null || companyName.equals("forgon")){ + request.setAttribute("logoPath","themes/portalPage/img/logo_Forgon.png"); + }else if(companyName.equals("dingxiang")){ + request.setAttribute("logoPath","themes/portalPage/img/logo_dingxiangsoft.png"); + } } %> @@ -86,7 +101,7 @@ - + Index: ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/CssdUtils.java =================================================================== diff -u -r15299 -r15337 --- ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/CssdUtils.java (.../CssdUtils.java) (revision 15299) +++ ssts-basedata/src/main/java/com/forgon/disinfectsystem/common/CssdUtils.java (.../CssdUtils.java) (revision 15337) @@ -1,6 +1,7 @@ package com.forgon.disinfectsystem.common; import java.io.BufferedReader; +import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; @@ -13,12 +14,15 @@ import java.util.Date; import java.util.List; import java.util.Properties; +import java.util.Scanner; import net.sf.json.JSONArray; import net.sf.json.JSONObject; import org.apache.commons.lang3.StringUtils; +import com.fasterxml.jackson.core.JsonParser.Feature; +import com.fasterxml.jackson.databind.ObjectMapper; import com.forgon.Constants; import com.forgon.directory.model.BarcodeDevice; import com.forgon.disinfectsystem.entity.assestmanagement.DiposableGoodsInstance; @@ -163,27 +167,58 @@ /** * 获取config.js内容 - * 使用先决条件是要去掉config.js中的中文注释,不然转json会报错 + * 支持config.js中有中文注释 */ public static JSONObject getWebConfigInfo(){ + JSONObject jsonObj = null; + + ObjectMapper mapper = new ObjectMapper().configure( + Feature.ALLOW_COMMENTS, true); + + mapper.configure(Feature.ALLOW_UNQUOTED_FIELD_NAMES, true); + mapper.configure(Feature.ALLOW_SINGLE_QUOTES, true); + Scanner scan = null; try { + String rootPath = Path.getWebAppRoot(); String project = getConfigProperty("project"); - String configPath = rootPath + "/disinfectsystem/config/" + project + String filename = rootPath + "/disinfectsystem/config/" + project + "/config.js"; - String jsonStr = CssdUtils.readFile(configPath); - if (StringUtils.isNotBlank(jsonStr)) { - int startIndex = jsonStr.indexOf("{"); - int endIndex = (jsonStr.lastIndexOf("}") + 1); - if (startIndex != -1 && endIndex != -1 && startIndex < endIndex) { - jsonStr = jsonStr.substring(startIndex, endIndex); - return JSONObject.fromObject(jsonStr); - } + scan = new Scanner(new File(filename)); + String content = scan.useDelimiter("\\Z").next(); + + content = content.replaceAll("var sstsConfig = ", ""); + + jsonObj = mapper + .readValue( + content, + JSONObject.class); + } catch (IOException e) { + e.printStackTrace(); + }finally{ + if(scan != null){ + scan.close(); } - } catch (Exception e) {} - return null; + } + return jsonObj; } + /** + * 根据key获取config.js的配置 + * @param key + * @return + */ + public static String getSystemSetConfigByName(String key){ + if(StringUtils.isBlank(key)){ + return null; + } + JSONObject obj = getWebConfigInfo(); + Object valueObj = obj.get(key); + if(valueObj != null){ + return valueObj.toString(); + } + return null; + } // 判断用户名是否为条形码编码 public static boolean usernameIsBarcode(String username) { return username.matches("^[0-9]{9}$"); Index: ssts-web/src/main/webapp/homepage/portalPage.jsp =================================================================== diff -u -r14691 -r15337 --- ssts-web/src/main/webapp/homepage/portalPage.jsp (.../portalPage.jsp) (revision 14691) +++ ssts-web/src/main/webapp/homepage/portalPage.jsp (.../portalPage.jsp) (revision 15337) @@ -4,6 +4,7 @@ <%@page import="com.forgon.disinfectsystem.entity.basedatamanager.supplyroomconfig.SupplyRoomConfig"%> <%@page import="com.forgon.disinfectsystem.entity.systemwarning.SystemWarningItemVO,net.sf.json.JSONObject"%> <%@ page contentType="text/html; charset=UTF-8"%> +<%@page import="com.forgon.disinfectsystem.common.*"%> <%@ page import="com.forgon.tools.SpringBeanManger,com.forgon.directory.vo.LoginUserData,com.forgon.portal.action.PortalPageAction"%> <%@ page import="java.util.Date"%> <%@ include file="/common/taglibs.jsp"%> @@ -37,13 +38,18 @@ String loginUserDataJsonStr = JSONObject.fromObject(userData).toString(); request.setAttribute("loginUserDataJsonStr",loginUserDataJsonStr); + String companyName = CssdUtils.getSystemSetConfigByName("companyName"); String project = CssdUtils.getConfigProperty("project"); String imgPath = "disinfectsystem/config/" + project + "/img/logo_" + project +".png"; File file = new File(application.getRealPath("/") + imgPath); if(file.exists()){ request.setAttribute("logoPath",imgPath); }else{ - request.setAttribute("logoPath","themes/portalPage/img/logo_Forgon.png"); + if(companyName == null || companyName.equals("forgon")){ + request.setAttribute("logoPath","themes/portalPage/img/logo_Forgon.png"); + }else if(companyName.equals("dingxiang")){ + request.setAttribute("logoPath","themes/portalPage/img/logo_dingxiangsoft.png"); + } } String openSelectOrgUnitWindow = (String)session.getAttribute("openSelectOrgUnitWindow"); //决定要不要显示切换科室的窗口 if ("打开".equals(openSelectOrgUnitWindow)) {