Browse Source

admin 2月15号

guojing 5 năm trước cách đây
mục cha
commit
5851fd9d8a

+ 8 - 2
admin-ui/app/whepi/tugou/dialogTugou.js

@@ -103,8 +103,14 @@ define(function (require) {
               readonly: context.isEdit ? true : false,
               maxlength: 6, validType: 'number',
               width: 450, height: 35,
-            },
-            ],
+            }],
+            [{
+              name: 'tgItemNum',
+              label: '单人限额',
+              readonly: context.isEdit ? true : false,
+              maxlength: 6, validType: 'integer',
+              width: 450, height: 35,
+            },],
             [{
               name: 'tgGoods', label: '套餐描述',
               required: true, width: 900, height: 35,

+ 8 - 4
whepi-ui/templates/home/buyClient.ftl

@@ -45,7 +45,8 @@
         ">备     注:
     </div>
     <textarea id="Myremarks" class="weui-textarea" placeholder="输入内容(200字内)" rows="3"
-              style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;" maxlength="200"></textarea>
+              style="border: 1px solid rgba(0,0,0,.2);box-sizing:border-box; border-radius: 5px; margin-top: 1vh;"
+              maxlength="200"></textarea>
 </div>
     <div style="display:flex; flex-direction: row; justify-content: space-between; margin-top: 1vh; margin-bottom: 5vh;">
     <#if type==1>
@@ -82,7 +83,7 @@
                 $("#myPhone").val(data.data.phone);
                 if (data.data.roleType == 1) {
                     $("#tc1").toggle();
-                }else {
+                } else {
                     $("#tc").html(data.data.tgMaxNum - data.data.count);
                 }
                 if (data.data.myRemark != null)
@@ -173,6 +174,9 @@
                 if (data.data == 3) {
                     $.alert("团购数量已经超过最大上限");
                     return false;
+                } else if (data.data == 4) {
+                    $.alert("团购数量已经超过单人限额");
+                    return false;
                 }
                 buyBack();
             },
@@ -197,8 +201,8 @@
             type: 'GET',
             async: false,
             success: function (data) {
-                console.log(data);
-                $("#myMenory").html($('#buyCount').val() * data.data.tgPrice)
+                console.log(data);//
+                $("#myMenory").html(Math.round($('#buyCount').val() * data.data.tgPrice * 10) / 10)
             },
             error: function () {
             }

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

@@ -33,12 +33,21 @@ public class BuyService {
       Buy buy2 = buyMapper.selectById(buy1.getBuyId());
       if (roleType.getRoleType() != 1) {
         if (jmTuangou.getTgMaxNum().intValue() >= jmTuangou.getCurrentNum().intValue() - buy2.getBuyCount().intValue() + buy.getBuyCount().intValue()) {
+          //个人限额(指挥部的限额 和 管理员的限额)
+          if (roleType.getTgItemNum().intValue() != 0 && roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
+            return 4;
+          }
           buy.setBuyId(buy1.getBuyId());
           return buyMapper.updateById(buy);
         } else {
           return 3;//不允许更改团购数量
         }
       } else {
+        //指挥部的更改
+        //个人限额(指挥部的限额 和 管理员的限额)
+        if (roleType.getTgItemNum().intValue() != 0 && roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
+          return 4;
+        }
         buy.setBuyId(buy1.getBuyId());
         return buyMapper.updateById(buy);
       }
@@ -51,6 +60,10 @@ public class BuyService {
         return 3;
       }
     }
+    //个人限额(指挥部的限额 和 管理员的限额)
+    if (roleType.getTgItemNum().intValue() < buy.getBuyCount().intValue()) {
+      return 4;
+    }
 
     buy.setBuyId(IdWorker.getId());
     buy.setUserCreate(buy.getUserId());
@@ -105,7 +118,7 @@ public class BuyService {
     if (jmTuangous != null && jmTuangous.size() > 0) {
       for (JmTuangou list : jmTuangous) {
         //判断是指挥部还是管理员
-        if (list.getRoleType()==1) {
+        if (list.getRoleType() == 1) {
           if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
             jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
           }

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

@@ -65,10 +65,10 @@ public class UserOpenController {
                              @RequestParam(value = "userType", required = false, defaultValue = "0") Integer userType) throws JsonProcessingException {
         List<UserRole> list = new ArrayList<>();
         if (userId == 0) {
-           UserOpen userOpen = homeService.getUserOpen();
+            UserOpen userOpen = homeService.getUserOpen();
             list = userRoleMapper.getUserRoleByUserId(userOpen.getUserId());
 //            list = userRoleMapper.getUserRoleByUserId(1225321682867105793L);
-//            UserOpen userOpen = userOpenMapper.selectByUserId(1225321682867105793L);
+//            UserOpen userOpen = userOpenMapper.select ByUserId(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: lll
+  profiles.active: guojing
 
   application:
     name: bofeng-web