Longlin 5 tahun lalu
induk
melakukan
43f04aff6e

+ 4 - 1
whepi-doc/group.sql

@@ -43,4 +43,7 @@ create table jm_tuangou (
 ENGINE = InnoDB
 DEFAULT CHARSET = utf8mb4
 COMMENT = '团购表'
-;
+;
+
+ALTER TABLE jm_tuangou
+ADD  tg_max_num     int(11)         NOT NULL DEFAULT 0          COMMENT '最大订量' AFTER tg_min_num;

+ 2 - 0
whepi-ui/templates/groupBuying/groupBuyingCx.ftl

@@ -25,6 +25,8 @@
             <div style="height: 1vh;"></div>
             <p style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
             <div style="height: 1vh;"></div>
+            <p style="text-indent: -0em;margin-left: 2em;">最大订量(份):&nbsp;&nbsp;${ tgItem.tgMaxNum }</p>
+            <div style="height: 1vh;"></div>
             <p id="cx_p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
             <div style="height: 1vh;"></div>
             <p id="cx_p_deliverTime"style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;</p>

+ 28 - 5
whepi-ui/templates/groupBuying/groupBuyingXx.ftl

@@ -26,6 +26,8 @@
             <div style="height: 1vh;"></div>
             <p style="text-indent: -0em;margin-left: 2em;">最低起送(份):&nbsp;&nbsp;${ tgItem.tgMinNum }</p>
             <div style="height: 1vh;"></div>
+            <p style="text-indent: -0em;margin-left: 2em;">最大订量(份):&nbsp;&nbsp;${ tgItem.tgMaxNum }</p>
+            <div style="height: 1vh;"></div>
             <p id="p_endTime" style="text-indent: -0em;margin-left: 2em;">截止时间:&nbsp;&nbsp;</p>
             <div style="height: 1vh;"></div>
             <p id="p_deliverTime" style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;</p>
@@ -45,6 +47,17 @@
                 <p id="gb_wc" class="weui-btn weui-btn_primary">完成团购</p>
                 <p id="gb_ck" class="weui-btn weui-btn_primary">查看参团信息</p>
             </div>
+            <div style="height: 10vh;">
+
+            </div>
+        </#if>
+        <#if isMine!='mine' && tgItem.tgStatus==1>
+            <div class="weui-btn-area">
+                <div class="weui-loadmore weui-loadmore_line" style="width: 100%">
+                    <span class="weui-loadmore__tips">参团状态</span>
+                    <div class="weui-cells__title">在团</div>
+                </div>
+            </div>
         </#if>
         <#if isMine=='mine' && tgItem.tgStatus==2>
             <div class="weui-btn-area">
@@ -61,23 +74,29 @@
 
             </div>
         </#if>
-        <#if isMine!='mine' && tgItem.tgStatus==1>
+        <#if isMine!='mine' && tgItem.tgStatus==2>
             <div class="weui-btn-area">
                 <div class="weui-loadmore weui-loadmore_line" style="width: 100%">
                     <span class="weui-loadmore__tips">参团状态</span>
-                    <div class="weui-cells__title">在团</div>
+                    <div class="weui-cells__title">发货</div>
                 </div>
             </div>
         </#if>
-        <#if isMine!='mine' && tgItem.tgStatus==2>
+        <#if isMine=='mine' && tgItem.tgStatus==3>
             <div class="weui-btn-area">
                 <div class="weui-loadmore weui-loadmore_line" style="width: 100%">
                     <span class="weui-loadmore__tips">参团状态</span>
-                    <div class="weui-cells__title">发货</div>
+                    <div class="weui-cells__title">完成</div>
                 </div>
             </div>
+            <div class="weui-btn-area">
+                <p id="gb_ck3" class="weui-btn weui-btn_primary">查看参团信息</p>
+            </div>
+            <div style="height: 10vh;">
+
+            </div>
         </#if>
-        <#if tgItem.tgStatus==3>
+        <#if isMine!='mine' && tgItem.tgStatus==3>
             <div class="weui-btn-area">
                 <div class="weui-loadmore weui-loadmore_line" style="width: 100%">
                     <span class="weui-loadmore__tips">参团状态</span>
@@ -130,6 +149,10 @@
         window.location.href = "/yeweihui/tuangou/member/list.html?jmId=" + tgItem.jmId + "&userId=" + userId;
     });
 
