package com.red.circle.console.app.convertor.impl;

import com.red.circle.console.app.convertor.PropsAppConvertor;
import com.red.circle.console.app.dto.clienobject.props.PropsResourcesOpsCO;
import com.red.circle.console.app.dto.clienobject.user.RunningWaterUserPropsCO;
import com.red.circle.console.app.dto.cmd.app.props.PropsCommodityStoreAddOrUpdateCmd;
import com.red.circle.console.app.dto.cmd.app.props.PropsSourceRecordSaveOrUpdateCmd;
import com.red.circle.other.inner.model.dto.material.PropsCommodityStoreDTO;
import com.red.circle.other.inner.model.dto.material.PropsResourcesDTO;
import com.red.circle.other.inner.model.dto.material.RunningWaterUserPropsDTO;
import javax.annotation.processing.Generated;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;


@Service("PropsAppConvertorNew")
public class PropsAppConvertorImpl implements PropsAppConvertor {

    @Override
    public PropsCommodityStoreDTO toPropsCommodityStoreDTO(PropsCommodityStoreAddOrUpdateCmd cmd) {
        if ( cmd == null ) {
            return null;
        }

        PropsCommodityStoreDTO propsCommodityStoreDTO = new PropsCommodityStoreDTO();

        propsCommodityStoreDTO.setId( cmd.getId() );
        propsCommodityStoreDTO.setSysOrigin( cmd.getSysOrigin() );
        propsCommodityStoreDTO.setSourceId( cmd.getSourceId() );
        propsCommodityStoreDTO.setPropsType( cmd.getPropsType() );
        propsCommodityStoreDTO.setCurrencyTypes( cmd.getCurrencyTypes() );
        propsCommodityStoreDTO.setValidDays( cmd.getValidDays() );
        propsCommodityStoreDTO.setDiscount( cmd.getDiscount() );
        propsCommodityStoreDTO.setShelfStatus( cmd.getShelfStatus() );
        propsCommodityStoreDTO.setSort( cmd.getSort() );
        propsCommodityStoreDTO.setLabel( cmd.getLabel() );
        propsCommodityStoreDTO.setDel( cmd.getDel() );
        propsCommodityStoreDTO.setCreateTime( cmd.getCreateTime() );
        propsCommodityStoreDTO.setUpdateTime( cmd.getUpdateTime() );

        return propsCommodityStoreDTO;
    }

    @Override
    public RunningWaterUserPropsCO toRunningWaterUserPropsCO(RunningWaterUserPropsDTO dto) {
        if ( dto == null ) {
            return null;
        }

        RunningWaterUserPropsCO runningWaterUserPropsCO = new RunningWaterUserPropsCO();

        runningWaterUserPropsCO.setId( dto.getId() );
        runningWaterUserPropsCO.setPropsCandy( dto.getPropsCandy() );
        runningWaterUserPropsCO.setPropsId( dto.getPropsId() );
        runningWaterUserPropsCO.setPropsOrigin( dto.getPropsOrigin() );
        runningWaterUserPropsCO.setPropsOriginDesc( dto.getPropsOriginDesc() );
        runningWaterUserPropsCO.setPropsCode( dto.getPropsCode() );
        runningWaterUserPropsCO.setPropsName( dto.getPropsName() );
        runningWaterUserPropsCO.setPropsCover( dto.getPropsCover() );
        runningWaterUserPropsCO.setBuyerId( dto.getBuyerId() );
        runningWaterUserPropsCO.setReceiverId( dto.getReceiverId() );
        runningWaterUserPropsCO.setCreateTime( dto.getCreateTime() );

        return runningWaterUserPropsCO;
    }

    @Override
    public PropsResourcesDTO toPropsResourcesDTO(PropsSourceRecordSaveOrUpdateCmd dto) {
        if ( dto == null ) {
            return null;
        }

        PropsResourcesDTO propsResourcesDTO = new PropsResourcesDTO();

        propsResourcesDTO.setId( dto.getId() );
        propsResourcesDTO.setSysOrigin( dto.getSysOrigin() );
        propsResourcesDTO.setType( dto.getType() );
        propsResourcesDTO.setCode( dto.getCode() );
        propsResourcesDTO.setName( dto.getName() );
        propsResourcesDTO.setCover( dto.getCover() );
        propsResourcesDTO.setSourceUrl( dto.getSourceUrl() );
        propsResourcesDTO.setExpand( dto.getExpand() );
        propsResourcesDTO.setAmount( dto.getAmount() );
        propsResourcesDTO.setDel( dto.getDel() );
        propsResourcesDTO.setAdminFree( dto.getAdminFree() );

        return propsResourcesDTO;
    }

    @Override
    public PropsResourcesOpsCO toPropsResourcesOpsCO(PropsResourcesDTO propsResources) {
        if ( propsResources == null ) {
            return null;
        }

        PropsResourcesOpsCO propsResourcesOpsCO = new PropsResourcesOpsCO();

        propsResourcesOpsCO.setId( propsResources.getId() );
        propsResourcesOpsCO.setSysOrigin( propsResources.getSysOrigin() );
        propsResourcesOpsCO.setType( propsResources.getType() );
        propsResourcesOpsCO.setCode( propsResources.getCode() );
        propsResourcesOpsCO.setName( propsResources.getName() );
        propsResourcesOpsCO.setCover( propsResources.getCover() );
        propsResourcesOpsCO.setSourceUrl( propsResources.getSourceUrl() );
        propsResourcesOpsCO.setExpand( propsResources.getExpand() );
        propsResourcesOpsCO.setAmount( propsResources.getAmount() );
        propsResourcesOpsCO.setDel( propsResources.getDel() );
        propsResourcesOpsCO.setRoomSendCoverUrl( propsResources.getRoomSendCoverUrl() );
        propsResourcesOpsCO.setRoomOpenedUrl( propsResources.getRoomOpenedUrl() );
        propsResourcesOpsCO.setRoomNotOpenedUrl( propsResources.getRoomNotOpenedUrl() );
        propsResourcesOpsCO.setImSendCoverUrl( propsResources.getImSendCoverUrl() );
        propsResourcesOpsCO.setImOpenedUrl( propsResources.getImOpenedUrl() );
        propsResourcesOpsCO.setImNotOpenedUrl( propsResources.getImNotOpenedUrl() );
        propsResourcesOpsCO.setImOpenedUrlTwo( propsResources.getImOpenedUrlTwo() );
        propsResourcesOpsCO.setCreateTime( propsResources.getCreateTime() );
        propsResourcesOpsCO.setUpdateTime( propsResources.getUpdateTime() );
        propsResourcesOpsCO.setAdminFree( propsResources.getAdminFree() );

        return propsResourcesOpsCO;
    }
}
