Browse Source

添加了公共类封装参数

liuzhiwei 7 years ago
parent
commit
427aeabab3

+ 121 - 5
watero-rst-core/src/main/java/com.iamberry.rst.core/cm/CustomerCommon.java

@@ -290,6 +290,119 @@ public class CustomerCommon implements Serializable {
         this.relationUpdateTime = relationUpdateTime;
     }
 
+    /**
+     * @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.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.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.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.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.setReissueBackEfastOrderId(c.getRelationBackEfastOrderId());
+                reissue.setReissueSendStatus(c.getRelationSendStatus());
+                reissue.setReissueSendName(c.getRelationSendName());
+                reissue.setReissueSendTel(c.getRelationSendTel());
+                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.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.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;
+        }
+    }
+
+
+
 
     /**
      * 封装参数
@@ -303,7 +416,7 @@ public class CustomerCommon implements Serializable {
         }
         CustomerCommon customerCommon = new CustomerCommon();
         switch (solve) {
-            case 3:
+            case 3://换新
                 Renewed renewed = (Renewed)object;
                 customerCommon.setRelationId(renewed.getRenewedId());
                 customerCommon.setCustomerId(renewed.getCustomerId());
@@ -334,7 +447,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationCreateTime(renewed.getRenewedCreateTime());
                 customerCommon.setRelationUpdateTime(renewed.getRenewedUpdateTime());
                 break;
-            case 4:
+            case 4://维修
                 Repair repair = (Repair)object;
                 customerCommon.setRelationId(repair.getRepairId());
                 customerCommon.setCustomerId(repair.getCustomerId());
@@ -365,7 +478,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationCreateTime(repair.getRepairCreateTime());
                 customerCommon.setRelationUpdateTime(repair.getRepairUpdateTime());
                 break;
-            case 5:
+            case 5://补发
                 Reissue reissue = (Reissue)object;
                 customerCommon.setRelationId(reissue.getReissueId());
                 customerCommon.setCustomerId(reissue.getCustomerId());
@@ -386,7 +499,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationCreateTime(reissue.getReissueCreateTime());
                 customerCommon.setRelationUpdateTime(reissue.getReissueUpdateTime());
                 break;
-            case 6:
+            case 6://退货
                 BackGoods backGoods = new BackGoods();
                 customerCommon.setRelationId(backGoods.getBackGoodsId());
                 customerCommon.setCustomerId(backGoods.getCustomerId());
@@ -406,7 +519,7 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationCreateTime(backGoods.getBackGoodsCreateTime());
                 customerCommon.setRelationUpdateTime(backGoods.getBackGoodsUpdateTime());
                 break;
-            case 7:
+            case 7://无理由退货
                 NoreasonBack noreasonBack = new NoreasonBack();
                 customerCommon.setRelationId(noreasonBack.getNoreasonBackId());
                 customerCommon.setCustomerId(noreasonBack.getCustomerId());
@@ -426,6 +539,9 @@ public class CustomerCommon implements Serializable {
                 customerCommon.setRelationCreateTime(noreasonBack.getNoreasonBackCreateTime());
                 customerCommon.setRelationUpdateTime(noreasonBack.getNoreasonBackUpdateTime());
                 break;
+                default:
+                    customerCommon = null;
+                    break;
         }
         return customerCommon;
     }