+    $('#gb_ck3').on('click', function () {
+        window.location.href = "/yeweihui/tuangou/member/list.html?jmId=" + tgItem.jmId + "&userId=" + userId;
+    });
+
     function goback() {
         window.location.href = "/yeweihui/home.html?show=tuangou&userId=" + userId;
     }

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

@@ -17,7 +17,9 @@
         <p class="weui-media-box__desc" style="margin-top: 1vh;">单价(元):</p>
         <input id="tg_input_price" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="50" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
         <p class="weui-media-box__desc" style="margin-top: 1vh;">最低起送(份):</p>
-        <input id="tg_input_mixnum" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="50" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
+        <input id="tg_input_minnum" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="50" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
+        <p class="weui-media-box__desc" style="margin-top: 1vh;">最大订量(份):</p>
+        <input id="tg_input_maxnum" class="weui-input" autofocus="" type="number" placeholder="请输入" maxlength="50" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;" />
         <p class="weui-media-box__desc" style="margin-top: 1vh;">截止时间:</p>
         <input id="tg_input_end_time" type="text" placeholder="请选择时间" style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; height: 5vh;"/>
         <p class="weui-media-box__desc" style="margin-top: 1vh;">预计送货时间:</p>
@@ -71,11 +73,16 @@
             return;
         }
 
