Browse Source

联合丽格 收款列表

kaick 2 years ago
parent
commit
c4b49f1ccb

+ 1 - 1
src/main/java/com/caimei/modules/order/entity/CmDiscernReceipt.java

@@ -59,7 +59,7 @@ public class CmDiscernReceipt extends DataEntity<CmDiscernReceipt> {
     private String orderNo;   //查询用 订单编号
     private String orderID;   //查询用 订单ID
     private String receiptProgress;//	收款进度  1待收  2部分收  3全收
-    private String receiptOrderType;//	订单类型  协销订单0, 普通订单1
+    private String receiptOrderType;//	订单类型  协销订单0, 普通订单1 , 呵呵订单2, 联合丽格订单3
     private String associationNum;//	关联数量  1单个  2多个
     private List<ReceiptExportVo> receiptExportVo; //导出用到的Vo类
     private String userName;//客户名称

+ 4 - 0
src/main/resources/mappings/modules/order/CmPayShopMapper.xml

@@ -72,6 +72,8 @@
 		left join sys_user u1 on u1.id = a.applicant
 		left join sys_user u2 on u2.id = a.reviewer
 		left join shop s on s.shopID = a.shopID
+		LEFT JOIN cm_pay_shop_record psr ON psr.payShopID = a.id
+		LEFT JOIN cm_shop_order so ON so.shopOrderID = psr.shopOrderID
 		<where>
 			<if test="id != null and id != ''">
 				and a.id = #{id}
@@ -122,8 +124,10 @@
 				AND a.id IN(SELECT payShopID FROM cm_pay_shop_record WHERE paymentType = #{paymentType} AND delFlag = 0)
 			</if>
 			and a.delFlag = '0'
+			and (so.organizeID!=4 or so.organizeID is null)
 			and a.shopID != 998
 		</where>
+		GROUP BY a.id
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}

+ 4 - 1
src/main/resources/mappings/modules/order/ShopOrderMapper.xml

@@ -831,8 +831,9 @@
                 and a.payStatus = 3 and co.status NOT IN (6,7)
             </if>
             and co.delFlag = 0
-#             and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
+--              and not (co.secondHandOrderFlag=1 AND co.rebateFlag=1)
             and a.delFlag = 0
+            and (a.organizeID!=4 or a.organizeID is null)
             and a.shopID != 998
             and co.orderID not in (
             SELECT orderID FROM cm_order_product WHERE productID IN
@@ -1140,6 +1141,7 @@
           AND co.orderType != 2
           AND a.delFlag = 0
           AND a.shopID != 998
+          AND (a.organizeID!=4 or a.organizeID is null)
           AND cdr.payWay = 1
           AND cdr.receiptDate <![CDATA[ <= ]]> NOW()
           AND cror.relationType = 2
@@ -1285,6 +1287,7 @@
           AND co.receiptStatus = 3
           AND a.delFlag = 0
           AND a.shopID != 998
+          AND (a.organizeID!=4 or a.organizeID is null)
           AND cdr.payWay = 1
           AND cror.relationType = 2
           AND a.settleStatus in (1,2)

+ 69 - 61
src/main/webapp/WEB-INF/views/modules/order/orderDetail.jsp

@@ -663,54 +663,58 @@
                         <c:if test="${order.status == 11 || order.status == 12 || order.status == 21 || order.status == 22 || order.status == 31 || order.status == 32}">
                             <a href="${ctx}/order/toDeliveryPage?id=${order.orderID}">发货</a>
                         </c:if>
-                        <c:if test="${order.receiptStatus == 2 && order.status != 6 && order.status != 7}">
+                        <c:if test="${order.receiptStatus == 2 && order.status != 6 && order.status != 7&& order.orderType !=3}">
                             <a href="javascript:void(0);" onclick="collection(${order.orderID})">抹平收款</a>
                         </c:if>
                     </c:if>
-                    <c:if test="${order.organizeID == 0}">
-                        <c:if test="${order.status == 0}">
-                            <a href="${ctx}/order/confirmOrder?orderID=${order.orderID}"
-                               onclick="return confirmx('是否确认订单?', this.href)">确认订单</a>
-                        </c:if>
-                        <c:if test="${order.status == 0 || order.status == 11}">
-                            <a href="${ctx}/order/cancelOrder?orderID=${order.orderID}"
-                               onclick="return confirmx('是否取消订单?', this.href)">取消订单</a>
-                        </c:if>
-                        <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||
+                    <c:if test="${order.orderType !=3}">
+                        <c:if test="${order.organizeID == 0}">
+                            <c:if test="${order.status == 0}">
+                                <a href="${ctx}/order/confirmOrder?orderID=${order.orderID}"
+                                   onclick="return confirmx('是否确认订单?', this.href)">确认订单</a>
+                            </c:if>
+                            <c:if test="${order.status == 0 || order.status == 11}">
+                                <a href="${ctx}/order/cancelOrder?orderID=${order.orderID}"
+                                   onclick="return confirmx('是否取消订单?', this.href)">取消订单</a>
+                            </c:if>
+                            <c:if test="${order.status eq 11 || order.status eq 12 || order.status eq 13 ||order.status eq 21 ||order.status eq 22 ||
 				            order.status eq 23 || order.status eq 0}">
-                            <c:if test="${order.rechargeGoods ne 1 && order.rechargeGoods ne 2 && (order.ableUserMoney > 0 || order.status eq 0)}">
-                                <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag != 1}">
-                                    <a href="${ctx}/order/form?id=${order.orderID}">修改订单</a>
+                                <c:if test="${order.rechargeGoods ne 1 && order.rechargeGoods ne 2 && (order.ableUserMoney > 0 || order.status eq 0)}">
+                                    <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag != 1}">
+                                        <a href="${ctx}/order/form?id=${order.orderID}">修改订单</a>
+                                    </c:if>
+                                    <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag == 1}">
+                                        <a href="${ctx}/order/secondeProductOrderForm?id=${order.orderID}">修改订单</a>
+                                    </c:if>
                                 </c:if>
