zhijiezhao 1 år sedan
förälder
incheckning
222d9f53a3

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

@@ -200,4 +200,6 @@ public interface NewShopOrderDao extends CrudDao<NewShopOrder> {
     void updateStatus(NewShopOrder shopOrder);
 
     OtherFeeDto findCmProfit(Integer shopOrderId);
+
+    List<NewShopOrder> findByShopOrderIDsNot(List<String> ids);
 }

+ 8 - 0
src/main/java/com/caimei/modules/order/entity/CmPayShopRecord.java

@@ -11,6 +11,14 @@ import org.hibernate.validator.constraints.Length;
 public class CmPayShopRecord extends DataEntity<CmPayShopRecord> {
 
     private static final long serialVersionUID = 1L;
+    /**
+     * 付第三方采美支付方式
+     */
+    private Integer cmOtherPayType;
+    /**
+     * 付第三方采美支付时间
+     */
+    private String cmOtherPayTime;
     /**
      * 采美银行账户
      */

+ 25 - 27
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -260,8 +260,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             //付款单待付供应商总金额
             double totalAmount = 0D;
             for (NewShopOrder so : payOrderList) {
-                totalAmount += ((so.getShouldPayShopAmount() == null ? 0D : so.getShouldPayShopAmount()) -
-                        (so.getPayedShopAmount() == null ? 0D : so.getPayedShopAmount()));
+                totalAmount += ((so.getShouldPayShopAmount() == null ? 0D : so.getShouldPayShopAmount()) - (so.getPayedShopAmount() == null ? 0D : so.getPayedShopAmount()));
                 if (so.getDifferenceType() != null && so.getDifferenceType() == 1) {
                     totalAmount = MathUtil.add(totalAmount, so.getDifferencePrice()).doubleValue();
                 } else if (so.getDifferenceType() != null && so.getDifferenceType() == 2) {
@@ -801,7 +800,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 double v = null == cmPayShop.getCmShopOtherFee() ? 0 : cmPayShop.getCmShopOtherFee();
                 shopOrder.setCmShopOtherFee(v);
                 shopOrder.setPayedShopAmount(shopOrder.getPayedShopAmount() == null ? 0D : MathUtil.add(shopOrder.getPayedShopAmount(), MathUtil.sub(record.getPayAmount(), shopOrder.getShopOtherFee())).doubleValue());
-                shopOrder.setPaying("0"); //退出付款进行状态
+                //退出付款进行状态
+                shopOrder.setPaying("0");
                 newShopOrderDao.update(shopOrder);
                 record.setStatus("1");
                 record.setPayTime(DateUtils.formatDateTime(new Date()));
@@ -816,8 +816,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                         break;
                     }
                 }
-                if (f) //所有的子订单都是全部付款
-                {
+                //所有的子订单都是全部付款
+                if (f) {
                     newOrderDao.updatePayStatus("3", shopOrder.getOrderID());
                 } else {
                     newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
@@ -834,11 +834,14 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 record.setStatus("1");
                 record.setPayTime(DateUtils.formatDateTime(new Date()));
                 record.setPayType(cmPayShop.getPayType());
+                record.setCmOtherPayType(cmPayShop.getCmOtherPayType());
+                record.setCmOtherPayTime(DateUtils.formatDateTime(new Date()));
                 cmPayShopRecordDao.update(record);
             });
             cmPayShop.setReviewer(currentUser.getId());
             cmPayShop.setReviewTime(DateUtils.getDateTime());
             cmPayShop.setPayTime(DateUtils.getDateTime());
+            cmPayShop.setCmOtherPayTime(DateUtils.getDateTime());
             cmPayShop.setStatus("1");
             cmPayShopDao.update(cmPayShop);
             Integer shopOrderId = Integer.valueOf(records.get(0).getShopOrderID());
@@ -945,10 +948,11 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                             break;
                         }
                     }
-                    if (f)
+                    if (f) {
                         newOrderDao.updatePayStatus("1", shopOrder.getOrderID());
-                    else
+                    } else {
                         newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
+                    }
                 } else if (shopOrder.getPayedShopAmount() > 0D) {
                     // 本次付款金额 + 原来已经付过的金额  近似于 总共要付的金额相等
                     shopOrder.setPayStatus("2");
@@ -957,7 +961,8 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                     logger.info("rollBackApply ----> 付款金额异常, 付款金额大于待付款金额");
                     throw new Exception("付款金额异常, 退款金额大于已付款金额");
                 }
