/*
|
* 生成1类型窗体文件,生成路径已系统菜单为准,文件为formID_file.jsp为准。 xiangluan 2010-04-16
|
*/
|
package com.yc.service.build.type;
|
|
import com.yc.action.grid.GridUtils;
|
import com.yc.action.grid.TMuiDTO;
|
import com.yc.api.bean.T9685Entity;
|
import com.yc.api.service.ApiServiceIfc;
|
import com.yc.exception.ApplicationException;
|
import com.yc.service.build.top.BuildTopIfc;
|
import com.yc.service.commons.GformIfc;
|
import com.yc.service.impl.DBHelper;
|
import com.yc.service.panel.PanelServiceIfc;
|
import com.yc.service.panel.SqlDBHelperIfc;
|
import com.yc.service.panel.SystemSettingsDao;
|
import org.apache.commons.io.FileUtils;
|
import org.apache.commons.lang.StringUtils;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.context.annotation.Scope;
|
import org.springframework.stereotype.Service;
|
|
import java.io.File;
|
import java.util.*;
|
|
//import com.yc.service.panel.TypeControlDao;
|
|
@Service("T_496_impl")
|
@Scope("prototype")
|
public class T_496_Impl extends BaseImpl implements T_496_Ifc {
|
// 通过功能号id获得明细设置
|
private static final String GET_TABPAGE_DETAIL = "select "+
|
"[mainformid] "+
|
",[mainformname] "+
|
",[FormGroupID] "+
|
",[FormGroupName]"+
|
",[SortBy] "+
|
",[formid] "+
|
",[formname] "+
|
",[formtype] "+
|
",[LabelName] "+
|
",[FT] "+
|
",[FTName] "+
|
",[FK] "+
|
",[SeekGroupID] "+
|
",[GridHeight] "+
|
",[GroupID] "+
|
",[GroupName] "+
|
",[TabID] "+
|
",[TabHeight] "+
|
",[isStartupCollapsed]"
|
+" from _sys_tabpageformid where mainformid=? and Actived=1 order by sortby asc";
|
@Autowired
|
private GformIfc gformIfc;
|
@Autowired
|
private BuildTopIfc buildTopIfc;
|
@Autowired
|
private PanelServiceIfc pIfc;
|
// @Autowired
|
// private TypeControlDao typeControlDao;
|
@Autowired
|
private SystemSettingsDao systemSettingsDao;
|
@Autowired
|
SqlDBHelperIfc sqlDBHelperIfc;
|
@Autowired
|
private ApiServiceIfc apiServiceIfc;
|
String doc = "";// 关联字段
|
private String id_info="";
|
/*
|
* 生成文件
|
*/
|
@Override
|
public synchronized int build() throws Exception {
|
Map<String, Object> gformInfo = getFormInfo(this.formID);
|
buildJsCssHead(gformInfo);
|
buildTop(gformInfo);
|
buildHelpPage(gformInfo);
|
buildFoolter();
|
buildCss();
|
buildIndex(gformInfo);
|
buildDataHead(gformInfo);
|
return 0;
|
}
|
|
protected Map<String, Object> getFormInfo(String formid) {
|
Map<String, Object> gformInfo = gformIfc.getGformInfo("predocstatus,formname,showdetail,"
|
+ "isopenFuncshowpwdedit," + "isshowpwdedit,isShowOnlineMsg,isShowProcessTracking,optype,"
|
+ "HDTable,version,CancelBtnProcName,RevokeBtnProcName,RevokeBtnExpression,"
|
+ "RevokeBtnEditStatus,isShowNewDocButton ",Integer.parseInt(formid));
|
return gformInfo;
|
}
|
|
/**
|
* 生成jsp数据处理头页面
|
*
|
* @throws Exception
|
*/
|
public void buildDataHead(Map<String, Object> gformInfo) throws Exception {
|
String fileName = "dataHead.jsp";
|
String tmpJsp = getPageCode(fileName);
|
tmpJsp = tmpJsp.replace("[?formId]", formID);
|
tmpJsp = tmpJsp.replace("[?formType]", type + "");
|
tmpJsp = tmpJsp.replace("[?canelProc]",toString(gformInfo.get("CancelBtnProcName")));//取消确认
|
tmpJsp = tmpJsp.replace("[?revokeProc]",toString(gformInfo.get("RevokeBtnProcName")));//撤回
|
tmpJsp = tmpJsp.replace("[?isShowOnlineMsg]", gformInfo.get("isShowOnlineMsg") + "");
|
tmpJsp = tmpJsp.replace("[?isShowProcessTracking]", gformInfo.get("isShowProcessTracking") + "");
|
// tmpJsp = tmpJsp.replace("[?isShowPwdEdit]",toString(map.get("isshowpwdedit")));//1类型没有确认
|
tmpJsp = tmpJsp.replace("[?isOpenFuncShowPwdEdit]", toString(gformInfo.get("isopenFuncshowpwdedit")));
|
tmpJsp = tmpJsp.replace("[?version]",("".equalsIgnoreCase(toString(gformInfo.get("version")))?"0":toString(gformInfo.get("version"))));
|
tmpJsp = replaceGform(tmpJsp);
|
tmpJsp = tmpJsp.replaceAll("@doc", doc);
|
tmpJsp = tmpJsp.replaceAll("@id_info", id_info);//各个子表需要调用的where条件:cltcode=...。
|
id_info="";
|
//--操作类型
|
if(gformInfo.get("optype")!=null&&!StringUtils.isBlank(gformInfo.get("optype").toString())){
|
tmpJsp = tmpJsp.replace("[?formOptType]", gformInfo.get("optype").toString().equalsIgnoreCase("0")?"-1":gformInfo.get("optype").toString());
|
}else{
|
tmpJsp = tmpJsp.replace("[?formOptType]","-1");
|
}
|
buildPageCode(tmpJsp, fileName);
|
}
|
|
/**
|
* 生成js css 导入的页面
|
*
|
* @throws Exception
|
*/
|
public void buildJsCssHead(Map<String, Object> gformInfo) throws Exception {
|
String fileName = "jsCssHead.jsp";
|
String data = getPageCode(fileName);
|
// ----------------
|
List<HashMap<String, String>> listS = null;
|
listS = systemSettingsDao.getListIn(Integer.valueOf(formID), 9303);
|
String companyId = "";
|
if (listS == null || listS.size() < 1) {
|
throw new Exception("凭证定义未定义" + formID + "功能号");
|
} else {
|
companyId = listS.get(0).get("periodorgfield").toLowerCase();
|
if (companyId.trim().equals("")) { throw new Exception("凭证定义未定义" + formID + "功能号的期间组织代码"); }
|
}
|
data = data.replaceAll("@CustomDoccode@", this.getValue(listS.get(0), "customdoccode"));
|
data = data.replace("#periodtype#", listS.get(0).get("periodtype"));
|
data = data.replace("#comanyId#", companyId);
|
String sql = " set nocount on ; select predocstatus,procgroupaftersavedoc,dealafterdocsave,transgroupcode from gform where formid=" + formID;
|
listS = sqlDBHelperIfc.getHashMap(sql);
|
data = data.replaceAll("#predocstatus#", getValueInt(listS.get(0), "predocstatus"));
|
data = data.replace("[?predocstatus]", getValueInt(listS.get(0),"predocstatus") + "");
|
data = data.replace("[?isShowOnlineMsg]", gformInfo.get("isShowOnlineMsg") + "");
|
data = data.replace("[?isShowProcessTracking]", gformInfo.get("isShowProcessTracking") + "");
|
buildPageCode(data, fileName);
|
}
|
|
/**
|
* 生成top页面
|
*
|
* @throws Exception
|
*/
|
public void buildTop(Map<String, Object> gformInfo) throws Exception {
|
buildTopIfc.build(Integer.parseInt(formID), type, getBuildPath() + "top.jsp", getToPath() + "top.jsp", gformInfo,this);
|
|
}
|
|
/**
|
* 生成帮助页面
|
*
|
* @throws Exception
|
*/
|
public void buildHelpPage(Map<String, Object> gformInfo) throws Exception {
|
buildTopIfc.build(Integer.parseInt(formID), type, getTemPath() + "help.jsp", getToPath() + "help.jsp", gformInfo,this);
|
}
|
|
/**
|
* 生成foolter页面(资源释放页)
|
*
|
* @throws Exception
|
*/
|
public void buildFoolter() throws Exception {
|
String fileName = "foolter.jsp";
|
String data = getPageCode(fileName);
|
// ----------------
|
|
buildPageCode(data, fileName);
|
|
}
|
public void buildCss() throws Exception {
|
String fileName = "css.css";
|
String data = getPageCode(fileName);
|
// ----------------
|
|
buildPageCode(data, fileName);
|
|
}
|
/**
|
* 通过分组id+页框id获得明细设置
|
*
|
* @param formGroupId
|
* @return
|
*/
|
public List<Map<String, Object>> getTabPageDetail(String formGroupId) {
|
return this.jdbcTemplate.queryForList(GET_TABPAGE_DETAIL, formGroupId);
|
}
|
|
/**
|
* 判断是实体表还是视图 如果是视图则返回true
|
* @param action 表名
|
* @return
|
*/
|
public boolean getdocstaut(String action) {
|
boolean bolcont=false;
|
String sql=" set nocount on ; select count(1) from INFORMATION_SCHEMA.TABLES where table_type='view' and table_name=?";
|
int cont = this.jdbcTemplate.queryForObject(sql,Integer.class,new Object[] {action});
|
if(cont==1){//是视图
|
bolcont=true;
|
}
|
return bolcont;
|
}
|
/**
|
* 生成主页面
|
*
|
* @throws Exception
|
*/
|
public void buildIndex(Map<String, Object> gformInfo) throws Exception {
|
String fileName = "index.jsp";
|
String data = getPageCode(fileName);
|
// --------从gform表获取是否显示大标题字段值(isTitle)判断是否显示大标题,并替换标识符-2012-02-20-syz--------[begin]----------------------
|
if (true) {
|
String sSQL = " set nocount on ; select count(1) from gform where formid='" + formID + "' and isTitle='1' ";// isTitle=1表示配置了显示大标题
|
int flg = this.getSimpleJdbcTemplate().queryForObject(sSQL, Integer.class);
|
if (flg == 1) {// 如果配置了显示大标题
|
String TopTitle = "<table id=\"top_table\" width=\"100%\" bgcolor=\"#DEEDF7\">\n" + "<tr>\n"
|
+ "<td>\n" + "<div id=\"title_top\">[?title]</div>\n" + "</td></tr>\n"
|
// + "<tr>\n" + "<td>\n"
|
// + "<hr style=\"position: absolute;left:0px;top:28px;height: 1px;color: #bdc7c6;width: 99%;\">\n"
|
// + "</td>\n" + "</tr>\n"
|
+ "<tr><td>\n" + "<div id=\"tplt-top\">\n"
|
+ "\t\t\t<jsp:include page=\"top.jsp\" flush=\"true\"/>\n" + "\t\t</div>\n" + "</td></tr>\n"
|
+ "</table>\n";// <%@include file=\"top.jsp\"%>
|
data = data.replace("[?TopAndTitle]", TopTitle);// 替换功能号标识符
|
} else {// 如果没有配置显示大标题
|
String TopAndTitle_str = "<div id=\"tplt-top\">\n\t\t\t<jsp:include page=\"top.jsp\" flush=\"true\"/>\n";
|
data = data.replace("[?TopAndTitle]", TopAndTitle_str);// 替换功能号标识符
|
}
|
}
|
// --------从gform表获取是否显示大标题字段值(isTitle)判断是否显示大标题,并替换标识符-2012-02-20-syz-----[end]-------------------------//
|
// ----------------
|
Map<String, String> endCreate = new HashMap<String, String>();// 延长生成文件
|
String jspName = "";//jsp名称
|
boolean isMainPanel=true;//是否是主面板
|
String html = "";//没设置页卡时候的内容
|
String htmlTab = "";//页卡内容
|
String nohtmlTab="";//设置了页卡但是个别子功能没有设置页卡的情况内容或直接是没设置有页卡内容。
|
int gridIndex = 0;//索引(格线索引)
|
int panelIndex = 0;//确定为页面上的第几个面板(16类型索引)
|
int tabID=0;//页卡分组编号
|
int sortBy=0;//显示顺序
|
boolean isTabs =false;// 是否是选项卡
|
String grid = "0";//格线
|
int height1 = 0;
|
String inPan = "";//inPan替换index.jsp里的@panFou@,进入主功能号panel.jsp
|
Map<String, Object> tabData = new HashMap<String, Object>(); // 选项卡内容和高度
|
List<Integer> tabIDlit = new ArrayList<>();// 选项卡对应的ID集合
|
List<Integer> sortBylit = new ArrayList<>();// 选项卡对应序列的ID集合
|
try {
|
//通过分组id+页框id获得明细设置
|
List<Map<String, Object>> sheMap = this.getTabPageDetail(formID);
|
String gridSql="set nocount on \n " +
|
"declare @mainFormid int = ? ,@result int\n" +
|
"declare @table table (mainFormid int)\n" +
|
"declare @table2 table(tabid int,formtype int,sortby int)\n" +
|
"if not exists(select 1 from _sys_TabPageFormid where mainformid = @mainFormid and formtype = 1 )\n" +
|
"begin\n" +
|
"select 0 \n" +
|
"return\n" +
|
"end\n" +
|
"if exists(select 1 from _sys_TabPageFormid where mainformid = @mainFormid and TabID is null and formtype = 1 )\n" +
|
"begin\n" +
|
"select 0 \n" +
|
"return\n" +
|
"end\n" +
|
"insert into @table2(tabid , formtype,sortby)\n" +
|
"select tabid,formtype,sortby from _sys_TabPageFormid where mainformid = @mainFormid and TabID is not null\n" +
|
"if not exists(select 1 from @table2 a \n" +
|
"where a.sortby in ( select min(sortby) from @table2 b where a.tabid = b.tabid )\n" +
|
"and formtype = 1 ) \n" +
|
"insert into @table(mainFormid) values (@mainFormid) \n" +
|
"select @result=mainFormid from @table\n" +
|
"select @result";
|
Integer result = this.getJdbcTemplate().queryForObject(gridSql, Integer.class,formID);
|
if(result!=null&&result>0) {// 存在有格线才需要判断 by danaus 2019/11/19 16:18
|
//处理当子功能号有格线,需要把格线的子功能号放在第一,如果不是这样设置则需要在生成页面时作出提示
|
throw new ApplicationException("请在【9771】496多表设置,把其中一个子功能号类型为1的子功能号放置到页卡的第一个位置显示");
|
}
|
|
String[] data1 = null;
|
for (Map<String, Object> map : sheMap) {
|
if (doc == ""){
|
doc = DBHelper.getValue(map, "SeekGroupID").toLowerCase();// 取得第一个功能号的关联字段
|
}
|
//子功能号是否和主功能号相同。 true表示相同 ,false表示不相同
|
isMainPanel=(DBHelper.getValueInt(map, "formid") != DBHelper.getValueInt(map, "mainformid")?false:true);
|
tabID=DBHelper.getValueInt(map, "TabID");//页卡分组编号
|
sortBy=DBHelper.getValueInt(map, "SortBy");//显示顺序
|
String labelName= GridUtils.prossRowSetDataType_String(map, "LabelName");
|
if(org.apache.commons.lang3.StringUtils.isBlank(labelName)){
|
labelName=GridUtils.prossRowSetDataType_String(map, "formname");
|
}
|
switch (DBHelper.getValueInt(map, "formtype")) {// 子功能号类型
|
case 1:// 子功能号类型为表格
|
if (gridIndex > 0){
|
id_info += ";" + "create" + gridIndex + "|" + DBHelper.getValue(map, "SeekGroupID").split(";")[0]
|
+ "," + DBHelper.getValue(map, "FK").split(";")[0];// 前提是以主功能号组装格线中各个关联字段:0|doccode,docede;1|test,test;
|
}else{
|
id_info += "create|" + DBHelper.getValue(map, "SeekGroupID").split(";")[0] + ","
|
+ DBHelper.getValue(map, "FK").split(";")[0];// 前提是以主功能号组装格线中各个关联字段:0|doccode,docede;1|test,test;
|
}
|
jspName = DBHelper.getValueInt(map, "formid") + "_grid.jsp";
|
// 是页卡进入处理 --xin 2019-10-14 16:27:08
|
if (tabID > 0) {
|
//格线
|
tabIDlit.add(tabID);
|
sortBylit.add(sortBy);
|
tabData.put("t" + tabID + sortBy,
|
"<div id=\"create" + (gridIndex == 0 ? "" : gridIndex) + "\" title=\"" + labelName
|
+ "\" style=\"margin-top:5px;\">" + "<%@ include file=\"" + jspName + "\" %>"
|
+ getPanFile(DBHelper.getValueInt(map, "formid")) + "\r<div id=\"mbcreate" + (gridIndex == 0 ? "" : gridIndex) + "\">"
|
+ "<jsp:include page=\""+ DBHelper.getValueInt(map, "formid") + "_top.jsp\" flush=\"true\"/></div></div>\n");
|
isTabs = true;
|
} else {//不是页卡的处理
|
if (gridIndex == 0) { // 第一个格线需要显示出来
|
html = "<div style=\"font-family:黑体; margin-left:10px;\">" + labelName + "</div>\r";
|
} else {
|
html = "<div style=\"font-family:黑体; margin-left:10px;\"><a title='展开' href='javascript:shows("
|
+ gridIndex + "," + DBHelper.getValueInt(map, "formid") + ");' id='A_"
|
+ DBHelper.getValueInt(map, "formid") + "'>\r<img id='img_" + DBHelper.getValueInt(map, "formid")
|
+ "' src='/images/down_list.gif' border='0'/> "
|
+ labelName + "</a><jsp:include page=\""
|
+ DBHelper.getValueInt(map, "formid") + "_top.jsp\" flush=\"true\"/></div>";
|
|
}
|
html += "<%@ include file=\"" + jspName + "\" %>" + getPanFile(DBHelper.getValueInt(map, "formid"));
|
nohtmlTab+=html;//在设置有页卡但是个别没设置页卡的内容
|
}
|
// ---生成功能链接,通过增加top.jsp页面
|
buildTopIfc.build(DBHelper.getValueInt(map, "formid"),DBHelper.getValueInt(map, "formtype"), getBuildPath() + "subtop.jsp",
|
getToPath() + DBHelper.getValueInt(map, "formid") + "_top.jsp",
|
getFormInfo(DBHelper.getValueInt(map, "formid") + ""), this);
|
String indexs[] = this.getPrIndex(DBHelper.getValue(map, "formid"), sheMap, "1");
|
height1 = DBHelper.getValueInt(map, "gridheight");
|
if (height1 == 0){
|
height1 = treeGrid.getGrigHieght(DBHelper.getValueInt(map, "formid"),
|
DBHelper.getValueInt(map, "formtype"), this.dataBaseId);
|
}
|
TMuiDTO dto = new TMuiDTO();
|
if (gridIndex == 0) {
|
dto.type = this.type;
|
dto.height1 = height1;
|
dto.indexs = indexs[0];
|
dto.tolkey = indexs[1];
|
dto.fromid = Integer.parseInt(formID);
|
dto.index = 0;
|
dto.formTabName =labelName;
|
// treeGrid.setTabPage497(this.type, height1, indexs[0],
|
// indexs[1], Integer.parseInt(formID), 0);
|
} else if (indexs[0] != "") {
|
dto.type = this.type;
|
dto.height1 = height1;
|
dto.indexs = indexs[0];
|
dto.tolkey = indexs[1];
|
dto.fromid = 0;
|
dto.index = gridIndex;
|
dto.formTabName =labelName;
|
// treeGrid.setTabPage497(this.type, height1, indexs[0],
|
// indexs[1], 0, index);
|
} else {
|
dto.type = 1;
|
dto.height1 = height1;
|
dto.indexs = "";
|
dto.tolkey = "";
|
dto.fromid = 0;
|
dto.index = gridIndex;
|
dto.formTabName =labelName;
|
// treeGrid.setTabPage497(1, height1, "", "", 0, index);
|
}
|
dto.addnew = true;// 表示需要生成处理+号的按钮代码
|
dto.xxk = (isTabs?1:0); // DBHelper.getValueInt(map,"isStartupCollapsed");
|
treeGrid.createGrid(DBHelper.getValueInt(map, "formtype"), DBHelper.getValueInt(map, "formid"), URI,
|
"app/" + gPath + "/", new String[] { jspName }, getTemPath(),
|
"/" + this.formID + "/" + this.type + "/", dto, this.dataBaseId);
|
height1 = (height1 <= 0) ? 320 : height1 + 20;
|
grid = "1";
|
gridIndex++;
|
break;
|
case 16://子功能号类型为16类型面板
|
data1 = new String[3];
|
data1[0] = FileUtils.readFileToString(new File(getBuildPath() + "panel.jsp"), "utf-8");
|
data1[1] = FileUtils.readFileToString(new File(getTemPath() + "panelControl.jsp"), "utf-8");
|
if (Integer.parseInt(formID) != DBHelper.getValueInt(map, "formid")) {
|
data1[2] = "1";
|
}
|
// ----------------
|
pIfc.setPrimaryPan(isMainPanel);// 控制496主面板和子面板
|
pIfc.setIndexPan(panelIndex);
|
// typeControlDao.setxuanx(tabID+"");// 针对选项卡里面的面板高度控制
|
// 生成面板内容
|
Map<String, String> mapIf = pIfc.getPanelHtml(DBHelper.getValueInt(map, "formid"),
|
DBHelper.getValueInt(map, "formtype"), data1, this);
|
//-----------------
|
boolean bol = this.getdocstaut((mapIf.get("zhu")!=null?mapIf.get("zhu").toString():""));
|
String pan16_496 = DBHelper.getValueInt(map, "FT") + ";" + DBHelper.getValue(map, "FK") + ";"
|
+ DBHelper.getValue(map, "SeekGroupID").toLowerCase();
|
String equalbol = (DBHelper.getValueInt(map, "formid") != DBHelper.getValueInt(map, "FT") ? "true"
|
: "false");
|
|
//formID功能号和子功能号相同则为主功能号面板
|
if (Integer.parseInt(formID) == DBHelper.getValueInt(map, "formid")) {
|
String isPanelTabs="";//主功能号也在页卡里面
|
if(tabID>0){
|
isPanelTabs ="\n<div class=\"istabs\" style=\"margin:10px 40px 20px 30px;width:auto\">\n";
|
isPanelTabs +="<div id=\"panl-" + panelIndex + "\" title=\"" + labelName
|
+ "\" style=\"margin-top:5px;\">\r<div id=\"mbpanl-" + panelIndex + "\">"
|
+ "<jsp:include page=\""+ DBHelper.getValueInt(map, "formid") + "_top.jsp\" flush=\"true\"/></div>";
|
tabIDlit.add(tabID);
|
sortBylit.add(sortBy);
|
tabData.put("t" + tabID+sortBy,"ispaneltabs");
|
isTabs = true;
|
// --------生成子功能号功能链接
|
buildTopIfc.build(DBHelper.getValueInt(map, "formid"),type, getBuildPath() + "subtop.jsp",
|
getToPath() + map.get("formid") + "_top.jsp",
|
getFormInfo(DBHelper.getValueInt(map, "formid") + ""), this);
|
// ---end
|
}
|
// else{
|
// html = "<div style=\"font-family:黑体; margin-left:10px;\">" + labelName+ "</div>";
|
// }
|
html += "<jsp:include page=\"panel.jsp\" flush=\"true\"/>";
|
inPan = html;//在index.jsp进入主功能号 panel.jsp
|
String filterFormId=DBHelper.getValue(map, "FT").equals(DBHelper.getValue(map,"formid"))?"true":"false";//496的子功能不需要执行浏览历史记录 xin 2022-4-12 16:13:10
|
endCreate.put("panel.jsp", mapIf.get("panHTML").replace("@FT@", DBHelper.getValue(map, "FT"))
|
.replace("@filterFormId@",filterFormId)
|
.replace("@isMasterFormId@",Integer.parseInt(formID) != DBHelper.getValueInt(map, "formid")?"true":"false")
|
.replace("@FK@", DBHelper.getValue(map, "FK")).replace("@equalbol@", equalbol)
|
.replace("@SeekGroupID@", DBHelper.getValue(map, "SeekGroupID").toLowerCase())
|
.replace("@where16_496@", pan16_496).replace("@view@", "" + bol)
|
.replace("@zhu496@", DBHelper.getValue(map, "formid")).replace("@isMaster@", "true").replace("@isPanelTabs@", isPanelTabs));
|
// by danaus 增加@isMaster@标记只有主功能号面板才需要执行取消确认和撤回
|
buildPageCode(mapIf.get("panelControl"), "panelControl" + formID + ".jsp");//生成panelControl+formId.jsp
|
} else {// 子功能号面板
|
// --------生成子功能号功能链接
|
buildTopIfc.build(DBHelper.getValueInt(map, "formid"),DBHelper.getValueInt(map, "formtype"), getBuildPath() + "subtop.jsp",
|
getToPath() + map.get("formid") + "_top.jsp",
|
getFormInfo(DBHelper.getValueInt(map, "formid") + ""), this);
|
// ---end
|
jspName = DBHelper.getValueInt(map, "formid") + "_panel.jsp";
|
String filterFormId=DBHelper.getValue(map, "FT").equals(DBHelper.getValue(map,"formid"))?"true":"false";//496的子功能不需要执行浏览历史记录 xin 2022-4-12 16:13:10
|
buildPageCode(mapIf.get("panHTML").replace("@isPanelTabs@", "").replace("@include@", "")
|
.replace("@FT@", DBHelper.getValue(map, "FT")).replace("@filterFormId@",filterFormId)
|
.replace("@isMasterFormId@",Integer.parseInt(formID) != DBHelper.getValueInt(map, "formid")?"true":"false")
|
.replace("@FK@", DBHelper.getValue(map, "FK")).replace("@equalbol@", equalbol)
|
.replace("@SeekGroupID@", DBHelper.getValue(map, "SeekGroupID").toLowerCase())
|
.replace("@grid@", grid).replace("@where16_496@", pan16_496).replace("@view@", "" + bol)
|
.replace("@zhu496@", DBHelper.getValue(map, "formid")).replace("@isMaster@", "false"),
|
jspName);
|
buildPageCode(mapIf.get("panelControl"),
|
"panelControl" + DBHelper.getValueInt(map, "formid") + ".jsp");
|
// 是页卡进入处理 --xin 2019-10-14 16:27:08
|
if (tabID>0 && !isMainPanel) {
|
//面板
|
tabIDlit.add(tabID);
|
sortBylit.add(sortBy);
|
tabData.put("t" + tabID+sortBy,
|
"<div id=\"panl-" + panelIndex + "\" title=\"" + labelName
|
+ "\" style=\"margin-top:5px;\"><jsp:include page=\"" + jspName + "\" flush=\"true\"/>"
|
+ getPanFile(DBHelper.getValueInt(map, "formid")) + "\r<div id=\"mbpanl-" + panelIndex + "\">"
|
+ "<jsp:include page=\""+ DBHelper.getValueInt(map, "formid") + "_top.jsp\" flush=\"true\"/></div></div>\n");
|
isTabs = true;
|
} else {//不是页卡的处理
|
html += "<jsp:include page=\"" + jspName + "\" flush=\"true\"/><jsp:include page=\""
|
+ DBHelper.getValueInt(map, "formid") + "_top.jsp\" flush=\"true\"/>"
|
+ getPanFile(DBHelper.getValueInt(map, "formid"));
|
nohtmlTab+=html;//在设置有页卡但是个别没设置页卡的内容
|
}
|
}
|
pIfc.setIndexPan(0);
|
panelIndex++;
|
break;
|
}
|
}
|
|
/** 处理组装成选项卡功能号的样式 */
|
if (isTabs) {
|
try {
|
htmlTab = getTabsValue(tabIDlit, sortBylit, tabData);
|
if (!nohtmlTab.equals("")) {
|
htmlTab = "<br>" + htmlTab + nohtmlTab; // 处理好的选项卡
|
}
|
} catch (Exception e) {
|
e.printStackTrace();
|
}
|
}else{
|
htmlTab=nohtmlTab;
|
}
|
pIfc.setPrimaryPan(true);
|
if (endCreate.get("panel.jsp") != null) {
|
html = inPan;
|
buildPageCode(endCreate.get("panel.jsp").replace("@include@", htmlTab).replace("@grid@", grid),
|
"panel.jsp");
|
} else {
|
html = htmlTab;
|
}
|
} catch (Exception e) {
|
throw new ApplicationException(e.getMessage());
|
}
|
//-------------文字颜色说明---------xin 2022-5-18 16:09:54-----------//
|
StringBuilder colorText =new StringBuilder();//文字颜色说明
|
if(StringUtils.isNotBlank(formID)) {
|
List<T9685Entity> colorList = apiServiceIfc.get9685List(Integer.parseInt(formID));
|
if (colorList != null && colorList.size() > 0) {
|
colorText.append("<div class=\"colorDescriptionContainer\">");
|
colorText.append("<div class=\"colorDescriptionTitle\">文字颜色说明</div>");
|
colorText.append("<div class=\"colorDescription\">");
|
for (T9685Entity t : colorList) {
|
colorText.append("<div><span title=\"" + t.getItemMemo() + "\" class=\"spanColor\" " +
|
"style=\"background-color: " + t.getHexColor() + "\"></span>" +
|
"<span class=\"spanText\" style=\"color: " + t.getHexColor() + "\">" +
|
t.getColorName() + "</span></div>");
|
}
|
colorText.append("</div></div>");
|
}
|
}
|
//文字颜色说明 xin 2022-5-18 15:53:13
|
data = data.replace("[?ColorDescription]",colorText);
|
data = data.replace("[?title]", gformInfo.get("formname") + "");
|
data = data.replace("@panFou@", html);
|
data = data.replace("[?notab]", ""+isTabs);
|
data = data.replace("[?height]", "");
|
buildPageCode(data, fileName);
|
}
|
|
/**
|
* 添加需显示字段
|
* @param formId 某功能号后
|
* @return String
|
*/
|
private String getPanFile(int formId){
|
StringBuffer sBuffer=new StringBuffer();
|
sBuffer.append("<div id=\"").append(formId).append("_panel\"></div>");
|
return sBuffer.toString();
|
}
|
|
/**
|
* 组装页卡里的顺序和页卡号。
|
* @param map
|
* @param tabsData
|
* @param tabsHeight
|
* @param sortBy
|
* @param mssMap
|
* @param uis
|
* @param htmlTab
|
*/
|
private String getTabsValue(List<Integer> tabIDlit, List<Integer> sortBylit, Map<String, Object> tabData) {
|
try {
|
String tabs = "";//组装页卡内容
|
removeDuplicateWithOrder(tabIDlit);
|
for (Integer tid : tabIDlit) {
|
tabs += "\n<%try{%>\n<div class=\"istabs\" style=\"margin:10px 40px 20px 30px;width:auto\">\n";//选项卡 height:"+ getTabsHeight(t, sortByList, tabsData) + "px;
|
for (Integer sid : sortBylit) {//获取上层选项卡里面的内容
|
if("ispaneltabs".equals(DBHelper.getValue(tabData, "t" + tid + sid))){//主功能号也是页卡
|
tabs ="\n<%try{%>\r</div>\r";
|
}else{
|
tabs += DBHelper.getValue(tabData, "t" + tid + sid);
|
}
|
}
|
tabs +="</div>\n"
|
+ "<%}catch(Exception e){throw new Exception(e.getCause()!=null?e.getCause().getMessage():e.getMessage());}%>\n";//抛出错误信息
|
}
|
tabs+="\n<script type=\"text/javascript\">$(function(){Tabs(<%=flag%>,iscp);})</script>\n";//加载页卡js
|
return tabs;
|
} catch (Exception e) {
|
throw new ApplicationException(e.getMessage());
|
}
|
}
|
|
/**
|
* 删除ArrayList中重复元素,保持顺序
|
* @param list
|
*/
|
@SuppressWarnings({ "rawtypes", "unchecked" })
|
public static void removeDuplicateWithOrder(List list) {
|
Set set = new HashSet();
|
List newList = new ArrayList();
|
for (Iterator iter = list.iterator(); iter.hasNext();) {
|
Object element = iter.next();
|
if (set.add(element))
|
newList.add(element);
|
}
|
list.clear();
|
list.addAll(newList);
|
}
|
}
|