package cn.superdesk.uniorder.dao.convert;

import cn.superdesk.uniorder.dto.vo.invoice.customer.InvoiceApplyCustomerDetailDimGoodsVo;
import cn.superdesk.uniorder.dto.vo.invoice.customer.InvoiceApplyCustomerPageVo;
import lombok.extern.slf4j.Slf4j;

/**
 * @Description: Dto转Dto
 * @Author: linjinyu
 * @CreateDate: 2021/6/10 上午10:54
 * @UpdateUser: linjinyu
 * @UpdateDate: 2021/6/10 上午10:54
 * @UpdateRemark: 修改内容
 * @Version: 1.0
 */
@Slf4j
public class Dto2DtoConvertUtils {


	/**
	 * @param input  数据来源
	 * @param output 转换目标
	 */
	public static void invoiceApplyPage2InvoiceApplyDetailDimGoodsVo(InvoiceApplyCustomerPageVo input, InvoiceApplyCustomerDetailDimGoodsVo output) {

		output.setId(input.getId());
		output.setAccountingOrderType(input.getAccountingOrderType());
		output.setDimCreateBy(input.getDimCreateBy());

		output.setOutVirtNamesStr(input.getOutVirtNamesStr());

		output.setInvoiceApplySn(input.getInvoiceApplySn());
		output.setInvoiceNumber(input.getInvoiceNumber());
		output.setInvoiceStatus(input.getInvoiceStatus());
		output.setInvoiceType(input.getInvoiceType());
		output.setInvoiceTitle(input.getInvoiceTitle());
		output.setTaxRate(input.getTaxRate());

		/****************************************** 申请部分 start ******************************************/
		output.setApplyUserId(input.getApplyUserId());
		output.setApplyUserName(input.getApplyUserName());
		output.setApplyTime(input.getApplyTime());

		/****************************************** 审核部分 start ******************************************/
		output.setAuditUserId(input.getAuditUserId());
		output.setAuditUserName(input.getAuditUserName());
		output.setAuditTime(input.getAuditTime());
		output.setAuditStatus(input.getAuditStatus());
		output.setAuditStatusName(input.getAuditStatusName());

		/****************************************** 开票登记部分 start ******************************************/
		output.setMakeInvoiceUserId(input.getMakeInvoiceUserId());
		output.setMakeInvoiceUserName(input.getMakeInvoiceUserName());
		output.setMakeInvoiceTime(input.getMakeInvoiceTime());
		output.setMakeInvoiceStatus(input.getMakeInvoiceStatus());
		output.setMakeInvoiceStatusName(input.getMakeInvoiceStatusName());

		/****************************************** 寄票登记部分 start ******************************************/
		output.setMailTickUserId(input.getMailTickUserId());
		output.setMailTickUserName(input.getMailTickUserName());
		output.setMailTickTime(input.getMailTickTime());
		output.setMailTickStatus(input.getMailTickStatus());
		output.setMailTickStatusName(input.getMailTickStatusName());
		output.setExpressCompanyId(input.getExpressCompanyId());
		output.setExpressCompanyName(input.getExpressCompanyName());
		output.setExpressNo(input.getExpressNo());

		output.setRemark(input.getRemark());
		output.setRemark2(input.getRemark2());

		// 弃用-mark by linjinyu at 20220516
		output.setServiceId(input.getServiceId());

		/**************************************** mark by linjinyu at 20220516 v2.3 start ****************************************/

		output.setServiceNo(input.getServiceNo());
		output.setServiceNoName(input.getServiceNoName());

		output.setSourceFrom(input.getSourceFrom());
		output.setSourceFromName(input.getSourceFromName());

		/**************************************** mark by linjinyu at 20220516 v2.3   end ****************************************/


		output.setSysOrgId(input.getSysOrgId());
		output.setSysVirtId(input.getSysVirtId());
		output.setOutOrgId(input.getOutOrgId());
		output.setOutVirtId(input.getOutVirtId());
//		output.setOutVirtNames(input.getout);
		output.setOutVirtNamesStr(input.getOutVirtNamesStr());

		// 开票申请金额: #公式= ∑(销售单价*商品数量)#-新添加 20210712-产品要求名为: 账单金额
		output.setInvoiceApplyAmount(input.getInvoiceApplyAmount());
		// 减免金额
		output.setFreeAmount(input.getFreeAmount());
		// 实际金额(开票申请金额-减免金额)-产品要求名为: 开票申请金额
		output.setRealAmount(input.getRealAmount());
		// 未回款金额 初始是等于 实际金额
		output.setNoBackMoney(input.getNoBackMoney());

		output.setMaxBackTime(input.getMaxBackTime());
		output.setBackAccountStatus(input.getBackAccountStatus());
		output.setBackAccountStatusName(input.getBackAccountStatusName());

		output.setAccountingOrderSnsStr(input.getAccountingOrderSnsStr());
	}
}
