Browse Source

第三方付款列表

huangzhiguo 1 year ago
parent
commit
102908044e

+ 2 - 0
src/main/java/com/caimei/modules/order/dao/NewShopOrderDao.java

@@ -31,6 +31,8 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
 
 
     List<NewShopOrder> findListByOrderID(@Param("orderID") Integer orderID);
     List<NewShopOrder> findListByOrderID(@Param("orderID") Integer orderID);
 
 
+    Double getFreightAmount(Integer productId);
+
     Shop getShopOrderId(@Param("shopId") Integer shopId);
     Shop getShopOrderId(@Param("shopId") Integer shopId);
 
 
     List<String> findCommercialCode(@Param("orderID") Integer orderID);
     List<String> findCommercialCode(@Param("orderID") Integer orderID);

+ 10 - 0
src/main/java/com/caimei/modules/order/entity/CmPayShop.java

@@ -69,6 +69,8 @@ public class CmPayShop extends DataEntity<CmPayShop> {
     //  付款账号的类型 0公账, 1私账
     //  付款账号的类型 0公账, 1私账
     private String typeStr;
     private String typeStr;
 
 
+    private Integer redirectType;
+
     public String getRebateFee() {
     public String getRebateFee() {
         return rebateFee;
         return rebateFee;
     }
     }
@@ -460,4 +462,12 @@ public class CmPayShop extends DataEntity<CmPayShop> {
     public void setPaymentType(Integer paymentType) {
     public void setPaymentType(Integer paymentType) {
         this.paymentType = paymentType;
         this.paymentType = paymentType;
     }
     }
+
+    public Integer getRedirectType() {
+        return redirectType;
+    }
+
+    public void setRedirectType(Integer redirectType) {
+        this.redirectType = redirectType;
+    }
 }
 }

+ 3 - 3
src/main/java/com/caimei/modules/order/service/NewOrderService.java

@@ -1341,8 +1341,8 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                         }
                         }
                     }
                     }
                     //拼接运费
                     //拼接运费
-                    Double ColdChina = Double.valueOf(700);
-                    String shopPostFlag = shopOrder.getShopPostFlag()!=null?shopOrder.getShopPostFlag():"-2";
+                    Double ColdChina = newShopOrderDao.getFreightAmount(7578);
+                    String shopPostFlag = shopOrder.getShopPostFlag()!=null?shopOrder.getShopPostFlag():"0";
                     String PostageInfo = null;
                     String PostageInfo = null;
                     if (null != shopOrder.getIsColdChina() && shopOrder.getIsColdChina() == 1) {
                     if (null != shopOrder.getIsColdChina() && shopOrder.getIsColdChina() == 1) {
                         if ("2" == shopOrder.getShopPostFlag()) {
                         if ("2" == shopOrder.getShopPostFlag()) {
@@ -1353,7 +1353,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                             PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 包邮)";
                             PostageInfo = "¥" + ColdChina + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: 包邮)";
                         } else {
                         } else {
                             // 有运费
                             // 有运费
-                            PostageInfo = "¥" + MathUtil.add(shopOrder.getShopPostFee(), ColdChina) + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: ¥" + shopOrder.getShopPostFee() + ")";
+                            PostageInfo = "¥" + shopOrder.getShopPostFee() + "(" + (shopOrder.getIsColdChina() == 1 ? "冷链费: ¥" + ColdChina + "," : "") + "其他: ¥" + MathUtil.sub(shopOrder.getShopPostFee(), ColdChina).doubleValue() + ")";
                         }
                         }
                     } else {
                     } else {
                         PostageInfo = shopPostFlag.equals("2") ? "到付" : shopPostFlag.equals("0") ? "包邮" : "¥" + shopOrder.getShopPostFee();
                         PostageInfo = shopPostFlag.equals("2") ? "到付" : shopPostFlag.equals("0") ? "包邮" : "¥" + shopOrder.getShopPostFee();

+ 6 - 2
src/main/java/com/caimei/modules/order/web/CmPayShopController.java

@@ -1031,7 +1031,11 @@ public class CmPayShopController extends BaseController {
                 addMessage(redirectAttributes, e.getMessage());
                 addMessage(redirectAttributes, e.getMessage());
             }
             }
         }
         }
