李天标 пре 2 година
родитељ
комит
0ea43d7ba8

+ 27 - 9
src/main/java/com/szwl/controller/TOrderController.java

@@ -124,7 +124,9 @@ public class TOrderController {
         }else {
             //有优惠码,需要对优惠码进行验证
 //            IPage<TPromoCode> pagePromoCode = R.getDataIfSuccess(szwlFeign.getTPromoCode(code));
-            TPromoCode tPromoCode = R.getDataIfSuccess(szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString()));
+            ResponseModel<TPromoCode> tPromoCodeResponseModel = szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString());
+            TPromoCode tPromoCode = tPromoCodeResponseModel.getData();
+//            TPromoCode tPromoCode = R.getDataIfSuccess(szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString()));
             promoCode = tPromoCode;
             if (tPromoCode == null||tPromoCode.getId()==null) {
                 //不存在
@@ -192,7 +194,9 @@ public class TOrderController {
 
         Long equipmentId = equipment.getId();
         //查找商品
-        TProduct product =  R.getDataIfSuccess(szwlFeign.getProduct(String.valueOf(equipmentId), productName));
+        ResponseModel<TProduct> product1 = szwlFeign.getProduct(String.valueOf(equipmentId), productName);
+        TProduct product = product1.getData();
+//        TProduct product =  R.getDataIfSuccess(szwlFeign.getProduct(String.valueOf(equipmentId), productName));
         if (product == null) {
             return JsonMessage.error("找不到商品");
         }
@@ -210,7 +214,9 @@ public class TOrderController {
         }
         String sn = orderService.initSn(equipmentId);
         //获取分销  关联设备
-        TProportion proportion = R.getDataIfSuccess(szwlFeign.getProportion(String.valueOf(equipmentId)));
+        ResponseModel<TProportion> proportion1 = szwlFeign.getProportion(String.valueOf(equipmentId));
+        TProportion proportion = proportion1.getData();
+//        TProportion proportion = R.getDataIfSuccess(szwlFeign.getProportion(String.valueOf(equipmentId)));
 
         if (proportion == null&&proportion.getId()==null) {
             return JsonMessage.error("设备商家未完成分销设置");
@@ -336,6 +342,7 @@ public class TOrderController {
                 adminProportion = proportion.getAdminProportion();
                 merchantProportion = proportion.getMerchantProportion();
                 personageProportion = proportion.getPersonageProportion();
+                selfProportion = proportion.getProportion();
 
                 orderType = "3";
                 BigDecimal refuseAmount1 = new BigDecimal(0.00);
@@ -529,7 +536,9 @@ public class TOrderController {
             //没有优惠码
         }else {
             //有优惠码,需要对优惠码进行验证
-            TPromoCode tPromoCode = R.getDataIfSuccess(szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString()));
+            ResponseModel<TPromoCode> tPromoCodeResponseModel = szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString());
+            TPromoCode tPromoCode = tPromoCodeResponseModel.getData();
+//            TPromoCode tPromoCode = R.getDataIfSuccess(szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString()));
             promoCode = tPromoCode;
             if (tPromoCode == null||tPromoCode.getId()==null) {
                 //不存在
@@ -742,7 +751,7 @@ public class TOrderController {
                 adminProportion = proportion.getAdminProportion();
                 merchantProportion = proportion.getMerchantProportion();
                 personageProportion = proportion.getPersonageProportion();
-
+                selfProportion = proportion.getProportion();
                 orderType = "3";
                 BigDecimal refuseAmount1 = new BigDecimal(0.00);
                 if(agencyProportion.compareTo(refuseAmount1) == 0||agencyProportion==null){
@@ -934,7 +943,9 @@ public class TOrderController {
             //没有优惠码
         }else {
             //有优惠码,需要对优惠码进行验证
-            TPromoCode tPromoCode = R.getDataIfSuccess(szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString()));
+            ResponseModel<TPromoCode> tPromoCodeResponseModel = szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString());
+            TPromoCode tPromoCode = tPromoCodeResponseModel.getData();
+//            TPromoCode tPromoCode = R.getDataIfSuccess(szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString()));
             promoCode = tPromoCode;
             if (tPromoCode == null||tPromoCode.getId()==null) {
                 //不存在
@@ -1140,6 +1151,7 @@ public class TOrderController {
                 adminProportion = proportion.getAdminProportion();
                 merchantProportion = proportion.getMerchantProportion();
                 personageProportion = proportion.getPersonageProportion();
+                selfProportion = proportion.getProportion();
 
                 orderType = "3";
                 BigDecimal refuseAmount1 = new BigDecimal(0.00);
@@ -1334,7 +1346,7 @@ public class TOrderController {
             // 汇聚支付支付申请返回支付二维码图片
 
 //            String code1 = "http://app.sunzee.com.cn/"+"/api/order/aliPay.htm?wx="+rc_Result1+"&zfb="+rc_Result2;
-            String code1 = "http://szwltest.sunzee.com.cn:49002/PAY-SERVER/tOrder/"+"aliPay?wx="+rc_Result1+"&zfb="+rc_Result2;
+            String code1 = "http://sz.sunzee.com.cn/PAY-SERVER/tOrder/"+"aliPay?wx="+rc_Result1+"&zfb="+rc_Result2;
             String rd_Pic = toQrcode(code1);
             JSONObject kindData = new JSONObject();
             kindData.put("sn", sn1+"-"+sn2);
@@ -1375,7 +1387,9 @@ public class TOrderController {
                     for(String code:value){
                         if(!code.equals("0")){
                             TPromoCode promoCode = new TPromoCode();
-                            TPromoCode tPromoCode = R.getDataIfSuccess(szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString()));
+                            ResponseModel<TPromoCode> tPromoCodeResponseModel = szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString());
+                            TPromoCode tPromoCode = tPromoCodeResponseModel.getData();
+//                            TPromoCode tPromoCode = R.getDataIfSuccess(szwlFeign.selectTPromoCode(code, equipment.getAdminId().toString()));
                             promoCode = tPromoCode;
                             if (tPromoCode == null||tPromoCode.getId()==null) {
                                 //不存在
@@ -2346,13 +2360,14 @@ public class TOrderController {
 //        order.setProductId(product.getId());
 //        order.setProductNo(product.getNo());
         order.setProductName(productName.toString());
-        order.setPrice(price);
+        order.setPrice(cutPrice);
         order.setClientId(equipment.getClientId());
         order.setEquipmentId(equipmentId);
         order.setFrpCode(frpCode1);
         order.setAltInfo(altInfo.toString());
         order.setStatus(0);
         order.setType(type);
+        order.setMarketingAmount(marketingAmount);
         if(couponList.size()>0){
             order.setCoupons(couponList.toString());
         }
@@ -2944,18 +2959,21 @@ public class TOrderController {
 
         return "success";
     }
+
     @ApiOperation(value = "添加订单")
     @PostMapping("/addOrder")
     public ResponseModel<?> addOrder(@RequestBody TOrder order) {
         boolean save = orderService.save(order);
         return R.ok(save);
     }
+
     @ApiOperation(value = "修改订单")
     @PostMapping("/updateOrder")
     public ResponseModel<?> updateOrder(@RequestBody TOrder order) {
         orderService.updateById(order);
         return R.ok();
     }
+
     @ApiOperation(value = "获取订单")
     @GetMapping("/getOrder")
     public ResponseModel<?> getOrder(@RequestParam String id) {

+ 2 - 0
src/main/java/com/szwl/model/entity/TOrder.java

@@ -93,5 +93,7 @@ public class TOrder implements Serializable {
 
     private BigDecimal marketingAmount;
 
+    private BigDecimal refundMarketingAmount;
+
     private String coupons;
 }