-                                <c:if test="${order.postageOrderFlag == 0 && order.secondHandOrderFlag == 1}">
-                                    <a href="${ctx}/order/secondeProductOrderForm?id=${order.orderID}">修改订单</a>
+                            </c:if>
+                            <c:if test="${order.status == 0}">
+                                <c:if test="${order.postageOrderFlag == 1}">
+                                    <a href="${ctx}/order/postageOrderForm?id=${order.orderID}">修改邮费订单</a>
                                 </c:if>
                             </c:if>
                         </c:if>
-                        <c:if test="${order.status == 0}">
-                            <c:if test="${order.postageOrderFlag == 1}">
-                                <a href="${ctx}/order/postageOrderForm?id=${order.orderID}">修改邮费订单</a>
-                            </c:if>
+                        <c:if test="${(order.organizeID == 0 or order.organizeID > 2) && order.status == 11 && order.payStatus == 1}">
+                            <a href="javascript:void(0);"
+                               onclick="modelShow('${order.orderID}')">编辑经理折扣</a>
                         </c:if>
-                    </c:if>
-                    <c:if test="${(order.organizeID == 0 or order.organizeID > 2) && order.status == 11 && order.payStatus == 1}">
-                        <a href="javascript:void(0);"
-                           onclick="modelShow('${order.orderID}')">编辑经理折扣</a>
-                    </c:if>
 
-                    <c:if test="${order.secondHandOrderFlag ne 1 && order.rebateFlag ne 1 && order.status != 0 && order.status != 6 && order.status != 7 && empty order.rechargeGoods}">
-                        <a href="javascript:void(0);"
-                           onclick="rebateFeeEdit('${order.orderID}')">编辑返佣服务费</a>
-                    </c:if>
+                        <c:if test="${order.secondHandOrderFlag ne 1 && order.rebateFlag ne 1 && order.status != 0 && order.status != 6 && order.status != 7 && empty order.rechargeGoods}">
+                            <a href="javascript:void(0);"
+                               onclick="rebateFeeEdit('${order.orderID}')">编辑返佣服务费</a>
+                        </c:if>
 
-                    <c:if test="${order.orderType != 1 && order.rebateFlag eq 0 && order.receiptStatus eq 1 && order.payStatus eq 1 && order.secondHandOrderFlag ne 1 && order.rechargeGoods ne 1 && order.rechargeGoods ne 3}">
-                        <a href="${ctx}/order/modifyRebate?orderId=${order.orderID}"
-                           onclick="return confirmx('确定将订单转为返佣订单吗?', this.href)">转为返佣订单</a>
-                    </c:if>
-                    <c:if test="${order.orderType != 1 && order.rebateFlag eq 0 && order.receiptStatus eq 1 && order.payStatus eq 1 && order.secondHandOrderFlag eq 1}">
-                        <a href="${ctx}/order/modifyRebate?orderId=${order.orderID}"
-                           onclick="return confirmx('确定将订单转为返佣订单吗?', this.href)">转为二手返佣订单</a>
+                        <c:if test="${order.orderType != 1 && order.rebateFlag eq 0 && order.receiptStatus eq 1 && order.payStatus eq 1 && order.secondHandOrderFlag ne 1 && order.rechargeGoods ne 1 && order.rechargeGoods ne 3}">
+                            <a href="${ctx}/order/modifyRebate?orderId=${order.orderID}"
+                               onclick="return confirmx('确定将订单转为返佣订单吗?', this.href)">转为返佣订单</a>
+                        </c:if>
+                        <c:if test="${order.orderType != 1 && order.rebateFlag eq 0 && order.receiptStatus eq 1 && order.payStatus eq 1 && order.secondHandOrderFlag eq 1}">
+                            <a href="${ctx}/order/modifyRebate?orderId=${order.orderID}"
+                               onclick="return confirmx('确定将订单转为返佣订单吗?', this.href)">转为二手返佣订单</a>
+                        </c:if>
                     </c:if>
