📄 tempforminfo.java
字号:
}
TemplateOject obj = new TemplateOject();
obj.setArea_id(area_id);
obj.setArea_name(area_name);
HashMap<HashMap, ArrayList> fieldMap = getFieldAndItems(
cust_id, form_id, area_id);
obj.setMap(fieldMap);
listTepm.add(obj);
}
}
return listTepm;
}
// 取出字段域和条目
public HashMap<HashMap, ArrayList> getFieldAndItems(String cust_id,
String form_id, String area_id) throws SaasApplicationException {
HashMap<HashMap, ArrayList> resultMap = new HashMap<HashMap, ArrayList>();
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VFORM_ID", form_id);
formExt.setParam(":VAREA_ID", area_id);
ArrayList list = formExt.selByList("SEL_BY_AREAID");
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
HashMap map = new HashMap();
map = (HashMap) list.get(i);
String field_id = "";
if (map.get("field_id") != null) {
field_id = map.get("field_id").toString();
}
ArrayList itemList = getTeplateItmesByArea(cust_id, form_id,
field_id);
resultMap.put(map, itemList);
}
}
return resultMap;
}
// 取出归属于一个字段的条目
public ArrayList getTeplateItmesByArea(String cust_id, String form_id,
String field_id) throws SaasApplicationException {
ArrayList list = new ArrayList();
TemplateItemExt itemExt = new TemplateItemExt();
itemExt.setParam(":VCUST_ID", cust_id);
itemExt.setParam(":VFORM_ID", form_id);
itemExt.setParam(":VFIELD_ID", field_id);
list = itemExt.selByList("SEL_BY_FORM");
return list;
}
// 取出一个表单及区域
public HashMap getTeplateAreaById(String cust_id, String form_id,
String area_id) throws SaasApplicationException {
HashMap map = new HashMap();
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VFORM_ID", form_id);
formExt.setParam(":VAREA_ID", area_id);
ArrayList list = formExt.selByList("SEL_BY_AREAID");
if (list != null && list.size() > 0) {
map = (HashMap) list.get(0);
}
return map;
}
// 取出模板列表
public ArrayList getTemplateFormList(int iStart, String cust_id)
throws SaasApplicationException {
ArrayList list = new ArrayList();
try {
iStart = iStart * 20;
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
list = formExt.selByList("SEL_BY_LIST", iStart, 20);
} catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
// 取出模板总数
public int getTemplateSize(String cust_id) throws SaasApplicationException {
int size = 0;
ArrayList list = new ArrayList();
try {
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
list = formExt.selByList("SEL_BY_CT");
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
size = Integer.parseInt(map.get("ct").toString());
}
} catch (NumberFormatException e) {
log.LOG_INFO(e.getMessage());
}
return size;
}
// 取出模板类型列表
public ArrayList getTemplateListByType(int iStart, String cust_id,
String entity_type) throws SaasApplicationException {
ArrayList list = new ArrayList();
try {
iStart = iStart * 20;
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VENTITY_TYPE", entity_type);
list = formExt.selByList("SEL_BY_TYPE_LIST", iStart, 20);
} catch (RuntimeException e) {
log.LOG_INFO(e.getMessage());
}
return list;
}
// 取出模板表列
public String getTemplateSelect(String cust_id, String entity_type)
throws SaasApplicationException {
String html = "";
ArrayList list = new ArrayList();
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VENTITY_TYPE", entity_type);
list = formExt.selByList("SEL_BY_TYPE_LIST");
if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) {
HashMap map = (HashMap) list.get(i);
String key = map.get("form_id").toString();
String value = map.get("form_name").toString();
html = html + "<option value=" + key + ">" + value
+ "</option>";
}
}
return html;
}
// 统计模板类型
public int getTemplateCountByType(String cust_id, String entity_type)
throws SaasApplicationException {
int size = 0;
ArrayList list = new ArrayList();
try {
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VENTITY_TYPE", entity_type);
list = formExt.selByList("SEL_BY_TYPE_CT");
if (list != null && list.size() > 0) {
HashMap map = (HashMap) list.get(0);
size = Integer.parseInt(map.get("ct").toString());
}
} catch (NumberFormatException e) {
log.LOG_INFO(e.getMessage());
}
return size;
}
// 删除模板
public void deleteTemplateForm(Buffers inbuffer) {
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
log.LOG_INFO("进入deleteTemplateForm方法...");
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String form_id = inbuffer.getString("FORM_ID");
try {
iResult = deleteTemplateForm(cust_id, form_id);
} catch (Exception e) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "提取表单数据出错!");
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
} else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出deleteTemplateForm方法...");
}
public int deleteTemplateForm(String cust_id, String form_id)
throws SaasApplicationException {
// 删除模板信息
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VFORM_ID", form_id);
tradeQuery.executeBy(formExt.insBy("DEL_BY_ID"));
// 删除模板条目信息
TemplateItemExt itemExt = new TemplateItemExt();
itemExt.setParam(":VCUST_ID", cust_id);
itemExt.setParam(":VFORM_ID", form_id);
tradeQuery.executeBy(itemExt.insBy("DEL_BY_ID"));
return 0;
}
// 删除区域及条目
public void deleteTemplateArea(Buffers inbuffer) {
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
log.LOG_INFO("进入deleteTemplateArea方法...");
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String form_id = inbuffer.getString("FORM_ID");
String area_id = inbuffer.getString("AREA_ID");
try {
iResult = deleteTemplateArea(cust_id, form_id, area_id);
} catch (Exception e) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "提取表单数据出错!");
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
} else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出deleteTemplateArea方法...");
}
public int deleteTemplateArea(String cust_id, String form_id, String area_id)
throws SaasApplicationException {
// 删除模板信息
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VFORM_ID", form_id);
formExt.setParam(":VAREA_ID", area_id);
tradeQuery.executeBy(formExt.insBy("DEL_BY_AREA"));
return 0;
}
// 删除字段及条目
public void deleteTemplateField(Buffers inbuffer) {
this.outBuffer = inbuffer;
this.inBuffer = inbuffer;
log.LOG_INFO("进入deleteTemplateField方法...");
int iResult = -1;
String cust_id = inbuffer.getString("SESSION_CUST_ID");
String form_id = inbuffer.getString("FORM_ID");
String field_id = inbuffer.getString("FIELD_ID");
try {
iResult = deleteTemplateField(cust_id, form_id, field_id);
} catch (Exception e) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "提取表单数据出错!");
}
if (iResult != 0) {
this.outBuffer.setInt("RESULT_CODE", -1);
this.outBuffer.setString("RESULT_INFO", "业务处理失败!");
} else {
this.outBuffer.setInt("RESULT_CODE", 0);
this.outBuffer.setString("RESULT_INFO", "业务处理成功!");
}
log.LOG_INFO("退出deleteTemplateField方法...");
}
public int deleteTemplateField(String cust_id, String form_id,
String field_id) throws SaasApplicationException {
// 删除模板信息
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VFORM_ID", form_id);
formExt.setParam(":VFIELD_ID", field_id);
tradeQuery.executeBy(formExt.insBy("DEL_BY_FILEDID"));
return 0;
}
// 取出模板字段
public ArrayList getTemplateFormByField(String cust_id, String form_id,
String field_id) throws SaasApplicationException {
ArrayList list = new ArrayList();
TemplateExt formExt = new TemplateExt();
formExt.setParam(":VCUST_ID", cust_id);
formExt.setParam(":VFORM_ID", form_id);
formExt.setParam(":VFIELD_ID", field_id);
list = formExt.selByList("SEL_BY_FORM");
return list;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -