Ver código fonte

订单列表bugfix

kaick 1 ano atrás
pai
commit
448e55d5c1

+ 1 - 1
src/main/java/com/caimei/modules/newhome/web/NewPageFloorController.java

@@ -402,7 +402,7 @@ public class NewPageFloorController extends BaseController {
         cleanRedisCache();
         addMessage(redirectAttributes, "保存成功");
         if (floorContent.getFloorId() != null) {
-            return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor/?repage";
+            return "redirect:" + Global.getAdminPath() + "/newhome/newPageFloor?repage";
         } else if (StringUtils.isNotBlank(floorContent.getFormType())) {
             if (floorContent.getRedirectFlag() == 1) {
                 return "redirect:" + Global.getAdminPath() + "/cmpage/cmPageCentre/?pageId=" + floorContent.getPageId() + "&type=" + floorContent.getFormType();

+ 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

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

@@ -1299,8 +1299,11 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
             if (count > 1) {
                 newOrder.setRechargeGoods(3);
             }
+            BigDecimal payTotalFee=new BigDecimal(0);
             if (CollectionUtils.isNotEmpty(shopOrders)) {
                 for (NewShopOrder shopOrder : shopOrders) {
+                     payTotalFee = MathUtil.add(payTotalFee,shopOrder.getRealPay() != null ? shopOrder.getRealPay() : shopOrder.getNeedPayAmount());
+
                     BigDecimal add = MathUtil.add(shopOrder.getReceiptAmount(),cmDiscernReceiptService.findShoOrderIDReceipt(shopOrder.getShopOrderID()));
                     shopOrder.setReceiptAmount(add.doubleValue());
                     BigDecimal sub = MathUtil.sub((shopOrder.getRealPay() != null ? shopOrder.getRealPay() : shopOrder.getNeedPayAmount()).doubleValue()
@@ -1429,6 +1432,7 @@ public class NewOrderService extends CrudService<NewOrderDao, NewOrder> {
                 }
                 newOrder.setNewShopOrders(shopOrders);
             }
+            newOrder.setPayTotalFee(payTotalFee.doubleValue());
             if (CollectionUtils.isNotEmpty(list)) {
                 newOrder.setOrderProduct(list);
                 double freight = 0D;

+ 2 - 2
src/main/resources/mappings/modules/cmpage/CmPageCentreMapper.xml

@@ -198,7 +198,7 @@
 		FROM
 		  new_page_floor_image a
 		  LEFT JOIN product p ON a.productId = p.productID
-		left join cm_organize_product_info copi on copi.productId = p.productID
+		left join cm_organize_product_info copi on copi.productId = p.productID and copi.productId = p.productID  and copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=p.productId)
 		  LEFT JOIN shop s on p.shopID = s.shopID
 		  left join cm_hehe_product chp on a.productId = chp.productId
 		WHERE
@@ -206,7 +206,7 @@
           <if test="type != null and type == '8'">
               and chp.id is not null
           </if>
-		group by p.productID
+		group by a.id
 	</select>
 
 	<select id="findPageTitle" resultType="java.lang.String">

+ 3 - 3
src/main/resources/mappings/modules/hehe/CmHeheCollageMapper.xml

@@ -27,7 +27,7 @@
 		FROM cm_hehe_collage a
 		<include refid="cmHeheCollageJoins"/>
 		WHERE a.id = #{id}
-		group by p.productID
+-- 		group by p.productID
 	</select>
 
 	<select id="findList" resultType="CmHeheCollage">
@@ -50,7 +50,7 @@
 				and s.name like concat('%',#{shopName},'%')
 			</if>
 		</where>
-		group by p.productID
+-- 		group by p.productID
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}
@@ -69,7 +69,7 @@
 		<where>
 
 		</where>
-		group by p.productID
+-- 		group by p.productID
 		<choose>
 			<when test="page !=null and page.orderBy != null and page.orderBy != ''">
 				ORDER BY ${page.orderBy}

+ 4 - 4
src/main/resources/mappings/modules/newhome/NewPageFirstNavigationMapper.xml

@@ -32,8 +32,8 @@
 		<where>
 			a.delFlag = 0
 			<if test="type != null and type != ''">
-				<if test="type == 0 and type ==0">and (a.type = 0 or a.type is null )</if>
-				<if test="type != 0 and type !=0">and a.type = #{type}</if>
+				<if test="type == 0 ">and (a.type = 0 or a.type is null )</if>
+				<if test="type != 0 ">and a.type = #{type}</if>
 			</if>
 		</where>
 		<choose>
@@ -53,8 +53,8 @@
 		<where>
 			a.delFlag = 0
 			<if test="type != null and type != ''">
-				<if test="type == 0 and type ==0">and (a.type = 0 or a.type is null )</if>
-				<if test="type != 0 and type !=0">and a.type = #{type}</if>
+				<if test="type == 0 ">and (a.type = 0 or a.type is null )</if>
+				<if test="type != 0 ">and a.type = #{type}</if>
 			</if>
 
 		</where>

+ 2 - 2
src/main/resources/mappings/modules/newhome/NewPageFloorMapper.xml

@@ -229,10 +229,10 @@
 		FROM
 		  new_page_floor_image a
 		  LEFT JOIN product p ON a.productId = p.productID
-		  left join cm_organize_product_info copi on copi.productId = p.productID
+		  left join cm_organize_product_info copi on copi.productId = p.productID and copi.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=p.productId)
 		WHERE
 		  a.floorId = #{floorId}
-		group by p.productID
+-- 		group by p.productID
 	</select>
 
 	<insert id="insertFloorContent">

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

@@ -226,7 +226,7 @@
         LEFT JOIN club c ON cr.userId = c.userId
         LEFT JOIN cm_offline_collection cof ON a.payType = cof.type
         <where>
-            crr.relationType != 1
+            crr.relationType is null
             <if test="id != null and id != '' and id != 0 ">
                 AND a.id = #{id}
             </if>
@@ -319,7 +319,125 @@
             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 != 1
+            <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">

+ 2 - 2
src/main/resources/mappings/modules/order/CmReturnedPurchaseProductMapper.xml

@@ -33,12 +33,12 @@
 			cs.organizeId as organizeId
 		FROM cm_returned_purchase_product a
 		left join cm_order_product b on a.orderProductID = b.orderProductID
-		left join cm_sku cs on b.skuId = cs.skuId
+		left join cm_sku cs on b.skuId = cs.skuId and cs.organizeId=b.organizeId
 		left join product c on c.productID = a.productID
 		left join shop d on d.shopID = a.shopID
 		<where>
 			  c.groundMall like CONCAT('%', cs.organizeId, '%')
-			and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
+-- 			and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
             <if test="returnedID != null and returnedID != ''">
                 AND a.returnedID = #{returnedID}
             </if>

+ 2 - 2
src/main/resources/mappings/modules/order/OrderMapper.xml

@@ -124,7 +124,7 @@
         co.payableAmount AS payableAmount,
         co.orderTime AS orderTime,
         co.confirmTime AS confirmTime,
-        co.payTotalFee AS payTotalFee,
+        (select sum(IFNULL(realPay,needPayAmount))from cm_shop_order WHERE orderId =co.orderID) AS payTotalFee,
         co.payStatus AS payStatus,
         co.refundType AS refundType,
         co.sendOutStatus AS sendOutStatus,
@@ -1303,7 +1303,7 @@
         FROM cm_order_product cop
                  LEFT JOIN product p ON cop.productID = p.productID
                  left join cm_order co on co.orderID = cop.orderID
-                 left join cm_sku cs on cop.skuId = cs.skuId
+                 left join cm_sku cs on cop.skuId = cs.skuId and cop.organizeID=cs.organizeID
         WHERE cop.shopOrderID = #{shopOrderId}
           AND IF(co.userBeans = 0, 1 = 1, cop.shopid != 998)
         group by p.productID

+ 3 - 2
src/main/resources/mappings/modules/order/OrderProductMapper.xml

@@ -556,12 +556,13 @@
                cs.organizeId      AS organizeId,
                cpo.touchPrice              AS touchPrice
         from cm_order_product cop
-                 left join cm_sku cs on cop.skuId = cs.skuId
+                 left join cm_sku cs on cop.skuId = cs.skuId and cs.organizeId=cop.organizeId
                  left join cm_promotions_order cpo on (cop.orderPromotionsId = cpo.id and cpo.mode = 1)
                  left join product p on p.productID = cop.productID
                  left join cm_order co on co.orderID = cop.orderID
                  left join user u on u.userID = co.userID
-        where cop.shopOrderID = #{shopOrderID}   and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
+        where cop.shopOrderID = #{shopOrderID}
+--           and cs.organizeId=(SELECT SUBSTRING(groundMall, 1, 1)FROM product WHERE productID=cs.productId)
         group by p.productID
     </select>
 

+ 1 - 1
src/main/resources/mappings/modules/user/CmBehaviorRecordMapper.xml

@@ -164,7 +164,7 @@
                 AND p.name like concat('%',#{productName},'%')
             </if>
         </where>
-        group by p.productID
+--         group by p.productID
         ORDER BY accessTime DESC
     </select>
     <select id="pageType" resultType="com.caimei.modules.user.entity.CmPageType">

+ 3 - 3
src/main/resources/mappings/modules/user/NewCmClubMapper.xml

@@ -541,7 +541,7 @@
                 and ccr.reportID=#{reportID}
             </if>
         </where>
-        group by p.productID
+--         group by p.productID
         ORDER BY ADDTIME DESC
         <choose>
             <when test="page !=null and page.orderBy != null and page.orderBy != ''">
@@ -651,7 +651,7 @@
                 and ccr.addTime <![CDATA[  <  ]]> #{endAddTime}
             </if>
         </where>
-        group by p.productID
+--         group by p.productID
         ORDER BY ccr.`addTime` DESC
     </select>
 
@@ -698,7 +698,7 @@
             </if>
             and ccr.remarks IS NOT NULL
         </where>
-        group by p.productID
+--         group by p.productID
         ORDER BY ADDTIME DESC
     </select>
 

+ 1 - 1
src/main/resources/mappings/modules/user/VisitRemarkMapper.xml

@@ -107,7 +107,7 @@
             </if>
             and ccr.remarks IS NOT NULL
         </where>
-        group by p.productID
+--         group by p.productID
         ORDER BY ADDTIME DESC
     </select>
     <select id="findClassName" resultType="java.lang.String">

+ 4 - 1
src/main/webapp/WEB-INF/views/modules/cmpage/cmPageList.jsp

@@ -219,9 +219,12 @@
                 <c:if test="${cmPage.type eq 6}">
                     <a href="${fns:getConfig('wwwServer')}product/activity-${cmPage.id}.html" target="_blank">${fns:getConfig('wwwServer')}product/activity-${cmPage.id}.html</a>
                 </c:if>
-                <c:if test="${cmPage.type eq 7||cmPage.type eq 9}">
+                <c:if test="${cmPage.type eq 7}">
                     <a href="${fns:getConfig('wwwServer')}product/beauty-${cmPage.id}.html" target="_blank">${fns:getConfig('wwwServer')}product/beauty-${cmPage.id}.html</a>
                 </c:if>
+                <c:if test="${cmPage.type eq 9}">
+                    <a href="${fns:getConfig('wwwServer')}quickOperation/operation-${cmPage.id}.html" target="_blank">${fns:getConfig('wwwServer')}quickOperation/operation-${cmPage.id}.html</a>
+                </c:if>
                 <c:if test="${cmPage.type ne 1 && cmPage.type ne 2 && cmPage.type ne 3 && cmPage.type ne 4 && cmPage.type ne 5 && cmPage.type ne 6 && cmPage.type ne 7&& cmPage.type ne 9 }">
                     <a href="${fns:getConfig('wwwServer')}cmpage/info-${cmPage.type}-${cmPage.id}.html" target="_blank">${fns:getConfig('wwwServer')}cmpage/info-${cmPage.type}-${cmPage.id}.html</a>
                 </c:if>

+ 2 - 2
src/main/webapp/WEB-INF/views/modules/newhome/beautyFloorContentForm.jsp

@@ -285,7 +285,7 @@
                         $(".Image4 .cancel-upload").click();
                         $(".Image5 .cancel-upload").click();
                     }
-                    $("#formType").val(7);
+                    $("#formType").val(${floorContent.type});
                     loading('正在提交,请稍等...');
                     form.submit();
                 },
@@ -567,7 +567,7 @@
                             <input class="btn btn-primary" id="showSelectBtn" style="width: 50px"
                                    onclick="showSelect('${ctx}/newhome/newPageFloor/addActivityImage')" value="添加"/>&nbsp;&nbsp;&nbsp;&nbsp;
                             <a class="btn btn-primary"
-                               href="${fns:getConfig('wwwServer')}cmpage/info-7-${floorContent.pageId}.html"
+                               href="${fns:getConfig('wwwServer')}cmpage/info-${floorContent.type}-${floorContent.pageId}.html"
                                target="_blank">一键预览</a>
                             <br><br>
                             <table id="adsImageTable" class="table table-striped table-bordered table-condensed"

+ 17 - 17
src/main/webapp/WEB-INF/views/modules/order/newOrderList.jsp

@@ -229,7 +229,7 @@
         <li>机构</li>
         <li>收货人</li>
         <li>订单来源</li>
-        <li>订单状态</li>
+<%--        <li>订单状态</li>--%>
         <li>收款状态</li>
         <li>付款状态</li>
         <li>发货状态</li>
@@ -238,7 +238,7 @@
         <li>订单金额</li>
         <li>返佣服务费</li>
         <li>下单时间</li>
-        <li>确认时间</li>
+<%--        <li>确认时间</li>--%>
         <li>操作</li>
     </ul>
     <c:forEach items="${page.list}" var="order">
@@ -296,13 +296,13 @@
             </li>
             <li>${order.receiver}</li>
             <li>${fns:getDictLabel(order.orderSource,"bp_orderSource","" )}</li>
-            <li class="sd-li">
-                <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 31 ||order.status eq 32 ||order.status eq 33}">
-                    交易中<br>(${fns:getDictLabel(order.status,"order_detail_status","" )})
-                </c:if>
-                <c:if test="${order.status eq 0 || order.status eq 4 || order.status eq 5 || order.status eq 6 || order.status eq 7}">${fns:getDictLabel(order.status,"order_detail_status","" )}</c:if>
-            </li>
+<%--            <li class="sd-li">--%>
+<%--                <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 31 ||order.status eq 32 ||order.status eq 33}">--%>
+<%--                    交易中<br>(${fns:getDictLabel(order.status,"order_detail_status","" )})--%>
+<%--                </c:if>--%>
+<%--                <c:if test="${order.status eq 0 || order.status eq 4 || order.status eq 5 || order.status eq 6 || order.status eq 7}">${fns:getDictLabel(order.status,"order_detail_status","" )}</c:if>--%>
+<%--            </li>--%>
             <li>
                 <c:if test="${order.receiptStatus == 1}">
                     <font color="red">待收款</font>
@@ -407,14 +407,14 @@
                 </c:if>
             </li>
             <li>${order.orderTime}</li>
-            <li>
-                <c:if test="${empty order.confirmTime}">
-                    ---
-                </c:if>
-                <c:if test="${not empty order.confirmTime}">
-                    ${order.confirmTime}
-                </c:if>
-            </li>
+<%--            <li>--%>
+<%--                <c:if test="${empty order.confirmTime}">--%>
+<%--                    -----%>
+<%--                </c:if>--%>
+<%--                <c:if test="${not empty order.confirmTime}">--%>
+<%--                    ${order.confirmTime}--%>
+<%--                </c:if>--%>
+<%--            </li>--%>
             <li class="operation-wrap">
                 <a href="${ctx}/order/detail?id=${order.orderID}&returnGoodsStutas=${order.returnGoodsStutas}">查看详情</a>
             </li>