Przeglądaj źródła

admin 2月20号

guojing 5 lat temu
rodzic
commit
1701f2680d

+ 21 - 12
admin-ui/app/whepi/tugou/dialogTugou.js

@@ -36,12 +36,12 @@ define(function (require) {
     return {
       xtype: 'dialog',
       dialogId: 'dialogTugou',
-      title: context.isEdit ? '取消团购信息' : '新增需求发布',
+      title: context.isEdit == 2 ? '增补修订需求' : '新增需求发布',
       width: '100%',
       height: '100%',
       onOpen: function () {
         $dlg = $(this);
-        if (context.isEdit) {
+        if (context.isEdit != 1) {
           $.yvan.ajax({
             loadingMask: false,
             url: api('/getSelectOne'),
@@ -78,7 +78,7 @@ define(function (require) {
                 width: 900,
                 height: 35,
                 validType: 'isBlank',
-                readonly: context.isEdit ? true : false,
+                readonly: context.isEdit != 1 ? true : false,
                 onChange: function (data) {
                   queryGrid1(data);
                 },
@@ -93,6 +93,7 @@ define(function (require) {
               }, {id: '5', text: '其他服务'}],
               width: 450,
               height: 35,
+              readonly: context.isEdit != 1 ? true : false,
               required: true,
               onChange: function (data) {
 
@@ -100,14 +101,14 @@ define(function (require) {
             }, {
               name: 'tgPrice',
               label: '单价',
-              readonly: context.isEdit ? true : false,
+              readonly: context.isEdit != 1 ? true : false,
               maxlength: 6, validType: 'number',
               width: 450, height: 35,
             }],
             [{
               name: 'tgItemNum',
               label: '单人限额',
-              readonly: context.isEdit ? true : false,
+              readonly: context.isEdit != 1 ? true : false,
               maxlength: 6, validType: 'integer',
               width: 450, height: 35,
             },],
@@ -115,31 +116,31 @@ define(function (require) {
               name: 'tgGoods', label: '套餐描述',
               required: true, width: 900, height: 35,
               maxlength: 500,
-              readonly: context.isEdit ? true : false,
+              readonly: context.isEdit != 1 ? true : false,
               height: '100px', multiline: true,
             }],
             [{
               name: 'tgMinNum',
               label: '最低配送',
-              readonly: context.isEdit ? true : false,
+              readonly: context.isEdit != 1 ? true : false,
               maxlength: 4, validType: 'integer',
               width: 450, height: 35,
             }, {
               name: 'tgMaxNum',
-              readonly: context.isEdit ? true : false,
+              readonly: context.isEdit != 1 ? true : false,
               label: '配送上限', validType: 'integer',
               maxlength: 4, width: 450, height: 35,
             }],
             [{
               name: 'tgEndTime',
               label: '需求截止时间',
-              readonly: context.isEdit ? true : false,
+              readonly: context.isEdit != 1 ? true : false,
               xtype: 'datetimebox',
               required: true, width: 450, height: 35,
             }, {
               name: 'tgDeliverTime',
               multiline: true,
-              readonly: context.isEdit ? true : false,
+              readonly: context.isEdit != 1 ? true : false,
               xtype: 'datetimebox',
               label: '预计配货时间',
               required: true, width: 450, height: 35,
@@ -147,13 +148,21 @@ define(function (require) {
               {
                 name: 'tgPhoneNumber', validType: 'telNum',
                 label: '联系电话', width: 450, height: 35,
-                readonly: context.isEdit ? true : false,
+                readonly: context.isEdit != 1 ? true : false,
                 required: true, maxlength: 11,
               },
               {
                 name: 'tgSupplier', width: 450, height: 35,
                 label: '供应商', maxlength: 20,
+                readonly: context.isEdit != 1 ? true : false,
               }],
+            [
+              {
+                name: 'remark', width: 900, height: 120,
+                label: '备注', maxlength: 500, multiline: true,
+                required: true, xtype: context.isEdit==1 ? 'hidden' : '',
+              }
+            ]
           ],
         }
       },
@@ -180,7 +189,7 @@ define(function (require) {
               isLoading = true;
             }
             $.yvan.postForm($form, {
-              url: (context.isEdit ? api('/yeweihui/tgStatus') : api('/yeweihui/tgPublish')),
+              url: (context.isEdit == 1 ? api('/yeweihui/tgPublish') : (context.isEdit == 3 ? api('/yeweihui/updateStatus') : api('/yeweihui/tgStatus'))),
               success: function (data) {
                 isLoading = false;
                 console.log("返回数据", data);

+ 38 - 21
admin-ui/app/whepi/tugou/tugou.js

@@ -122,7 +122,7 @@ define(function (require) {
             text: '新增', iconCls: 'fa fa-plus-circle fa-lg', onClick: function () {
               $.yvan.showDialog(this,
                 require('/app/whepi/tugou/dialogTugou.js')({
-                  isEdit: false,
+                  isEdit: 1,
                   confirm: function () {
                     queryGrid1();
                   }
@@ -131,6 +131,29 @@ define(function (require) {
             }
           },
           {
+            text: '增补修订', iconCls: 'fa fa-pencil-square-o', onClick: function () {
+              var row = $grid1.rowData();
+              if (!row) {
+                $.yvan.msg('请先选择一行数据');
+                return;
+              }
+              if (row.tgStatus != 1) {
+                $.yvan.msg('在团状态才能增补修订');
+                return;
+              }
+              $.yvan.showDialog(this,
+                require('/app/whepi/tugou/dialogTugou.js')({
+                  isEdit: 2,
+                  jmId: row.jmId,
+                  confirm: function () {
+                    queryGrid1();
+                  }
+                })
+              );
+            }
+          },
+
+          {
             text: '取消', iconCls: 'fa fa-times-circle', onClick: function () {
               var row = $grid1.rowData();
               if (!row) {
@@ -141,22 +164,15 @@ define(function (require) {
                 $.yvan.msg('在团状态才能取消');
                 return;
               }
-              $.yvan.confirm('是否' + "<span style='color: red; font-weight:bold;'>取消</span>" + '[' + (row.tgTitle) + ']吗?', {
-                yes: function (index) {
-                  $.yvan.ajax({
-                    method: 'post',
-                    url: api('/yeweihui/updateStatus'),
-                    data: {
-                      jmId: row.jmId,
-                      tgStatus: 4,
-                    },
-                    success: function (data) {
-                      $.yvan.msg('取消成功');
-                      $grid1.reload();
-                    }
-                  });
-                }
-              });
+              $.yvan.showDialog(this,///yeweihui/updateStatus
+                require('/app/whepi/tugou/dialogTugou.js')({
+                  isEdit: 3,
+                  jmId: row.jmId,
+                  confirm: function () {
+                    queryGrid1();
+                  }
+                })
+              );
             }
           },
           {
@@ -166,15 +182,15 @@ define(function (require) {
                 $.yvan.msg('请先选择一行数据');
                 return;
               }
-              if (row.tgStatus != 1) {
-                $.yvan.msg('在团状态才能完成');
+              if (row.tgStatus == 3 || row.tgStatus == 4) {
+                $.yvan.msg('在团状态或者发货状态才能完成');
                 return;
               }
               $.yvan.confirm('是否' + "<span style='color: green; font-weight:bold;'>完成</span>" + '[' + (row.tgTitle) + ']吗?', {
                 yes: function (index) {
                   $.yvan.ajax({
                     method: 'post',
-                    url: api('/yeweihui/updateStatus'),
+                    url: api('/yeweihui/updateStatusstarts'),
                     data: {
                       jmId: row.jmId,
                       tgStatus: 3,
@@ -264,7 +280,7 @@ define(function (require) {
                     {
                       field: 'tgItemNum',
                       title: '单人限额',
-                      align:'left',
+                      align: 'left',
                     },
                     {
                       field: 'tgMinNum',
@@ -302,6 +318,7 @@ define(function (require) {
                       },
                     },
                     {field: 'tgStatus', title: '状态', hidden: true},
+                    {field: 'remark', title: '备注', maxWidth: 300,},
                     {field: 'timeCreate', title: '创建时间', align: 'center'},
                     {field: 'timeUpdate', title: '修改时间', align: 'center'},
                   ]

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

@@ -17,8 +17,8 @@
                          id="buyListGroup">
 
                         <div style="display: flex; flex-direction: row; color: grey; font-size: medium;">
-                            <div style="width: 30%; text-align: center;color: #0a001f">标题</div>
-                            <div style="width: 20%; text-align: center;color: #0a001f">已团</div>
+                            <div style="width: 38%; text-align: center;color: #0a001f">标题</div>
+                            <div style="width: 12%; text-align: center;color: #0a001f">已团</div>
                             <div style="width: 35%; text-align: center;color: #0a001f">截止时间</div>
                             <div style="width: 15%; text-align: center;color: #0a001f">状态</div>
                         </div>
@@ -103,8 +103,8 @@
             $('#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;">' + 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: 38%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px;text-align: left;">' + v.tgTitle + '</div>\n' +
+                    '                    <div style="width: 12%; overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size: 14px">\n' + v.count + '</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' +
                     '                <div class="weui-textarea-counter">\n' + '</div></div>\n' +

+ 6 - 2
whepi-ui/templates/home/buyClient.ftl

@@ -154,7 +154,7 @@
             return;
         }
 
-        if (!(/^1[34578]\d{9}$/.test($('#myPhone').val()))) {
+        if (!(/^1[345789]\d{9}$/.test($('#myPhone').val()))) {
             $.alert("手机号码有误,请重填");
             return false;
 
@@ -181,7 +181,11 @@
             success: function (data) {
                 console.log(data.data);
                 if (data.data == 3) {
-                    $.alert("团购数量已经超过最大上限");
+                    if ($("#tc").html() == 0) {
+                        $.alert("团购套餐已售空");
+                        return false;
+                    }
+                    $.alert("团购套餐只剩" + $('#tc').html() + "份");
                     return false;
                 } else if (data.data == 4) {
                     $.alert("团购数量已经超过单人限额");

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

@@ -137,14 +137,14 @@ public class BuyService {
             } else {
               jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
             }
-          } else {
+          } /*else {
             //团购数量已经过了最大起订量的 就直接发货
             if (buy != null) {
               if (list.getTgMaxNum().intValue() == buy.getCount().intValue()) {
                 jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
               }
             }
-          }
+          }*/
         }
       }
     }

+ 8 - 3
whepi-web/src/main/java/com/bofeng/service/JmTuangouService.java

@@ -134,7 +134,7 @@ public class JmTuangouService {
     }
     Integer success = jmTuangouDao.insertJmTuangouList(tgList);
     if (success > 0) {
-      Thread thread=new Thread(new Runnable() {
+      Thread thread = new Thread(new Runnable() {
         @Override
         public void run() {
           for (String uptownId : uptownIdArray) {
@@ -220,7 +220,12 @@ public class JmTuangouService {
   }
 
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-  public int updateStatus(Long jmId,Long tgStatus){
-    return jmTuangouDao.updateStatusByJmId(jmId,tgStatus);
+  public int updateStatus(Long jmId, Long tgStatus, String remark) {
+    return jmTuangouDao.updateStatusRemarkByJmId(jmId, tgStatus, remark);
+  }
+
+  @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+  public int updateRemarkByJmIdzbxd(JmTuangou jmTuangou) {
+    return jmTuangouDao.updateRemarkByJmId(jmTuangou.getJmId(), jmTuangou.getRemark());
   }
 }

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

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

+ 8 - 4
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -411,7 +411,7 @@ public class YeWeiHuiController {
 
   @PostMapping("/whepi/yeweihui/tgStatus")
   public ModelOps whepiYeweihuiTgStatus(@JsonBody JmTuangou jmTuangou) {
-    int success = jmTuangouService.updateRemarkByJmId(jmTuangou.getJmId(),4L, jmTuangou.getRemark());
+    int success = jmTuangouService.updateRemarkByJmIdzbxd(jmTuangou);
     return ModelOps.newSuccess(success);
   }
 
@@ -443,9 +443,13 @@ public class YeWeiHuiController {
     return Model.newSuccess(pageDb,members);
   }
 
-
   @PostMapping("/whepi/yeweihui/updateStatus")
-  public ModelOps updateStatus(@Pd(name = "jmId") Long jmId,@Pd(name = "tgStatus") Long tgStatus){
-    return ModelOps.newSuccess(jmTuangouService.updateStatus(jmId,tgStatus));
+  public ModelOps updateStatus(@JsonBody JmTuangou jmTuangou){
+    return ModelOps.newSuccess(jmTuangouService.updateStatus(jmTuangou.getJmId(),4L,jmTuangou.getRemark()));
+  }
+  @PostMapping("/whepi/yeweihui/updateStatusstarts")
+  public ModelOps updateStatus(@Pd(name = "jmId") Long jmId, @Pd(name = "tgStatus") Long tgStatus){
+    int success =jmTuangouService.zhihuibuUpdateStatus(jmId,tgStatus);
+    return ModelOps.newSuccess(success);
   }
 }

+ 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