Commit fd65819c by gechengyang

A

parent 0e1e726e
package com.brilliance.eibs.etrade; package com.brilliance.eibs.etrade;
import static org.sss.common.impl.Constants.*; import static org.sss.common.impl.Constants.CALLER;
import static org.sss.common.impl.Constants.EQ;
import static org.sss.common.impl.Constants.LIKE;
import static org.sss.common.impl.Constants.NO_ERROR;
import static org.sss.common.impl.Constants.VIEW_CHECK;
import static org.sss.common.impl.Constants.VIEW_LABEL;
import java.util.ArrayList;
import java.util.List;
import log.Log; import log.Log;
import log.LogFactory; import log.LogFactory;
import java.util.*;
import org.sss.common.model.*;
import org.sss.common.impl.*;
import java.util.regex.Pattern;
import java.util.regex.Matcher;
import java.math.BigDecimal;
import java.io.Serializable;
import org.sss.util.ContainerUtils;
import org.sss.common.impl.AbstractModule; import org.sss.common.impl.AbstractModule;
import org.sss.common.impl.AttributeValue;
import org.sss.common.impl.DatafieldImpl;
import org.sss.common.impl.PanelImpl;
import org.sss.common.impl.RuleUtils;
import org.sss.common.impl.StreamGrid;
import org.sss.common.impl.StreamImpl;
import org.sss.common.model.Argument;
import org.sss.common.model.Event;
import org.sss.common.model.EventType;
import org.sss.common.model.IAttributeValue;
import org.sss.common.model.IContext;
import org.sss.common.model.IDatafield;
import org.sss.common.model.IEventRule;
import org.sss.common.model.IModule;
import org.sss.common.model.IPanel;
import org.sss.common.model.IParent;
import org.sss.common.model.IRule;
import org.sss.common.model.IStream;
import org.sss.common.model.MessageType;
import org.sss.util.ContainerUtils;
@SuppressWarnings("unused") @SuppressWarnings("unused")
public class Pxip public class Pxip extends AbstractModule {
extends AbstractModule static final Log log = LogFactory.getLog(Pxip.class);
{ final protected ProxyPxigrp _pxigrp = new ProxyPxigrp(this);
static final Log log = LogFactory.getLog(Pxip.class); final protected ElstPxi _pxilst = new ElstPxi(this, 0);
final protected ProxyPxigrp _pxigrp = new ProxyPxigrp(this); final protected IDatafield<String> _sav = new DatafieldImpl<String>(this, String.class, null);
final protected ElstPxi _pxilst = new ElstPxi(this,0); final protected IDatafield<String> _sel = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _sav = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _nam = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _sel = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _sex = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _nam = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _univer = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _sex = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _major = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _univer = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _del = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _major = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<IStream> _upload = new DatafieldImpl<IStream>(this, IStream.class, new StreamImpl());
final protected IDatafield<String> _del = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<StreamGrid> _tree = new DatafieldImpl<StreamGrid>(this, StreamGrid.class, new StreamGrid());
final protected IDatafield<IStream> _upload = new DatafieldImpl<IStream>(this,IStream.class,new StreamImpl()); final protected IDatafield<String> _sogou = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<StreamGrid> _tree = new DatafieldImpl<StreamGrid>(this,StreamGrid.class,new StreamGrid()); final protected IDatafield<String> _pinittest = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _sogou = new DatafieldImpl<String>(this,String.class,null); final transient protected IPanel _edtp = new PanelImpl(this, "edtp", "PD000000");
final protected IDatafield<String> _pinittest = new DatafieldImpl<String>(this,String.class,null); final transient protected IPanel _pxiaddmp = new PanelImpl(this, "pxiaddmp", "PD000007");
final transient protected IPanel _edtp = new PanelImpl(this,"edtp","PD000000"); final transient protected IPanel _pxiselp = new PanelImpl(this, "pxiselp", "PD000013");
final transient protected IPanel _pxiaddmp = new PanelImpl(this,"pxiaddmp","PD000007"); final transient protected IPanel _argp = new PanelImpl(this, "argp", "PD000014");
final transient protected IPanel _pxiselp = new PanelImpl(this,"pxiselp","PD000013"); final transient protected IPanel _infp = new PanelImpl(this, "infp", "PD000025");
final transient protected IPanel _argp = new PanelImpl(this,"argp","PD000014"); final transient protected IPanel _pxidelp = new PanelImpl(this, "pxidelp", "PD000035");
final transient protected IPanel _infp = new PanelImpl(this,"infp","PD000025"); final transient protected IPanel _grdemp = new PanelImpl(this, "grdemp", "PD000041");
final transient protected IPanel _pxidelp = new PanelImpl(this,"pxidelp","PD000035"); final transient protected IPanel _centerp = new PanelImpl(this, "centerp", "PD000042");
final transient protected IPanel _grdemp = new PanelImpl(this,"grdemp","PD000041"); final transient protected IPanel _btnp = new PanelImpl(this, "btnp", "PD000049");
final transient protected IPanel _centerp = new PanelImpl(this,"centerp","PD000042"); final transient protected IPanel _savp = new PanelImpl(this, "savp", "PD000051");
final transient protected IPanel _btnp = new PanelImpl(this,"btnp","PD000049");
final transient protected IPanel _savp = new PanelImpl(this,"savp","PD000051"); public Pxip(IParent parent) {
super(parent);
public Pxip(IParent parent) }
{
super(parent); @Override
} public final void copyValue(IModule module) {
Pxip eibsObject = (Pxip) module;
@Override _sav.setValue(eibsObject._sav.getValue());
public final void copyValue(IModule module) _sel.setValue(eibsObject._sel.getValue());
{ _nam.setValue(eibsObject._nam.getValue());
Pxip eibsObject=(Pxip)module; _sex.setValue(eibsObject._sex.getValue());
_sav.setValue(eibsObject._sav.getValue()); _univer.setValue(eibsObject._univer.getValue());
_sel.setValue(eibsObject._sel.getValue()); _major.setValue(eibsObject._major.getValue());
_nam.setValue(eibsObject._nam.getValue()); _del.setValue(eibsObject._del.getValue());
_sex.setValue(eibsObject._sex.getValue()); _upload.setValue(eibsObject._upload.getValue());
_univer.setValue(eibsObject._univer.getValue()); _tree.setValue(eibsObject._tree.getValue());
_major.setValue(eibsObject._major.getValue()); _sogou.setValue(eibsObject._sogou.getValue());
_del.setValue(eibsObject._del.getValue()); _pinittest.setValue(eibsObject._pinittest.getValue());
_upload.setValue(eibsObject._upload.getValue()); }
_tree.setValue(eibsObject._tree.getValue());
_sogou.setValue(eibsObject._sogou.getValue()); @Override
_pinittest.setValue(eibsObject._pinittest.getValue()); public final void copyValues(IParent parent) {
} copyValue((IModule) parent);
Pxip eibsObject = (Pxip) parent;
@Override _pxigrp.copyValues(eibsObject._pxigrp);
public final void copyValues(IParent parent) _pxilst.copyValues(eibsObject._pxilst);
{ }
copyValue((IModule)parent);
Pxip eibsObject=(Pxip)parent; @Override
_pxigrp.copyValues(eibsObject._pxigrp); public final void clear() {
_pxilst.copyValues(eibsObject._pxilst); _sav.clear();
} _sel.clear();
_nam.clear();
@Override _sex.clear();
public final void clear() _univer.clear();
{ _major.clear();
_sav.clear(); _del.clear();
_sel.clear(); _upload.clear();
_nam.clear(); _tree.clear();
_sex.clear(); _sogou.clear();
_univer.clear(); _pinittest.clear();
_major.clear(); _pxigrp.clear();
_del.clear(); _pxilst.clear();
_upload.clear(); }
_tree.clear();
_sogou.clear(); @Override
_pinittest.clear(); public final IModule clone() {
_pxigrp.clear(); Pxip module = new Pxip(null);
_pxilst.clear(); module.copyValues(this);
} module.addChild();
return module;
@Override }
public final IModule clone()
{ @Override
Pxip module=new Pxip(null); public final void addChild() {
module.copyValues(this); put("pxigrp", _pxigrp);
module.addChild(); put("pxilst", _pxilst);
return module; _pxilst.addChild();
} put("sav", _sav);
put("sel", _sel);
@Override put("nam", _nam);
public final void addChild() put("sex", _sex);
{ put("univer", _univer);
put("pxigrp",_pxigrp); put("major", _major);
put("pxilst",_pxilst); put("del", _del);
_pxilst.addChild(); put("upload", _upload);
put("sav",_sav); put("tree", _tree);
put("sel",_sel); put("sogou", _sogou);
put("nam",_nam); put("pinittest", _pinittest);
put("sex",_sex); }
put("univer",_univer);
put("major",_major); @Override
put("del",_del); public final void bindEvents(IContext ctx) {
put("upload",_upload); if (isEventBinded())
put("tree",_tree); return;
put("sogou",_sogou); getSav().addEventRule(event050_sav);
put("pinittest",_pinittest); getSav().addEventRule(event03000_sav);
} getSel().addEventRule(event0100_sel);
getPxilst().addEventRule(event2100_pxilst);
@Override getDel().addEventRule(event0100_del);
public final void bindEvents(IContext ctx) getUpload().addEventRule(event5100_upload);
{ ctx.getRoot().addDefaultRule(init100__);
if(isEventBinded()) ctx.getRoot().addDefaultRule(init200__);
return; _pxilst.bindEvents(ctx);
getSav().addEventRule(event050_sav); super.bindEvents(ctx);
getSav().addEventRule(event03000_sav); }
getSel().addEventRule(event0100_sel);
getPxilst().addEventRule(event2100_pxilst); public Pxigrp getPxigrp() {
getDel().addEventRule(event0100_del); return _pxigrp.getHost();
getUpload().addEventRule(event5100_upload); }
ctx.getRoot().addDefaultRule(init100__);
ctx.getRoot().addDefaultRule(init200__); public void setPxigrp(Pxigrp value) {
_pxilst.bindEvents(ctx); _pxigrp.setHost(value);
super.bindEvents(ctx); }
}
public ElstPxi getPxilst() {
public Pxigrp getPxigrp() return _pxilst;
{ }
return _pxigrp.getHost();
} public IDatafield<String> getSav() {
return _sav;
public void setPxigrp(Pxigrp value) }
{
_pxigrp.setHost(value); public String getEibsSav() {
} return _sav.getValue();
}
public ElstPxi getPxilst()
{ public void setEibsSav(String value) {
return _pxilst; _sav.setValue(value);
} }
public IDatafield<String> getSav() public IDatafield<String> getSel() {
{ return _sel;
return _sav; }
}
public String getEibsSel() {
public String getEibsSav() return _sel.getValue();
{ }
return _sav.getValue();
} public void setEibsSel(String value) {
_sel.setValue(value);
public void setEibsSav(String value) }
{
_sav.setValue(value); public IDatafield<String> getNam() {
} return _nam;
}
public IDatafield<String> getSel()
{ public String getEibsNam() {
return _sel; return _nam.getValue();
} }
public String getEibsSel() public void setEibsNam(String value) {
{ _nam.setValue(value);
return _sel.getValue(); }
}
public IDatafield<String> getSex() {
public void setEibsSel(String value) return _sex;
{ }
_sel.setValue(value);
} public String getEibsSex() {
return _sex.getValue();
public IDatafield<String> getNam() }
{
return _nam; public void setEibsSex(String value) {
} _sex.setValue(value);
}
public String getEibsNam()
{ public IDatafield<String> getUniver() {
return _nam.getValue(); return _univer;
} }
public void setEibsNam(String value) public String getEibsUniver() {
{ return _univer.getValue();
_nam.setValue(value); }
}
public void setEibsUniver(String value) {
public IDatafield<String> getSex() _univer.setValue(value);
{ }
return _sex;
} public IDatafield<String> getMajor() {
return _major;
public String getEibsSex() }
{
return _sex.getValue(); public String getEibsMajor() {
} return _major.getValue();
}
public void setEibsSex(String value)
{ public void setEibsMajor(String value) {
_sex.setValue(value); _major.setValue(value);
} }
public IDatafield<String> getUniver() public IDatafield<String> getDel() {
{ return _del;
return _univer; }
}
public String getEibsDel() {
public String getEibsUniver() return _del.getValue();
{ }
return _univer.getValue();
} public void setEibsDel(String value) {
_del.setValue(value);
public void setEibsUniver(String value) }
{
_univer.setValue(value); public IDatafield<IStream> getUpload() {
} return _upload;
}
public IDatafield<String> getMajor()
{ public IStream getEibsUpload() {
return _major; return _upload.getValue();
} }
public String getEibsMajor() public void setEibsUpload(IStream value) {
{ _upload.setValue(value);
return _major.getValue(); }
}
public IDatafield<StreamGrid> getTree() {
public void setEibsMajor(String value) return _tree;
{ }
_major.setValue(value);
} public StreamGrid getEibsTree() {
return _tree.getValue();
public IDatafield<String> getDel() }
{
return _del; public void setEibsTree(StreamGrid value) {
} _tree.setValue(value);
}
public String getEibsDel()
{ public IDatafield<String> getSogou() {
return _del.getValue(); return _sogou;
} }
public void setEibsDel(String value) public String getEibsSogou() {
{ return _sogou.getValue();
_del.setValue(value); }
}
public void setEibsSogou(String value) {
public IDatafield<IStream> getUpload() _sogou.setValue(value);
{ }
return _upload;
} public IDatafield<String> getPinittest() {
return _pinittest;
public IStream getEibsUpload() }
{
return _upload.getValue(); public String getEibsPinittest() {
} return _pinittest.getValue();
}
public void setEibsUpload(IStream value)
{ public void setEibsPinittest(String value) {
_upload.setValue(value); _pinittest.setValue(value);
} }
public IDatafield<StreamGrid> getTree() public IPanel getEdtp() {
{ return _edtp;
return _tree; }
}
public IPanel getPxiaddmp() {
public StreamGrid getEibsTree() return _pxiaddmp;
{ }
return _tree.getValue();
} public IPanel getPxiselp() {
return _pxiselp;
public void setEibsTree(StreamGrid value) }
{
_tree.setValue(value); public IPanel getArgp() {
} return _argp;
}
public IDatafield<String> getSogou()
{ public IPanel getInfp() {
return _sogou; return _infp;
} }
public String getEibsSogou() public IPanel getPxidelp() {
{ return _pxidelp;
return _sogou.getValue(); }
}
public IPanel getGrdemp() {
public void setEibsSogou(String value) return _grdemp;
{ }
_sogou.setValue(value);
} public IPanel getCenterp() {
return _centerp;
public IDatafield<String> getPinittest() }
{
return _pinittest; public IPanel getBtnp() {
} return _btnp;
}
public String getEibsPinittest()
{ public IPanel getSavp() {
return _pinittest.getValue(); return _savp;
} }
public void setEibsPinittest(String value) private final transient IRule init100__ = new IRule() {
{ public final int getOrder() {
_pinittest.setValue(value); return 100;
} }
public IPanel getEdtp() @SuppressWarnings(value = "unchecked")
{ public final boolean invoke(IContext ctx, IAttributeValue evt) {
return _edtp; buildTree();
} return true;
}
public IPanel getPxiaddmp()
{ };
return _pxiaddmp;
} private final transient IRule init200__ = new IRule() {
public final int getOrder() {
public IPanel getPxiselp() return 200;
{ }
return _pxiselp;
} @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx, IAttributeValue evt) {
public IPanel getArgp() Pxip.this.setEibsPinittest("999");
{ return true;
return _argp; }
}
};
public IPanel getInfp()
{ private final transient IEventRule event050_sav = new IEventRule() {
return _infp; public final int getOrder() {
} return 50;
}
public IPanel getPxidelp()
{ public final EventType getType() {
return _pxidelp; return EventType.ON_CLICK;
} }
public IPanel getGrdemp() @SuppressWarnings(value = "unchecked")
{ public final boolean invoke(IContext ctx, Event evt) {
return _grdemp; if (!ctx.getSession().checkAll(Pxip.this.getPxigrp().getRec())) {
} return false;
}
public IPanel getCenterp() ctx.getSupport().begin();
{ return true;
return _centerp; }
}
};
public IPanel getBtnp()
{ private final transient IEventRule event03000_sav = new IEventRule() {
return _btnp; public final int getOrder() {
} return 3000;
}
public IPanel getSavp()
{ public final EventType getType() {
return _savp; return EventType.ON_CLICK;
} }
private final transient IRule init100__=new IRule() @SuppressWarnings(value = "unchecked")
{ public final boolean invoke(IContext ctx, Event evt) {
public final int getOrder() if (ctx.getError() == NO_ERROR) {
{ ctx.getSupport().commit();
return 100; ctx.getGui().message(MessageType.INFORMATION, ctx.getGui().getI18nValue("pxip", "CT000009"),
} ctx.getGui().getI18nValue("pxip", "CT000010"));
String trnsnam = ctx.getSession().getTransName();
@SuppressWarnings(value = "unchecked") if ("pxiadd".equals(trnsnam) || "pxidel".equals(trnsnam)) {
public final boolean invoke(IContext ctx,IAttributeValue evt) ctx.getGui().chain(CALLER);
{ }
buildTree(); } else {
return true; ctx.getSupport().rollback();
} ctx.getGui().message(MessageType.INFORMATION, ctx.getGui().getI18nValue("pxip", "CT000011"),
ctx.getGui().getI18nValue("pxip", "CT000012"));
}; }
return true;
private final transient IRule init200__=new IRule() }
{
public final int getOrder() };
{
return 200; private final transient IEventRule event0100_sel = new IEventRule() {
} public final int getOrder() {
return 100;
@SuppressWarnings(value = "unchecked") }
public final boolean invoke(IContext ctx,IAttributeValue evt)
{ public final EventType getType() {
Pxip.this.setEibsPinittest("999"); return EventType.ON_CLICK;
return true; }
}
@SuppressWarnings(value = "unchecked")
}; public final boolean invoke(IContext ctx, Event evt) {
Argument arg = new Argument();
private final transient IEventRule event050_sav=new IEventRule() if (!ContainerUtils.isEmpty(Pxip.this.getNam())) {
{ arg = arg.and("nam", LIKE, "%" + Pxip.this.getEibsNam() + "%");
public final int getOrder() }
{ if (!ContainerUtils.isEmpty(Pxip.this.getUniver())) {
return 50; arg = arg.and("univer", LIKE, "%" + Pxip.this.getEibsUniver() + "%");
} }
if (!ContainerUtils.isEmpty(Pxip.this.getMajor())) {
public final EventType getType() arg = arg.and("major", LIKE, "%" + Pxip.this.getEibsMajor() + "%");
{ }
return EventType.ON_CLICK; if (!ContainerUtils.isEmpty(Pxip.this.getSex())) {
} arg = arg.and("sex", EQ, "%" + Pxip.this.getEibsSex() + "%");
}
@SuppressWarnings(value = "unchecked") ctx.getSupport().find(Pxip.this.getPxilst(), arg);
public final boolean invoke(IContext ctx,Event evt) ctx.getGui().setModified(Pxip.this.getPxilst());
{ System.out.println(Pxip.this.getPxilst().size());
if(!ctx.getSession().checkAll(Pxip.this.getPxigrp().getRec())) return true;
{ }
return false;
} };
ctx.getSupport().begin();
return true; private final transient IEventRule event2100_pxilst = new IEventRule() {
} public final int getOrder() {
return 100;
}; }
private final transient IEventRule event03000_sav=new IEventRule() public final EventType getType() {
{ return EventType.ON_DBLCLICK;
public final int getOrder() }
{
return 3000; @SuppressWarnings(value = "unchecked")
} public final boolean invoke(IContext ctx, Event evt) {
int idx = ctx.getGui().getSelectedRowIndex(Pxip.this.getPxilst());
public final EventType getType() if (idx < 0) {
{ return true;
return EventType.ON_CLICK; }
} String selInr = Pxip.this.getPxilst().get(idx).getEibsInr();
ctx.getSession().storeData("pxiinr", selInr);
@SuppressWarnings(value = "unchecked") ctx.getGui().chain("pxiame");
public final boolean invoke(IContext ctx,Event evt) return true;
{ }
if(ctx.getError() == NO_ERROR)
{ };
ctx.getSupport().commit();
ctx.getGui().message(MessageType.INFORMATION,ctx.getGui().getI18nValue("pxip","CT000009"),ctx.getGui().getI18nValue("pxip","CT000010")); private final transient IEventRule event0100_del = new IEventRule() {
String trnsnam = ctx.getSession().getTransName(); public final int getOrder() {
if("pxiadd".equals(trnsnam) || "pxidel".equals(trnsnam)) return 100;
{ }
ctx.getGui().chain(CALLER);
} public final EventType getType() {
} return EventType.ON_CLICK;
else }
{
ctx.getSupport().rollback(); @SuppressWarnings(value = "unchecked")
ctx.getGui().message(MessageType.INFORMATION,ctx.getGui().getI18nValue("pxip","CT000011"),ctx.getGui().getI18nValue("pxip","CT000012")); public final boolean invoke(IContext ctx, Event evt) {
} int idx = ctx.getGui().getSelectedRowIndex(Pxip.this.getPxilst());
return true; if (idx < 0) {
} return true;
}
}; String selInr = Pxip.this.getPxilst().get(idx).getEibsInr();
ctx.getSession().storeData("pxiinr", selInr);
private final transient IEventRule event0100_sel=new IEventRule() ctx.getGui().chain("pxidel");
{ return true;
public final int getOrder() }
{
return 100; };
}
private final transient IEventRule event5100_upload = new IEventRule() {
public final EventType getType() public final int getOrder() {
{ return 100;
return EventType.ON_CLICK; }
}
public final EventType getType() {
@SuppressWarnings(value = "unchecked") return EventType.ON_STREAM_UPLOAD;
public final boolean invoke(IContext ctx,Event evt) }
{
Argument arg = new Argument(); @SuppressWarnings(value = "unchecked")
if(!ContainerUtils.isEmpty(Pxip.this.getNam())) public final boolean invoke(IContext ctx, Event evt) {
{
arg = arg.and("nam",LIKE,"%"+Pxip.this.getEibsNam()+"%"); // 准备目录
} String relativeFolder = "header";
if(!ContainerUtils.isEmpty(Pxip.this.getUniver())) String path = ContainerUtils.catPath(ctx.getGui().getRootPath(), relativeFolder);
{ log.info(getOrder(), "file path=" + path);
arg = arg.and("univer",LIKE,"%"+Pxip.this.getEibsUniver()+"%"); if (!ContainerUtils.fileExists(path)) {
} ContainerUtils.fileMkdirs(path);
if(!ContainerUtils.isEmpty(Pxip.this.getMajor())) }
{ // 准备服务器端文件名
arg = arg.and("major",LIKE,"%"+Pxip.this.getEibsMajor()+"%"); int seq = ctx.getSupport().count("headerImage");
} String fileName = seq + ".jpg";
if(!ContainerUtils.isEmpty(Pxip.this.getSex())) String relPath = "header/" + fileName;
{ // 处理上传文件
arg = arg.and("sex",EQ,"%"+Pxip.this.getEibsSex()+"%"); IStream stream = Pxip.this.getEibsUpload();
} ContainerUtils.streamSave(stream, ContainerUtils.catPath(path, fileName));
ctx.getSupport().find(Pxip.this.getPxilst(),arg); Pxip.this.getPxigrp().getRec().setEibsHeadimg(relPath);
ctx.getGui().setModified(Pxip.this.getPxilst()); ctx.getGui().setModified(Pxip.this.getPxigrp().getRec());
return true; return true;
} }
}; };
private final transient IEventRule event2100_pxilst=new IEventRule() @SuppressWarnings(value = "unchecked")
{ public final void buildTree() {
public final int getOrder() IContext ctx = RuleUtils.ctx.get();
{ StreamGrid grid = Pxip.this.getEibsTree();
return 100; // 设置Grid空表头,固定列表宽度
} AttributeValue h01 = new AttributeValue("");
ctx.getGui().setViewType(h01, VIEW_LABEL, 50);
public final EventType getType() AttributeValue h02 = new AttributeValue();
{ ctx.getGui().setViewType(h02, VIEW_LABEL, 100);
return EventType.ON_DBLCLICK; grid.setHeaders(new AttributeValue[] { h01, h02 });
} // ----------------------------------------------
AttributeValue row00 = new AttributeValue();
@SuppressWarnings(value = "unchecked") ctx.getGui().setViewType(row00, VIEW_CHECK, 100);
public final boolean invoke(IContext ctx,Event evt) AttributeValue row01 = new AttributeValue("研发中心");
{ AttributeValue row02 = new AttributeValue();
int idx = ctx.getGui().getSelectedRowIndex(Pxip.this.getPxilst()); AttributeValue[] row0 = new AttributeValue[] { row00, row02, row01 };
if(idx < 0) grid.add(row0);
{ // ----------------------------------------------
return true; List<AttributeValue[]> subrows = new ArrayList<AttributeValue[]>();
} row02.setValue(subrows);
String selInr = Pxip.this.getPxilst().get(idx).getEibsInr(); // ----------------------------------------------
ctx.getSession().storeData("pxiinr",selInr); AttributeValue srow02 = new AttributeValue("");
ctx.getGui().chain("pxiame"); ctx.getGui().setViewType(srow02, VIEW_LABEL, 50);
return true; AttributeValue srow00 = new AttributeValue();
} ctx.getGui().setViewType(srow00, VIEW_CHECK, 100);
AttributeValue srow01 = new AttributeValue("武汉");
}; subrows.add(new AttributeValue[] { srow02, srow00, srow01 });
// ----------------------------------------------
private final transient IEventRule event0100_del=new IEventRule() AttributeValue srow12 = new AttributeValue("");
{ ctx.getGui().setViewType(srow12, VIEW_LABEL, 50);
public final int getOrder() AttributeValue srow10 = new AttributeValue();
{ ctx.getGui().setViewType(srow10, VIEW_CHECK, 100);
return 100; AttributeValue srow11 = new AttributeValue("天津");
} subrows.add(new AttributeValue[] { srow12, srow10, srow11 });
}
public final EventType getType()
{
return EventType.ON_CLICK;
}
@SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,Event evt)
{
int idx = ctx.getGui().getSelectedRowIndex(Pxip.this.getPxilst());
if(idx < 0)
{
return true;
}
String selInr = Pxip.this.getPxilst().get(idx).getEibsInr();
ctx.getSession().storeData("pxiinr",selInr);
ctx.getGui().chain("pxidel");
return true;
}
};
private final transient IEventRule event5100_upload=new IEventRule()
{
public final int getOrder()
{
return 100;
}
public final EventType getType()
{
return EventType.ON_STREAM_UPLOAD;
}
@SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,Event evt)
{
//准备目录
String relativeFolder = "header";
String path = ContainerUtils.catPath(ctx.getGui().getRootPath(),relativeFolder);
log.info(getOrder(),"file path="+path);
if(!ContainerUtils.fileExists(path))
{
ContainerUtils.fileMkdirs(path);
}
//准备服务器端文件名
int seq = ctx.getSupport().count("headerImage");
String fileName = seq+".jpg";
String relPath = "header/"+fileName;
//处理上传文件
IStream stream = Pxip.this.getEibsUpload();
ContainerUtils.streamSave(stream,ContainerUtils.catPath(path,fileName));
Pxip.this.getPxigrp().getRec().setEibsHeadimg(relPath);
ctx.getGui().setModified(Pxip.this.getPxigrp().getRec());
return true;
}
};
@SuppressWarnings(value = "unchecked")
public final void buildTree()
{
IContext ctx=RuleUtils.ctx.get();
StreamGrid grid = Pxip.this.getEibsTree();
//设置Grid空表头,固定列表宽度
AttributeValue h01 = new AttributeValue("");
ctx.getGui().setViewType(h01,VIEW_LABEL,50);
AttributeValue h02 = new AttributeValue();
ctx.getGui().setViewType(h02,VIEW_LABEL,100);
grid.setHeaders(new AttributeValue[]{h01,h02});
//----------------------------------------------
AttributeValue row00 = new AttributeValue();
ctx.getGui().setViewType(row00,VIEW_CHECK,100);
AttributeValue row01 = new AttributeValue("研发中心");
AttributeValue row02 = new AttributeValue();
AttributeValue[] row0 = new AttributeValue[]{row00,row02,row01};
grid.add(row0);
//----------------------------------------------
List<AttributeValue[]> subrows = new ArrayList<AttributeValue[]>();
row02.setValue(subrows);
//----------------------------------------------
AttributeValue srow02 = new AttributeValue("");
ctx.getGui().setViewType(srow02,VIEW_LABEL,50);
AttributeValue srow00 = new AttributeValue();
ctx.getGui().setViewType(srow00,VIEW_CHECK,100);
AttributeValue srow01 = new AttributeValue("武汉");
subrows.add(new AttributeValue[]{srow02,srow00,srow01});
//----------------------------------------------
AttributeValue srow12 = new AttributeValue("");
ctx.getGui().setViewType(srow12,VIEW_LABEL,50);
AttributeValue srow10 = new AttributeValue();
ctx.getGui().setViewType(srow10,VIEW_CHECK,100);
AttributeValue srow11 = new AttributeValue("天津");
subrows.add(new AttributeValue[]{srow12,srow10,srow11});
}
} }
...@@ -6,7 +6,13 @@ public class ErrorCodes { ...@@ -6,7 +6,13 @@ public class ErrorCodes {
public static final String SUCCESS_INFO = "success"; public static final String SUCCESS_INFO = "success";
public static final String NOT_LOGIN = "R0001"; public static final String NOT_LOGIN = "R0001";
// public static final String NO_SESSION = "R0002"; // public static final String NO_SESSION = "R0002";
public static final String LOGIN_ERROR = "R0003";
public static final String LOGIN_ID_ISNULL = "L0001";
public static final String LOGIN_TOKEN_ISNULL = "L0002";
public static final String LOGIN_TOKEN_CHECKERROR = "L0003";
public static final String LOGIN_TIMEOUT = "L0004";
public static final String LOGIN_ERROR = "L0005";
public static final String NOT_FOUND_DATA = "R0004"; public static final String NOT_FOUND_DATA = "R0004";
public static final String DATA_TYPE_ERROR = "R0005"; public static final String DATA_TYPE_ERROR = "R0005";
public static final String CHAIN_ERROR = "R0006"; public static final String CHAIN_ERROR = "R0006";
......
package org.sss.presentation.noui.controller; package org.sss.presentation.noui.controller;
import java.io.ByteArrayOutputStream; import java.io.ByteArrayOutputStream;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -105,9 +107,10 @@ public class AbstractCommonController { ...@@ -105,9 +107,10 @@ public class AbstractCommonController {
redisLoginInfo.setSysmod(sysmodBytes); redisLoginInfo.setSysmod(sysmodBytes);
RedisUtil.set(StringUtil.userUniqueId(noUiRequest), redisLoginInfo); RedisUtil.set(StringUtil.userUniqueId(noUiRequest), redisLoginInfo);
return ResultUtil.result(ErrorCodes.SUCCESS, NoUiPresentationUtil.retMsg(context), Map<String, Object> afterReturnData = handleReturnData(eventType, context, noUiRequest, alias);
handleReturnData(eventType, context, noUiRequest, alias), NoUiPresentationUtil.handleErrorReturnData(context, alias),
NoUiPresentationUtil.handleCodeTableReturnData(context, alias)); return ResultUtil.result(ErrorCodes.SUCCESS, NoUiPresentationUtil.retMsg(context), afterReturnData,
NoUiPresentationUtil.handleErrorReturnData(context, alias), NoUiPresentationUtil.handleCodeTableReturnData(context, alias));
} catch (Exception e) { } catch (Exception e) {
log.error("OnClick command error", e); log.error("OnClick command error", e);
} }
...@@ -141,6 +144,7 @@ public class AbstractCommonController { ...@@ -141,6 +144,7 @@ public class AbstractCommonController {
NoUiPresentation gui = (NoUiPresentation) context.getGui(); NoUiPresentation gui = (NoUiPresentation) context.getGui();
Map<String, Object> modifyMap = gui.getModifyMap(); Map<String, Object> modifyMap = gui.getModifyMap();
List<String> containsKeys = new ArrayList<String>();
for (Map.Entry<String, Object> modifyEntry : modifyMap.entrySet()) { for (Map.Entry<String, Object> modifyEntry : modifyMap.entrySet()) {
for (Map.Entry<String, String> aliasEntry : alias.getRel().entrySet()) { for (Map.Entry<String, String> aliasEntry : alias.getRel().entrySet()) {
String aliasKey = aliasEntry.getKey(); String aliasKey = aliasEntry.getKey();
...@@ -148,10 +152,18 @@ public class AbstractCommonController { ...@@ -148,10 +152,18 @@ public class AbstractCommonController {
if (aliasPath.startsWith(modifyEntry.getKey())) { if (aliasPath.startsWith(modifyEntry.getKey())) {
Object val = modifyEntry.getValue(); Object val = modifyEntry.getValue();
data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, val, aliasEntry.getValue())); data.put(aliasKey, NoUiPresentationUtil.handIBaseObject(context, val, aliasEntry.getValue()));
containsKeys.add(modifyEntry.getKey());
} }
} }
} }
for (String key : modifyMap.keySet()) {
if (!containsKeys.contains(key)) {
data.put(key, modifyMap.get(key));
}
}
return data; return data;
} }
} }
...@@ -34,35 +34,35 @@ public class TokenInterceptor implements HandlerInterceptor { ...@@ -34,35 +34,35 @@ public class TokenInterceptor implements HandlerInterceptor {
String terminalType = noUiRequest.getTerminalType(); // APP WEB String terminalType = noUiRequest.getTerminalType(); // APP WEB
// token不存在 // token不存在
if (StringUtil.isEmpty(token)) { if (StringUtil.isEmpty(token)) {
Result rt = new Result(ErrorCodes.ERROR, "登录token不能为空", null); Result rt = new Result(ErrorCodes.LOGIN_TOKEN_ISNULL, "登录token不能为空", null);
responseMessage(response, response.getWriter(), rt); responseMessage(response, response.getWriter(), rt);
return false; return false;
} }
// userId不存在 // userId不存在
if (StringUtil.isEmpty(userId)) { if (StringUtil.isEmpty(userId)) {
Result rt = new Result(ErrorCodes.ERROR, "用户id不能为空", null); Result rt = new Result(ErrorCodes.LOGIN_ID_ISNULL, "用户id不能为空", null);
responseMessage(response, response.getWriter(), rt); responseMessage(response, response.getWriter(), rt);
return false; return false;
} }
JwtLogin login = JWT.unsign(token, JwtLogin.class); JwtLogin login = JWT.unsign(token, JwtLogin.class);
if (login == null || (!userId.equals((login.getUserId())))) { if (login == null || (!userId.equals((login.getUserId())))) {
Result rt = new Result(ErrorCodes.ERROR, "用户token或ID验证不通过", null); Result rt = new Result(ErrorCodes.LOGIN_TOKEN_CHECKERROR, "用户token或ID验证不通过", null);
responseMessage(response, response.getWriter(), rt); responseMessage(response, response.getWriter(), rt);
return false; return false;
} }
RedisLoginInfo redisLoginInfo = (RedisLoginInfo) RedisUtil.get(StringUtil.userUniqueId(noUiRequest)); RedisLoginInfo redisLoginInfo = (RedisLoginInfo) RedisUtil.get(StringUtil.userUniqueId(noUiRequest));
if (redisLoginInfo == null) { if (redisLoginInfo == null) {
Result rt = new Result(ErrorCodes.ERROR, "登陆异常", null); Result rt = new Result(ErrorCodes.LOGIN_ERROR, "登陆异常", null);
responseMessage(response, response.getWriter(), rt); responseMessage(response, response.getWriter(), rt);
return false; return false;
} }
// 验证登录时间 // 验证登录时间
if (System.currentTimeMillis() > redisLoginInfo.getExpiredTime()) { if (System.currentTimeMillis() > redisLoginInfo.getExpiredTime()) {
Result rt = new Result(ErrorCodes.ERROR, "登录时间超长,请重新登录", null); Result rt = new Result(ErrorCodes.LOGIN_TIMEOUT, "登录时间超长,请重新登录", null);
responseMessage(response, response.getWriter(), rt); responseMessage(response, response.getWriter(), rt);
return false; return false;
} }
......
...@@ -236,6 +236,8 @@ public class NoUiPresentationUtil { ...@@ -236,6 +236,8 @@ public class NoUiPresentationUtil {
String realKey = alias.getRevertRel().get(key); String realKey = alias.getRevertRel().get(key);
if (!StringUtils.isEmpty(realKey)) if (!StringUtils.isEmpty(realKey))
errorMap.put(realKey, errorEntity.getValue()); errorMap.put(realKey, errorEntity.getValue());
else
errorMap.put(key, errorEntity.getValue());
} }
return errorMap; return errorMap;
} }
......
...@@ -8,10 +8,11 @@ ...@@ -8,10 +8,11 @@
<property name="hibernate.connection.autocommit">false</property> <property name="hibernate.connection.autocommit">false</property>
<property name="use_outer_join">false</property> <property name="use_outer_join">false</property>
<property name="dialect">org.hibernate.dialect.Oracle10gDialect</property> <property name="dialect">org.hibernate.dialect.Oracle10gDialect</property>
<property name="connection.url">jdbc:oracle:thin:@172.17.2.108:1521:xe</property> <property name="connection.url">jdbc:oracle:thin:@172.17.2.4:1521:ORCL</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.username">pxi</property> <property name="connection.username">gcy</property>
<property name="connection.password">pxi</property> <property name="connection.password">gcy</property>
<property name="connection.autocommit">false</property> <property name="connection.autocommit">false</property>
<property name="connection.autoReconnect">true</property> <property name="connection.autoReconnect">true</property>
<property name="connection.autoReconnectForPools">true</property> <property name="connection.autoReconnectForPools">true</property>
......
...@@ -20,8 +20,8 @@ public class HttpTest { ...@@ -20,8 +20,8 @@ public class HttpTest {
Map<String, Object> map2 = (Map<String, Object>) map1.get("data"); Map<String, Object> map2 = (Map<String, Object>) map1.get("data");
String token = (String) map2.get("token"); String token = (String) map2.get("token");
pxiadd(token, userId, terminalType); // pxiadd(token, userId, terminalType);
// pxisel(token, userId, terminalType); pxisel(token, userId, terminalType);
// pxiame(token, userId, terminalType); // pxiame(token, userId, terminalType);
// check(token, userId, terminalType); // check(token, userId, terminalType);
// upload(token, userId, terminalType); // upload(token, userId, terminalType);
...@@ -179,7 +179,7 @@ public class HttpTest { ...@@ -179,7 +179,7 @@ public class HttpTest {
try { try {
// "http://172.17.2.100:8080/oauth/token?username=user_1&password=123456&grant_type=password&client_id=client&client_secret=123456" // "http://172.17.2.100:8080/oauth/token?username=user_1&password=123456&grant_type=password&client_id=client&client_secret=123456"
URL realUrl = new URL("http://localhost:8080/business/service/pxisel/_sel"); URL realUrl = new URL("http://localhost:8080/business/service/pxisel/sel");
// URL realUrl = new // URL realUrl = new
// URL("http://localhost:8080/healthServer/getMacSeq"); // URL("http://localhost:8080/healthServer/getMacSeq");
...@@ -341,14 +341,15 @@ public class HttpTest { ...@@ -341,14 +341,15 @@ public class HttpTest {
out = new PrintWriter(conn.getOutputStream()); out = new PrintWriter(conn.getOutputStream());
// 发送请求参数 // 发送请求参数
Map<String, Object> map = new HashMap<String, Object>(); Map<String, Object> map = new HashMap<String, Object>();
map.put("nam", "2121"); map.put("nam", "gggeeeccc");
map.put("sex", ""); map.put("sex", "");
map.put("univer", "2121"); map.put("univer", "2121");
map.put("major", "2121"); map.put("major", "2121");
map.put("headimg", ""); map.put("headimg", "");
map.put("age", "21212"); map.put("age", "21212");
map.put("tel", "1212"); map.put("tel", "12999998899");
map.put("balance", ""); map.put("balance", "");
map.put("balance1", "");
Map<String, Object> map2 = new HashMap<String, Object>(); Map<String, Object> map2 = new HashMap<String, Object>();
map2.put("data", map); map2.put("data", map);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment