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); static final Log log = LogFactory.getLog(Pxip.class);
final protected ProxyPxigrp _pxigrp = new ProxyPxigrp(this); final protected ProxyPxigrp _pxigrp = new ProxyPxigrp(this);
final protected ElstPxi _pxilst = new ElstPxi(this,0); final protected ElstPxi _pxilst = new ElstPxi(this, 0);
final protected IDatafield<String> _sav = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _sav = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _sel = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _sel = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _nam = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _nam = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _sex = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _sex = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _univer = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _univer = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _major = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _major = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _del = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _del = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<IStream> _upload = new DatafieldImpl<IStream>(this,IStream.class,new StreamImpl()); final protected IDatafield<IStream> _upload = new DatafieldImpl<IStream>(this, IStream.class, new StreamImpl());
final protected IDatafield<StreamGrid> _tree = new DatafieldImpl<StreamGrid>(this,StreamGrid.class,new StreamGrid()); final protected IDatafield<StreamGrid> _tree = new DatafieldImpl<StreamGrid>(this, StreamGrid.class, new StreamGrid());
final protected IDatafield<String> _sogou = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _sogou = new DatafieldImpl<String>(this, String.class, null);
final protected IDatafield<String> _pinittest = new DatafieldImpl<String>(this,String.class,null); final protected IDatafield<String> _pinittest = new DatafieldImpl<String>(this, String.class, null);
final transient protected IPanel _edtp = new PanelImpl(this,"edtp","PD000000"); final transient protected IPanel _edtp = new PanelImpl(this, "edtp", "PD000000");
final transient protected IPanel _pxiaddmp = new PanelImpl(this,"pxiaddmp","PD000007"); final transient protected IPanel _pxiaddmp = new PanelImpl(this, "pxiaddmp", "PD000007");
final transient protected IPanel _pxiselp = new PanelImpl(this,"pxiselp","PD000013"); final transient protected IPanel _pxiselp = new PanelImpl(this, "pxiselp", "PD000013");
final transient protected IPanel _argp = new PanelImpl(this,"argp","PD000014"); final transient protected IPanel _argp = new PanelImpl(this, "argp", "PD000014");
final transient protected IPanel _infp = new PanelImpl(this,"infp","PD000025"); final transient protected IPanel _infp = new PanelImpl(this, "infp", "PD000025");
final transient protected IPanel _pxidelp = new PanelImpl(this,"pxidelp","PD000035"); final transient protected IPanel _pxidelp = new PanelImpl(this, "pxidelp", "PD000035");
final transient protected IPanel _grdemp = new PanelImpl(this,"grdemp","PD000041"); final transient protected IPanel _grdemp = new PanelImpl(this, "grdemp", "PD000041");
final transient protected IPanel _centerp = new PanelImpl(this,"centerp","PD000042"); final transient protected IPanel _centerp = new PanelImpl(this, "centerp", "PD000042");
final transient protected IPanel _btnp = new PanelImpl(this,"btnp","PD000049"); final transient protected IPanel _btnp = new PanelImpl(this, "btnp", "PD000049");
final transient protected IPanel _savp = new PanelImpl(this,"savp","PD000051"); final transient protected IPanel _savp = new PanelImpl(this, "savp", "PD000051");
public Pxip(IParent parent) public Pxip(IParent parent) {
{
super(parent); super(parent);
} }
@Override @Override
public final void copyValue(IModule module) public final void copyValue(IModule module) {
{ Pxip eibsObject = (Pxip) module;
Pxip eibsObject=(Pxip)module;
_sav.setValue(eibsObject._sav.getValue()); _sav.setValue(eibsObject._sav.getValue());
_sel.setValue(eibsObject._sel.getValue()); _sel.setValue(eibsObject._sel.getValue());
_nam.setValue(eibsObject._nam.getValue()); _nam.setValue(eibsObject._nam.getValue());
...@@ -65,17 +83,15 @@ public class Pxip ...@@ -65,17 +83,15 @@ public class Pxip
} }
@Override @Override
public final void copyValues(IParent parent) public final void copyValues(IParent parent) {
{ copyValue((IModule) parent);
copyValue((IModule)parent); Pxip eibsObject = (Pxip) parent;
Pxip eibsObject=(Pxip)parent;
_pxigrp.copyValues(eibsObject._pxigrp); _pxigrp.copyValues(eibsObject._pxigrp);
_pxilst.copyValues(eibsObject._pxilst); _pxilst.copyValues(eibsObject._pxilst);
} }
@Override @Override
public final void clear() public final void clear() {
{
_sav.clear(); _sav.clear();
_sel.clear(); _sel.clear();
_nam.clear(); _nam.clear();
...@@ -92,37 +108,34 @@ public class Pxip ...@@ -92,37 +108,34 @@ public class Pxip
} }
@Override @Override
public final IModule clone() public final IModule clone() {
{ Pxip module = new Pxip(null);
Pxip module=new Pxip(null);
module.copyValues(this); module.copyValues(this);
module.addChild(); module.addChild();
return module; return module;
} }
@Override @Override
public final void addChild() public final void addChild() {
{ put("pxigrp", _pxigrp);
put("pxigrp",_pxigrp); put("pxilst", _pxilst);
put("pxilst",_pxilst);
_pxilst.addChild(); _pxilst.addChild();
put("sav",_sav); put("sav", _sav);
put("sel",_sel); put("sel", _sel);
put("nam",_nam); put("nam", _nam);
put("sex",_sex); put("sex", _sex);
put("univer",_univer); put("univer", _univer);
put("major",_major); put("major", _major);
put("del",_del); put("del", _del);
put("upload",_upload); put("upload", _upload);
put("tree",_tree); put("tree", _tree);
put("sogou",_sogou); put("sogou", _sogou);
put("pinittest",_pinittest); put("pinittest", _pinittest);
} }
@Override @Override
public final void bindEvents(IContext ctx) public final void bindEvents(IContext ctx) {
{ if (isEventBinded())
if(isEventBinded())
return; return;
getSav().addEventRule(event050_sav); getSav().addEventRule(event050_sav);
getSav().addEventRule(event03000_sav); getSav().addEventRule(event03000_sav);
...@@ -136,285 +149,228 @@ public class Pxip ...@@ -136,285 +149,228 @@ public class Pxip
super.bindEvents(ctx); super.bindEvents(ctx);
} }
public Pxigrp getPxigrp() public Pxigrp getPxigrp() {
{
return _pxigrp.getHost(); return _pxigrp.getHost();
} }
public void setPxigrp(Pxigrp value) public void setPxigrp(Pxigrp value) {
{
_pxigrp.setHost(value); _pxigrp.setHost(value);
} }
public ElstPxi getPxilst() public ElstPxi getPxilst() {
{
return _pxilst; return _pxilst;
} }
public IDatafield<String> getSav() public IDatafield<String> getSav() {
{
return _sav; return _sav;
} }
public String getEibsSav() public String getEibsSav() {
{
return _sav.getValue(); return _sav.getValue();
} }
public void setEibsSav(String value) public void setEibsSav(String value) {
{
_sav.setValue(value); _sav.setValue(value);
} }
public IDatafield<String> getSel() public IDatafield<String> getSel() {
{
return _sel; return _sel;
} }
public String getEibsSel() public String getEibsSel() {
{
return _sel.getValue(); return _sel.getValue();
} }
public void setEibsSel(String value) public void setEibsSel(String value) {
{
_sel.setValue(value); _sel.setValue(value);
} }
public IDatafield<String> getNam() public IDatafield<String> getNam() {
{
return _nam; return _nam;
} }
public String getEibsNam() public String getEibsNam() {
{
return _nam.getValue(); return _nam.getValue();
} }
public void setEibsNam(String value) public void setEibsNam(String value) {
{
_nam.setValue(value); _nam.setValue(value);
} }
public IDatafield<String> getSex() public IDatafield<String> getSex() {
{
return _sex; return _sex;
} }
public String getEibsSex() public String getEibsSex() {
{
return _sex.getValue(); return _sex.getValue();
} }
public void setEibsSex(String value) public void setEibsSex(String value) {
{
_sex.setValue(value); _sex.setValue(value);
} }
public IDatafield<String> getUniver() public IDatafield<String> getUniver() {
{
return _univer; return _univer;
} }
public String getEibsUniver() public String getEibsUniver() {
{
return _univer.getValue(); return _univer.getValue();
} }
public void setEibsUniver(String value) public void setEibsUniver(String value) {
{
_univer.setValue(value); _univer.setValue(value);
} }
public IDatafield<String> getMajor() public IDatafield<String> getMajor() {
{
return _major; return _major;
} }
public String getEibsMajor() public String getEibsMajor() {
{
return _major.getValue(); return _major.getValue();
} }
public void setEibsMajor(String value) public void setEibsMajor(String value) {
{
_major.setValue(value); _major.setValue(value);
} }
public IDatafield<String> getDel() public IDatafield<String> getDel() {
{
return _del; return _del;
} }
public String getEibsDel() public String getEibsDel() {
{
return _del.getValue(); return _del.getValue();
} }
public void setEibsDel(String value) public void setEibsDel(String value) {
{
_del.setValue(value); _del.setValue(value);
} }
public IDatafield<IStream> getUpload() public IDatafield<IStream> getUpload() {
{
return _upload; return _upload;
} }
public IStream getEibsUpload() public IStream getEibsUpload() {
{
return _upload.getValue(); return _upload.getValue();
} }
public void setEibsUpload(IStream value) public void setEibsUpload(IStream value) {
{
_upload.setValue(value); _upload.setValue(value);
} }
public IDatafield<StreamGrid> getTree() public IDatafield<StreamGrid> getTree() {
{
return _tree; return _tree;
} }
public StreamGrid getEibsTree() public StreamGrid getEibsTree() {
{
return _tree.getValue(); return _tree.getValue();
} }
public void setEibsTree(StreamGrid value) public void setEibsTree(StreamGrid value) {
{
_tree.setValue(value); _tree.setValue(value);
} }
public IDatafield<String> getSogou() public IDatafield<String> getSogou() {
{
return _sogou; return _sogou;
} }
public String getEibsSogou() public String getEibsSogou() {
{
return _sogou.getValue(); return _sogou.getValue();
} }
public void setEibsSogou(String value) public void setEibsSogou(String value) {
{
_sogou.setValue(value); _sogou.setValue(value);
} }
public IDatafield<String> getPinittest() public IDatafield<String> getPinittest() {
{
return _pinittest; return _pinittest;
} }
public String getEibsPinittest() public String getEibsPinittest() {
{
return _pinittest.getValue(); return _pinittest.getValue();
} }
public void setEibsPinittest(String value) public void setEibsPinittest(String value) {
{
_pinittest.setValue(value); _pinittest.setValue(value);
} }
public IPanel getEdtp() public IPanel getEdtp() {
{
return _edtp; return _edtp;
} }
public IPanel getPxiaddmp() public IPanel getPxiaddmp() {
{
return _pxiaddmp; return _pxiaddmp;
} }
public IPanel getPxiselp() public IPanel getPxiselp() {
{
return _pxiselp; return _pxiselp;
} }
public IPanel getArgp() public IPanel getArgp() {
{
return _argp; return _argp;
} }
public IPanel getInfp() public IPanel getInfp() {
{
return _infp; return _infp;
} }
public IPanel getPxidelp() public IPanel getPxidelp() {
{
return _pxidelp; return _pxidelp;
} }
public IPanel getGrdemp() public IPanel getGrdemp() {
{
return _grdemp; return _grdemp;
} }
public IPanel getCenterp() public IPanel getCenterp() {
{
return _centerp; return _centerp;
} }
public IPanel getBtnp() public IPanel getBtnp() {
{
return _btnp; return _btnp;
} }
public IPanel getSavp() public IPanel getSavp() {
{
return _savp; return _savp;
} }
private final transient IRule init100__=new IRule() private final transient IRule init100__ = new IRule() {
{ public final int getOrder() {
public final int getOrder()
{
return 100; return 100;
} }
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,IAttributeValue evt) public final boolean invoke(IContext ctx, IAttributeValue evt) {
{
buildTree(); buildTree();
return true; return true;
} }
}; };
private final transient IRule init200__=new IRule() private final transient IRule init200__ = new IRule() {
{ public final int getOrder() {
public final int getOrder()
{
return 200; return 200;
} }
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,IAttributeValue evt) public final boolean invoke(IContext ctx, IAttributeValue evt) {
{
Pxip.this.setEibsPinittest("999"); Pxip.this.setEibsPinittest("999");
return true; return true;
} }
}; };
private final transient IEventRule event050_sav=new IEventRule() private final transient IEventRule event050_sav = new IEventRule() {
{ public final int getOrder() {
public final int getOrder()
{
return 50; return 50;
} }
public final EventType getType() public final EventType getType() {
{
return EventType.ON_CLICK; return EventType.ON_CLICK;
} }
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,Event evt) public final boolean invoke(IContext ctx, Event evt) {
{ if (!ctx.getSession().checkAll(Pxip.this.getPxigrp().getRec())) {
if(!ctx.getSession().checkAll(Pxip.this.getPxigrp().getRec()))
{
return false; return false;
} }
ctx.getSupport().begin(); ctx.getSupport().begin();
...@@ -423,167 +379,139 @@ public class Pxip ...@@ -423,167 +379,139 @@ public class Pxip
}; };
private final transient IEventRule event03000_sav=new IEventRule() private final transient IEventRule event03000_sav = new IEventRule() {
{ public final int getOrder() {
public final int getOrder()
{
return 3000; return 3000;
} }
public final EventType getType() public final EventType getType() {
{
return EventType.ON_CLICK; return EventType.ON_CLICK;
} }
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,Event evt) public final boolean invoke(IContext ctx, Event evt) {
{ if (ctx.getError() == NO_ERROR) {
if(ctx.getError() == NO_ERROR)
{
ctx.getSupport().commit(); ctx.getSupport().commit();
ctx.getGui().message(MessageType.INFORMATION,ctx.getGui().getI18nValue("pxip","CT000009"),ctx.getGui().getI18nValue("pxip","CT000010")); ctx.getGui().message(MessageType.INFORMATION, ctx.getGui().getI18nValue("pxip", "CT000009"),
ctx.getGui().getI18nValue("pxip", "CT000010"));
String trnsnam = ctx.getSession().getTransName(); String trnsnam = ctx.getSession().getTransName();
if("pxiadd".equals(trnsnam) || "pxidel".equals(trnsnam)) if ("pxiadd".equals(trnsnam) || "pxidel".equals(trnsnam)) {
{
ctx.getGui().chain(CALLER); ctx.getGui().chain(CALLER);
} }
} } else {
else
{
ctx.getSupport().rollback(); ctx.getSupport().rollback();
ctx.getGui().message(MessageType.INFORMATION,ctx.getGui().getI18nValue("pxip","CT000011"),ctx.getGui().getI18nValue("pxip","CT000012")); ctx.getGui().message(MessageType.INFORMATION, ctx.getGui().getI18nValue("pxip", "CT000011"),
ctx.getGui().getI18nValue("pxip", "CT000012"));
} }
return true; return true;
} }
}; };
private final transient IEventRule event0100_sel=new IEventRule() private final transient IEventRule event0100_sel = new IEventRule() {
{ public final int getOrder() {
public final int getOrder()
{
return 100; return 100;
} }
public final EventType getType() public final EventType getType() {
{
return EventType.ON_CLICK; return EventType.ON_CLICK;
} }
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,Event evt) public final boolean invoke(IContext ctx, Event evt) {
{
Argument arg = new Argument(); Argument arg = new Argument();
if(!ContainerUtils.isEmpty(Pxip.this.getNam())) if (!ContainerUtils.isEmpty(Pxip.this.getNam())) {
{ arg = arg.and("nam", LIKE, "%" + Pxip.this.getEibsNam() + "%");
arg = arg.and("nam",LIKE,"%"+Pxip.this.getEibsNam()+"%");
} }
if(!ContainerUtils.isEmpty(Pxip.this.getUniver())) if (!ContainerUtils.isEmpty(Pxip.this.getUniver())) {
{ arg = arg.and("univer", LIKE, "%" + Pxip.this.getEibsUniver() + "%");
arg = arg.and("univer",LIKE,"%"+Pxip.this.getEibsUniver()+"%");
} }
if(!ContainerUtils.isEmpty(Pxip.this.getMajor())) if (!ContainerUtils.isEmpty(Pxip.this.getMajor())) {
{ arg = arg.and("major", LIKE, "%" + Pxip.this.getEibsMajor() + "%");
arg = arg.and("major",LIKE,"%"+Pxip.this.getEibsMajor()+"%");
} }
if(!ContainerUtils.isEmpty(Pxip.this.getSex())) if (!ContainerUtils.isEmpty(Pxip.this.getSex())) {
{ arg = arg.and("sex", EQ, "%" + Pxip.this.getEibsSex() + "%");
arg = arg.and("sex",EQ,"%"+Pxip.this.getEibsSex()+"%");
} }
ctx.getSupport().find(Pxip.this.getPxilst(),arg); ctx.getSupport().find(Pxip.this.getPxilst(), arg);
ctx.getGui().setModified(Pxip.this.getPxilst()); ctx.getGui().setModified(Pxip.this.getPxilst());
System.out.println(Pxip.this.getPxilst().size());
return true; return true;
} }
}; };
private final transient IEventRule event2100_pxilst=new IEventRule() private final transient IEventRule event2100_pxilst = new IEventRule() {
{ public final int getOrder() {
public final int getOrder()
{
return 100; return 100;
} }
public final EventType getType() public final EventType getType() {
{
return EventType.ON_DBLCLICK; return EventType.ON_DBLCLICK;
} }
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,Event evt) public final boolean invoke(IContext ctx, Event evt) {
{
int idx = ctx.getGui().getSelectedRowIndex(Pxip.this.getPxilst()); int idx = ctx.getGui().getSelectedRowIndex(Pxip.this.getPxilst());
if(idx < 0) if (idx < 0) {
{
return true; return true;
} }
String selInr = Pxip.this.getPxilst().get(idx).getEibsInr(); String selInr = Pxip.this.getPxilst().get(idx).getEibsInr();
ctx.getSession().storeData("pxiinr",selInr); ctx.getSession().storeData("pxiinr", selInr);
ctx.getGui().chain("pxiame"); ctx.getGui().chain("pxiame");
return true; return true;
} }
}; };
private final transient IEventRule event0100_del=new IEventRule() private final transient IEventRule event0100_del = new IEventRule() {
{ public final int getOrder() {
public final int getOrder()
{
return 100; return 100;
} }
public final EventType getType() public final EventType getType() {
{
return EventType.ON_CLICK; return EventType.ON_CLICK;
} }
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,Event evt) public final boolean invoke(IContext ctx, Event evt) {
{
int idx = ctx.getGui().getSelectedRowIndex(Pxip.this.getPxilst()); int idx = ctx.getGui().getSelectedRowIndex(Pxip.this.getPxilst());
if(idx < 0) if (idx < 0) {
{
return true; return true;
} }
String selInr = Pxip.this.getPxilst().get(idx).getEibsInr(); String selInr = Pxip.this.getPxilst().get(idx).getEibsInr();
ctx.getSession().storeData("pxiinr",selInr); ctx.getSession().storeData("pxiinr", selInr);
ctx.getGui().chain("pxidel"); ctx.getGui().chain("pxidel");
return true; return true;
} }
}; };
private final transient IEventRule event5100_upload=new IEventRule() private final transient IEventRule event5100_upload = new IEventRule() {
{ public final int getOrder() {
public final int getOrder()
{
return 100; return 100;
} }
public final EventType getType() public final EventType getType() {
{
return EventType.ON_STREAM_UPLOAD; return EventType.ON_STREAM_UPLOAD;
} }
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final boolean invoke(IContext ctx,Event evt) public final boolean invoke(IContext ctx, Event evt) {
{
//准备目录 // 准备目录
String relativeFolder = "header"; String relativeFolder = "header";
String path = ContainerUtils.catPath(ctx.getGui().getRootPath(),relativeFolder); String path = ContainerUtils.catPath(ctx.getGui().getRootPath(), relativeFolder);
log.info(getOrder(),"file path="+path); log.info(getOrder(), "file path=" + path);
if(!ContainerUtils.fileExists(path)) if (!ContainerUtils.fileExists(path)) {
{
ContainerUtils.fileMkdirs(path); ContainerUtils.fileMkdirs(path);
} }
//准备服务器端文件名 // 准备服务器端文件名
int seq = ctx.getSupport().count("headerImage"); int seq = ctx.getSupport().count("headerImage");
String fileName = seq+".jpg"; String fileName = seq + ".jpg";
String relPath = "header/"+fileName; String relPath = "header/" + fileName;
//处理上传文件 // 处理上传文件
IStream stream = Pxip.this.getEibsUpload(); IStream stream = Pxip.this.getEibsUpload();
ContainerUtils.streamSave(stream,ContainerUtils.catPath(path,fileName)); ContainerUtils.streamSave(stream, ContainerUtils.catPath(path, fileName));
Pxip.this.getPxigrp().getRec().setEibsHeadimg(relPath); Pxip.this.getPxigrp().getRec().setEibsHeadimg(relPath);
ctx.getGui().setModified(Pxip.this.getPxigrp().getRec()); ctx.getGui().setModified(Pxip.this.getPxigrp().getRec());
return true; return true;
...@@ -592,40 +520,39 @@ public class Pxip ...@@ -592,40 +520,39 @@ public class Pxip
}; };
@SuppressWarnings(value = "unchecked") @SuppressWarnings(value = "unchecked")
public final void buildTree() public final void buildTree() {
{ IContext ctx = RuleUtils.ctx.get();
IContext ctx=RuleUtils.ctx.get();
StreamGrid grid = Pxip.this.getEibsTree(); StreamGrid grid = Pxip.this.getEibsTree();
//设置Grid空表头,固定列表宽度 // 设置Grid空表头,固定列表宽度
AttributeValue h01 = new AttributeValue(""); AttributeValue h01 = new AttributeValue("");
ctx.getGui().setViewType(h01,VIEW_LABEL,50); ctx.getGui().setViewType(h01, VIEW_LABEL, 50);
AttributeValue h02 = new AttributeValue(); AttributeValue h02 = new AttributeValue();
ctx.getGui().setViewType(h02,VIEW_LABEL,100); ctx.getGui().setViewType(h02, VIEW_LABEL, 100);
grid.setHeaders(new AttributeValue[]{h01,h02}); grid.setHeaders(new AttributeValue[] { h01, h02 });
//---------------------------------------------- // ----------------------------------------------
AttributeValue row00 = new AttributeValue(); AttributeValue row00 = new AttributeValue();
ctx.getGui().setViewType(row00,VIEW_CHECK,100); ctx.getGui().setViewType(row00, VIEW_CHECK, 100);
AttributeValue row01 = new AttributeValue("研发中心"); AttributeValue row01 = new AttributeValue("研发中心");
AttributeValue row02 = new AttributeValue(); AttributeValue row02 = new AttributeValue();
AttributeValue[] row0 = new AttributeValue[]{row00,row02,row01}; AttributeValue[] row0 = new AttributeValue[] { row00, row02, row01 };
grid.add(row0); grid.add(row0);
//---------------------------------------------- // ----------------------------------------------
List<AttributeValue[]> subrows = new ArrayList<AttributeValue[]>(); List<AttributeValue[]> subrows = new ArrayList<AttributeValue[]>();
row02.setValue(subrows); row02.setValue(subrows);
//---------------------------------------------- // ----------------------------------------------
AttributeValue srow02 = new AttributeValue(""); AttributeValue srow02 = new AttributeValue("");
ctx.getGui().setViewType(srow02,VIEW_LABEL,50); ctx.getGui().setViewType(srow02, VIEW_LABEL, 50);
AttributeValue srow00 = new AttributeValue(); AttributeValue srow00 = new AttributeValue();
ctx.getGui().setViewType(srow00,VIEW_CHECK,100); ctx.getGui().setViewType(srow00, VIEW_CHECK, 100);
AttributeValue srow01 = new AttributeValue("武汉"); AttributeValue srow01 = new AttributeValue("武汉");
subrows.add(new AttributeValue[]{srow02,srow00,srow01}); subrows.add(new AttributeValue[] { srow02, srow00, srow01 });
//---------------------------------------------- // ----------------------------------------------
AttributeValue srow12 = new AttributeValue(""); AttributeValue srow12 = new AttributeValue("");
ctx.getGui().setViewType(srow12,VIEW_LABEL,50); ctx.getGui().setViewType(srow12, VIEW_LABEL, 50);
AttributeValue srow10 = new AttributeValue(); AttributeValue srow10 = new AttributeValue();
ctx.getGui().setViewType(srow10,VIEW_CHECK,100); ctx.getGui().setViewType(srow10, VIEW_CHECK, 100);
AttributeValue srow11 = new AttributeValue("天津"); AttributeValue srow11 = new AttributeValue("天津");
subrows.add(new AttributeValue[]{srow12,srow10,srow11}); 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