package com.iamberry.rst.util; import com.iamberry.rst.core.cm.*; import java.util.ArrayList; import java.util.List; public class CustomerCommonUtil { /** * @param type 处理结果: 1:已解决 2:未解决 3:换新 4:维修 5:补发 6:退货 7:无理由退货 * @return */ @Deprecated public static Object getRelation(Integer type,CustomerCommon c){ switch (type){ case 3: //换新 Renewed renewed = new Renewed(); renewed.setRenewedId(c.getRelationId()); renewed.setCustomerId(c.getCustomerId()); renewed.setOrderId(c.getOrderId()); renewed.setSignclosedId(c.getSignclosedId()); renewed.setRenewedBackEfastOrderId(c.getRelationBackEfastOrderId()); renewed.setRenewedBackStatus(c.getRelationBackStatus()); renewed.setRenewedBackName(c.getRelationBackName()); renewed.setRenewedBackTel(c.getRelationBackTel()); renewed.setRenewedBackLogisticsCompany(c.getRelationBackLogisticsCompany()); renewed.setRenewedBackLogisticsNo(c.getRelationBackLogisticsNo()); renewed.setRenewedBackPostage(c.getRelationBackPostage()); renewed.setRenewedBackMachineNo(c.getRelationBackMachineNo()); renewed.setRenewedSendStatus(c.getRelationSendStatus()); renewed.setRenewedSendName(c.getRelationSendName()); renewed.setRenewedSendTel(c.getRelationSendTel()); renewed.setProvinceNumber(c.getProvinceNumber()); renewed.setCityNumber(c.getCityNumber()); renewed.setAreaNumber(c.getAreaNumber()); renewed.setRenewedSendMergeAddress(c.getRelationSendMergeAddress()); renewed.setRenewedSendAddress(c.getRelationSendAddress()); renewed.setRenewedSendLogisticsCompany(c.getRelationSendLogisticsCompany()); renewed.setRenewedSendLogisticsNo(c.getRelationSendLogisticsNo()); renewed.setRenewedDesc(c.getRelationDesc()); renewed.setRenewedState(c.getRelationState()); renewed.setRenewedAlipay(c.getRelationAlipay()); renewed.setRenewedAlipayName(c.getRelationAlipayName()); renewed.setRenewedIsTransfer(c.getRelationIsTransfer()); renewed.setRenewedCreateTime(c.getRelationCreateTime()); renewed.setRenewedUpdateTime(c.getRelationUpdateTime()); return renewed; case 4: //维修 Repair repair = new Repair(); repair.setRepairId(c.getRelationId()); repair.setCustomerId(c.getCustomerId()); repair.setOrderId(c.getOrderId()); repair.setSignclosedId(c.getSignclosedId()); repair.setRepairBackEfastOrderId( c.getRelationBackEfastOrderId()); repair.setRepairBackStatus(c.getRelationBackStatus()); repair.setRepairBackName(c.getRelationBackName()); repair.setRepairBackTel(c.getRelationBackTel()); repair.setRepairBackLogisticsCompany(c.getRelationBackLogisticsCompany()); repair.setRepairBackLogisticsNo(c.getRelationBackLogisticsNo()); repair.setRepairBackPostage(c.getRelationBackPostage()); repair.setRepairBackMachineNo(c.getRelationBackMachineNo()); repair.setRepairSendStatus(c.getRelationSendStatus()); repair.setRepairSendName(c.getRelationSendName()); repair.setRepairSendTel(c.getRelationSendTel()); repair.setProvinceNumber(c.getProvinceNumber()); repair.setCityNumber(c.getCityNumber()); repair.setAreaNumber(c.getAreaNumber()); repair.setRepairSendMergeAddress(c.getRelationSendMergeAddress()); repair.setRepairSendAddress(c.getRelationSendAddress()); repair.setRepairSendLogisticsCompany(c.getRelationSendLogisticsCompany()); repair.setRepairSendLogisticsNo(c.getRelationSendLogisticsNo()); repair.setRepairDesc(c.getRelationDesc()); repair.setRepairState(c.getRelationState()); repair.setRepairAlipay(c.getRelationAlipay()); repair.setRepairAlipayName(c.getRelationAlipayName()); repair.setRepairIsTransfer(c.getRelationIsTransfer()); repair.setRepairCreateTime(c.getRelationCreateTime()); repair.setRepairUpdateTime(c.getRelationUpdateTime()); repair.setRepairFactoryCosts(c.getRelationFactoryCosts() == null ? null : c.getRelationFactoryCosts()*100); repair.setRepairCustomerCosts(c.getRelationCustomerCosts() == null ? null : c.getRelationCustomerCosts()*100); return repair; case 5://补发 Reissue reissue = new Reissue(); reissue.setReissueId(c.getRelationId()); reissue.setCustomerId(c.getCustomerId()); reissue.setOrderId(c.getOrderId()); reissue.setReissueBackEfastOrderId(c.getRelationBackEfastOrderId()); reissue.setReissueSendStatus(c.getRelationSendStatus()); reissue.setReissueSendName(c.getRelationSendName()); reissue.setReissueSendTel(c.getRelationSendTel()); reissue.setProvinceNumber(c.getProvinceNumber()); reissue.setCityNumber(c.getCityNumber()); reissue.setAreaNumber(c.getAreaNumber()); reissue.setReissueSendMergeAddress(c.getRelationSendMergeAddress()); reissue.setReissueSendAddress(c.getRelationSendAddress()); reissue.setReissueSendLogisticsCompany(c.getRelationSendLogisticsCompany()); reissue.setReissueSendLogisticsNo(c.getRelationSendLogisticsNo()); reissue.setReissueDesc(c.getRelationDesc()); reissue.setReissueState(c.getRelationState()); reissue.setReissueCreateTime(c.getRelationCreateTime()); reissue.setReissueUpdateTime(c.getRelationUpdateTime()); return reissue; case 6://退货 BackGoods backGoods = new BackGoods(); backGoods.setBackGoodsId(c.getRelationId()); backGoods.setCustomerId(c.getCustomerId()); backGoods.setOrderId(c.getOrderId()); backGoods.setSignclosedId(c.getSignclosedId()); backGoods.setBackGoodsBackStatus(c.getRelationBackStatus()); backGoods.setBackGoodsBackName(c.getRelationBackName()); backGoods.setBackGoodsBackTel(c.getRelationBackTel()); backGoods.setBackGoodsBackLogisticsCompany(c.getRelationBackLogisticsCompany()); backGoods.setBackGoodsBackLogisticsNo(c.getRelationBackLogisticsNo()); backGoods.setBackGoodsBackPostage(c.getRelationBackPostage()); backGoods.setBackGoodsBackMachineNo(c.getRelationBackMachineNo()); backGoods.setBackGoodsDesc(c.getRelationDesc()); backGoods.setBackGoodsState(c.getRelationState()); backGoods.setBackGoodsAlipay(c.getRelationAlipay()); backGoods.setBackGoodsAlipayName(c.getRelationAlipayName()); backGoods.setBackGoodsIsTransfer(c.getRelationIsTransfer()); backGoods.setBackGoodsCreateTime(c.getRelationCreateTime()); backGoods.setBackGoodsUpdateTime(c.getRelationUpdateTime()); return backGoods; case 7://无理由退货 NoreasonBack noreasonBack = new NoreasonBack(); noreasonBack.setNoreasonBackId( c.getRelationId()); noreasonBack.setCustomerId(c.getCustomerId()); noreasonBack.setOrderId(c.getOrderId()); noreasonBack.setSignclosedId(c.getSignclosedId()); noreasonBack.setNoreasonBackBackStatus(c.getRelationBackStatus()); noreasonBack.setNoreasonBackBackName(c.getRelationBackName()); noreasonBack.setNoreasonBackBackTel(c.getRelationBackTel()); noreasonBack.setNoreasonBackBackLogisticsCompany(c.getRelationBackLogisticsCompany()); noreasonBack.setNoreasonBackBackLogisticsNo(c.getRelationBackLogisticsNo()); noreasonBack.setNoreasonBackBackPostage(c.getRelationBackPostage()); noreasonBack.setNoreasonBackBackMachineNo(c.getRelationBackMachineNo()); noreasonBack.setNoreasonBackDesc(c.getRelationDesc()); noreasonBack.setNoreasonBackState(c.getRelationState()); noreasonBack.setNoreasonBackAlipay(c.getRelationAlipay()); noreasonBack.setNoreasonBackAlipayName(c.getRelationAlipayName()); noreasonBack.setNoreasonBackIsTransfer(c.getRelationIsTransfer()); noreasonBack.setNoreasonBackCreateTime(c.getRelationCreateTime()); noreasonBack.setNoreasonBackUpdateTime(c.getRelationUpdateTime()); return noreasonBack; default : return null; } } /** * 封装参数 * @param solve 处理类型 * @param object * @return */ @Deprecated public static CustomerCommon getCustomerCommon(int solve, Object object) { if (object == null) { return null; } CustomerCommon customerCommon = new CustomerCommon(); switch (solve) { case 3://换新 Renewed renewed = (Renewed)object; customerCommon.setRelationId(renewed.getRenewedId()); customerCommon.setCustomerId(renewed.getCustomerId()); customerCommon.setOrderId(renewed.getOrderId()); customerCommon.setSignclosedId(renewed.getSignclosedId()); customerCommon.setRelationBackEfastOrderId(renewed.getRenewedBackEfastOrderId()); customerCommon.setRelationBackStatus(renewed.getRenewedBackStatus()); customerCommon.setRelationBackName(renewed.getRenewedBackName()); customerCommon.setRelationBackTel(renewed.getRenewedBackTel()); customerCommon.setRelationBackLogisticsCompany(renewed.getRenewedBackLogisticsCompany()); customerCommon.setRelationBackLogisticsNo(renewed.getRenewedBackLogisticsNo()); customerCommon.setRelationBackPostage(renewed.getRenewedBackPostage()); customerCommon.setRelationBackMachineNo(renewed.getRenewedBackMachineNo()); customerCommon.setRelationSendStatus(renewed.getRenewedSendStatus()); customerCommon.setRelationSendName(renewed.getRenewedSendName()); customerCommon.setRelationSendTel(renewed.getRenewedSendTel()); customerCommon.setProvinceNumber(renewed.getProvinceNumber()); customerCommon.setCityNumber(renewed.getCityNumber()); customerCommon.setAreaNumber(renewed.getAreaNumber()); customerCommon.setRelationSendMergeAddress(renewed.getRenewedSendMergeAddress()); customerCommon.setRelationSendAddress(renewed.getRenewedSendAddress()); customerCommon.setRelationSendLogisticsCompany(renewed.getRenewedSendLogisticsCompany()); customerCommon.setRelationSendLogisticsNo(renewed.getRenewedSendLogisticsNo()); customerCommon.setRelationDesc(renewed.getRenewedDesc()); customerCommon.setRelationState(renewed.getRenewedState()); customerCommon.setRelationAlipay(renewed.getRenewedAlipay()); customerCommon.setRelationAlipayName(renewed.getRenewedAlipayName()); customerCommon.setRelationIsTransfer(renewed.getRenewedIsTransfer()); customerCommon.setRelationCreateTime(renewed.getRenewedCreateTime()); customerCommon.setRelationUpdateTime(renewed.getRenewedUpdateTime()); customerCommon.setMaintenanceIsRepair(renewed.getMaintenanceIsRepair()); break; case 4://维修 Repair repair = (Repair)object; customerCommon.setRelationId(repair.getRepairId()); customerCommon.setCustomerId(repair.getCustomerId()); customerCommon.setOrderId(repair.getOrderId()); customerCommon.setSignclosedId(repair.getSignclosedId()); customerCommon.setRelationBackEfastOrderId(repair.getRepairBackEfastOrderId()); customerCommon.setRelationBackStatus(repair.getRepairBackStatus()); customerCommon.setRelationBackName(repair.getRepairBackName()); customerCommon.setRelationBackTel(repair.getRepairBackTel()); customerCommon.setRelationBackLogisticsCompany(repair.getRepairBackLogisticsCompany()); customerCommon.setRelationBackLogisticsNo(repair.getRepairBackLogisticsNo()); customerCommon.setRelationBackPostage(repair.getRepairBackPostage()); customerCommon.setRelationBackMachineNo(repair.getRepairBackMachineNo()); customerCommon.setRelationSendStatus(repair.getRepairSendStatus()); customerCommon.setRelationSendName(repair.getRepairSendName()); customerCommon.setRelationSendTel(repair.getRepairSendTel()); customerCommon.setProvinceNumber(repair.getProvinceNumber()); customerCommon.setCityNumber(repair.getCityNumber()); customerCommon.setAreaNumber(repair.getAreaNumber()); customerCommon.setRelationSendMergeAddress(repair.getRepairSendMergeAddress()); customerCommon.setRelationSendAddress(repair.getRepairSendAddress()); customerCommon.setRelationSendLogisticsCompany(repair.getRepairSendLogisticsCompany()); customerCommon.setRelationSendLogisticsNo(repair.getRepairSendLogisticsNo()); customerCommon.setRelationDesc(repair.getRepairDesc()); customerCommon.setRelationState(repair.getRepairState()); customerCommon.setRelationAlipay(repair.getRepairAlipay()); customerCommon.setRelationAlipayName(repair.getRepairAlipayName()); customerCommon.setRelationIsTransfer(repair.getRepairIsTransfer()); customerCommon.setRelationCreateTime(repair.getRepairCreateTime()); customerCommon.setRelationUpdateTime(repair.getRepairUpdateTime()); customerCommon.setMaintenanceIsRepair(repair.getMaintenanceIsRepair()); customerCommon.setDetectState(repair.getDetectState()); customerCommon.setRelationFactoryCosts(repair.getRepairFactoryCosts()== null ? null: repair.getRepairFactoryCosts()/100); customerCommon.setRelationCustomerCosts(repair.getRepairCustomerCosts() == null ? null:repair.getRepairCustomerCosts()/100); break; case 5://补发 Reissue reissue = (Reissue)object; customerCommon.setRelationId(reissue.getReissueId()); customerCommon.setCustomerId(reissue.getCustomerId()); customerCommon.setOrderId(reissue.getOrderId()); customerCommon.setRelationBackEfastOrderId(reissue.getReissueBackEfastOrderId()); customerCommon.setRelationSendStatus(reissue.getReissueSendStatus()); customerCommon.setRelationSendName(reissue.getReissueSendName()); customerCommon.setRelationSendTel(reissue.getReissueSendTel()); customerCommon.setProvinceNumber(reissue.getProvinceNumber()); customerCommon.setCityNumber(reissue.getCityNumber()); customerCommon.setAreaNumber(reissue.getAreaNumber()); customerCommon.setRelationSendMergeAddress(reissue.getReissueSendMergeAddress()); customerCommon.setRelationSendAddress(reissue.getReissueSendAddress()); customerCommon.setRelationSendLogisticsCompany(reissue.getReissueSendLogisticsCompany()); customerCommon.setRelationSendLogisticsNo(reissue.getReissueSendLogisticsNo()); customerCommon.setRelationDesc(reissue.getReissueDesc()); customerCommon.setRelationState(reissue.getReissueState()); customerCommon.setRelationCreateTime(reissue.getReissueCreateTime()); customerCommon.setRelationUpdateTime(reissue.getReissueUpdateTime()); break; case 6://退货 BackGoods backGoods = (BackGoods)object; customerCommon.setRelationId(backGoods.getBackGoodsId()); customerCommon.setCustomerId(backGoods.getCustomerId()); customerCommon.setOrderId(backGoods.getOrderId()); customerCommon.setSignclosedId(backGoods.getSignclosedId()); customerCommon.setRelationBackStatus(backGoods.getBackGoodsBackStatus()); customerCommon.setRelationBackName(backGoods.getBackGoodsBackName()); customerCommon.setRelationBackTel(backGoods.getBackGoodsBackTel()); customerCommon.setRelationBackLogisticsCompany(backGoods.getBackGoodsBackLogisticsCompany()); customerCommon.setRelationBackLogisticsNo(backGoods.getBackGoodsBackLogisticsNo()); customerCommon.setRelationBackPostage(backGoods.getBackGoodsBackPostage()); customerCommon.setRelationBackMachineNo(backGoods.getBackGoodsBackMachineNo()); customerCommon.setRelationDesc(backGoods.getBackGoodsDesc()); customerCommon.setRelationState(backGoods.getBackGoodsState()); customerCommon.setRelationAlipay(backGoods.getBackGoodsAlipay()); customerCommon.setRelationAlipayName(backGoods.getBackGoodsAlipayName()); customerCommon.setRelationIsTransfer(backGoods.getBackGoodsIsTransfer()); customerCommon.setRelationCreateTime(backGoods.getBackGoodsCreateTime()); customerCommon.setRelationUpdateTime(backGoods.getBackGoodsUpdateTime()); customerCommon.setDetectState(backGoods.getDetectState()); break; case 7://无理由退货 NoreasonBack noreasonBack = (NoreasonBack)object; customerCommon.setRelationId(noreasonBack.getNoreasonBackId()); customerCommon.setCustomerId(noreasonBack.getCustomerId()); customerCommon.setOrderId(noreasonBack.getOrderId()); customerCommon.setSignclosedId(noreasonBack.getSignclosedId()); customerCommon.setRelationBackStatus(noreasonBack.getNoreasonBackBackStatus()); customerCommon.setRelationBackName(noreasonBack.getNoreasonBackBackName()); customerCommon.setRelationBackTel(noreasonBack.getNoreasonBackBackTel()); customerCommon.setRelationBackLogisticsCompany(noreasonBack.getNoreasonBackBackLogisticsCompany()); customerCommon.setRelationBackLogisticsNo(noreasonBack.getNoreasonBackBackLogisticsNo()); customerCommon.setRelationBackPostage(noreasonBack.getNoreasonBackBackPostage()); customerCommon.setRelationBackMachineNo(noreasonBack.getNoreasonBackBackMachineNo()); customerCommon.setRelationDesc(noreasonBack.getNoreasonBackDesc()); customerCommon.setRelationState(noreasonBack.getNoreasonBackState()); customerCommon.setRelationAlipay(noreasonBack.getNoreasonBackAlipay()); customerCommon.setRelationAlipayName(noreasonBack.getNoreasonBackAlipayName()); customerCommon.setRelationIsTransfer(noreasonBack.getNoreasonBackIsTransfer()); customerCommon.setRelationCreateTime(noreasonBack.getNoreasonBackCreateTime()); customerCommon.setRelationUpdateTime(noreasonBack.getNoreasonBackUpdateTime()); customerCommon.setDetectState(noreasonBack.getDetectState()); break; default: customerCommon = null; break; } return customerCommon; } /** * 封装参数 list * @param solve 处理类型 * @param relationList * @return */ @Deprecated public static List listToCustomerCommon(int solve,List relationList){ List ccList = new ArrayList<>(); for (Object relation : relationList){ CustomerCommon cc = CustomerCommonUtil.getCustomerCommon(solve,relationList); ccList.add(cc); } return ccList; } /** * 将所有的寄回寄出中的类型改为 type * 售后类型 3:换新;4:维修;5:补发;6:退货;7:无理由退货 * @param type */ @Deprecated public static void setProduceOrFitting(Integer type,CustomerCommon cc){ for (int i=0;i