Package com.kylietech.oaj.server.audit

Source Code of com.kylietech.oaj.server.audit.POPlanningLog

package com.kylietech.oaj.server.audit;

import java.util.HashMap;
import java.util.Map;

import com.kylietech.oaj.common.util.OABeanUtil;
import com.kylietech.oaj.server.domain.orders.OrderLinePlanning;
import com.kylietech.oaj.types.LineItem;

/**
* @hibernate.subclass
*/
public class POPlanningLog extends SimpleLogItemizable {
   
    public Map propertiesToLog() {
        Map props = new HashMap();
        props.put(OABeanUtil.DATE_ENTRY_FIELD,OABeanUtil.DATE_ENTRY_FIELD);
        props.put(OABeanUtil.COMMENTS_FIELD,OABeanUtil.COMMENTS_FIELD);       
        return props;
    }
   
    protected boolean isDifferent(LineItem line1, LineItem line2) {
        if (line1 == line2)
            return false;
        if (line1 == null || line2 == null || !line1.equals(line2))
            return true;
       
        OrderLinePlanning orderLine1 = (OrderLinePlanning)line1;
        OrderLinePlanning orderLine2 = (OrderLinePlanning)line2;
        if (!orderLine1.getQuantity().equals(orderLine2.getQuantity()))
            return true;
        if (!orderLine1.getDateDelivery().equals(orderLine2.getDateDelivery()))
            return true;
        return false;
    }   
   
    protected SimpleLogLine newLogLine(LineItem sourceLine) {
        OrderLinePlanning line = (OrderLinePlanning)sourceLine;
       
        SimpleLogLine lineLog = new SimpleLogLine();

        lineLog.setDateDelivery(line.getDateDelivery());
        lineLog.setQuantity(line.getQuantity());
        lineLog.setIsSplit(line.getIsSplit());
        return lineLog;      
    }
  
}
TOP

Related Classes of com.kylietech.oaj.server.audit.POPlanningLog

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.