123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339 |
- 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
- */
- 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.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.setRepairIsTransfer(c.getRelationIsTransfer());
- repair.setRepairCreateTime(c.getRelationCreateTime());
- repair.setRepairUpdateTime(c.getRelationUpdateTime());
- 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.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.setNoreasonBackIsTransfer(c.getRelationIsTransfer());
- noreasonBack.setNoreasonBackCreateTime(c.getRelationCreateTime());
- noreasonBack.setNoreasonBackUpdateTime(c.getRelationUpdateTime());
- return noreasonBack;
- default :
- return null;
- }
- }
- /**
- * 封装参数
- * @param solve 处理类型
- * @param object
- * @return
- */
- 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.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.setRelationIsTransfer(repair.getRepairIsTransfer());
- customerCommon.setRelationCreateTime(repair.getRepairCreateTime());
- customerCommon.setRelationUpdateTime(repair.getRepairUpdateTime());
- customerCommon.setMaintenanceIsRepair(repair.getMaintenanceIsRepair());
- customerCommon.setDetectState(repair.getDetectState());
- 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.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.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
- */
- public static List<CustomerCommon> listToCustomerCommon(int solve,List<?> relationList){
- List<CustomerCommon> 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
- */
- public static void setProduceOrFitting(Integer type,CustomerCommon cc){
- for (int i=0;i<cc.getSendProdcues().size();i++) {
- cc.getSendProdcues().get(i).setSendProduceType(type);
- cc.getSendProdcues().get(i).setRelationId(cc.getRelationId());
- }
- for (int i=0;i<cc.getSendFittings().size();i++) {
- cc.getSendFittings().get(i).setSendFittingType(type);
- cc.getSendFittings().get(i).setRelationId(cc.getRelationId());
- }
- for (int i=0;i<cc.getClosedProdcues().size();i++) {
- cc.getClosedProdcues().get(i).setClosedProdcueType(type);
- cc.getClosedProdcues().get(i).setRelationId(cc.getRelationId());
- }
- for (int i=0;i<cc.getClosedFittings().size();i++) {
- cc.getClosedFittings().get(i).setClosedFittingType(type);
- cc.getClosedFittings().get(i).setRelationId(cc.getRelationId());
- }
- }
- }
|