Example usage for java.lang Double toString

List of usage examples for java.lang Double toString

Introduction

In this page you can find the example usage for java.lang Double toString.

Prototype

public String toString() 

Source Link

Document

Returns a string representation of this Double object.

Usage

From source file:com.belle.yitiansystem.merchant.service.impl.MerchantsService.java

/**
 * //from  w w  w  .jav a2 s .  com
 * ?
 * 
 * @Date 2012-03-07
 * @author wang.m
 * @throws Exception
 */
@Transactional
@Deprecated
public Integer addSupplier(HttpServletRequest req, SupplierSp supplierSp) {
    Integer count = 0;
    try {
        SupplierSp supplier = new SupplierSp();
        supplier.setUpdateTimestamp(System.currentTimeMillis());// 
        supplier.setSupplier(supplierSp.getSupplier());// ??
        supplier.setSimpleName(supplierSp.getSimpleName());// 
        supplier.setAddress(supplierSp.getAddress());// ?
        supplier.setTaxRate(supplierSp.getTaxRate());// 
        supplier.setRemark(supplierSp.getRemark());// 
        if (null != supplierSp && supplierSp.getSupplierType() != null
                && "".equals(supplierSp.getSupplierType())) {
            if (supplierSp.getCouponsAllocationProportion() == null) {
                supplier.setCouponsAllocationProportion(supplierSp.getCouponsAllocationProportion());// 
            } else {
                supplier.setCouponsAllocationProportion(0.00);// 
            }
        } else {
            supplier.setCouponsAllocationProportion(0.00);// 
        }
        supplier.setSupplierType(supplierSp.getSupplierType());// 
        supplier.setIsInputYougouWarehouse(supplierSp.getIsInputYougouWarehouse());// ?
        supplier.setSetOfBooksCode(supplierSp.getSetOfBooksCode());// ???
        supplier.setSetOfBooksName(supplierSp.getSetOfBooksName());// ????
        supplier.setBalanceTraderCode(supplierSp.getBalanceTraderCode());// ?
        supplier.setBalanceTraderName(supplierSp.getBalanceTraderName());// ??
        supplier.setPosSourceNo(supplierSp.getPosSourceNo());// pos?
        supplier.setIsUseYougouWms(supplierSp.getIsUseYougouWms());//?WMS
        supplier.setDeleteFlag(1);// 
        supplier.setShipmentType(supplierSp.getShipmentType());// ?
        SystemmgtUser user = GetSessionUtil.getSystemUser(req);
        String loginUser = "";
        if (user != null) {
            loginUser = user.getUsername();
        }
        supplier.setCreator(loginUser);// 
        supplier.setUpdateUser(loginUser);// 
        supplier.setUpdateDate(new Date());//  
        // 
        if (StringUtils.isNotBlank(supplierSp.getId())) {
            // ?
            SupplierSp supplierInfo = getSupplierSpById(supplierSp.getId());
            // ?
            if (supplierInfo != null) {
                supplier.setBank(supplierInfo.getBank());
                supplier.setSubBank(supplierInfo.getSubBank());
                supplier.setDutyCode(supplierInfo.getDutyCode());
                supplier.setContact(supplierInfo.getContact());
                supplier.setPayType(supplierInfo.getPayType());
                supplier.setAccount(supplierInfo.getAccount());
                supplier.setConTime(supplierInfo.getConTime());
            }
            if (supplierInfo != null) {
                // ??()
                if (null != supplierSp && supplierSp.getSupplierType() != null
                        && "".equals(supplierSp.getSupplierType())) {
                    // 
                    Double proportion = supplierInfo.getCouponsAllocationProportion() == null ? 0.0
                            : supplierInfo.getCouponsAllocationProportion();
                    if (supplierSp.getCouponsAllocationProportion() != null
                            && !proportion.equals(supplierSp.getCouponsAllocationProportion())) {
                        count = addMerhcantlog(supplierSp.getId(), "?",
                                "", proportion.toString(),
                                supplierSp.getCouponsAllocationProportion().toString(), loginUser);
                    }
                }
                // ????
                String setOfBooksName = supplierInfo.getSetOfBooksName() == null ? ""
                        : supplierInfo.getSetOfBooksName();
                if (!setOfBooksName.equals(supplierSp.getSetOfBooksName())) {
                    count = addMerhcantlog(supplierSp.getId(), "?",
                            "????", setOfBooksName, supplierSp.getSetOfBooksName(), loginUser);
                }
                // 
                Double taxRate = supplierInfo.getTaxRate() == null ? 0.0 : supplierInfo.getTaxRate();
                if (!taxRate.equals(supplierSp.getTaxRate())) {
                    count = addMerhcantlog(supplierSp.getId(), "?", "",
                            taxRate.toString(), supplierSp.getTaxRate().toString(), loginUser);
                }
                // ?
                Integer warehouse = supplierInfo.getIsInputYougouWarehouse() == null ? 1
                        : supplierInfo.getIsInputYougouWarehouse();
                if (warehouse != supplierSp.getIsInputYougouWarehouse()) {
                    String wareStr = "";
                    String wareStr1 = "";
                    if (warehouse == 1) {
                        wareStr = "";
                        wareStr1 = "?";
                    } else {
                        wareStr = "?";
                        wareStr1 = "";
                    }
                    count = addMerhcantlog(supplierSp.getId(), "?", "",
                            wareStr, wareStr1, loginUser);
                }
            }
            supplier.setId(supplierSp.getId());
            supplier.setSupplierCode(supplierSp.getSupplierCode());// ?
            supplier.setIsValid(supplierSp.getIsValid());// ?
            //supplierDaoImpl.merge(supplier);
            //TODO
        } else {
            String supplierCode = new CodeGenerate().getSupplierCode();
            supplier.setSupplierCode(supplierCode);// ?
            supplier.setIsValid(2);// ? 
            //supplierDaoImpl.save(supplier);
            //TODO
        }

        count = 1;
    } catch (Exception e) {
        // TODO Auto-generated catch block
        logger.error("?!", e);
        e.printStackTrace();
    }
    return count;
}