You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
565 lines
26 KiB
Java
565 lines
26 KiB
Java
package weaver.interfaces.dito.card;
|
|
|
|
import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONArray;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.customization.wfTodoCard.*;
|
|
import com.customization.wfTodoCard.service.CheckSendCardService;
|
|
import com.customization.wfTodoCard.service.TodoCardService;
|
|
import org.apache.commons.lang3.StringEscapeUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.jsoup.Jsoup;
|
|
import org.jsoup.nodes.Document;
|
|
import org.jsoup.nodes.Element;
|
|
import org.jsoup.select.Elements;
|
|
import weaver.conn.RecordSet;
|
|
import weaver.general.BaseBean;
|
|
import weaver.general.Util;
|
|
import weaver.hrm.User;
|
|
import java.util.*;
|
|
|
|
public class SendRequestToCardUtil {
|
|
|
|
String oaAuthKey = new BaseBean().getPropValue("workflowTodoCard", "oaAuthKey");
|
|
|
|
public void sendRequestAtToCard(String requestId, User user, String nodeid,String workflowId,String remark){
|
|
BaseBean bb = new BaseBean();
|
|
RecordSet rs = new RecordSet();
|
|
try{
|
|
bb.writeLog("SendRequestToCardUtil-remark:"+remark);
|
|
List<String> result = new ArrayList<String>();
|
|
String title = "";
|
|
if(StringUtils.isNotBlank(remark)){
|
|
Document doc = Jsoup.parse(remark);
|
|
// 选择所有包含 atsome - uid 属性的元素
|
|
Elements uidElements = doc.select("[atsome-uid]");
|
|
Iterator<Element> uidIt = uidElements.iterator();
|
|
while(uidIt.hasNext()) {
|
|
Element element = uidIt.next();
|
|
String atsomeUid = element.attr("atsome-uid");
|
|
if(!result.contains(atsomeUid)){
|
|
result.add(atsomeUid);
|
|
}
|
|
}
|
|
|
|
Elements pElements = doc.select("p");
|
|
Iterator<Element> pIt = pElements.iterator();
|
|
while(pIt.hasNext()) {
|
|
Element element = pIt.next();
|
|
title += element.text();
|
|
}
|
|
}
|
|
|
|
bb.writeLog("SendRequestToCardUtil-title1:"+title);
|
|
if(StringUtils.isNotBlank(title)){
|
|
title = StringEscapeUtils.unescapeHtml4(title);
|
|
}
|
|
|
|
bb.writeLog("SendRequestToCardUtil-title2:"+title);
|
|
|
|
if(result.size() > 0){
|
|
for(int i= 0;i<result.size();i++){
|
|
String receiverId = result.get(i);
|
|
if(StringUtils.isNotBlank(receiverId)){
|
|
String lastname = "";
|
|
String sql = "select lastname,workcode,systemlanguage from hrmresource where id=?" ;
|
|
rs.executeQuery(sql, new Object[] { receiverId });
|
|
if (rs.next()){
|
|
lastname = rs.getString("lastname");
|
|
}
|
|
if(StringUtils.isNotBlank(lastname)){
|
|
title = title.replace(lastname,lastname+" ");
|
|
}
|
|
}
|
|
}
|
|
bb.writeLog("SendRequestToCardUtil-title2:"+title);
|
|
for(int i= 0;i<result.size();i++){
|
|
String receiverId = result.get(i);
|
|
if(StringUtils.isNotBlank(receiverId)){
|
|
String systemlanguage = "";
|
|
String workcode = "";
|
|
String sql = "select lastname,workcode,systemlanguage from hrmresource where id=?" ;
|
|
rs.executeQuery(sql, new Object[] { receiverId });
|
|
if (rs.next()){
|
|
systemlanguage = rs.getString("systemlanguage");
|
|
workcode = rs.getString("workcode");
|
|
}
|
|
|
|
new CheckSendCardService().sendShareCard(""+user.getUID(), receiverId, requestId,"",title,"You have been tagged in a comment.");
|
|
|
|
//sendDefault(workflowId,requestId,receiverId, "1", systemlanguage,workcode,title);
|
|
}
|
|
}
|
|
}
|
|
}catch (Exception e){
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
|
|
public void sendDefault(String workflowId, String requestId, String receiverId, String logintype, String language,String workcode,String expandMsg) {
|
|
BaseBean bb = new BaseBean();
|
|
RecordSet rd = new RecordSet();
|
|
bb.writeLog("sendRequestAtToCard-default >>>>>");
|
|
|
|
String icon = "";
|
|
String sql1 = "select id,WORKFLOWNAME, isMessageRemind,icon from workflow_base where id='" + workflowId + "'";
|
|
bb.writeLog("sendRequestAtToCard-sql1:"+sql1);
|
|
rd.executeQuery(sql1);
|
|
if(rd.next()){
|
|
icon = rd.getString("icon");
|
|
}
|
|
|
|
bb.writeLog("sendRequestAtToCard-icon:"+icon);
|
|
|
|
String requestName = "";
|
|
String createDate = "";
|
|
String createTime = "";
|
|
rd.executeQuery("select WORKFLOWID, CREATER,REQUESTNAME, CREATETIME, CREATEDATE from workflow_requestbase where REQUESTID = '" + requestId + "'");
|
|
if (rd.next()) {
|
|
requestName = rd.getString("REQUESTNAME");
|
|
createDate = rd.getString("CREATEDATE");
|
|
createTime = rd.getString("CREATETIME");
|
|
}
|
|
|
|
bb.writeLog("sendRequestAtToCard-requestName:"+requestName);
|
|
bb.writeLog("sendRequestAtToCard-createDate:"+createDate);
|
|
bb.writeLog("sendRequestAtToCard-createTime:"+createTime);
|
|
|
|
JSONArray callAuth = new JSONArray();
|
|
callAuth.add((new JSONObject())
|
|
.fluentPut("name", "weaver_userid").fluentPut("value", receiverId));
|
|
callAuth.add((new JSONObject())
|
|
.fluentPut("name", "usertoken").fluentPut("value", oaAuthKey));
|
|
callAuth.add((new JSONObject())
|
|
.fluentPut("name", "weaver_usertype").fluentPut("value", logintype));
|
|
callAuth.add((new JSONObject())
|
|
.fluentPut("name", "weaver_userlanguage").fluentPut("value", language));
|
|
|
|
doAtSend(requestName, icon, null, workflowId,requestId,language,createDate,createTime,workcode,expandMsg);
|
|
}
|
|
|
|
|
|
// public void copySendNeedSubmit(String requestname,String requestid,String nodeid){
|
|
// RecordSet rs = new RecordSet();
|
|
//
|
|
// String workflowId = "";
|
|
// String userid = "";
|
|
// String requestName = "";
|
|
// String createtime = "";
|
|
// String createdate = "";
|
|
//
|
|
// String sql = "select WORKFLOWID, CREATER,REQUESTNAME, CREATETIME, CREATEDATE from workflow_requestbase where REQUESTID = '" + requestid + "'";
|
|
// rs.executeQuery(sql);
|
|
// if(rs.next()){
|
|
// workflowId = rs.getString("WORKFLOWID");
|
|
// userid = rs.getString("CREATER");
|
|
// requestName = rs.getString("REQUESTNAME");
|
|
// createtime = rs.getString("CREATETIME");
|
|
// createdate = rs.getString("CREATEDATE");
|
|
// }
|
|
//
|
|
// String isMessageRemind = "";
|
|
// String icon = "";
|
|
// String messageRemindScope = "";
|
|
// if(StringUtils.isNotBlank(workflowId)){
|
|
// sql = "select id, WORKFLOWNAME, messageRemindScope, isMessageRemind,icon from workflow_base where id=?" ;
|
|
// rs.executeQuery(sql, new Object[] { workflowId });
|
|
// if(rs.next()){
|
|
// isMessageRemind = rs.getString("isMessageRemind");
|
|
// icon = rs.getString("icon");
|
|
// messageRemindScope = rs.getString("messageRemindScope");
|
|
// }
|
|
// }
|
|
//
|
|
// String ifMr = "";
|
|
// String mainid = "";
|
|
// if("1".equals(isMessageRemind)){
|
|
// sql = "select id, workflowid, nodeid, sfmr from uf_wftodocontent where workflowid =" + workflowId + " and nodeid =" + nodeid ;
|
|
// rs.executeQuery(sql);
|
|
// if (rs.next()) {
|
|
// mainid = rs.getString("id");
|
|
// ifMr = rs.getString("sfmr");
|
|
// }
|
|
// }else{
|
|
// ifMr = "1";
|
|
// }
|
|
// if ("1".equals(ifMr)) {
|
|
// sql = "select id from uf_wftodocontent where workflowid = '" + workflowId + "' and nodeid ='0'";
|
|
// rs.executeQuery(sql);
|
|
// if (rs.next()) {
|
|
// mainid = rs.getString("id");
|
|
// }
|
|
// }
|
|
//
|
|
// List<String> filedNameList = new ArrayList<>();
|
|
// sql = "select fieldname from uf_wftodocontent_dt1 where mainid = '" + mainid + "' and selected =1 order by sort asc" ;
|
|
// rs.executeQuery(sql);
|
|
// while (rs.next()) {
|
|
// String fieldname = rs.getString("fieldname");
|
|
// if (!fieldname.startsWith("sys_")){
|
|
// filedNameList.add(fieldname);
|
|
// }
|
|
// }
|
|
//
|
|
// JSONArray callAuth = new JSONArray();
|
|
// callAuth.add((new JSONObject())
|
|
// .fluentPut("name", "weaver_userid").fluentPut("value", receiverId));
|
|
// callAuth.add((new JSONObject())
|
|
// .fluentPut("name", "usertoken").fluentPut("value", this.oaAuthKey));
|
|
// callAuth.add((new JSONObject())
|
|
// .fluentPut("name", "weaver_usertype").fluentPut("value", (logintype == null) ? "1" : logintype));
|
|
// callAuth.add((new JSONObject())
|
|
// .fluentPut("name", "weaver_userlanguage").fluentPut("value", language));
|
|
// String callAuthStr = callAuth.toJSONString();
|
|
//
|
|
//
|
|
// }
|
|
|
|
public void doAtSend(String requestname,String icon, List<String> fieldNameList,String workflowId,String requestId,String language,String CreateDate,String CreateTime,String WorkCode,String expandMsg){
|
|
BaseBean bb = new BaseBean();
|
|
bb.writeLog("doAtSend--requestname:"+requestname);
|
|
|
|
JSONArray cardJsonArray = getCardParam(fieldNameList, requestname,workflowId,requestId,language);
|
|
bb.writeLog("doAtSend-cardJsonArray:"+cardJsonArray.toJSONString());
|
|
Map<String,String> sendUserMap = getRequestCreator(requestId);
|
|
|
|
cardJsonArray.add(
|
|
new JSONObject().fluentPut("name", "Create Time").fluentPut("value", CreateDate + " " + CreateTime)
|
|
);
|
|
cardJsonArray.add(
|
|
new JSONObject().fluentPut("name", "Creator").fluentPut("value", sendUserMap.get("name"))
|
|
);
|
|
String cardData = cardJsonArray.toJSONString();
|
|
bb.writeLog("doAtSend casrdifno :: " + cardData);
|
|
|
|
CardInfo cardInfo = baseCardInfo(requestname,"", icon, cardData, requestId);
|
|
|
|
if (StringUtils.isNotBlank(expandMsg)) {
|
|
expandMsg = expandMsg.replace(" ", " ");
|
|
cardInfo.setExpandMsg(expandMsg);
|
|
}
|
|
|
|
bb.writeLog("doAtSend cardInfo :: " + cardInfo.toString());
|
|
|
|
String uid = UUID.randomUUID().toString();
|
|
String message = TodoCardService.createTodoCard(sendUserMap.get("code"),WorkCode, 1, uid, cardInfo);
|
|
bb.writeLog("message:"+message);
|
|
|
|
}
|
|
|
|
|
|
public CardInfo baseCardInfo(String requestName,String color, String icon, String cardData, String requestid){
|
|
RecordSet recordSet = new RecordSet();
|
|
|
|
// 卡片标题替换成流程标题
|
|
recordSet.executeQuery("select a.WORKFLOWNAME from workflow_base a left join workflow_requestbase b on a.id=b.WORKFLOWID where b.REQUESTID ="+requestid);
|
|
if (recordSet.next()){
|
|
requestName = Util.null2String(recordSet.getString("WORKFLOWNAME"));
|
|
}
|
|
|
|
TitleInfo titleInfo = new TitleInfo();
|
|
titleInfo.setName(requestName);
|
|
titleInfo.setColor(null==color || "".equals(color)?"#F4F5F7":color);
|
|
titleInfo.setIconName(icon);
|
|
|
|
CardInfo cardInfo = new CardInfo();
|
|
cardInfo.setTitleInfo(titleInfo);
|
|
|
|
ContentInfo contentInfo = new ContentInfo();
|
|
contentInfo.setType("keyInfo");
|
|
contentInfo.setOrder(1);
|
|
contentInfo.setData(cardData);
|
|
List<ContentInfo> contentInfos = new ArrayList<>();
|
|
contentInfos.add(contentInfo);
|
|
cardInfo.setContentInfos(contentInfos);
|
|
|
|
recordSet.executeQuery("select pcxqdz, appxqdz from uf_cardifno_conf"); // 配置跳转地址
|
|
if (recordSet.next()){
|
|
ViewDetail viewDetail = new ViewDetail();
|
|
String detailPcUrl = Util.null2String(recordSet.getString("pcxqdz"));
|
|
String detailAppUrl = Util.null2String(recordSet.getString("appxqdz"));
|
|
if (!"".equals(detailPcUrl)){
|
|
viewDetail.setPcUrl(detailPcUrl + requestid);
|
|
}
|
|
if (!"".equals(detailAppUrl)){
|
|
viewDetail.setAppUrl(detailAppUrl + requestid);
|
|
}
|
|
viewDetail.setOpenMethod("H5");
|
|
|
|
cardInfo.setViewDetailInfo(viewDetail);
|
|
}
|
|
|
|
return cardInfo;
|
|
}
|
|
|
|
|
|
private Map<String, String> getRequestCreator(String requestid) {
|
|
Map<String, String> map = new HashMap<String, String>();
|
|
RecordSet recordSet = new RecordSet();
|
|
recordSet.executeQuery("select h.LASTNAME, h.WORKCODE from workflow_requestbase a left join hrmresource h on h.id=a.CREATER where a.requestid = " + requestid, new Object[0]);
|
|
if (recordSet.next()) {
|
|
map.put("name", recordSet.getString("LASTNAME"));
|
|
map.put("code", recordSet.getString("WORKCODE"));
|
|
}
|
|
return map;
|
|
}
|
|
|
|
|
|
// 卡片通用参数
|
|
private JSONArray getCardParam(List<String> filedNameList,String requestName,String workflowId,String requestId,String language){
|
|
BaseBean bb = new BaseBean();
|
|
bb.writeLog(">>>> get param :"+requestName);
|
|
JSONArray cardJsonArray = new JSONArray();
|
|
cardJsonArray.add(
|
|
new JSONObject().fluentPut("name", "Title").fluentPut("value", requestName)
|
|
);
|
|
|
|
// 参数存储
|
|
Map<String, String> paramMap = new HashMap<>();
|
|
RecordSet rd = new RecordSet();
|
|
Integer billid=0; // 表单id
|
|
if (null != filedNameList && filedNameList.size() > 0) {
|
|
|
|
String queryTablesql = "select TABLENAME,b.id billid from workflow_base a inner join workflow_bill b on a.FORMID =b.ID where a.id = '" + workflowId+ "'";
|
|
rd.executeQuery(queryTablesql);
|
|
String tablename = "";
|
|
if (rd.next()) {
|
|
tablename = rd.getString("TABLENAME");
|
|
billid = rd.getInt("billid");
|
|
|
|
String selectSql = String.join(",", filedNameList);
|
|
String querySql = "select " + selectSql + " from " + tablename + " where requestid = '" + requestId + "'";
|
|
rd.executeQuery(querySql);
|
|
if (rd.next()) {
|
|
for (String tempname : filedNameList) {
|
|
paramMap.put(tempname, Util.null2String(rd.getString(tempname)));
|
|
}
|
|
}
|
|
}
|
|
|
|
String sqlSelectLabel="select wb.FIELDNAME, hb.LABELNAME " +
|
|
"from workflow_billfield wb left join htmllabelinfo hb on hb.INDEXID = wb.FIELDLABEL " +
|
|
"where wb.BILLID = ? and hb.languageid=?";
|
|
|
|
RecordSet queryLabel=new RecordSet();
|
|
queryLabel.executeQuery(sqlSelectLabel,billid, language);
|
|
|
|
Map<String,String> labelMap = new HashMap<>();
|
|
while (queryLabel.next()){
|
|
String fieldname = queryLabel.getString("FIELDNAME");
|
|
String labelname = queryLabel.getString("LABELNAME");
|
|
labelMap.put(fieldname,labelname);
|
|
}
|
|
|
|
Map<String,Map<String,String>> selectItemMap = mapSelectItem(billid); // 选择框选项
|
|
Map<String,String> liulanMap = mapLiuLan(billid); // 浏览按钮
|
|
Map<String,String> commonLiuLanMap = mapCommonLiuLan(billid); // 浏览按钮
|
|
Set<String> checkSet = getCheckFieldName(billid); // check字段
|
|
Set<String> fileFieldSet = getFileFieldSet(billid); // 文件字段
|
|
|
|
bb.writeLog("》》》 select item >> "+ JSON.toJSONString(selectItemMap));
|
|
bb.writeLog("》》》 liulanMap >> "+ JSON.toJSONString(liulanMap));
|
|
|
|
for (String tempname : filedNameList) {
|
|
String labelName = labelMap.getOrDefault(tempname,tempname);
|
|
String value = paramMap.getOrDefault(tempname, "");
|
|
if (!"".equals(value)){
|
|
bb.writeLog(">>> for tempname >> "+tempname);
|
|
|
|
if (selectItemMap.containsKey(tempname)){ // 选择框
|
|
bb.writeLog("select item >> "+tempname+" >> "+value);
|
|
Map<String,String> selectItem = selectItemMap.get(tempname);
|
|
String [] valueArray = value.split(",");
|
|
List<String> valueList = new ArrayList<>();
|
|
for (String tempValue : valueArray){
|
|
String tempValueName = selectItem.getOrDefault(tempValue,tempValue);
|
|
valueList.add(tempValueName);
|
|
}
|
|
bb.writeLog("> select item >> "+tempname+" >> "+valueList);
|
|
value = String.join(", ",valueList);
|
|
|
|
} else if (checkSet.contains(tempname)){ // check字段
|
|
bb.writeLog("checkSet >> "+tempname+" >> "+value);
|
|
value= "1".equals(value) ? "Yes" : "No";
|
|
|
|
} else if (fileFieldSet.contains(tempname)){ // 附件字段
|
|
bb.writeLog("fileFieldSet >> "+tempname+" >> "+value);
|
|
List<String> fileList = new ArrayList<>();
|
|
RecordSet queryTemp = new RecordSet();
|
|
queryTemp.executeQuery("select IMAGEFILENAME from docimagefile where docid in ("+value+")");
|
|
while (queryTemp.next()){
|
|
String tempValueName = queryTemp.getString("IMAGEFILENAME");
|
|
fileList.add(tempValueName);
|
|
}
|
|
value = String.join(", ",fileList);
|
|
|
|
} else if (liulanMap.containsKey(tempname)){ //自定义浏览框
|
|
String searchById = liulanMap.get(tempname);
|
|
bb.writeLog("liulanMap >> "+tempname+" >> "+searchById);
|
|
String [] valueArray = value.split(",");
|
|
List<String> valueList = new ArrayList<>();
|
|
RecordSet queryTemp = new RecordSet();
|
|
|
|
for (String tempValue : valueArray){
|
|
bb.writeLog("liulanMap >> "+tempname+" >> "+searchById+" >> "+tempValue);
|
|
queryTemp.executeQuery(searchById,tempValue);
|
|
if (queryTemp.next()){
|
|
String tempValueName = queryTemp.getString(1);
|
|
bb.writeLog("query reuslt ");
|
|
valueList.add(tempValueName);
|
|
}else {
|
|
bb.writeLog("query reuslt null");
|
|
}
|
|
}
|
|
value = String.join(", ",valueList);
|
|
|
|
} else if (commonLiuLanMap.containsKey(tempname)){ // 公共浏览框类型
|
|
String fieldType = commonLiuLanMap.get(tempname);
|
|
bb.writeLog("commonLiuLanMap >> "+tempname+" >> "+fieldType + " >>value= "+value);
|
|
|
|
RecordSet queryTemp = new RecordSet();
|
|
|
|
switch (fieldType){
|
|
case "1": // 单选人力
|
|
queryTemp.executeQuery("select LASTNAME from hrmresource h where id =?",value);
|
|
if (queryTemp.next()){
|
|
value = Util.null2String(queryTemp.getString("LASTNAME"));
|
|
}
|
|
break;
|
|
|
|
case "17": // 多选人力
|
|
queryTemp.executeQuery("select LASTNAME from hrmresource h where id in ("+value+")");
|
|
List<String> valueList = new ArrayList<>();
|
|
while (queryTemp.next()){
|
|
valueList.add(Util.null2String(queryTemp.getString("LASTNAME")));
|
|
}
|
|
bb.writeLog("user list >> "+ JSON.toJSONString(valueList));
|
|
value = String.join(", ",valueList);
|
|
break;
|
|
|
|
case "4": // 单选部门
|
|
queryTemp.executeQuery("select DEPARTMENTNAME from hrmdepartment where id=?",value);
|
|
if (queryTemp.next()){
|
|
value = Util.null2String(queryTemp.getString("DEPARTMENTNAME"));
|
|
}
|
|
break;
|
|
|
|
case "57": // 多选部门
|
|
queryTemp.executeQuery("select DEPARTMENTNAME from hrmdepartment where id in ("+value+")");
|
|
List<String> valueList2 = new ArrayList<>();
|
|
while (queryTemp.next()){
|
|
valueList2.add(Util.null2String(queryTemp.getString("DEPARTMENTNAME")));
|
|
}
|
|
bb.writeLog("dep lis is >> "+ JSON.toJSONString(valueList2));
|
|
value = String.join(", ",valueList2);
|
|
break;
|
|
|
|
case "16": // 单选流程
|
|
queryTemp.executeQuery("select REQUESTNAME from workflow_requestbase where REQUESTID =?",value);
|
|
if (queryTemp.next()){
|
|
value = Util.null2String(queryTemp.getString("REQUESTNAME"));
|
|
}
|
|
break;
|
|
|
|
case "152": // 多选流程
|
|
queryTemp.executeQuery("select REQUESTNAME from workflow_requestbase where REQUESTID in ("+value+")");
|
|
List<String> valueList3 = new ArrayList<>();
|
|
while (queryTemp.next()){
|
|
valueList3.add(Util.null2String(queryTemp.getString("REQUESTNAME")));
|
|
}
|
|
bb.writeLog("request list >> "+ JSON.toJSONString(valueList3));
|
|
value = String.join(", ",valueList3);
|
|
break;
|
|
}
|
|
|
|
} else {
|
|
value = value.replace(" ", " ");
|
|
value = value.replace("<br>", " ");
|
|
}
|
|
}
|
|
cardJsonArray.add(
|
|
new JSONObject().fluentPut("name", labelName).fluentPut("value", value)
|
|
);
|
|
}
|
|
}
|
|
return cardJsonArray;
|
|
}
|
|
|
|
|
|
// 选择框选项数据
|
|
private Map<String,Map<String,String>> mapSelectItem(Integer billid){
|
|
RecordSet query = new RecordSet();
|
|
query.executeQuery("select a.FIELDNAME , b.SELECTVALUE , b.SELECTNAME from workflow_billfield a left join workflow_selectitem b on a.id=b.FIELDID where a.billid=? and a.fieldhtmltype=5 order by a.id",billid);
|
|
Map<String,Map<String,String>> map = new HashMap<>();
|
|
while (query.next()){
|
|
String fieldname = query.getString("FIELDNAME");
|
|
String selectvalue = query.getString("SELECTVALUE");
|
|
String selectname = query.getString("SELECTNAME");
|
|
if (map.containsKey(fieldname)){
|
|
map.get(fieldname).put(selectvalue,selectname);
|
|
}else{
|
|
Map<String,String> tempMap = new HashMap<>();
|
|
tempMap.put(selectvalue,selectname);
|
|
map.put(fieldname,tempMap);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// 勾选框字段名
|
|
private Set<String> getCheckFieldName(Integer billid){
|
|
Set<String> set = new HashSet<>();
|
|
RecordSet query = new RecordSet();
|
|
query.executeQuery("select FIELDNAME from workflow_billfield where BILLID =? and FIELDHTMLTYPE=4",billid);
|
|
while (query.next()){
|
|
set.add(query.getString("FIELDNAME"));
|
|
}
|
|
return set;
|
|
}
|
|
|
|
// 附件选择
|
|
private Set<String> getFileFieldSet(Integer billid){
|
|
Set<String> set = new HashSet<>();
|
|
RecordSet query = new RecordSet();
|
|
query.executeQuery("select FIELDNAME from workflow_billfield where BILLID =? and FIELDHTMLTYPE=6",billid);
|
|
while (query.next()){
|
|
set.add(query.getString("FIELDNAME"));
|
|
}
|
|
return set;
|
|
}
|
|
|
|
// 浏览按钮
|
|
private Map<String,String> mapLiuLan(Integer billid){
|
|
RecordSet query = new RecordSet();
|
|
Map<String,String> map = new HashMap<>();
|
|
query.executeQuery("select FIELDNAME, FIELDDBTYPE from workflow_billfield where BILLID =? and FIELDDBTYPE like 'browser.%'",billid);
|
|
while (query.next()){
|
|
String fieldname = query.getString("FIELDNAME");
|
|
String fielddbtpye = query.getString("FIELDDBTYPE");
|
|
String showname = fielddbtpye.substring(8);
|
|
RecordSet query2 = new RecordSet();
|
|
query2.executeQuery("select searchById from mode_browser where showname =?",showname);
|
|
if (query2.next()){
|
|
String searchById = query2.getString("searchById");
|
|
map.put(fieldname,searchById);
|
|
}
|
|
}
|
|
return map;
|
|
}
|
|
|
|
// 公共浏览框类型
|
|
private Map<String,String> mapCommonLiuLan(Integer billid){
|
|
Map<String,String> map = new HashMap<>();
|
|
RecordSet query = new RecordSet();
|
|
query.executeQuery("select FIELDNAME, type from workflow_billfield wb where FIELDHTMLTYPE=3 and BILLID = ?",billid);
|
|
while (query.next()){
|
|
String fieldname = query.getString("FIELDNAME");
|
|
String fielddbtpye = query.getString("type");
|
|
map.put(fieldname,fielddbtpye);
|
|
}
|
|
return map;
|
|
}
|
|
|
|
}
|