Переглянути джерело

Merge remote-tracking branch 'origin/developerA' into developerA

chao 3 роки тому
батько
коміт
d6261a26d8

+ 2 - 0
src/main/java/com/caimei/modules/supervip/dao/CmSvipHistoryDao.java

@@ -25,4 +25,6 @@ public interface CmSvipHistoryDao extends CrudDao<CmSvipHistory> {
     CmSvipHistory findOutEndTime(Long userId);
 
     Integer findPackage(Integer pac);
+
+    Integer findDuration(Integer packageId);
 }

+ 11 - 0
src/main/java/com/caimei/modules/supervip/service/CmSvipHistoryService.java

@@ -44,6 +44,17 @@ public class CmSvipHistoryService extends CrudService<CmSvipHistoryDao, CmSvipHi
         List<CmSvipHistory> history = svipDao.findHistory(cmSvipHistory);
         //1生效2过期3未生效
         for (CmSvipHistory svipHistory : history) {
+            Integer packageID = svipHistory.getPackageId();
+            Integer duration=svipDao.findDuration(packageID);
+            if(duration.equals(3)){
+                svipHistory.setPackageId(3);
+            }
+            if(duration.equals(1)){
+                svipHistory.setPackageId(1);
+            }
+            if(duration.equals(12)){
+                svipHistory.setPackageId(12);
+            }
             Date beginTime = svipHistory.getBeginTime();
             Date endTime = svipHistory.getEndTime();
             //开始时间<现在

+ 10 - 0
src/main/resources/mappings/modules/super/CmSvipHistoryMapper.xml

@@ -94,6 +94,7 @@
         LEFT JOIN club cb ON cs.userId = cb.userId
         left join user u on cs.userId = u.userID
         where cs.userId = #{userId}
+        AND cs.payStatus = '1'
         <if test="startPayTime != null and startPayTime != '' and endPayTime != null and endPayTime != ''">
             and (payTime between #{startPayTime} and #{endPayTime})
         </if>
@@ -112,6 +113,7 @@
         <if test='status == "3"'>
             and beginTime > NOW()
         </if>
+        order by cs.payTime desc
     </select>
 
     <select id="findEndTime" resultType="com.caimei.modules.supervip.entity.CmSvipHistory">
@@ -130,6 +132,7 @@
         LEFT JOIN cm_svip_user cu ON cs.userId = cu.userId
         left join user u on cs.userId = u.userID
         <where>
+            AND cs.payStatus = '1'
             <if test="clubName != null and clubName != ''">
                 and u.name like concat('%',#{clubName},'%')
             </if>
@@ -156,6 +159,7 @@
             </if>
         </where>
         group by cs.userId
+        order by cs.payTime DESC
     </select>
 
     <select id="findOutEndTime" resultType="com.caimei.modules.supervip.entity.CmSvipHistory">
@@ -171,4 +175,10 @@
         where duration = #{pac}
     </select>
 
+    <select id="findDuration" resultType="java.lang.Integer">
+        select duration
+        from cm_svip_package
+        where id = #{packageId}
+    </select>
+
 </mapper>

+ 3 - 3
src/main/webapp/WEB-INF/views/modules/svip/cmSvipHistoryForm.jsp

@@ -102,9 +102,9 @@
     <c:forEach items="${page.list}" var="cmSvipHistory">
         <tr>
             <td>
-                    <c:if test="${cmSvipHistory.packageId eq '1'}">12个月</c:if>
-                    <c:if test="${cmSvipHistory.packageId eq '2'}">3个月</c:if>
-                    <c:if test="${cmSvipHistory.packageId eq '3'}">1个月</c:if>
+                    <c:if test="${cmSvipHistory.packageId eq '12'}">12个月</c:if>
+                    <c:if test="${cmSvipHistory.packageId eq '3'}">3个月</c:if>
+                    <c:if test="${cmSvipHistory.packageId eq '1'}">1个月</c:if>
             </td>
             <td>
                 <c:if test="${cmSvipHistory.payWay eq '0'}">¥${cmSvipHistory.price}</c:if>

+ 4 - 3
src/main/webapp/static/modules/bulkpurchase/orderForm.js

@@ -491,6 +491,10 @@ $("#couponBox").on("change", "input[name=clubCouponId]", function(){
             couponPrice = item.couponAmount;
             $("#clubCouponId").val(clubCouponId);
             $("#couponAmount").val(couponPrice);
+        } else if (clubCouponId == 0) {
+            couponPrice = 0;
+            $("#clubCouponId").val('');
+            $("#couponAmount").val(couponPrice);
         }
     });
     // 重新计算总价
@@ -1237,7 +1241,6 @@ function setOrderFee() { //不考虑经理折扣、运费,此时 商品总金
         presentCount = Number(presentCount) + Number(obj.presentNum);
         orderTotalFee = ((Number(orderTotalFee) * 100 + Number(obj.totalFee) * 100) / 100).toFixed(2);
         payTotalFee = ((Number(payTotalFee) * 100 + Number(obj.totalFee) * 100) / 100).toFixed(2);
-        debugger
         svipFullReduction = ((Number(svipFullReduction) * 100 + Number(obj.svipReduction) * obj.num * 100) / 100).toFixed(2);
     });
     $('.productTable tbody tr.promotions').each(function(index, element) {
@@ -1895,7 +1898,6 @@ function num(obj) {
 
 // 添加供应应付商金额
 function shopFee(i) {
-    debugger
     var $shopFee = $("#shopFee1" + i).val();
     var shopFee = Number($shopFee);
     var $checkItem = eval('(' + $("#check-item" + i).val() + ')');
@@ -1945,7 +1947,6 @@ function otherFee(i) {
 }
 // 添加采美应付金额
 function cmFee(i) {
-    debugger
     var discountPrice = $("#discountPrice" + i).val(); //折后单价
     var shopFee1 = $("#shopFee1" + i).val(); //应付供应商
     var otherFee1 = $("#otherFee1" + i).val() //应付第三方