Commit 5e1df948 by gechengyang

modify

parent b6598e9d
......@@ -29,4 +29,6 @@ public class ErrorCodes {
public static final String INTERRUPTED_ERROR = "R9997";
public static final String REDIS_CONNECTION_ERROR = "R9998";
public static final String ERROR = "R9999";
public static final String BUSINESS_ERROR = "E0001";
}
......@@ -15,7 +15,9 @@ import log.Log;
import log.LogFactory;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang.StringUtils;
import org.sss.common.impl.AbstractNullPresentation;
import org.sss.common.impl.ProxyDatafield;
import org.sss.common.model.CodetableItem;
import org.sss.common.model.IAttribute;
import org.sss.common.model.IAttributeValue;
......@@ -31,6 +33,7 @@ import org.sss.common.model.RowOpType;
import org.sss.common.model.ViewType;
import org.sss.exception.ContainerException;
import org.sss.presentation.noui.api.request.NoUiRequest;
import org.sss.presentation.noui.api.response.ErrorCodes;
import org.sss.presentation.noui.common.Constants;
import org.sss.presentation.noui.util.NoUiUtils;
import org.sss.util.ContainerUtils;
......@@ -67,6 +70,7 @@ public class NoUiPresentation extends AbstractNullPresentation {
// public final List<IAttribute<?>> requiredList = new
// ArrayList<IAttribute<?>>();
private String message = null; // 弹出的message
private String message_code = null;
public IPanel popupPanel = null;
public String transactionName = null;
public boolean clearFlag = false;
......@@ -74,6 +78,10 @@ public class NoUiPresentation extends AbstractNullPresentation {
private boolean isChain = false;
public Boolean logoutFlag = null;
public String getMessageCode() {
return this.message_code;
}
public String getMessage() {
return this.message;
}
......@@ -204,6 +212,9 @@ public class NoUiPresentation extends AbstractNullPresentation {
if (paramString == null) {
paramString = getI18nValue("eibs", "error.title");
}
if ((!StringUtils.isEmpty(paramString)) && paramString.equals(ErrorCodes.BUSINESS_ERROR)) {
this.message_code = ErrorCodes.BUSINESS_ERROR;
}
/*
* if (MessageType.ERROR.equals(paramMessageType)) {
* log.error(StringUtils.isEmpty(paramString) ? str1 : str1 + ":" +
......@@ -425,6 +436,12 @@ public class NoUiPresentation extends AbstractNullPresentation {
@SuppressWarnings("rawtypes")
private final void setModified(IAttribute paramIAttribute, boolean paramBoolean) {
if (paramIAttribute instanceof ProxyDatafield) {
while (paramIAttribute instanceof ProxyDatafield) {
paramIAttribute = ((ProxyDatafield) paramIAttribute).getHost();
}
}
modifyMap.put(((IBaseObject) paramIAttribute).getUrl(), paramIAttribute);
}
......
......@@ -111,7 +111,7 @@ public class AbstractCommonController {
Map<String, Object> afterReturnData = handleReturnData(eventType, context, noUiRequest, alias);
return ResultUtil.result(ErrorCodes.SUCCESS, NoUiPresentationUtil.retMsg(context), afterReturnData,
return ResultUtil.result(NoUiPresentationUtil.retCode(context), NoUiPresentationUtil.retMsg(context), afterReturnData,
NoUiPresentationUtil.handleErrorReturnData(context, alias), NoUiPresentationUtil.handleCodeTableReturnData(context, alias));
} catch (Exception e) {
log.error("OnClick command error", e);
......
......@@ -169,6 +169,11 @@ public class NoUiPresentationUtil {
return StringUtil.isEmpty(gui.getMessage()) ? ErrorCodes.SUCCESS_INFO : gui.getMessage();
}
public static String retCode(NoUiContext context) {
NoUiPresentation gui = (NoUiPresentation) context.getGui();
return StringUtil.isEmpty(gui.getMessageCode()) ? ErrorCodes.SUCCESS : gui.getMessageCode();
}
public static Map<String, Object> handleEventReturnData(EventType eventType, NoUiContext context, NoUiRequest request, Alias alias) {
Map<String, Object> data = new HashMap<String, Object>();
......@@ -239,30 +244,6 @@ public class NoUiPresentationUtil {
return null;
}
public static void main(String[] args) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
try {
Date d = sdf.parse("2018/11/11 11:11:11");
SimpleDateFormat sdf1 = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
System.out.println(sdf1.format(d));
System.out.println(new BigDecimal("999999999999.99").toString());
long b = 999999999;
String bb = b + "";
System.out.println(String.valueOf(b));
java.text.NumberFormat nf = java.text.NumberFormat.getInstance();
nf.setGroupingUsed(false);
// 设置数的小数部分所允许的最小位数
nf.setMinimumFractionDigits(0);
// 设置数的小数部分所允许的最大位数
nf.setMaximumFractionDigits(2);
System.out.println(nf.format(999999999999.0));
} catch (ParseException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
public static Object handIBaseObject(NoUiContext context, Object val, String path) {
if (val == null)
return null;
......@@ -306,15 +287,16 @@ public class NoUiPresentationUtil {
public static Map<String, Object> handleCodeTableReturnData(NoUiContext context, Alias alias) {
NoUiPresentation gui = (NoUiPresentation) context.getGui();
Map<String, Object> codeTableMap = gui.getCodetable();
Map<String, Object> retCodeTableMap = new HashMap<>();
for (Map.Entry<String, Object> codeTableEntity : codeTableMap.entrySet()) {
String key = codeTableEntity.getKey();
String realKey = alias.getRevertRel().get(key);
if (!StringUtils.isEmpty(realKey))
codeTableMap.put(realKey, codeTableEntity.getValue());
retCodeTableMap.put(realKey, codeTableEntity.getValue());
else
codeTableMap.put(key, codeTableEntity.getValue());
retCodeTableMap.put(key, codeTableEntity.getValue());
}
return codeTableMap;
return retCodeTableMap;
}
public static void setSysmod(NoUiContext context, byte[] oldSysmod) {
......
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