EAS 根据物料设置单价以及数量的精度问题

        int pricePrecision = materialInfo.getPricePrecision();//  单价的精度
        int qtyPrecision = 0;
if (materialInfo != null && materialInfo != null) {
try {
IMultiMeasureUnit imultiUnit = MultiMeasureUnitFactory.getLocalInstance(ctx);
// 取得计量单位在物料中对应的多计量单位
    MultiMeasureUnitInfo multiUnitInfo = imultiUnit.getMultiUnit(materialInfo.getId().toString(), materialInfo.getBaseUnit().getId().toString());
    if (multiUnitInfo != null) {
    qtyPrecision = multiUnitInfo.getQtyPrecision();// 数量精度
    }
} catch (Exception e) {
logger.error(e);
}

}


 com.kingdee.eas.st.common.util.KDTableUtils.setBigDecimalColumnPrecision(kdtEntries,new String[] { "weighNumber","ownSuttle","diNumber","dwNumber","dhNumber","settleNumber","freightNumber","cokeBreezeNumber"}, qtyPrecision);


/**
     * 设置列的显示格式
     * @param table
     * @param colNames
     * @param precision
     * @date 2008-1-3
     * @author wangyb
     */
    public static void setBigDecimalColumnPrecision(KDTable table,String[] colNames,int precision){
//     KDTDefaultCellEditor editor = new KDTDefaultCellEditor(getBigDecimalTextField(precision));
        KDTDefaultCellEditor editor = FormattedEditorFactory.getBigDecimalCellEditor(precision,true);
    String sFormat = PrecisionUtil.getFormatString(precision);
    for(int i=0;i     IColumn column = table.getColumn(colNames[i]);
    if(column!=null){
    column.setEditor(editor);
    column.getStyleAttributes().setNumberFormat(sFormat);
    }
    }
    }








你可能感兴趣的:(EAS,BOS)