📄 tablecolumnaction.java
字号:
package cn.myapps.core.report.tablecolumn.action;
import java.util.Collection;
import java.util.Iterator;
import cn.myapps.base.action.BaseAction;
import cn.myapps.base.dao.DataPackage;
import cn.myapps.core.report.reportconfig.ejb.ReportConfig;
import cn.myapps.core.report.reportconfig.ejb.ReportConfigProcess;
import cn.myapps.core.report.tablecolumn.ejb.TableColumn;
import cn.myapps.core.report.tablecolumn.ejb.TableColumnProcess;
import cn.myapps.util.ProcessFactory;
public class TableColumnAction extends BaseAction {
private String _reportConfigid;
private String _type;
private Collection _fieldList; // 根据_reportConfigid,_type取得
private String _isSort;
private String calculateMode[];
private String _description[];
private String _width[];
private String _queryid;
private String _orderNo[];
private String _fontSize[];
private String _backColor[];
public String get_queryid() {
return _queryid;
}
public void set_queryid(String _queryid) {
this._queryid = _queryid;
}
public String[] get_description() {
return _description;
}
public void set_description(String[] _description) {
this._description = _description;
}
public String[] get_width() {
return _width;
}
public void set_width(String[] _width) {
this._width = _width;
}
public TableColumnAction() throws Exception {
super(ProcessFactory.createProcess(TableColumnProcess.class),
new TableColumn());
}
public String doSave() throws Exception {
DataPackage data = ((TableColumnProcess) proxy)
.getFieldsByReportConfigAndType(_reportConfigid, _type,
getApplication());
if (data != null && data.datas != null && data.datas.size() > 0)
for (Iterator iter = data.datas.iterator(); iter.hasNext();) {
TableColumn em = (TableColumn) iter.next();
this.proxy.doRemove(em.getId());
}
ReportConfigProcess rp = (ReportConfigProcess) (ProcessFactory
.createProcess(ReportConfigProcess.class));
ReportConfig rc = (ReportConfig) rp.doView(_reportConfigid);
if (_selects != null && _selects.length > 0) {
boolean flag = false;
for (int i = 0; i < _selects.length; i++) {
String name = _selects[i];
TableColumn content = new TableColumn();
content.setName(name);
content.setReportConfig(rc);
content.setType(_type);
content.setDescription(_description[i]);
content.setWidth(_width[i]);
content.setBackColor(_backColor[i]);
if (name.equals(this._isSort)) {
content.setSort(true);
flag = true;
} else {
content.setSort(false);
if (flag)
content.setCalculateMode(calculateMode[i - 1]);
else
content.setCalculateMode(calculateMode[i]);
}
if (!content.isSort() && _orderNo[i] != null
&& _orderNo[i].length() > 0)
content.setOrderno(Integer.parseInt(_orderNo[i]));
if (_fontSize[i] != null && _fontSize[i].length() > 0)
content.setFontSize(Integer.parseInt(_fontSize[i]));
content.setApplicationid(getApplication());
this.proxy.doCreate(content);
}
}
DataPackage dt = ((TableColumnProcess) proxy)
.getFieldsByReportConfigAndType(_reportConfigid, _type,
getApplication());
if (dt != null)
set_fieldList(dt.datas);
return SUCCESS;
}
public String doEdit() throws Exception {
DataPackage data = ((TableColumnProcess) proxy)
.getFieldsByReportConfigAndType(_reportConfigid, _type,
getApplication());
if (data != null)
set_fieldList(data.datas);
return SUCCESS;
}
public String doNew() throws Exception {
DataPackage data = ((TableColumnProcess) proxy)
.getFieldsByReportConfigAndType(_reportConfigid, _type,
getApplication());
if (data != null)
set_fieldList(data.datas);
return SUCCESS;
}
public String doList() throws Exception {
DataPackage data = ((TableColumnProcess) proxy)
.getFieldsByReportConfigAndType(_reportConfigid, _type,
getParams().getParameterAsString("application"));
setDatas(data);
if (data != null)
set_fieldList(data.datas);
return SUCCESS;
}
public String get_reportConfigid() {
return _reportConfigid;
}
public void set_reportConfigid(String configid) {
_reportConfigid = configid;
}
public String get_type() {
return _type;
}
public void set_type(String _type) {
this._type = _type;
}
public Collection get_fieldList() {
return _fieldList;
}
public void set_fieldList(Collection list) {
_fieldList = list;
}
public String get_isSort() {
return _isSort;
}
public void set_isSort(String sort) {
_isSort = sort;
}
public String[] getCalculateMode() {
return calculateMode;
}
public void setCalculateMode(String[] calculateMode) {
this.calculateMode = calculateMode;
}
public String[] get_orderNo() {
return _orderNo;
}
public void set_orderNo(String[] no) {
_orderNo = no;
}
public String[] get_backColor() {
return _backColor;
}
public void set_backColor(String[] color) {
_backColor = color;
}
public String[] get_fontSize() {
return _fontSize;
}
public void set_fontSize(String[] size) {
_fontSize = size;
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -