zoukankan      html  css  js  c++  java
  • 一段逻辑代码

    //add by zengzw@曾志伟 2016年10月24日15:30:35  begin
              LfwView mainWidget = AppLifeCycleContext.current().getWindowContext().getViewContext("main").getView();
              Dataset ds = mainWidget.getViewModels().getDataset(getMasterDsId());
                String djlxbm_a = (String)AppUtil.getAppAttr(IExpConst.DEFAULT_DJLXBM);
                if("264X-Cxx-0001".equals(djlxbm_a)
                        ||"264X-Cxx-0002".equals(djlxbm_a)
                        ||"264X-Cxx-0005".equals(djlxbm_a)
                        ||"264X-Cxx-0038".equals(djlxbm_a)){
                    Integer state =  (Integer) AppLifeCycleContext.current().getApplicationContext().getAppSession().getAttribute("workflow_type");
                    if(AppUtil.getAppAttr("isfromssc") != null && "Y".equalsIgnoreCase((String)AppUtil.getAppAttr("isfromssc"))
                            && state == 6){
                        Row row = ds.getSelectedRow();
                        //共享初审的时候保存按钮可用
                        Object test = AppUtil.getAppAttr("result");//确保拿的比较的金额一直是第一次数据库中的值
                        if(!"".equals(test) &&test != null) {
                            UFDouble amount = (UFDouble) row.getValue(ds.nameToIndex("total"));
                            UFDouble fina = (new UFDouble(test.toString())).sub(amount);
                            if(fina.toDouble() > 300 || fina.toDouble() < 0){
                                throw new LfwRuntimeException("修改金额只能下浮小于或等于300元"); 
                            }
                        }else {
                            String djbh = (String) row.getValue(ds.nameToIndex("djbh"));
                            if(djbh != null && djbh.length() > 0 ) {
                                String sql = " select a.total from ncdata.er_bxzb a where a.djbh = '"+djbh+"'";
                                Object result;
                                try {
                                    result = (Object) getQuery().executeQuery(sql, new ColumnProcessor());
                                    if(!"".equals(result) && result != null){
                                        AppUtil.addAppAttr("result", result.toString());                                    
                                        UFDouble amount = (UFDouble) row.getValue(ds.nameToIndex("total"));
                                        UFDouble fina = (new UFDouble(result.toString())).sub(amount);
                                        if(fina.toDouble() > 300 || fina.toDouble() < 0){
                                            throw new LfwRuntimeException("修改金额只能下浮小于或等于300元"); 
                                        }
                                    }
                                } catch (BusinessException e) {
                                    // TODO Auto-generated catch block
                                    Debug.debug(e.getMessage());
                                }                            
                            }
                        }                    
                    }else{                    
                    }
                }
                //add by zengzw@曾志伟 2016年10月24日15:30:35  end
    ---- 动动手指关注我!或许下次你又能在我这里找到你需要的答案!ZZZZW与你一起学习,一起进步!
  • 相关阅读:
    【复现】cve-2020-1472 微软NetLogon权限提升漏洞 附exp
    Vmware 问题【持续更新】
    linux命令之上传文件和下载文件-lrzsz
    在ubuntu16.04中输入不存在shell命令时,报错ModuleNotFoundError的解决方案
    linux编译命令:tmpfs,make,distcc,ccache
    Linux常用命令之必知必会
    crontab定时任务
    Ubuntu使用官网的安装包安装Nodejs
    接口测试(Python)之DDT
    【XMCTF】web3 考核
  • 原文地址:https://www.cnblogs.com/zzzzw/p/5997932.html
Copyright © 2011-2022 走看看