起步软件技术论坛
搜索
 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1015|回复: 2

[结贴] 如何使用自己定义的action 在页面grid

[复制链接]

19

主题

62

帖子

241

积分

中级会员

Rank: 3Rank: 3

积分
241
发表于 2015-7-13 14:25:35 | 显示全部楼层 |阅读模式
版本: X5.2.7 小版本号:
数据库: MS SQLServer 服务器操作系统: Windows 应用服务器: Tomcat
客户端操作系统: Windows 7 浏览器: IE10
自定义action 代码:

public static Table getBillInfo(Map variables) {
  
  String accountID = variables.get("accountID").toString();
  String accountMode = variables.get("accountMode").toString();
  Integer finaYear = (Integer) variables.get("finaYear");
  Integer finaMonth = (Integer) variables.get("finaMonth");
  
  //按照如下条件提取 领料单、入库单:
  StringBuffer sql = new StringBuffer(64);
  //领料单:
  sql.append("select case when a.outstocksort = '销售出库' then '出售单' else '领料单' end  field1,outstockno field2,depotNo field3,depotname field4,receiveOrgaName field5,receiver field6,case when  a.recStatus='进行' then '正在审批,没有办理出库。'  else '没有办理出库。' end field7");
  sql.append(" from  t_outstockbill a  ,t_depot d ,SA_OPORG sa ,t_finaperidef b  ");
  sql.append("   where    a.recStatus in ('进行','生效') and a.depotid=d.fid  and d.orgaID=sa.sID   and b.AccountID=sa.sAccountId  and  a.outStockDate between b.begindate and b.enddate ");
  sql.append(" and b.accountid='").append(accountID).append("' and b.finayear=").append(finaYear).append(" and b.finamonth=").append(finaMonth)
    .append("  and b.ACCOUNTMODE='").append(accountMode).append("'  and a.materialtype='").append(accountMode).append("'");
  sql.append(" union ");
  sql.append("select '入库单' field1,instockno field2,depotNo field3,depotname field4,a.orgashortname field5,a.creator field6,case when  a.recStatus='进行' then '正在审批,没有办理入库。'  else '没有办理入库。' end field7");
  sql.append(" from t_instockbill a ,t_depot d ,SA_OPORG sa ,t_finaperidef b  ");
  sql.append(" where a.recStatus in ('进行','生效')  and a.depotid=d.fid  and d.orgaID=sa.sID   and b.AccountID=sa.sAccountId  and  a.instockdate between b.begindate and b.enddate ");
  sql.append(" and b.accountid='").append(accountID).append("' and b.finayear=").append(finaYear).append(" and b.finamonth=").append(finaMonth)
    .append("  and b.ACCOUNTMODE='").append(accountMode).append("'  and a.materialtype='").append(accountMode).append("'");
  return Butone.excuteSel(sql.toString());
}

//Butone 查询
public static Table excuteSel(String sql) {
  System.out.println("sqlSel ==== " + sql);
  HashMap<String, String> sqlMap = new HashMap<String, String>();
  sqlMap.put("MSSQL", sql);
  return SQL.select(sqlMap, null, DATA_MODEL);
}


.W页面
var tableInfoActivity = {};
var accountMode;
var accountID;
var finaYear;
var finaMonth;
tableInfoActivity.bizDataRefreshCreateParam = function(event){
var param = new justep.Request.MapParam();
param.put("accountMode", accountMode);
param.put("accountID", accountID);
param.put("finaYear", finaYear);
param.put("finaMonth", finaMonth);
event.param.setMap("variables", param);
};

tableInfoActivity.windowReceiverReceive = function(event){
accountMode = event.data.accountMode;
accountID = event.data.accountID;
finaYear = event.data.finaYear;
finaMonth = event.data.finaMonth;
};


请问如何在页面的grid 展示自己写的SQL 列 ?



91

主题

13万

帖子

3万

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
35920
发表于 2015-7-13 17:49:09 | 显示全部楼层
远程的联系方法QQ1392416607,添加好友时,需在备注里注明其论坛名字及ID,公司等信息
发远程时同时也发一下帖子地址,方便了解要解决的问题  WeX5教程  WeX5下载



如按照该方法解决,请及时跟帖,便于版主结贴
回复 支持 反对

使用道具 举报

19

主题

62

帖子

241

积分

中级会员

Rank: 3Rank: 3

积分
241
 楼主| 发表于 2015-7-14 09:10:20 | 显示全部楼层
好的,我看看,请结贴。
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|X3技术论坛|Justep Inc.    

GMT+8, 2024-5-3 19:55 , Processed in 0.068726 second(s), 24 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表