瀏覽代碼

业主购买2月10号

guojing 5 年之前
父節點
當前提交
40b268d2cc

+ 1 - 1
whepi-doc/group.sql

@@ -9,7 +9,7 @@ create table jm_buy (
     buy_count       int(11)         NOT NULL DEFAULT 0          COMMENT '购买数量',
     buy_money       varchar(6)      NOT NULL DEFAULT 0.00       COMMENT '购买金额',
     phone           varchar(20)     NOT NULL DEFAULT ''         COMMENT '联系电话',
-    buy_status      int(11)         NOT NULL DEFAULT 0          COMMENT '状态 1 在团 2 发货 3完成 4取消',
+    buy_status      int(11)         NOT NULL DEFAULT 1          COMMENT '状态 1 在团 2 撤单',
     my_remark       varchar(200)    NOT NULL DEFAULT ''         COMMENT '备注',
     user_create     bigint(20)      NOT NULL DEFAULT 0          COMMENT '新增人',
     time_create     datetime(0)     NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间(订单提交时间)',

+ 3 - 4
whepi-ui/templates/home/buy.ftl

@@ -130,14 +130,13 @@
                     '                        <div style="display: flex; flex-direction: row; text-align: center; font-size: x-small; line-height: 5vh;">\n' +
                     '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + v.tgTitle + '</div>\n' +
                     '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + timestampToTime(v.timeCreate) + '</div>\n' +
-                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + getStatus(v.buyStatus) + '</div>\n' +
-                    '                        </div>\n' + '<div style="display: none;width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + getStatus(v.tgStatus) + '</div>\n' +
-                    '                    </a>')
+                    '                            <div style="width: 33%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 12px">' + getStatus(v.tgStatus) + '</div>\n' +
+                    '                        </div>\n' + '                    </a>')
         }
 
         function myBuyClick2(v) {
             if (v.buyStatus != 1) {
-                return  $.alert("该订单已经取消");
+                return $.alert("该订单已经取消");
             }
             window.location.href = "/home/buytc.html?userId=" + $('#userId').val() + "&jmId=" + v.jmId + "&type=" + 2 + "&tgStatus=" + v.tgStatus;
         }

+ 2 - 1
whepi-ui/templates/home/buytc.ftl

@@ -64,7 +64,8 @@
                         '            <div style="text-indent: -0em;margin-left: 2em;">预计送货时间:&nbsp;&nbsp;' + timestampToTime(v.tgDeliverTime) + '</div>\n' +
                         '\n' +
                         '            <div style="text-indent: -0em;margin-left: 2em;">服务电话:&nbsp;&nbsp;' + v.tgPhoneNumber + '</div>\n' +
-                        '        </div>\n' +
+                        '            <div style="text-indent: -0em;margin-left: 2em;">备&nbsp;&nbsp;&nbsp;&nbsp;注:&nbsp;&nbsp;' + v.remark + '</div>\n'+
+                        '     </div>\n' +
                         '    </div>')
             },
             error: function () {

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

@@ -29,10 +29,6 @@ public class BuyService {
     buy.setBuyId(IdWorker.getId());
     buy.setUserCreate(buy.getUserId());
     buy.setTimeCreate(new DateTime());
-    //在添加的时候 进行检测该团购是否在规定时间里 已经达到了最小起订量的要求
-/*    if () {
-
-    }*/
     buy.setBuyStatus(1);//在团
     return buyMapper.insert(buy);
   }
@@ -61,7 +57,7 @@ public class BuyService {
     if (jmTuangou.getTgEndTime().getTime() >= new DateTime().getMillis() && jmTuangou.getTgStatus() == 1) {
       Buy buy1 = buyMapper.selectBuyOne(buy.getUserId(), buy.getJmId());
       buy.setBuyId(buy1.getBuyId());
-      buy.setBuyStatus(4);
+      buy.setBuyStatus(2);//撤单
       return buyMapper.updateById(buy);
     }
     //不允许更改

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

@@ -4,12 +4,12 @@
 
 
     <select id="selectBuyOne" resultType="com.bofeng.entity.Buy">
-        select * from jm_buy where user_id=#{userId} and jm_id=#{jmId} limit 1
+        select * from jm_buy where user_id=#{userId} and jm_id=#{jmId}  and buy_status=1 limit 1
     </select>
 
     <select id="group" resultType="com.bofeng.entity.JmTuangou">
        select *,
-       IFNULL((select SUM(jb.buy_count) FROM jm_buy jb where jb.jm_id=jt.jm_id),0) as count
+       IFNULL((select SUM(jb.buy_count) FROM jm_buy jb where jb.jm_id=jt.jm_id and buy_status=1),0) as count
        FROM jm_tuangou jt
        where jt.uptown_id =(select c.uptown_id
        from sys_user_role a
@@ -22,7 +22,7 @@
         select DISTINCT a.tg_title,b.time_create,a.tg_status,a.jm_id,b.buy_status
         from  jm_tuangou a
         INNER JOIN jm_buy b on a.jm_id=b.jm_id
-        where a.user_id=#{userId}
+        where a.user_id=#{userId} and buy_status=1
     </select>
 
 
@@ -37,7 +37,7 @@
     <select id="status" resultType="com.bofeng.entity.Buy">
        SELECT a.tg_status,a.tg_price,
        IFNULL(( SELECT SUM(b.buy_count)
-      FROM jm_buy b WHERE a.jm_id = b.jm_id ), 0 ) AS count
+      FROM jm_buy b WHERE a.jm_id = b.jm_id and buy_status=1), 0 ) AS count
       FROM jm_tuangou a
       WHERE a.jm_id = #{jmId} limit 1
     </select>