فهرست منبع

非订单款bugfix

kaick 1 سال پیش
والد
کامیت
f9e910e614

+ 8 - 4
src/main/java/com/caimei/modules/order/service/CmDiscernReceiptService.java

@@ -142,10 +142,14 @@ public class CmDiscernReceiptService extends CrudService<CmDiscernReceiptDao, Cm
         }
 //        vo.setReceiptOrderFlag(receiptOrderFlag);//设置一款多单状态
         List<ReceiptOrderInfoVo> orderInfos = new ArrayList<>(); //一个收款可能会关联了一个或多个订单
-        ReceiptOrderInfoVo receiptOrderInfoVo = cmDiscernReceiptDao.getOrderInfoByShopOrderID(cmDiscernReceipt.getShopOrderId().toString());
-        BigDecimal add = MathUtil.add(receiptOrderInfoVo.getReceiptAmount(),cmDiscernReceiptService.findShoOrderIDReceipt(cmDiscernReceipt.getShopOrderId()));
-        receiptOrderInfoVo.setReceiptAmount(add.toString());
-        orderInfos.add(receiptOrderInfoVo);
+        ReceiptOrderInfoVo receiptOrderInfoVo = null;
+        if(null!=cmDiscernReceipt.getShopOrderId()){
+            receiptOrderInfoVo=cmDiscernReceiptDao.getOrderInfoByShopOrderID(cmDiscernReceipt.getShopOrderId().toString());
+            BigDecimal add = MathUtil.add(receiptOrderInfoVo.getReceiptAmount(),cmDiscernReceiptService.findShoOrderIDReceipt(cmDiscernReceipt.getShopOrderId()));
+            receiptOrderInfoVo.setReceiptAmount(add.toString());
+            orderInfos.add(receiptOrderInfoVo);
+        }
+
 //        for (CmReceiptOrderRelation relation : relations) {
 //            ReceiptOrderInfoVo roi = null; //这是通过订单列表上的一条收款记录对应的多个订单中的一个订单
 //            if ("1".equals(relation.getRelationType())) { // relation.orderID 指的是子订单id

+ 120 - 1
src/main/resources/mappings/modules/order/CmDiscernReceiptMapper.xml

@@ -319,7 +319,126 @@
             and a.delFlag = '0'
         </where>
          group by a.id
-     )) as a order by a.id desc
+     )
+        union
+        (
+        SELECT
+        <include refid="cmDiscernReceiptColumns"/>,
+        cso.orderId AS orderID,
+        cso.shopOrderNo as shopOrderNo,
+        cso.shopOrderId as shopOrderId,
+        cof.bankAccount AS bankNameType,
+        s.checkMan,
+        s.name AS shopName,
+        u.userName AS "userName",
+        u.name AS "name",
+        IF(crr.relationType = '6',(SELECT NAME FROM USER mu WHERE mu.userId=ccb.userId),'') AS "backname",
+        cr.organizeID AS organizeID
+        FROM cm_discern_receipt a
+        LEFT JOIN cm_receipt_order_relation crr ON crr.receiptId = a.id AND crr.delFlag = '0'
+        LEFT JOIN cm_coupon_buyrecord ccb ON crr.couponRecordId=ccb.id
+        LEFT JOIN cm_shop_order cso ON  cso.orderId = crr.orderId
+        LEFT JOIN cm_order cr ON cr.orderId = cso.orderId
+        LEFT JOIN shop s ON s.shopID = cso.shopID
+        left join user u on u.userID = cr.userID
+        LEFT JOIN club c ON cr.userId = c.userId
+        LEFT JOIN cm_offline_collection cof ON a.payType = cof.type
+        <where>
+            crr.relationType is null
+            <if test="id != null and id != '' and id != 0 ">
+                AND a.id = #{id}
+            </if>
+            <if test="organizeID != null and organizeID != 9999 ">
+                AND cr.organizeID = #{organizeID}
+            </if>
+            <if test="organizeID == 9999 ">
+                AND cr.orderType = 2
+            </if>
+            <if test="startTime != null and startTime != ''">
+                AND (a.receiptDate &gt; #{startTime} OR a.receiptDate = #{startTime})
+            </if>
+            <if test="endTime != null and endTime != ''">
+                AND (a.receiptDate &lt; #{endTime} OR a.receiptDate = #{endTime})
+            </if>
+            <if test="payWay != null and payWay != ''">
+                AND a.payWay = #{payWay}
+            </if>
+            <if test="payType != null and payType != ''">
+                AND a.payType = #{payType}
+            </if>
+            <if test="receiptType != null and receiptType != ''">
+                <if test="receiptType==2 and newReceiptType==3">
+                    and (a.receiptType = 9)
+                    or a.receiptType = #{receiptType}
+                </if>
+                <if test="receiptType!=2">
+                    AND a.receiptType = #{receiptType}
+                </if>
+                AND a.receiptType = #{receiptType}
+            </if>
+            <if test="newReceiptType !=null">
+                <if test="newReceiptType==3">
+                    and a.newReceiptType =3
+                </if>
+                <if test="newReceiptType != 3">
+                    and a.newReceiptType=#{newReceiptType}
+                </if>
+            </if>
+
+            <if test="receiptStatus != null and receiptStatus != ''">
+                AND a.receiptStatus = #{receiptStatus}
+            </if>
+            <if test="orderNo != null and orderNo != ''">
+                AND ((cr.orderNo like concat('%',#{orderNo},'%')) OR (cso.shopOrderNo like concat('%',#{orderNo},'%')))
+            </if>
+            <if test="orderID != null and orderID != ''">
+                AND (cr.orderID = #{orderID} )
+            </if>
+            <if test="shopOrderId != null and shopOrderId != ''">
+                AND (cso.shopOrderId = #{shopOrderId} )
+            </if>
+            <if test="userName != null and userName != ''">
+                AND (u.userName LIKE concat('%',#{userName},'%') or u.name LIKE concat('%',#{userName},'%'))
+            </if>
+            <if test="receiptProgress != null and receiptProgress != ''">
+                and (case when crr.relationType = '1' then
+                cso_cr.receiptStatus
+                else
+                cr.receiptStatus
+                end) = #{receiptProgress}
+            </if>
+            <if test="receiptOrderType != null and receiptOrderType != ''">
+                and (case when crr.relationType = '1' then
+                cso.orderType
+                else
+                cr.orderType
+                end) = #{receiptOrderType}
+            </if>
+            <if test="associationNum != null and associationNum != ''">
+                <if test="associationNum == 1">
+                    and (select count(1) from cm_receipt_order_relation where receiptID = a.id and delFlag = '0') = 1
+                </if>
+                <if test="associationNum == 2">
+                    and (select count(1) from cm_receipt_order_relation where receiptID = a.id and delFlag = '0')
+                    <![CDATA[ > ]]> 1
+                </if>
+            </if>
+            <if test="paYee !=null and paYee != ''">
+                <if test="paYee == '采美'">
+                    and a.payWay = 3
+                    OR a.payWay = 2
+                    AND a.newReceiptType != 3 AND a.payWay = 2
+                </if>
+                <if test="payWay==1">
+                    and s.name=#{paYee}
+                </if>
+
+            </if>
+            and a.delFlag = '0'
+        </where>
+        group by a.id
+        )
+) as a order by a.id desc
     </select>
 
     <select id="findAllList" resultType="CmDiscernReceipt">

+ 4 - 2
src/main/webapp/WEB-INF/views/modules/order/cmDiscernReceiptList.jsp

@@ -339,8 +339,10 @@
 <%--                <c:if test="${cmDiscernReceipt.receiptType != 6}">${cmDiscernReceipt.orders}</c:if>--%>
 <%--                <c:if test="${cmDiscernReceipt.receiptType == 6}">-----</c:if>--%>
 <%--                <c:if test="${cmDiscernReceipt.receiptType == 7}">-----</c:if>--%>
-<%--                <c:if test="${cmDiscernReceipt.receiptType == 8}">-----</c:if>--%>
-               <a href="${ctx}/order/detail?id=${cmDiscernReceipt.orderID}&shopOrderID=${cmDiscernReceipt.shopOrderId}">子订单${cmDiscernReceipt.shopOrderNo}(${cmDiscernReceipt.shopOrderId})</a>
+                <c:if test="${cmDiscernReceipt.shopOrderId == null}">-----</c:if>
+                <c:if test="${cmDiscernReceipt.shopOrderId != null}">
+                    <a href="${ctx}/order/detail?id=${cmDiscernReceipt.orderID}&shopOrderID=${cmDiscernReceipt.shopOrderId}">子订单${cmDiscernReceipt.shopOrderNo}(${cmDiscernReceipt.shopOrderId})</a>
+                </c:if>
             </td>
             <shiro:hasPermission name="order:cmDiscernReceipt:edit">
                 <td>