huangzhiguo hai 1 ano
pai
achega
2642cff911

+ 3 - 1
src/main/java/com/caimei/modules/order/dao/CmReceiptOrderRelationDao.java

@@ -26,6 +26,8 @@ public interface CmReceiptOrderRelationDao extends CrudDao<CmReceiptOrderRelatio
 
     Double findPayFeeByOrderID(@Param("orderID")String orderID);
 
+    Double findReceiptByShopOrderId(@Param("shopOrderId")String shopOrderId);
+
     List<Integer> toAudit(@Param("orderID")Integer orderID);
 
     CmReceiptOrderRelation findOrderRelation(Integer orderID);
@@ -37,4 +39,4 @@ public interface CmReceiptOrderRelationDao extends CrudDao<CmReceiptOrderRelatio
     String findUserId(Integer orderId);
 
     List<CmReceiptOrderRelation> findByShopOrderIds(@Param("shopOrderIds")List<Integer> shopOrderIds);
-}
+}

+ 4 - 2
src/main/java/com/caimei/modules/order/service/NewShopOrderService.java

@@ -294,10 +294,12 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
             } else {
                 so.setReceiptStatus("1");
             }
+            // 主订单已收金额
             double receiptTotalFee = cmReceiptOrderRelationDao.findPayFeeByOrderID(so.getOrderID().toString());
-
             so.setReceiptTotalFee(receiptTotalFee);
