zhijiezhao 1 year ago
parent
commit
ed1d6d4e45

+ 2 - 0
src/main/java/com/caimei/modules/order/entity/CmPayShop.java

@@ -18,6 +18,8 @@ public class CmPayShop extends DataEntity<CmPayShop> {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
 
 
+    private String cmBankNameType;
+
     /**
     /**
      * 付第三方采美中介费付款时间
      * 付第三方采美中介费付款时间
      */
      */

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

@@ -11,6 +11,10 @@ import org.hibernate.validator.constraints.Length;
 public class CmPayShopRecord extends DataEntity<CmPayShopRecord> {
 public class CmPayShopRecord extends DataEntity<CmPayShopRecord> {
 
 
     private static final long serialVersionUID = 1L;
     private static final long serialVersionUID = 1L;
+    /**
+     * 采美银行账户
+     */
+    private String cmBankNameType;
     /**
     /**
      * 供应商Id
      * 供应商Id
      */
      */

+ 14 - 2
src/main/java/com/caimei/modules/order/service/CmPayShopService.java

@@ -421,13 +421,14 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             //详情
             //详情
             List<CmPayShopRecord> payRecords = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
             List<CmPayShopRecord> payRecords = cmPayShopRecordDao.findByPayShopID(cmPayShop.getId());
             cmPayShop.setBankNameType(payRecords.get(0).getBankNameType());
             cmPayShop.setBankNameType(payRecords.get(0).getBankNameType());
+            String bankName = null == payRecords.get(0).getBankNameType() ? "" : payRecords.get(0).getBankNameType();
+            cmPayShop.setCmBankNameType(bankName);
             List<String> ids = payRecords.stream().map(CmPayShopRecord::getShopOrderID).collect(Collectors.toList());
             List<String> ids = payRecords.stream().map(CmPayShopRecord::getShopOrderID).collect(Collectors.toList());
             List<NewShopOrder> csos = new ArrayList<>();
             List<NewShopOrder> csos = new ArrayList<>();
             if (null != ids && ids.size() > 0) {
             if (null != ids && ids.size() > 0) {
                 csos = newShopOrderDao.findByShopOrderIDs(ids);
                 csos = newShopOrderDao.findByShopOrderIDs(ids);
             }
             }
             for (NewShopOrder so : csos) {
             for (NewShopOrder so : csos) {
-                logger.info("付第三方------------------------》" + so.getCmShopOtherFee());
                 CmPayShopRecord cmPayShopRecord = payRecords.stream().filter(p -> p.getShopOrderID().equals(so.getShopOrderID().toString())).findAny().get();
                 CmPayShopRecord cmPayShopRecord = payRecords.stream().filter(p -> p.getShopOrderID().equals(so.getShopOrderID().toString())).findAny().get();
                 // 供应商已退金额
                 // 供应商已退金额
                 Double collect = 0d;
                 Double collect = 0d;
@@ -1118,10 +1119,21 @@ public class CmPayShopService extends CrudService<CmPayShopDao, CmPayShop> {
             payShop.setBankName(payShopOther.getBankName());
             payShop.setBankName(payShopOther.getBankName());
             payShop.setType(payShopOther.getType().toString());
             payShop.setType(payShopOther.getType().toString());
         }
         }
+        Double payCmAmount = null == payShopOther.getCmShopOtherFee() ? 0d : payShopOther.getCmShopOtherFee();
+        String cmBankAccount = null == payShopOther.getCmBankAccount() ? "" : payShopOther.getCmBankAccount();
+        String cmBankAccountName = null == payShopOther.getCmBankAccountName() ? "" : payShopOther.getCmBankAccountName();
+        String cmBankName = null == payShopOther.getCmBankName() ? "" : payShopOther.getCmBankName();
+        Integer cmType = null == payShopOther.getCmType() ? 0 : payShopOther.getCmType();
+        Double cmShopOtherFee = null == payShopOther.getCmShopOtherFee() ? 0d : payShopOther.getCmShopOtherFee();
+        payShop.setCmShopOtherFee(payCmAmount);
+        payShop.setCmBankAccount(cmBankAccount);
+        payShop.setCmBankAccountName(cmBankAccountName);
+        payShop.setCmBankName(cmBankName);
+        payShop.setCmType(cmType);
         payShop.setOtherFeeFlag(payShopOther.getOtherFeeFlag());
         payShop.setOtherFeeFlag(payShopOther.getOtherFeeFlag());
         payShop.setTotalAmount(payShopOther.getShopOtherFee().doubleValue());
         payShop.setTotalAmount(payShopOther.getShopOtherFee().doubleValue());
         payShop.setBalancePayFee(0d);
         payShop.setBalancePayFee(0d);
-        payShop.setTransferPayFee(payShopOther.getShopOtherFee().doubleValue());
+        payShop.setTransferPayFee(payShopOther.getShopOtherFee().doubleValue() + cmShopOtherFee);
         payShop.setWipePayment(0d);
         payShop.setWipePayment(0d);
         payShop.setApplicant(currentUser.getId());
         payShop.setApplicant(currentUser.getId());
         payShop.setApplyTime(time);
         payShop.setApplyTime(time);

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

@@ -35,6 +35,12 @@
 		u2.name AS reviewerName,
 		u2.name AS reviewerName,
 		s.name AS shopName,
 		s.name AS shopName,
 		ifnull(a.payCmAmount,0) as cmShopOtherFee,
 		ifnull(a.payCmAmount,0) as cmShopOtherFee,
+		a.cmOtherPayType,
+		a.cmBankAccountName,
+		a.cmBankAccount,
+		a.cmBankName,
+		a.cmType,
+		a.cmOtherPayTime,
 		s.ableRebateAmount AS ableRebateAmount,
 		s.ableRebateAmount AS ableRebateAmount,
 		s.rebateAmount AS rebateAmount,
 		s.rebateAmount AS rebateAmount,
 		(SELECT paymentType FROM cm_pay_shop_record WHERE payShopID = a.id LIMIT 1) AS paymentType
 		(SELECT paymentType FROM cm_pay_shop_record WHERE payShopID = a.id LIMIT 1) AS paymentType
@@ -269,6 +275,7 @@
 			reason,
 			reason,
 			delFlag,
 			delFlag,
 		    otherFeeFlag,
 		    otherFeeFlag,
+			payCmAmount,
 		    cmType,
 		    cmType,
 		    cmBankAccountName,
 		    cmBankAccountName,
 		    cmBankAccount,
 		    cmBankAccount,
@@ -297,6 +304,7 @@
 			#{reason},
 			#{reason},
 			#{delFlag},
 			#{delFlag},
 			#{otherFeeFlag},
 			#{otherFeeFlag},
+		    #{cmShopOtherFee},
 		    #{cmType},
 		    #{cmType},
 			#{cmBankAccountName},
 			#{cmBankAccountName},
 		    #{cmBankAccount},
 		    #{cmBankAccount},
@@ -328,6 +336,8 @@
 			status = #{status},
 			status = #{status},
 			reason = #{reason},
 			reason = #{reason},
 			delFlag = #{delFlag},
 			delFlag = #{delFlag},
+			payCmAmount = #{cmShopOtherFee},
+			cmOtherPayType = #{cmOtherPayType},
 			otherFeeFlag = ifnull(#{otherFeeFlag},0),
 			otherFeeFlag = ifnull(#{otherFeeFlag},0),
 			cmType = #{cmType},
 			cmType = #{cmType},
 			cmBankAccountName = #{cmBankAccountName},
 			cmBankAccountName = #{cmBankAccountName},

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

@@ -140,9 +140,11 @@
     <select id="findByPayShopID" resultType="CmPayShopRecord">
     <select id="findByPayShopID" resultType="CmPayShopRecord">
         SELECT
         SELECT
         f.bankAccount AS "bankNameType",
         f.bankAccount AS "bankNameType",
+        cf.bankAccount as "cmBankNameType",
         <include refid="cmPayShopRecordColumns"/>
         <include refid="cmPayShopRecordColumns"/>
         FROM cm_pay_shop_record a
         FROM cm_pay_shop_record a
         LEFT JOIN cm_offline_collection f ON a.payType = f.type
         LEFT JOIN cm_offline_collection f ON a.payType = f.type
+        left join cm_offline_collection cf on a.cmOtherPayType = f.type
         WHERE a.payShopID = #{payShopID}
         WHERE a.payShopID = #{payShopID}
     </select>
     </select>
 
 

+ 52 - 48
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherCheck.jsp

@@ -410,7 +410,7 @@
                 <tr>
                 <tr>
                     <th>订单编号(ID)</th>
                     <th>订单编号(ID)</th>
                     <th colspan="3"> 供应商</th>
                     <th colspan="3"> 供应商</th>
-<%--                    <th colspan="3">子订单佣金</th>--%>
+                        <%--                    <th colspan="3">子订单佣金</th>--%>
                     <th colspan="6">商品费</th>
                     <th colspan="6">商品费</th>
                     <th>应付税费</th>
                     <th>应付税费</th>
                     <th>供应商运费</th>
                     <th>供应商运费</th>
@@ -422,14 +422,15 @@
                 <tr>
                 <tr>
                     <td> ${s.orderNo}(${s.orderID})</td>
                     <td> ${s.orderNo}(${s.orderID})</td>
                     <td colspan="3">${s.shopName}</td>
                     <td colspan="3">${s.shopName}</td>
-<%--                    <td colspan="3" class="payCm-t">子订单佣金</td>--%>
+                        <%--                    <td colspan="3" class="payCm-t">子订单佣金</td>--%>
                     <td colspan="6" class="product-fee">${s.shopProductAmount}</td>
                     <td colspan="6" class="product-fee">${s.shopProductAmount}</td>
 
 
                     <td class="taxes">
                     <td class="taxes">
                         <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                         <fmt:formatNumber value="${s.shopTaxFee}" type="number" pattern="#,##0.00"/>
                     </td>
                     </td>
 
 
-                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}" type="number"
+                    <td class="freight"><fmt:formatNumber value="${empty s.supplierFreight ? 0 : s.supplierFreight}"
+                                                          type="number"
                                                           pattern="#,##0.00"/></td>
                                                           pattern="#,##0.00"/></td>
 
 
                     <td>
                     <td>
@@ -574,7 +575,8 @@
                 <div>
                 <div>
                     <label style="font-weight: bold; font-size:18px">转账支付:</label>
                     <label style="font-weight: bold; font-size:18px">转账支付:</label>
                     <span id="transferPayFee" style="font-weight: bold; font-size:18px"><fmt:formatNumber
                     <span id="transferPayFee" style="font-weight: bold; font-size:18px"><fmt:formatNumber
-                            value="${cmPayShop.transferPayFee + cmPayShop.cmShopOtherFee}" pattern="#,##0.00"/> </span>
+                            value="${cmPayShop.shopOrders[0].shopOtherFee + cmPayShop.shopOrders[0].cmShopOtherFee}"
+                            pattern="#,##0.00"/> </span>
                     <label>付款银行:</label><span>
                     <label>付款银行:</label><span>
 					<select name="payType" style="width: 200px">
 					<select name="payType" style="width: 200px">
 						<option value="">请选择</option>
 						<option value="">请选择</option>
@@ -596,11 +598,12 @@
                 <span>${cmPayShop.shopOrders[0].cmShopOtherFee}</span>
                 <span>${cmPayShop.shopOrders[0].cmShopOtherFee}</span>
             </div>
             </div>
             <div>
             <div>
-            <label style="font-weight: bold; font-size:18px">转账支付:</label>
-            <span id="" style="font-weight: bold; font-size:18px">
+                <label style="font-weight: bold; font-size:18px">转账支付:</label>
+                <span id="" style="font-weight: bold; font-size:18px">
                 <fmt:formatNumber
                 <fmt:formatNumber
-                    value="${cmPayShop.transferPayFee + cmPayShop.cmShopOtherFee}" pattern="#,##0.00"/> </span>
-            <label>付款银行:</label><span>
+                        value="${cmPayShop.shopOrders[0].shopOtherFee + cmPayShop.shopOrders[0].cmShopOtherFee}"
+                        pattern="#,##0.00"/> </span>
+                <label>付款银行:</label><span>
 					<select name="cmOtherPayType" style="width: 200px">
 					<select name="cmOtherPayType" style="width: 200px">
 						<option value="">请选择</option>
 						<option value="">请选择</option>
                         <c:forEach items="${offlineCollections}" var="offlineCollections">
                         <c:forEach items="${offlineCollections}" var="offlineCollections">
@@ -609,44 +612,44 @@
 					</select>
 					</select>
 				</span>
 				</span>
 
 
-            <label>付款时间:</label>
-            <span>${cmPayShop.cmOtherPayTime}</span>
-        </div>
+                <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>--%>
+            <%--                <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>
         </div>
         <br/>
         <br/>
         <div class="process-details">
         <div class="process-details">
@@ -757,8 +760,9 @@
         }
         }
 
 
         $('.check-cfm-btn').on('click', function (e) {
         $('.check-cfm-btn').on('click', function (e) {
-            var payType = $('select[name="payType"]').val(),
-                id = $('#id').val();
+            var payType = $('select[name="payType"]').val();
+            var cmPayType = $('select[name="cmPayType"]').val();
+            id = $('#id').val();
             if ($(this).hasClass('check-blue-btn')) {
             if ($(this).hasClass('check-blue-btn')) {
                 var textareaVal = $('#refuse-reasn').val();
                 var textareaVal = $('#refuse-reasn').val();
                 if (!textareaVal.trim()) {
                 if (!textareaVal.trim()) {
@@ -771,7 +775,7 @@
                 }
                 }
             } else {
             } else {
                 if (accessFlag) {
                 if (accessFlag) {
-                    window.location.href = '${ctx}/order/cmPayShop/checkPass?payType=' + payType + '&id=' + id;
+                    window.location.href = '${ctx}/order/cmPayShop/checkPass?payType=' + payType + '&id=' + id + '$cmOtherPayType=' + cmPayType;
                     accessFlag = false;
                     accessFlag = false;
                 }
                 }
             }
             }

+ 10 - 12
src/main/webapp/WEB-INF/views/modules/order/cmPayShopOtherEdit.jsp

@@ -211,12 +211,11 @@
                 </div>
                 </div>
                 <div>
                 <div>
                     <label>付款银行:</label><span>
                     <label>付款银行:</label><span>
-					 <select name="payType" class="input-medium required" style="width: 200px">
-                         <option value="">请选择</option>
-                         <c:forEach items="${offlineCollections}" var="offlineCollections" varStatus="index">
-                             <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
-                         </c:forEach>
-                     </select>
+                    <form:select path="payType" class="input-medium required">
+                        <form:option value="" label="请选择"/>
+                        <form:options items="${offlineCollections}" itemLabel="bankAccount" itemValue="type"
+                                      htmlEscape="false"/>
+                    </form:select>
 				</span>
 				</span>
                 </div>
                 </div>
                 <div>
                 <div>
@@ -249,12 +248,11 @@
                 </div>
                 </div>
                 <div>
                 <div>
                     <label>付款银行:</label><span>
                     <label>付款银行:</label><span>
-					 <select name="cmOtherPayType" class="input-medium required" style="width: 200px">
-                         <option value="">请选择</option>
-                         <c:forEach items="${offlineCollections}" var="offlineCollections" varStatus="index">
-                             <option value="${offlineCollections.type}">${offlineCollections.bankAccount}</option>
-                         </c:forEach>
-                     </select>
+                    <form:select path="cmOtherPayType" class="input-medium required">
+                        <form:option value="" label="请选择"/>
+                        <form:options items="${offlineCollections}" itemLabel="bankAccount" itemValue="type"
+                                      htmlEscape="false"/>
+                    </form:select>
 				</span>
 				</span>
                 </div>
                 </div>
                 <div>
                 <div>