-                shopOrder.setPaying("1"); //进入付款进行状态
+                //进入付款进行状态
+                shopOrder.setPaying("1");
                 newShopOrderDao.update(shopOrder);
                 record.setStatus("0");
                 record.setPayTime(DateUtils.formatDateTime(new Date()));
@@ -974,11 +979,12 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                         break;
                     }
                 }
-                if (f) //所有的子订单都是没有付款
+                if (f) {
+                    //所有的子订单都是没有付款
                     newOrderDao.updatePayStatus("1", shopOrder.getOrderID());
-                else
+                } else {
                     newOrderDao.updatePayStatus("2", shopOrder.getOrderID());
-
+                }
             }
             cmPayShop.setStatus("0");
             cmPayShop.setPayTime(null);
@@ -1074,6 +1080,10 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
 
     @Transactional(readOnly = false)
     public void saveShopOtherFee(ChangePayShopOther payShopOther) {
+        OtherFeeDto otherFeeDto = newShopOrderDao.findCmProfit(payShopOther.getShopOrderId());
+        if (1 != otherFeeDto.getCmAccountType() || 0 == payShopOther.getOtherFeeFlag()) {
+            payShopOther.setCmShopOtherFee(0d);
+        }
         /**
          * payType = 2为线上付第三方,创建付款单,无付款银行,开户行,帐号
          * 生成的记录,审核人/审核时间/审核状态,分别置为:系统自动/同申请时间/审核通过
@@ -1107,12 +1117,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             status = "1";
             //已付第三方金额
             BigDecimal shopOtherFee = cmPayShopRecordDao.findPayShopOtherFee(payShopOther.getShopOrderId());
-            OtherFeeDto cmProfit = newShopOrderDao.findCmProfit(payShopOther.getShopOrderId());
-            Double profit = 0d;
-            if (1 == cmProfit.getCmAccountType()) {
-                profit = cmProfit.getCmProfit();
-            }
-            newShopOrderDao.updateByShopOtherFee(profit, MathUtil.add(shopOtherFee, payShopOther.getShopOtherFee()), payShopOther.getShopOrderId());
+            newShopOrderDao.updateByShopOtherFee(null, MathUtil.add(shopOtherFee, payShopOther.getShopOtherFee()), payShopOther.getShopOrderId());
         } else {
             payShop.setBankAccountName(payShopOther.getBankAccountName());
             payShop.setBankAccount(payShopOther.getBankAccount());
@@ -1374,8 +1379,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             //付款单待付供应商总金额
             double totalAmount = 0D;
             for (NewShopOrder so : payOrderList) {
-                totalAmount += ((so.getShouldPayShopAmount() == null ? 0D : so.getShouldPayShopAmount()) -
-                        (so.getPayedShopAmount() == null ? 0D : so.getPayedShopAmount()));
+                totalAmount += ((so.getShouldPayShopAmount() == null ? 0D : so.getShouldPayShopAmount()) - (so.getPayedShopAmount() == null ? 0D : so.getPayedShopAmount()));
                 if (so.getDifferenceType() != null && so.getDifferenceType() == 1) {
                     totalAmount = MathUtil.add(totalAmount, so.getDifferencePrice()).doubleValue();
                 } else if (so.getDifferenceType() != null && so.getDifferenceType() == 2) {
@@ -1475,11 +1479,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
                 if (null != cmReportingClubById) {
                     //分销团队分账号
                     split = cmReportingClubById.splitCode();
-                    cmReportingClubMapper.updateCmReportingClub(new CmReportingClub()
-                            .id(cmReportingClubById.id())
-                            .splitSettleStatus(3)
-                            .splitSettleTime(new Date())
-                    );
+                    cmReportingClubMapper.updateCmReportingClub(new CmReportingClub().id(cmReportingClubById.id()).splitSettleStatus(3).splitSettleTime(new Date()));
                 } else {
                     logger.info("分销订单分账结算异常,子订单Id:" + shopOrderId + ">>>>!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
                     return;
@@ -1506,9 +1506,7 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
         sPara.put("P5_summary", "订单结算");
         sPara.put("signType", "RSA");
         StringBuffer sb = new StringBuffer();
-        sb.append(Constant.SPLIT).append("MerchantSettlement").append(Constant.SPLIT).append(P2_orderId).append(Constant.SPLIT)
-                .append(P3_customerNumber).append(Constant.SPLIT).append(settleAmount).append(Constant.SPLIT).append("订单结算")
-                .append(Constant.SPLIT).append("RSA");
+        sb.append(Constant.SPLIT).append("MerchantSettlement").append(Constant.SPLIT).append(P2_orderId).append(Constant.SPLIT).append(P3_customerNumber).append(Constant.SPLIT).append(settleAmount).append(Constant.SPLIT).append("订单结算").append(Constant.SPLIT).append("RSA");
         String sign = RSA.sign(sb.toString(), RSA.getPrivateKey(Constant.signKey_setttlement));
         sPara.put("sign", sign);
         logger.info("发送结算参数-----------------------》" + sPara);

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

@@ -482,7 +482,7 @@ public class NewShopOrderService extends CrudService<NewShopOrderDao, NewShopOrd
         if (StringUtils.isNotBlank(shopOrderID)) {
             List<String> ids = new ArrayList<>();
             ids.add(shopOrderID);
-            List<NewShopOrder> csos = newShopOrderDao.findByShopOrderIDs(ids);
+            List<NewShopOrder> csos = newShopOrderDao.findByShopOrderIDsNot(ids);
             NewShopOrder shopOrder = csos.get(0);
             //统计该子订单的主的收款金额和收款状态
             NewOrder newOrder = newOrderDao.get(shopOrder.getOrderID().toString());

+ 46 - 15
src/main/resources/mappings/modules/order/CmPayShopRecordMapper.xml

@@ -116,18 +116,28 @@
 
     <update id="update">
         UPDATE cm_pay_shop_record
-        SET shopID      = #{shopID},
-            shopOrderID = #{shopOrderID},
-            shopOrderNo = #{shopOrderNo},
-            payAmount   = #{payAmount},
-            wipePayment = #{wipePayment},
-            payType     = #{payType},
-            payTime     = #{payTime},
-            wipeTime    = #{wipeTime},
-            payShopID   = #{payShopID},
-            status      = #{status},
-            payCmAmount = #{payCmAmount},
-            delFlag     = #{delFlag}
+        SET shopID = #{shopID},
+        shopOrderID = #{shopOrderID},
+        shopOrderNo = #{shopOrderNo},
+        payAmount = #{payAmount},
+        wipePayment = #{wipePayment},
+        <if test="payType != null and payType !=''">
+            payType = #{payType},
+        </if>
+        <if test="cmOtherPayType != null and cmOtherPayType !=''">
+            cmOtherPayType = #{cmOtherPayType},
+        </if>
+        <if test="payTime != null and payTime !=''">
+            payTime = #{payTime},
+        </if>
+        <if test="cmOtherPayTime != null and cmOtherPayTime !=''">
+            cmOtherPayTime = #{cmOtherPayTime},
+        </if>
+        wipeTime = #{wipeTime},
+        payShopID = #{payShopID},
+        status = #{status},
+        payCmAmount = #{payCmAmount},
+        delFlag = #{delFlag}
         WHERE id = #{id}
     </update>
 
@@ -141,6 +151,9 @@
         SELECT
         f.bankAccount AS "bankNameType",
         cf.bankAccount as "cmBankNameType",
+        a.payCmAmount,
+        a.cmOtherPayType,
+        a.cmOtherPayTime,
         <include refid="cmPayShopRecordColumns"/>
         FROM cm_pay_shop_record a
         LEFT JOIN cm_offline_collection f ON a.payType = f.type
@@ -261,19 +274,37 @@
 
     <update id="applyCompileSave" parameterType="com.caimei.modules.order.entity.CmPayShop">
         UPDATE cm_pay_shop
-        SET payType        = #{payType},
-            payTime        = #{payTime},
+        SET
+        <if test="payType != null and payType !=''">
+            payType = #{payType},
+        </if>
+        <if test="payTime != null and payTime !=''">
+            payTime = #{payTime},
+        </if>
+        <if test="cmOtherPayType != null and cmOtherPayType !=''">
             cmOtherPayType = #{cmOtherPayType},
+        </if>
+        <if test="cmOtherPayTime != null and cmOtherPayTime !=''">
             cmOtherPayTime = #{cmOtherPayTime}
+        </if>
         WHERE id = #{id}
     </update>
 
     <update id="applyCompileRecordSave">
         update cm_pay_shop_record
-        SET payType = #{payType},
+        SET
+        <if test="payType != null and payType !=''">
+            payType = #{payType},
+        </if>
+        <if test="payTime != null and payTime !=''">
             payTime = #{payTime},
+        </if>
+        <if test="cmOtherPayType != null and cmOtherPayType !=''">
             cmOtherPayType = #{cmOtherPayType},
+        </if>
+        <if test="cmOtherPayTime != null and cmOtherPayTime !=''">
             cmOtherPayTime = #{cmOtherPayTime}
+        </if>
         WHERE payShopID = #{id}
     </update>
 

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

@@ -1123,12 +1123,103 @@
     </select>
 
     <select id="findByShopOrderIDs" resultType="newShopOrder">
-        select distinct<include refid="shopOrderColumns"/>,
+        select distinct
+        co.rebateFee as rebateFee,
+        co.userBeans as userBeans,
+        a.shopOrderID AS shopOrderID,
+        a.shopStatus AS status,
+        a.shopPostFlag AS shopPostFlag,
+        a.orderID AS orderID,
+        a.organizeID AS organizeID,
+        a.shopOrderNo AS  shopOrderNo,
+        a.orderNo AS  orderNo,
+        a.userID  AS userID,
+        a.shopID  AS shopID,
+        a.isColdChina  AS isColdChina,
+        a.itemCount  AS itemCount,
+        a.townID  AS townID,
+        a.productAmount  AS productAmount,
+        a.discountAmount AS  discountAmount,
+        a.accountAmount AS  accountAmount,
+        a.totalAmount AS  totalAmount,
+        a.payFlag  AS payFlag,
+        a.payTime  AS payTime,
+        a.finishTime AS finishTime,
+        a.refundStatus AS  refundStatus,
+        a.needPayAmount AS  needPayAmount,
+        a.splitCode,
+        ifnull(a.realPay, a.needPayAmount) AS realPay,
+        a.eachDiscount AS eachDiscount,
+        IFNULL((SELECT SUM(cror.associateAmount)
+        FROM cm_receipt_order_relation cror
+        LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
+        WHERE cror.shopOrderId = a.shopOrderId
+        AND cror.relationType = '2'
+        AND cdr.receiptType = 1
+        AND cdr.delFlag = 0
+        AND cror.delFlag = 0
+        AND cdr.receiptStatus IN (2, 3)
+        AND cdr.payWay != 3)
+        , 0) AS receiptAmount,
+        (ifnull(a.realPay,a.needPayAmount) - ifnull(a.receiptAmount,0)) as restAmount,
+        a.receiptStatus as shopReceiptStatus,
+        a.receiptStatus as ReceiptStatus,
+        a.canRefundAmount AS  canRefundAmount,
+        a.refundAmount AS  refundAmount,
+        a.clubID  AS clubID,
+        a.spID AS  spID,
+        a.mainSpID  AS mainSpID,
+        a.orderBeanAmount AS  orderBeanAmount,
+        a.useBeanAmount AS  useBeanAmount,
+        a.useBeanFlag AS  useBeanFlag,
+        a.canRefundFlag AS  canRefundFlag,
+        a.useBalanceFlag  AS useBalanceFlag,
+        a.canRefundBeans AS  canRefundBeans,
+        a.freePostageFee AS  freePostageFee,
+        a.freePostageTicketID  AS freePostageTicketID,
+        a.brokerage  AS brokerage,
+        a.delFlag  AS delFlag,
+        a.refundsAmount  AS refundsAmount,
+        a.orderStatusFlag  AS orderStatusFlag,
+        a.buyStatus AS buyStatus,
+        a.orderSubmitType AS orderSubmitType,
+        a.orderType AS orderType,
+        a.orderTime AS orderTime,
+        a.deliveryTimeMills AS deliveryTimeMills,
+        a.presentNum AS presentNum,
+        a.preferential AS preferential,
+        a.outStoreNum AS outStoreNum,
+        IFNULL(a.outStoreTimes, 0) AS outStoreTimes,
+        a.splitFlag AS splitFlag,
+        a.autoReceiveTimeMills AS autoReceiveTimeMills,
+        a.autoOverTimeMills AS autoOverTimeMills,
+        a.receiveGoodsTime AS receiveGoodsTime,
+        a.totalAddedValueTax AS totalAddedValueTax,
+        a.note AS note,
+        a.payStatus AS payStatus,
+        a.sendOutStatus AS sendOutStatus,
+        a.shopProductAmount AS shopProductAmount,
+        ifnull(a.shopPostFee, 0) AS shopPostFee,
+        ifnull(a.shopTaxFee,0) AS shopTaxFee,
+        a.shouldPayShopAmount AS shouldPayShopAmount,
+        a.payedShopAmount AS payedShopAmount,
+        a.paying AS paying,
+        a.costType AS costType,
+        a.settleStatus AS settleStatus,
+        a.modifyShouldPayNote AS modifyShouldPayNote,
+        a.orderPromotionsId AS orderPromotionsId,
+        a.differenceType AS differenceType,
+        a.differencePrice AS differencePrice,
+        a.proportional AS proportional,
+        ifnull(a.promotionFullReduction, 0) As promotionFullReduction,
+        ifnull(a.couponAmount, 0) As couponAmount,
+        a.zeroCostFlag AS zeroCostFlag,
         co.payTotalFee AS payTotalFee,
         co.promotionFullReduction AS promotionFullReduction,
         a.onlinePayWays,
         ifnull(a.cmAccountType,0) as cmAccountType,
-        ifnull(a.cmShopOtherFee,0) as cmShopOtherFee,
+        ifnull(IF(cpsr.status!=1 AND paymentType=3,cpsr.payAmount,a.shopOtherFee), 0) AS shopOtherFee,
+        ifnull(IF(cpsr.status!=1 AND paymentType=3,cpsr.payCmAmount,a.cmShopOtherFee),0) AS cmShopOtherFee,
         ifnull(a.supplierFreight,0) as supplierFreight,
         ifnull(a.rebateOrder,0) as rebateOrder,
         bou.name AS buyer,
@@ -2577,6 +2668,123 @@
         where acso.shopOrderId = #{shopOrderId}
     </select>
 
+    <select id="findByShopOrderIDsNot" resultType="com.caimei.modules.order.entity.NewShopOrder">
+            select distinct
+            co.rebateFee as rebateFee,
+            co.userBeans as userBeans,
+            a.shopOrderID AS shopOrderID,
+            a.shopStatus AS status,
+            a.shopPostFlag AS shopPostFlag,
+            a.orderID AS orderID,
+            a.organizeID AS organizeID,
+            a.shopOrderNo AS  shopOrderNo,
+            a.orderNo AS  orderNo,
+            a.userID  AS userID,
+            a.shopID  AS shopID,
+            a.isColdChina  AS isColdChina,
+            a.itemCount  AS itemCount,
+            a.townID  AS townID,
+            a.productAmount  AS productAmount,
+            a.discountAmount AS  discountAmount,
+            a.accountAmount AS  accountAmount,
+            a.totalAmount AS  totalAmount,
+            a.payFlag  AS payFlag,
+            a.payTime  AS payTime,
+            a.finishTime AS finishTime,
+            a.refundStatus AS  refundStatus,
+            a.needPayAmount AS  needPayAmount,
+            a.splitCode,
+            ifnull(a.realPay, a.needPayAmount) AS realPay,
+            a.eachDiscount AS eachDiscount,
+            IFNULL((SELECT SUM(cror.associateAmount)
+            FROM cm_receipt_order_relation cror
+            LEFT JOIN cm_discern_receipt cdr ON cror.receiptID = cdr.id
+            WHERE cror.shopOrderId = a.shopOrderId
+            AND cror.relationType = '2'
+            AND cdr.receiptType = 1
+            AND cdr.delFlag = 0
+            AND cror.delFlag = 0
+            AND cdr.receiptStatus IN (2, 3)
+            AND cdr.payWay != 3)
+            , 0) AS receiptAmount,
+            (ifnull(a.realPay,a.needPayAmount) - ifnull(a.receiptAmount,0)) as restAmount,
+            a.receiptStatus as shopReceiptStatus,
+            a.receiptStatus as ReceiptStatus,
+            a.canRefundAmount AS  canRefundAmount,
+            a.refundAmount AS  refundAmount,
+            a.clubID  AS clubID,
+            a.spID AS  spID,
+            a.mainSpID  AS mainSpID,
+            a.orderBeanAmount AS  orderBeanAmount,
+            a.useBeanAmount AS  useBeanAmount,
+            a.useBeanFlag AS  useBeanFlag,
+            a.canRefundFlag AS  canRefundFlag,
+            a.useBalanceFlag  AS useBalanceFlag,
+            a.canRefundBeans AS  canRefundBeans,
+            a.freePostageFee AS  freePostageFee,
+            a.freePostageTicketID  AS freePostageTicketID,
+            a.brokerage  AS brokerage,
+            a.delFlag  AS delFlag,
+            a.refundsAmount  AS refundsAmount,
+            a.orderStatusFlag  AS orderStatusFlag,
+            a.buyStatus AS buyStatus,
+            a.orderSubmitType AS orderSubmitType,
+            a.orderType AS orderType,
+            a.orderTime AS orderTime,
+            a.deliveryTimeMills AS deliveryTimeMills,
+            a.presentNum AS presentNum,
+            a.preferential AS preferential,
+            a.outStoreNum AS outStoreNum,
+            IFNULL(a.outStoreTimes, 0) AS outStoreTimes,
+            a.splitFlag AS splitFlag,
+            a.autoReceiveTimeMills AS autoReceiveTimeMills,
+            a.autoOverTimeMills AS autoOverTimeMills,
+            a.receiveGoodsTime AS receiveGoodsTime,
+            a.totalAddedValueTax AS totalAddedValueTax,
+            a.note AS note,
+            a.payStatus AS payStatus,
+            a.sendOutStatus AS sendOutStatus,
+            a.shopProductAmount AS shopProductAmount,
+            ifnull(a.shopPostFee, 0) AS shopPostFee,
+            ifnull(a.shopTaxFee,0) AS shopTaxFee,
+            a.shouldPayShopAmount AS shouldPayShopAmount,
+            a.payedShopAmount AS payedShopAmount,
+            a.paying AS paying,
+            a.costType AS costType,
+            a.settleStatus AS settleStatus,
+            a.modifyShouldPayNote AS modifyShouldPayNote,
+            a.orderPromotionsId AS orderPromotionsId,
+            a.differenceType AS differenceType,
+            a.differencePrice AS differencePrice,
+            a.proportional AS proportional,
+            ifnull(a.promotionFullReduction, 0) As promotionFullReduction,
+            ifnull(a.couponAmount, 0) As couponAmount,
+            a.zeroCostFlag AS zeroCostFlag,
+            co.payTotalFee AS payTotalFee,
+            co.promotionFullReduction AS promotionFullReduction,
+            a.onlinePayWays,
+            ifnull(a.cmAccountType,0) as cmAccountType,
+            ifnull(a.shopOtherFee, 0) AS shopOtherFee,
+            ifnull(a.cmShopOtherFee,0) AS cmShopOtherFee,
+            ifnull(a.supplierFreight,0) as supplierFreight,
+            ifnull(a.rebateOrder,0) as rebateOrder,
+            bou.name AS buyer,
+            s.name AS shopName,
+            c.name AS clubName
+            from cm_shop_order a
+            left join cm_pay_shop_record cpsr on a.shopOrderID = cpsr.shopOrderID
+            left join bp_order_userinfo bou on bou.orderId = a.orderID
+            left join cm_order co on co.orderID = a.orderID
+            left join shop s on s.shopID = a.shopID
+            left join club c on c.userID = a.userID
+            <if test="shopOrderIDs != null and shopOrderIDs.size() > 0">
+                where a.shopOrderID in
+                <foreach collection="shopOrderIDs" separator="," item="shopOrderID" open="(" close=")">
+                    #{shopOrderID}
+                </foreach>
+            </if>
+    </select>
+
     <insert id="addCmShopOrder" parameterType="com.caimei.modules.order.entity.NewShopOrder" useGeneratedKeys="true"
             keyProperty="shopOrderID">
         insert into cm_shop_order

+ 6 - 39
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp

@@ -566,7 +566,8 @@
         </c:forEach>
     </div>
     <div class="payment-form-bottom">
-        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;">
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;
+                ${empty cmPayShop.shopOrders[0].shopOtherFee or cmPayShop.shopOrders[0].shopOtherFee eq 0 ? 'display:none':''}">
             <div>
                 <label>第三方中介费:</label>
                 <span>${cmPayShop.shopOrders[0].shopOtherFee}</span>
@@ -592,7 +593,8 @@
             </c:if>
         </div>
         <br/>
-        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;${empty cmPayShop.shopOrders[0].cmShopOtherFee or cmPayShop.shopOrders[0].cmShopOtherFee eq 0 ? 'display:none':''}">
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;
+        ${empty cmPayShop.shopOrders[0].cmShopOtherFee or cmPayShop.shopOrders[0].cmShopOtherFee eq 0 ? 'display:none':''}">
             <div>
                 <label>采美中介费:</label>
                 <span>${cmPayShop.shopOrders[0].cmShopOtherFee}</span>
@@ -615,41 +617,6 @@
                 <label>付款时间:</label>
                 <span>${cmPayShop.cmOtherPayTime}</span>
             </div>
-
-            <%--            <div>--%>
-            <%--                <label><em class="required">* </em>付款账号:</label>--%>
-            <%--                <c:if test="${cmPayShop.cmOtherPayType eq '6'}">--%>
-            <%--                    无--%>
-            <%--                </c:if>--%>
-            <%--                <c:if test="${cmPayShop.cmOtherPayType ne '6'}">--%>
-            <%--                    <span>户名:${cmPayShop.cmBankAccountName}</span>--%>
-            <%--                    <span>账号:${cmPayShop.cmBankAccount}</span>--%>
-            <%--                    <span>开户行:${cmPayShop.cmBankName}</span>--%>
-            <%--                    <span>账户类型:--%>
-            <%--        						<c:if test="${cmPayShop.cmType == '0'}">公帐</c:if>--%>
-            <%--        						<c:if test="${cmPayShop.cmType == '1'}">私帐</c:if>--%>
-            <%--        					</span>--%>
-            <%--                </c:if>--%>
-            <%--            </div>--%>
-            <%--            <c:if test="${cmPayShop.cmOtherPayType ne '6'}">--%>
-            <%--                <div>--%>
-            <%--                    <label style="font-weight: bold; font-size:18px">转账支付:</label>--%>
-            <%--                    <span id="transferAmount" style="font-weight: bold; font-size:18px"><fmt:formatNumber--%>
-            <%--                            value="${cmPayShop.cmShopOtherFee + cmPayShop.totalAmount}" pattern="#,##0.00"/></span>--%>
-            <%--                    <c:if test="${cmPayShop.status != '2'}">--%>
-            <%--                        <c:if test="${not empty cmPayShop.cmOtherPayType }">--%>
-            <%--                            <label>付款银行:</label>--%>
-            <%--                            <span id="payType">--%>
-            <%--                                    ${cmPayShop.cmBankNameType}--%>
-            <%--                            </span>--%>
-            <%--                        </c:if>--%>
-            <%--                        <c:if test="${cmPayShop.status != '0'}">--%>
-            <%--                            <label>付款时间:</label>--%>
-            <%--                            <span>${cmPayShop.cmOtherPayTime}</span>--%>
-            <%--                        </c:if>--%>
-            <%--                    </c:if>--%>
-            <%--                </div>--%>
-            <%--            </c:if>--%>
         </div>
         <br/>
         <div class="process-details">
@@ -761,7 +728,7 @@
 
         $('.check-cfm-btn').on('click', function (e) {
             var payType = $('select[name="payType"]').val();
-            var cmPayType = $('select[name="cmPayType"]').val();
+            var cmPayType = $('select[name="cmOtherPayType"]').val();
             id = $('#id').val();
             if ($(this).hasClass('check-blue-btn')) {
                 var textareaVal = $('#refuse-reasn').val();
@@ -775,7 +742,7 @@
                 }
             } else {
                 if (accessFlag) {
-                    window.location.href = '${ctx}/order/cmPayShop/checkPass?payType=' + payType + '&id=' + id + '$cmOtherPayType=' + cmPayType;
+                    window.location.href = '${ctx}/order/cmPayShop/checkPass?payType=' + payType + '&id=' + id + '&cmOtherPayType=' + cmPayType;
                     accessFlag = false;
                 }
             }

+ 9 - 7
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherEdit.jsp

@@ -189,10 +189,11 @@
                 <label>付款单名称:</label>
                 <span>${cmPayShop.name}</span>
             </div>
-            <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%">
+            <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;
+                ${empty cmPayShop.shopOrders[0].shopOtherFee or cmPayShop.shopOrders[0].shopOtherFee eq 0 ? 'display:none':''}">
                 <div>
                     <label>付第三方中介费:</label>
-                    <span>${cmPayShop.totalAmount}</span>
+                    <span>${cmPayShop.shopOrders[0].shopOtherFee}</span>
                 </div>
                 <div>
                     <label>付款账号:</label>
@@ -204,9 +205,9 @@
                         <span>账号:${cmPayShop.bankAccount}</span>
                         <span>开户行:${cmPayShop.bankName}</span>
                         <span>账户类型:
-                						<c:if test="${cmPayShop.type == '0'}">公帐</c:if>
-                						<c:if test="${cmPayShop.type == '1'}">私帐</c:if>
-                					</span>
+                            <c:if test="${cmPayShop.type == '0'}">公帐</c:if>
+                            <c:if test="${cmPayShop.type == '1'}">私帐</c:if>
+                		</span>
                     </c:if>
                 </div>
                 <div>
@@ -226,10 +227,11 @@
                 </div>
             </div>
             <br/>
-            <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;${not empty otherFee.onlinePayWays or otherFee.cmAccountType ne 1?'display:none':''}">
+            <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;
+                ${empty cmPayShop.shopOrders[0].cmShopOtherFee or cmPayShop.shopOrders[0].cmShopOtherFee eq 0 ? 'display:none':''}">
                 <div>
                     <label>采美中介费:</label>
-                    <span>${cmPayShop.cmShopOtherFee}</span>
+                    <span>${cmPayShop.shopOrders[0].cmShopOtherFee }</span>
                 </div>
                 <div>
                     <label>付款账号:</label>

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

@@ -700,7 +700,8 @@
         </c:forEach>
     </div>
     <div class="payment-form-bottom">
-        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;">
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;
+        ${empty cmPayShop.shopOrders[0].shopOtherFee or cmPayShop.shopOrders[0].shopOtherFee eq 0 ? 'display:none':''}">
             <div>
                 <label>第三方中介费:</label>
                 <span>${cmPayShop.shopOrders[0].shopOtherFee}</span>

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

@@ -512,7 +512,8 @@
         </c:forEach>
     </div>
     <div class="payment-form-bottom">
-        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;">
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;
+                ${empty cmPayShop.shopOrders[0].shopOtherFee or cmPayShop.shopOrders[0].shopOtherFee eq 0 ? 'display:none':''}">
             <div>
                 <label>第三方中介费:</label>
                 <span>${cmPayShop.shopOrders[0].shopOtherFee}</span>
@@ -549,7 +550,8 @@
             </c:if>
         </div>
         <br/>
-        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;${empty cmPayShop.shopOrders[0].cmShopOtherFee or cmPayShop.shopOrders[0].cmShopOtherFee eq 0 ? 'display:none':''}">
+        <div style="border:solid 1px black;padding: 10px;display: flex;flex-direction: column;height: 15%;
+            ${empty cmPayShop.shopOrders[0].cmShopOtherFee or cmPayShop.shopOrders[0].cmShopOtherFee eq 0 ? 'display:none':''}">
             <div>
                 <label>采美中介费:</label>
                 <span>${cmPayShop.shopOrders[0].cmShopOtherFee}</span>

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

@@ -200,12 +200,8 @@
                     var shouldPayShopAmount = ${shouldPayShopAmount};
                     if (shouldPayShopAmount < shopOtherFee) {
                         top.$.jBox.confirm("付第三方的值不合理,不能大于付供应商!", '提示', function (v, h, f) {
-                            if (v == true) {
-                                loading('正在提交,请稍等...');
-                                form.submit();
-                            }
                             return;
-                        }, {buttons: {'取消': false, '确定': true}});
+                        }, {buttons: {'取消': false}});
                     } else {
                         loading('正在提交,请稍等...');
                         form.submit();