+
+
                 </shiro:hasPermission>
                 <shiro:hasPermission name="order:order:applyrefound">
                     <%--线下订单以主订单为单位退款--%>
@@ -742,37 +746,41 @@
                 </shiro:hasPermission>
 
                 <shiro:hasPermission name="order:order:edit">
-                    <c:if test="${(order.rebateOrder == '1' ) && (brokerage == 0) && (order.status != 0)}">
-                        <a href="${ctx}/order/toChangePay?orderId=${order.orderID}"
-                           onclick="return confirmx('确定将该返佣订单直接置为已收款和已付款状态吗?', this.href)">置为已收款已付款</a>
-                    </c:if>
-                    <c:if test="${order.organizeID == 0}">
-                        <c:if test="${order.status == 11}">
-                            <c:if test="${order.splitFlag == 1}">
-                                <a href="${ctx}/order/toSplit?id=${order.orderID}">
-                                    拆分订单
-                                </a>
+                    <c:if test="${order.orderType !=3}">
+                        <c:if test="${(order.rebateOrder == '1' ) && (brokerage == 0) && (order.status != 0)}">
+                            <a href="${ctx}/order/toChangePay?orderId=${order.orderID}"
+                               onclick="return confirmx('确定将该返佣订单直接置为已收款和已付款状态吗?', this.href)">置为已收款已付款</a>
+                        </c:if>
+                        <c:if test="${order.organizeID == 0}">
+                            <c:if test="${order.status == 11}">
+                                <c:if test="${order.splitFlag == 1}">
+                                    <a href="${ctx}/order/toSplit?id=${order.orderID}">
+                                        拆分订单
+                                    </a>
+                                </c:if>
+                            </c:if>
+                            <a href="javascript:" onclick="QRCodewin(${order.orderID},'${order.orderNo}')">分享二维码</a>
+                            <c:if test="${order.status ne 6 && order.status ne 7}">
+                                <a href="${ctx}/order/editclausecontent?id=${order.orderID}">修改售后条款</a>
                             </c:if>
                         </c:if>
-                        <a href="javascript:" onclick="QRCodewin(${order.orderID},'${order.orderNo}')">分享二维码</a>
-                        <c:if test="${order.status ne 6 && order.status ne 7}">
-                            <a href="${ctx}/order/editclausecontent?id=${order.orderID}">修改售后条款</a>
+                        <c:if test="${order.status ne 0}">
+                            <a href="${ctx}/order/printOrder?orderID=${order.orderID}">打印发货单</a>
                         </c:if>
-                    </c:if>
-                    <c:if test="${order.status ne 0}">
-                        <a href="${ctx}/order/printOrder?orderID=${order.orderID}">打印发货单</a>
-                    </c:if>
-                    <a href="${ctx}/order/exportOrder?id=${order.orderID}">订单导出</a>
-                    <%--                        <a href="javascript:void(0);" onclick="remarks('${order.orderID}','')">备注</a>--%>
-                    <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2">订单备注</a>
-                    <c:if test="${order.orderType ==0}" >
-                    <a href="${ctx}/bulkpurchase/commissions?orderId=${order.orderID}">销售提成记录</a>
-                </c:if>
-                    <c:if test="${order.orderType !=0}" >
-                        <c:if test="${order.spID!=null}">
+                        <a href="${ctx}/order/exportOrder?id=${order.orderID}">订单导出</a>
+                        <%--                        <a href="javascript:void(0);" onclick="remarks('${order.orderID}','')">备注</a>--%>
+                        <a href="${ctx}/order/cmOrderRemark/remarksViewNew.rpc?orderID=${order.orderID}&source=2">订单备注</a>
+                        <c:if test="${order.orderType ==0}">
                             <a href="${ctx}/bulkpurchase/commissions?orderId=${order.orderID}">销售提成记录</a>
                         </c:if>
+                        <c:if test="${order.orderType !=0}">
+                            <c:if test="${order.spID!=null}">
+                                <a href="${ctx}/bulkpurchase/commissions?orderId=${order.orderID}">销售提成记录</a>
+                            </c:if>
+                        </c:if>
                     </c:if>
+
+
                     <%--包含订单充值商品就不显示--%>
                     <c:if test="${order.rechargeGoods ne 1 and order.rechargeGoods ne 2}">
                         <c:if test="${order.status ne 0 && order.status ne 11 && order.status ne 21 && order.status ne 6}">