Jelajahi Sumber

admin 2月15号

guojing 5 tahun lalu
induk
melakukan
f088770abd

+ 1 - 1
admin-ui/app/whepi/tugou/dialogTugou.js

@@ -118,7 +118,7 @@ define(function (require) {
             [{
               name: 'tgGoods', label: '套餐描述',
               required: true, width: 900, height: 35,
-              maxlength: 50,
+              maxlength: 500,
               readonly: context.isEdit ? true : false,
               height: '100px', multiline: true,
             }],

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

@@ -94,29 +94,35 @@ public class BuyService {
     List<JmTuangou> jmTuangous = jmTuangouDao.selectAll();
     if (jmTuangous != null && jmTuangous.size() > 0) {
       for (JmTuangou list : jmTuangous) {
-        // 团购数量  最小起订量
-        Buy buy = buyMapper.selectCountNum(list.getJmId());
-        //已经到截止时间
-        if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
-
-          if (buy != null) { //最小起订量
-            if (list.getTgMinNum().intValue() > buy.getCount().intValue()) {
-              jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+        //判断是指挥部还是管理员
+        if (list.getTgSupplier().equals("指挥部")) {
+          if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
+            jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//取消
+          }
+        } else {
+          // 团购数量  最小起订量
+          Buy buy = buyMapper.selectCountNum(list.getJmId());
+          //已经到截止时间
+          if (list.getTgEndTime().getTime() < new DateTime().getMillis()) {
+
+            if (buy != null) { //最小起订量
+              if (list.getTgMinNum().longValue() > buy.getCount().longValue()) {
+                jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
+              } else {
+                jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
+              }
             } else {
-              jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
+              jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
             }
           } else {
-            jmTuangouDao.updateStatusByJmId(list.getJmId(), 4L);//取消
-          }
-        } else {
-          //团购数量已经过了最大起订量的 就直接发货
-          if (buy != null) {
-            if (list.getTgMaxNum().intValue() == buy.getCount().intValue()) {
-              jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
+            //团购数量已经过了最大起订量的 就直接发货
+            if (buy != null) {
+              if (list.getTgMaxNum().intValue() == buy.getCount().intValue()) {
+                jmTuangouDao.updateStatusByJmId(list.getJmId(), 2L);//发货
+              }
             }
           }
         }
-
       }
     }
     return 1;