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

QQ登录

只需一步,快速开始

查看: 2039|回复: 1

[处理中] 前台调用后台Action,报错:重复添加的列定义"codename"

[复制链接]

4

主题

11

帖子

96

积分

初级会员

Rank: 2

积分
96
QQ
发表于 2014-4-30 18:52:13 | 显示全部楼层 |阅读模式
报错内容:
Caused by: com.justep.exception.BusinessException: 编码: JUSTEP150204; 提示: 重复添加的列定义"codename"
        at com.justep.exception.BusinessException.create(Unknown Source)
        at com.justep.system.data.impl.TableMetaDataImpl.addColumnMetaData(Unknown Source)
        at com.justep.system.data.impl.TableImpl.addColumns(Unknown Source)
        at com.justep.system.data.impl.TableImpl.createTable(Unknown Source)
        at com.justep.system.data.impl.TableUtilsImplement.createTable(Unknown Source)
        at com.justep.system.data.TableUtils.createTable(Unknown Source)
        at com.justep.system.util.BizUtils.resultSet2Table(Unknown Source)
        at com.justep.system.util.BizUtils.resultSet2Table(Unknown Source)
        at Asset.queryT_suppliersMessage(Asset.java:2337)
        ... 26 more


后台代码:
                        sql="select b.enterpriseName as enterprisename" +
                        ",t.codename as codename1" +
                        ",b.scope as scope" +
                        ",b.enterprisenAddress as enterprisenAddress" +
                        ",sa_oporg.sName as sName,b.statu as statu" +
                        ",tcodes.codename as codename2 " +
                        "from t_suppliers b inner join (" +
                        "select businessLicNo,max(addtime) as addtimes " +
                        "from t_suppliers where (isnull(addtime) = 0) " +
                        "group by businessLicNo ) a " +
                        "on (b.businessLicNo = a.businessLicNo and b.addtime = a.addtimes) " +
                        "left join t_codes t " +
                        "on (b.enterpriseType=t.codevalue and t.codetype='supplierstype') " +
                        "left join t_codes tcodes " +
                        "on (b.statu=tcodes.codevalue and tcodes.codetype='supplierstatus') " +
                        "left join sa_oporg  sa_oporg " +
                        "on (b.unitId=sa_oporg.sCode and sa_oporg.sOrgKindID='ogn') " ;
                //        }
                         sql += " where b.enterpriseName like '%" + enterprisename + "%'";
                        if(!"".equals(statu)){
                                sql += " and b.statu = '"+statu+"' ";
                        }
                        myconn = ModelUtils.getConnectionInTransaction("/OA_WS/management/data");
                        mystmt = myconn.createStatement();
                        ResultSet rs = mystmt.executeQuery(sql);
                       
                        return com.justep.system.util.BizUtils.resultSet2Table(rs, (String)null);

报错的是最后一行: return com.justep.system.util.BizUtils.resultSet2Table(rs, (String)null);

39

主题

1379

帖子

2464

积分

金牌会员

Rank: 6Rank: 6

积分
2464
发表于 2014-5-4 09:04:14 | 显示全部楼层
看这个语句好像没有问题,楼主把这条语句提取到sql dev上执行一下
高级模式
B Color Image Link Quote Code Smilies |上传

本版积分规则

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

GMT+8, 2024-11-22 17:32 , Processed in 0.095998 second(s), 23 queries .

Powered by Discuz! X3.4

© 2001-2013 Comsenz Inc.

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