ソースを参照

Merge remote-tracking branch 'origin/master'

peiguo 5 年 前
コミット
45a43439ef

+ 2 - 2
whepi-ui/templates/home/buy.ftl

@@ -103,7 +103,7 @@
             $('#buyAll').append(' <a href="javascript:void(0);" style="color: grey;font-size: large" data-id="form"\n' +
                     '                                             onclick=\'myBuyClick(' + JSON.stringify(v) + ')\'>\n' +
                     '                <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 4vh;">\n' +
-                    '                    <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;">' + '【' + type(v.roleType) + '】' + v.tgTitle + '</div>\n' +
+                    '                    <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;">' + v.tgTitle + '</div>\n' +
                     '                    <div style="width: 20%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">\n' + v.count + '/' + v.tgMinNum + '</div>\n' +
                     '                    <div style="width: 35%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + sub(v.tgEndTime) + '</div>\n' +
                     '                    <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + getStatus(v.tgStatus) + '</div>\n' +
@@ -143,7 +143,7 @@
         function MybuyList(v) {
             $('#MyBuyAll').append('<a href="javascript:void(0);" style="color: grey;font-size: large" data-id="form" onclick=\'myBuyClick2(' + JSON.stringify(v) + ')\'>\n' +
                     '                        <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 4vh;">\n' +
-                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;">' + '【' + type(v.roleType) + '】' + v.tgTitle + '</div>\n' +
+                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;">' + v.tgTitle + '</div>\n' +
                     '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + timestampY(v.timeCreate) + '</div>\n' +
                     '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">' + getStatus(v.tgStatus) + '</div>\n' +
                     '                        </div>\n' + '                    </a>')

+ 9 - 0
whepi-ui/templates/home/buyClient.ftl

@@ -11,6 +11,10 @@
         <div style="display: inline;margin-top: 1vh;" id="myStatus"></div>
     </div>
 
+    <div class="weui-flex__item" id="xe1">
+        <div style="display: inline;align-items: flex-end">单人限额:</div>
+        <div style="display: inline;margin-top: 1vh;" id="xe"></div>
+    </div>
     <div class="weui-flex__item" id="tc1">
         <div style="display: inline;align-items: flex-end">剩余套餐(份):</div>
         <div style="display: inline;margin-top: 1vh;" id="tc"></div>
@@ -92,6 +96,11 @@
                     $('#buyCount').val(data.data.buyCount);
                 if (data.data.buyMoney != null)
                     $('#myMenory').text(Math.round(data.data.buyMoney * 10) / 10);
+                if (data.data.tgItemNum == 0) {
+                    $('#xe1').toggle();
+                } else {
+                    $('#xe').html(data.data.tgItemNum);
+                }
             },
             error: function () {
             }

+ 5 - 6
whepi-ui/templates/yeweihui/tgPublish.ftl

@@ -100,8 +100,7 @@
 
         let itemNum = $("#tg_input_itemNum").val();
         if (itemNum.length <= 0) {
-            $.alert("请输入单人限购");
-            return;
+            itemNum = "0";
         }
 
         let end_time = $("#tg_input_end_time").val();
@@ -164,10 +163,10 @@
             return;
         }
 
-        if (parseInt(itemNum) <= 0) {
-            $.alert("单人限购应大于0");
-            return;
-        }
+        // if (parseInt(itemNum) <= 0) {
+        //     $.alert("单人限购应大于0");
+        //     return;
+        // }
 
         if (parseInt(maxnum) < parseInt(itemNum)) {
             $.alert("最大订量应大于或等于单人限购");

+ 2 - 0
whepi-web/src/main/java/com/bofeng/entity/Buy.java

@@ -58,5 +58,7 @@ public class Buy {
   private String tgSupplier;
   @TableField(exist = false)
   private Integer roleType;
+  @TableField(exist = false)
+  private Integer tgItemNum;
 
 }

+ 1 - 1
whepi-web/src/main/java/com/bofeng/service/BuyService.java

@@ -61,7 +61,7 @@ public class BuyService {
       }
     }
     //个人限额(指挥部的限额 和 管理员的限额)
-    if (roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
+    if (roleType.getTgItemNum().intValue() != 0 && roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
       return 4;
     }
 

+ 1 - 1
whepi-web/src/main/java/com/bofeng/wx/controller/UserOpenController.java

@@ -68,7 +68,7 @@ public class UserOpenController {
             UserOpen userOpen = homeService.getUserOpen();
             list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
 //            list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
-//            UserOpen userOpen = userOpenMapper.select ByUserId(1225321682867105793L);
+//            UserOpen userOpen = userOpenMapper.selectByUserId(1225321682867105793L);
             userId = userOpen.getUserId();
             model.put("user", userOpen);
             model.put("user_id", "\"" + userOpen.getUserId() + "\"");

+ 1 - 1
whepi-web/src/main/resources/application.yml

@@ -43,7 +43,7 @@ endpoints:
 #  whitelabel.enabled: false
 
 spring:
-  profiles.active: guojing
+  profiles.active: lll
 
   application:
     name: bofeng-web

+ 1 - 1
whepi-web/src/main/resources/mapper/BuyMapper.xml

@@ -32,7 +32,7 @@
     </select>
 
     <select id="status" resultType="com.bofeng.entity.Buy">
-       SELECT a.tg_status, a.tg_price,a.tg_max_num,b.buy_count,b.buy_money,b.my_remark,a.role_type,
+       SELECT a.tg_status, a.tg_price,a.tg_max_num,b.buy_count,b.buy_money,b.my_remark,a.role_type,a.tg_item_num,
        IFNULL(( SELECT SUM(b.buy_count)
        FROM jm_buy b WHERE a.jm_id = b.jm_id AND buy_status = 1 ), 0 ) AS count,
        ( SELECT phone FROM sys_user_role aa

+ 1 - 1
whepi-web/src/main/resources/mapper/JmTuangouMapper.xml

@@ -47,7 +47,7 @@
                 and a.tg_status=#{status}
             </if>
         </where>
-        order by a.tg_end_time desc
+        order by a.time_create desc
     </select>
 
     <select id="selectJmTuangouByJmId" resultType="com.bofeng.entity.JmTuangou">