-        return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/?repage";
+        if (2 == cmPayShop.getRedirectType()) {
+            return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/payList?repage";
+        } else {
+            return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/?repage";
+        }
     }
     }
 
 
     /**
     /**
@@ -1059,7 +1063,7 @@ public class CmPayShopController extends BaseController {
     public String saveShopOtherFee(ChangePayShopOther payShopOther, RedirectAttributes redirectAttributes) {
     public String saveShopOtherFee(ChangePayShopOther payShopOther, RedirectAttributes redirectAttributes) {
         cmPayShopService.saveShopOtherFee(payShopOther);
         cmPayShopService.saveShopOtherFee(payShopOther);
         addMessage(redirectAttributes, "保存成功");
         addMessage(redirectAttributes, "保存成功");
-        return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/";
+        return "redirect:" + Global.getAdminPath() + "/order/cmPayShop/payList";
     }
     }
 
 
     /**
     /**

+ 8 - 0
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -279,6 +279,14 @@
         WHERE a.orderID = #{orderID} ORDER BY a.shopOrderNo DESC
         WHERE a.orderID = #{orderID} ORDER BY a.shopOrderNo DESC
     </select>
     </select>
 
 
+    <select id="getFreightAmount" resultType="java.lang.Double">
+        SELECT ifnull(SUM(cfr.freightAmount), 0)
+        FROM cm_freight_rule cfr
+                 LEFT JOIN cm_freight_template cft ON cft.id = cfr.freightId
+                 LEFT JOIN product p ON p.freightTemplateId = cft.id
+        WHERE productId = #{productId} and cft.delFlag = 0
+    </select>
+
     <select id="getShopOrderId" resultType="com.caimei.modules.product.entity.Shop">
     <select id="getShopOrderId" resultType="com.caimei.modules.product.entity.Shop">
         select shopId, AccountOwnership, bankAccount from shop where shopId = #{shopId}
         select shopId, AccountOwnership, bankAccount from shop where shopId = #{shopId}
     </select>
     </select>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/cmPayFormList.jsp

@@ -230,7 +230,7 @@
 					</c:if>
 					</c:if>
 					<c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
 					<c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
 						<shiro:hasPermission name="order:cmPayShop:rollBack">
 						<shiro:hasPermission name="order:cmPayShop:rollBack">
-							<a class="td-a" href="${ctx}/order/cmPayShop/rollBackApply?id=${cmPayShop.id}"
+							<a class="td-a" href="${ctx}/order/cmPayShop/rollBackApply?id=${cmPayShop.id}&redirectType=1"
 							   onclick="return confirmx('确定要撤销审核流程,重新来过吗?', this.href)">撤销重来</a>
 							   onclick="return confirmx('确定要撤销审核流程,重新来过吗?', this.href)">撤销重来</a>
 						</shiro:hasPermission>
 						</shiro:hasPermission>
 					</c:if>
 					</c:if>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/order/cmPayList.jsp

@@ -227,7 +227,7 @@
                 </c:if>
                 </c:if>
                 <c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
                 <c:if test="${cmPayShop.payType ne '6' && cmPayShop.status == '1'}">
                     <shiro:hasPermission name="order:cmPayShop:rollBack">
                     <shiro:hasPermission name="order:cmPayShop:rollBack">
-                        <a class="td-a" href="${ctx}/order/cmPayShop/rollBackApply?id=${cmPayShop.id}"
+                        <a class="td-a" href="${ctx}/order/cmPayShop/rollBackApply?id=${cmPayShop.id}&redirectType=2"
                            onclick="return confirmx('确定要撤销审核流程,重新来过吗?', this.href)">撤销重来</a>
                            onclick="return confirmx('确定要撤销审核流程,重新来过吗?', this.href)">撤销重来</a>
                     </shiro:hasPermission>
                     </shiro:hasPermission>
                 </c:if>
                 </c:if>

+ 3 - 3
src/main/webapp/WEB-INF/views/modules/order/shopOtherFeeForm.jsp

@@ -226,9 +226,9 @@
 </head>
 </head>
 <body>
 <body>
 <ul class="nav nav-tabs">
 <ul class="nav nav-tabs">
-    <li><a href="${ctx}/order/cmPayShop">付款列表</a></li>
-    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
-    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>
+    <li><a href="${ctx}/order/cmPayShop/payList">付款列表</a></li>
+    <%--<li><a href="${ctx}/shopOrder/payOrderList?operatingMode=1">申请付款</a></li>
+    <li><a href="${ctx}/shopOrder/payOrderList?operatingMode=3">已付款子订单</a></li>--%>
     <li class="active"><a
     <li class="active"><a
             href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${payShopOther.shopOrderId}&payType=${payType}">付第三方</a></li>
             href="${ctx}/order/cmPayShop/shopOtherFeeForm?shopOrderId=${payShopOther.shopOrderId}&payType=${payType}">付第三方</a></li>
 </ul>
 </ul>