-        let mixnum = $("#tg_input_mixnum").val();
-        if (mixnum.length <= 0) {
+        let minnum = $("#tg_input_minnum").val();
+        if (minnum.length <= 0) {
             $.alert("请输入最低起送");
             return;
         }
+        let maxnum = $("#tg_input_maxnum").val();
+        if (maxnum.length <= 0) {
+            $.alert("请输入最大订量");
+            return;
+        }
 
         let end_time = $("#tg_input_end_time").val();
         if (end_time.length <= 0) {
@@ -95,6 +102,16 @@
             return;
         }
 
+        if (parseInt(minnum) <= 0) {
+            $.alert("最低起送量应大于0");
+            return;
+        }
+
+        if (parseInt(maxnum) < parseInt(minnum)) {
+            $.alert("最大订量应大于或等于最低起送量");
+            return;
+        }
+
         let curTimestamp =(new Date()).valueOf();
         let endTimestamp = end_time.replace(/-/g,'/');
         endTimestamp = Date.parse(endTimestamp);
@@ -121,7 +138,7 @@
             supplier + "---" +
             goods + "---" +
             price + "---" +
-            mixnum + "---" +
+            minnum + "---" +
             end_time + "---" +
             deliver_time + "---" +
             phone_number
@@ -133,7 +150,7 @@
             tgSupplier: supplier,
             tgGoods: goods,
             tgPrice: price,
-            tgMinNum: mixnum,
+            tgMinNum: minnum,
             endTime: end_time,
             deliverTime: deliver_time,
             tgPhoneNumber: phone_number,

+ 12 - 14
whepi-ui/templates/yeweihui/tuangou.ftl

@@ -22,10 +22,14 @@
                         <div style="width: 20vw; height: 5vh;line-height:5vh; text-align: center; color: white">查询</div>
                     </a>
                 </div>
-
+                <div class="weui-btn-area">
+                    <a id="tg_publish" class="weui-btn weui-btn_primary">
+                        发布新团购
+                    </a>
+                </div>
                 <div class="weui-panel weui-panel_access">
                     <div style="display: flex; flex-direction: row; color: grey; font-size: medium; line-height: 7vh;">
-                        <div style="width: 40%; text-align: center;">标题</div>
+                        <div style="width: 40%; text-align: center;padding-left:3vw;">标题</div>
                         <div style="width: 15%; text-align: center;">已团</div>
                         <div style="width: 30%; text-align: center;">截止时间</div>
                         <div style="width: 15%; text-align: center;">状态</div>
@@ -51,11 +55,6 @@
                             <span class="weui-loadmore__tips">暂无数据</span>
                         </div>
                     </div>
-                    <div class="weui-btn-area">
-                        <a id="tg_publish" class="weui-btn weui-btn_primary">
-                            发布新团购
-                        </a>
-                    </div>
                     <div style="line-height: 55px;">
                         <br>
                     </div>
@@ -71,10 +70,14 @@
                         <div style="width: 20vw; height: 5vh;line-height:5vh; text-align: center; color: white">查询</div>
                     </a>
                 </div>
-
+                <div class="weui-btn-area">
+                    <a id="tg_publish2" class="weui-btn weui-btn_primary">
+                        发布新团购
+                    </a>
+                </div>
                 <div class="weui-panel weui-panel_access">
                     <div style="display: flex; flex-direction: row; color: grey; font-size: medium; line-height: 7vh;">
-                        <div style="width: 40%; text-align: center;">标题</div>
+                        <div style="width: 40%; text-align: center;padding-left:3vw;">标题</div>
                         <div style="width: 15%; text-align: center;">已团</div>
                         <div style="width: 30%; text-align: center;">截止时间</div>
                         <div style="width: 15%; text-align: center;">状态</div>
@@ -84,11 +87,6 @@
                             <span class="weui-loadmore__tips">暂无数据</span>
                         </div>
                     </div>
-                    <div class="weui-btn-area">
-                        <a id="tg_publish2" class="weui-btn weui-btn_primary">
-                            发布新团购
-                        </a>
-                    </div>
                     <div style="line-height: 55px;">
                         <br>
                     </div>

+ 6 - 4
whepi-ui/templates/yeweihui/tuangou.js

@@ -96,11 +96,12 @@ function makeList(list) {
         else if (item.tgStatus == 4) {
             status = "取消";
         }
+        let sstime = item.tgEndTime.toString().substring(5);
         $('#tg_list1').append($('<a href="javascript:tgItemSelect(' + "'" + item.jmId + "'" + ');" style="color: grey;">\n' +
             '                            <div style="display: flex; flex-direction: row; text-align: center; font-size: small; line-height: 5vh;">\n' +
-            '                                <div style="width: 40%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.tgTitle + '</div>\n' +
+            '                                <div style="width: 40%; padding-left:3vw; text-align: left; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.tgTitle + '</div>\n' +
             '                                <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.currentNum + '/' + item.tgMinNum + '</div>\n' +
-            '                                <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.tgEndTime.toString() + '</div>\n' +
+            '                                <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + sstime + '</div>\n' +
             '                                <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + status + '</div>\n' +
             '                            </div>\n' +
             '                        </a>'));
@@ -133,11 +134,12 @@ function makeMyPublishList(list) {
         else if (item.tgStatus == 4) {
             status = "取消";
         }
+        let sstime = item.tgEndTime.toString().substring(5);
         $('#tg_list2').append($('<a href="javascript:tgMyItemSelect(' + "'" + item.jmId + "'" + ');" style="color: grey;">\n' +
             '                            <div style="display: flex; flex-direction: row; text-align: center; font-size: small; line-height: 5vh;">\n' +
-            '                                <div style="width: 40%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.tgTitle + '</div>\n' +
+            '                                <div style="width: 40%; padding-left:3vw; text-align: left; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.tgTitle + '</div>\n' +
             '                                <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.currentNum + '/' + item.tgMinNum + '</div>\n' +
-            '                                <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + item.tgEndTime.toString() + '</div>\n' +
+            '                                <div style="width: 30%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + sstime + '</div>\n' +
             '                                <div style="width: 15%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;">' + status + '</div>\n' +
             '                            </div>\n' +
             '                        </a>'));

+ 4 - 0
whepi-web/src/main/java/com/bofeng/entity/JmTuangou.java

@@ -52,6 +52,10 @@ public class JmTuangou implements Serializable {
      * 最低起送
      */
     private Integer tgMinNum;
+    /**
+     * 最大订量
+     */
+    private Integer tgMaxNum;
 
     @TableField(exist = false)
     private Integer currentNum;

+ 12 - 7
whepi-web/src/main/java/com/bofeng/entity/JmTuangouMember.java

@@ -36,39 +36,44 @@ public class JmTuangouMember {
     @ExcelProperty(value = "最低起送", index = 4)
     private Integer tgMinNum;
     /**
+     * 最大订量
+     */
+    @ExcelProperty(value = "最大订量", index = 5)
+    private Integer tgMaxNum;
+    /**
      * 小区名称
      */
-    @ExcelProperty(value = "小区名称", index = 5)
+    @ExcelProperty(value = "小区名称", index = 6)
     private String uptownName;
     /**
      * 栋
      */
-    @ExcelProperty(value = "楼栋", index = 6)
+    @ExcelProperty(value = "楼栋", index = 7)
     private String ridgepole;
     /**
      * 单元
      */
-    @ExcelProperty(value = "单元", index = 7)
+    @ExcelProperty(value = "单元", index = 8)
     private String unit;
     /**
      * 门牌号
      */
-    @ExcelProperty(value = "门牌号", index = 8)
+    @ExcelProperty(value = "门牌号", index = 9)
     private String houseNumber;
     /**
      * 参团数量
      */
-    @ExcelProperty(value = "参团数量", index = 9)
+    @ExcelProperty(value = "参团数量", index = 10)
     private Integer buyCount;
     /**
      * 联系方式
      */
-    @ExcelProperty(value = "联系方式", index = 10)
+    @ExcelProperty(value = "联系方式", index = 11)
     private String phone;
     /**
      * 备注
      */
-    @ExcelProperty(value = "备注", index = 11)
+    @ExcelProperty(value = "备注", index = 12)
     private String myRemark;
 
     private Integer uptownId;

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

@@ -5,31 +5,36 @@
     <select id="queryTuangouListByUptownId" resultType="com.bofeng.entity.JmTuangou">
         select a.*, IFNULL((select SUM(b.buy_count) FROM jm_buy b where b.jm_id=a.jm_id and buy_status=1),0) as currentNum
         from jm_tuangou a
-        where uptown_id=#{uptownId}
+        where a.uptown_id=#{uptownId}
+        order by a.tg_end_time desc
     </select>
 
     <select id="queryTuangouListByUptownIdAndTitle" resultType="com.bofeng.entity.JmTuangou">
         select a.*, IFNULL((select SUM(b.buy_count) FROM jm_buy b where b.jm_id=a.jm_id and buy_status=1),0) as currentNum
         from jm_tuangou a
-        where uptown_id=#{uptownId} and tg_title like concat('%', #{title}, '%')
+        where a.uptown_id=#{uptownId} and a.tg_title like concat('%', #{title}, '%')
+        order by a.tg_end_time desc
     </select>
 
     <select id="queryTuangouListByUserId" resultType="com.bofeng.entity.JmTuangou">
         select a.*, IFNULL((select SUM(b.buy_count) FROM jm_buy b where b.jm_id=a.jm_id and buy_status=1),0) as currentNum
         from jm_tuangou a
-        where user_id=#{userId}
+        where a.user_id=#{userId}
+        order by a.tg_end_time desc
     </select>
 
     <select id="queryTuangouListByUserIdAndTitle" resultType="com.bofeng.entity.JmTuangou">
         select a.*, IFNULL((select SUM(b.buy_count) FROM jm_buy b where b.jm_id=a.jm_id and buy_status=1),0) as currentNum
         from jm_tuangou a
-        where user_id=#{userId} and tg_title like concat('%', #{title}, '%')
+        where a.user_id=#{userId} and a.tg_title like concat('%', #{title}, '%')
+        order by a.tg_end_time desc
     </select>
 
     <select id="selectJmTuangouByJmId" resultType="com.bofeng.entity.JmTuangou">
         select a.*, IFNULL((select SUM(b.buy_count) FROM jm_buy b where b.jm_id=a.jm_id and buy_status=1),0) as currentNum
         from jm_tuangou a
-        where jm_id=#{JmId}
+        where a.jm_id=#{JmId}
+        order by a.tg_end_time desc
     </select>
 
     <update id="updateRemarkByJmId">

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

@@ -3,7 +3,7 @@
 <mapper namespace="com.bofeng.dao.JmTuangouMemberDao">
 
     <select id="querMemberListByJmId" resultType="com.bofeng.entity.JmTuangouMember">
-        select a.user_id,a.buy_count,a.phone, a.my_remark, y.houseNumber, y.ridgepole, y.unit, y.uptown_id, y.uptown_name, z.tg_title, z.tg_supplier, z.tg_goods, z.tg_price, z.tg_min_num from jm_buy a
+        select a.user_id,a.buy_count,a.phone, a.my_remark, y.houseNumber, y.ridgepole, y.unit, y.uptown_id, y.uptown_name, z.tg_title, z.tg_supplier, z.tg_goods, z.tg_price, z.tg_min_num, z.tg_max_num from jm_buy a
            LEFT JOIN
        (
            select a.user_id, b.house_id, b.doorplate as houseNumber, c.uptown_id, c.ridgepole, c.unit, u.uptown_name