-
+            // 子订单已收金额
+            Double receiptAmount = cmReceiptOrderRelationDao.findReceiptByShopOrderId(so.getShopOrderID().toString());
+            so.setReceiptAmount(MathUtil.add(so.getReceiptAmount(), receiptAmount).doubleValue());
             //第一次收款收款时间
             Date receiptDate = cmReceiptOrderRelationDao.findOnlinePayment(so.getOrderID());
             if (receiptDate != null) {

+ 10 - 0
src/main/resources/mappings/modules/order/CmReceiptOrderRelationMapper.xml

@@ -157,6 +157,16 @@
           AND b.delFlag = '0'
     </select>
 
+    <select id="findReceiptByShopOrderId" resultType="java.lang.Double">
+        select IFNULL(sum(associateAmount), 0)
+        from cm_receipt_order_relation a
+                 left join cm_discern_receipt b on a.receiptID = b.id
+        where a.shopOrderId = #{shopOrderId}
+          AND b.receiptStatus = '3'
+          AND a.delFlag = '0'
+          AND b.delFlag = '0'
+    </select>
+
     <select id="toAudit" resultType="java.lang.Integer">
         SELECT cdr.id
         FROM `cm_receipt_order_relation` cror

+ 3 - 1
src/main/resources/mappings/modules/product/ProductNewMapper.xml

@@ -121,7 +121,9 @@
     </sql>
     <select id="get" resultType="Product">
         SELECT
-        <include refid="productColumns"/>
+        <include refid="productColumns"/>,
+        (select costCheckFlag from cm_organize_product_info where productId = #{id} and organizeId = 0 ) as costCheckFlag,
+        (select costCheckFlag from cm_organize_product_info where productId = #{id} and organizeId = 4 ) as mallCostCheckFlag
         FROM product a
         <include refid="productJoins"/>
         WHERE a.productID = #{id} and  copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=#{id})

+ 50 - 22
src/main/webapp/WEB-INF/views/modules/order/cmPayShopForm.jsp

@@ -416,24 +416,24 @@
                 <table class="table table-striped table-bordered table-condensed pay-table">
                     <tr>
                         <th>子订单编号(ID)</th>
-                        <th colspan="3">客户</th>
-                        <th colspan="2">下单时间</th>
-                        <th>子订单金额</th>
+<%--                        <th colspan="3">客户</th>--%>
+                        <th colspan="3">下单时间</th>
+                        <th colspan="2">子订单金额</th>
 <%--                        <th colspan="3">所有子订单</th>--%>
 <%--                        <th>订单总佣金</th>--%>
                         <th colspan="4">总平台服务费</th>
-                        <th>机构运费</th>
-                        <th>收款状态</th>
+<%--                        <th>机构运费</th>--%>
+                        <th colspan="2">收款状态</th>
                         <th colspan="3">收款金额</th>
-                        <th>经理折扣</th>
-                        <th>优惠券</th>
+                        <th colspan="2">经理折扣</th>
+                        <th colspan="2">优惠券</th>
                     <tr/>
                     <tr>
 <%--                        <td> ${s.orderNo}(${s.orderID})</td>--%>
                         <td>${s.shopOrderNo}(${s.shopOrderID})</td>
-                        <td colspan="3"> ${s.buyer}</td>
-                        <td colspan="2"> ${s.orderTime}</td>
-                        <td>${s.payTotalFee}</td>
+<%--                        <td colspan="3"> ${s.buyer}</td>--%>
+                        <td colspan="3"> ${s.orderTime}</td>
+                        <td colspan="2">${s.totalAmount}</td>
 <%--                        <td colspan="3">--%>
 <%--                        <c:forEach items="${s.shopOrderNos}" var="cs">--%>
 <%--                            ${cs}<br/>--%>
@@ -446,7 +446,7 @@
 <%--                            </c:if>--%>
 <%--                        </td>--%>
                         <td colspan="4"></td>
-                        <td>
+                        <%--<td>
                             <label class="clubFreight"  style="display: none">
                                 <c:choose>
                                     <c:when test="${s.freight != -1 && s.freight != 0 && s.freight != -2 && s.returnedFreightFlag ne true}">
@@ -473,19 +473,19 @@
                             <c:if test="${s.userBeans gt 0}">
                                 (采美豆抵用${s.userBeans})
                             </c:if>
-                        </td>
-                        <td>
+                        </td>--%>
+                        <td colspan="2">
                             <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
                                style="text-decoration: underline">
-                                <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
-                                <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
-                                <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
+                                <c:if test="${s.shopReceiptStatus == 1}"><font color="red">待收款</font></c:if>
+                                <c:if test="${s.shopReceiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
+                                <c:if test="${s.shopReceiptStatus == 3}"><font color="green">已收款</font></c:if></a>
                         </td>
                         <td colspan="3">
                             <a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1"
-                               style="text-decoration: underline">${s.receiptTotalFee}</a>
+                               style="text-decoration: underline">${s.receiptAmount}</a>
                         </td>
-                        <td>
+                        <td colspan="2">
                             <label class="discountFee">
                                 <c:choose>
                                     <c:when test="${s.discountTotalFee gt 0 && s.discountTotalFee gt s.returnedPurchaseTotalFee}">
@@ -518,7 +518,7 @@
                             </c:if>
                             <c:if test="${s.discountTotalFee le 0}">¥0.00</c:if>
                         </td>
-                        <td class="couponAmount">${s.couponAmount} </td>
+                        <td class="couponAmount" colspan="2">${s.couponAmount} </td>
                         <td class="eachDiscount" style="display: none">${s.eachDiscount}</td>
                     <tr/>
                     <tr>
@@ -527,6 +527,7 @@
                         <th colspan="3">子订单利润</th>
                         <th colspan="3">商品费</th>
                         <th>应付税费</th>
+                        <th>机构运费</th>
                         <th>供应商运费</th>
                         <th>付款状态</th>
                         <th colspan="3">付供应商</th>
@@ -544,7 +545,34 @@
                         <td class="taxes">
                             <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                         </td>
-
+                        <td>
+                            <label class="clubFreight"  style="display: none">
+                                <c:choose>
+                                    <c:when test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2 && s.returnedFreightFlag ne true}">
+                                        <fmt:formatNumber value="${s.shopPostFee}"/>
+                                    </c:when>
+                                    <c:otherwise>
+                                        <fmt:formatNumber value="0"/>
+                                    </c:otherwise>
+                                </c:choose>
+                            </label>
+                            <c:if test="${s.shopPostFlag == 0}">
+                                包邮
+                            </c:if>
+                            <c:if test="${s.shopPostFlag == 2}">
+                                到付
+                            </c:if>
+                            <c:if test="${s.shopPostFlag == -2}">
+                                仪器到付-产品包邮
+                            </c:if>
+                            <c:if test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
+                                <fmt:formatNumber value="${s.shopPostFee}" type="currency"/>
+                                <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
+                            </c:if>
+                            <c:if test="${s.userBeans gt 0}">
+                                (采美豆抵用${s.userBeans})
+                            </c:if>
+                        </td>
                         <td class="freight"><fmt:formatNumber value="${s.shopPostFee}" type="number"
                                                               pattern="#,##0.00"/></td>
 
@@ -594,7 +622,7 @@
                         <th>退货</th>
                         <th colspan="2">单价</th>
                         <th colspan="3">机构税率 / 单税费 / 总税费</th>
-                        <th>总价</th>
+                        <th colspan="2">总价</th>
                         <th>利润(单)</th>
                         <th>利润(总)</th>
                         <th>平台服务费</th>
@@ -636,7 +664,7 @@
                                             type="number" pattern="#,##0.00"/>
                                 </c:otherwise>
                             </c:choose></td>
-                            <td><fmt:formatNumber
+                            <td colspan="2"><fmt:formatNumber
                                     value="${((empty p.touchPrice?p.discountPrice:p.touchPrice) + p.addedValueTax)*(p.num+p.presentNum-p.returnedNum)}"
                                     type="number" pattern="#,##0.00"/></td>
                             <td><fmt:formatNumber

+ 11 - 11
src/main/webapp/WEB-INF/views/modules/order/cmPayShopList.jsp

@@ -416,15 +416,15 @@
                 <tr>
                     <td><a href="${ctx}/order/detail?id=${s.orderID}">${s.shopOrderNo}(${s.shopOrderID})</a></td>
                     <td colspan="3"><a href="${ctx}/order/detail?id=${s.orderID}">${s.orderNo}(${s.orderID})</a></td>
-                    <td colspan="2"><fmt:formatNumber value="${s.payTotalFee}" type="number" pattern="#,##0.00"/></td>
+                    <td colspan="2"><fmt:formatNumber value="${s.totalAmount}" type="number" pattern="#,##0.00"/></td>
                     <td colspan="3">${s.orderTime}</td>
                         <%--此处对应订单列表收款状态--%>
                     <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">
-                        <c:if test="${s.receiptStatus == 1}"><font color="red">待收款</font></c:if>
-                        <c:if test="${s.receiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
-                        <c:if test="${s.receiptStatus == 3}"><font color="green">已收款</font></c:if></a>
+                        <c:if test="${s.shopReceiptStatus == 1}"><font color="red">待收款</font></c:if>
+                        <c:if test="${s.shopReceiptStatus == 2}"><font color="#ff8c00">部分收款</font></c:if>
+                        <c:if test="${s.shopReceiptStatus == 3}"><font color="green">已收款</font></c:if></a>
                     </td>
-                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">${s.receiptTotalFee}</a></td>
+                    <td><a href="${ctx}/bulkpurchase/cmRefundsProduct/toRefundRecord.rpc?orderID=${s.orderID}&from=1" style="text-decoration: underline">${s.receiptAmount}</a></td>
                     <td colspan="3">
                         <c:if test="${s.discountTotalFee gt 0}">
                             <c:if test="${s.discountTotalFee gt s.returnedPurchaseTotalFee}">
@@ -471,20 +471,20 @@
                         <c:if test="${s.organizeID eq 1}"><span class="org-note">星范</span></c:if>
                             ${s.clubName}
                         <c:if test="${s.orderType eq 2}"><font color="red">(呵呵商城)</font></c:if>
-                        <c:if test="${s.organizeID == 3}"></c:if>
+                        <c:if test="${s.organizeID == 4}"><font color="red">(丽格集采联盟)</font></c:if>
                     </td>
                     <td>
-                        <c:if test="${s.freight == 0}">
+                        <c:if test="${s.shopPostFlag == 0}">
                             包邮
                         </c:if>
-                        <c:if test="${s.freight == -1}">
+                        <c:if test="${s.shopPostFlag == 2}">
                             到付
                         </c:if>
-                        <c:if test="${s.freight == -2}">
+                        <c:if test="${s.shopPostFlag == -2}">
                             仪器到付-产品包邮
                         </c:if>
-                        <c:if test="${s.freight != -1 && s.freight != 0 && s.freight != -2}">
-                            <fmt:formatNumber value="${s.freight}" type="currency"/>
+                        <c:if test="${s.shopPostFlag != 2 && s.shopPostFlag != 0 && s.shopPostFlag != -2}">
+                            <fmt:formatNumber value="${s.shopPostFee}" type="currency"/>
                             <c:if test="${s.returnedFreightFlag eq true}"><font color="red">(已退)</font></c:if>
                         </c:if>
                         <c:if test="${s.userBeans > 0}">