guojing 5 éve
szülő
commit
0e5656b33d

+ 11 - 6
admin-ui/app/whepi/tugou/dialogTugou.js

@@ -85,7 +85,7 @@ define(function (require) {
               }],
             [{
               xtype: 'yvselect',
-              name: 'uptownIds',
+              name: 'xqType',
               label: '需求类型',
               data: [{id: '1', text: '食蔬采购'}, {id: '2', text: '药品采购'}, {id: '3', text: '医疗服务'}, {
                 id: '4',
@@ -97,12 +97,17 @@ define(function (require) {
 
               },
             },{
-              name: 'tgPrice',
+              name: 'tgSupplier',
               label: '单价',
               readonly: context.isEdit ? true : false,
               maxlength: 4, validType: 'integer',
               width: 450, height: 35,
-            }
+            },
+              {
+                name: 'tgPrice',
+                label: '供应商',
+                xtype: 'hidden',
+              }
               /*{
                 name: 'tgTitle',
                 label: '发布标题',
@@ -181,14 +186,14 @@ define(function (require) {
             else {
               isLoading = true;
             }
-            if ($form.formGet().uptownIds.trim() == '') {
+            if ($form.formGet().uptownIds == '') {
               $.yvan.msg('请先选择小区');
               return;
             }
-            if ($form.formGet().tgMinNum > $form.formGet().tgMaxNum) {
+           /* if ($form.formGet().tgMinNum > $form.formGet().tgMaxNum) {
               $.yvan.msg('最大上限必须大于等于最小起订量');
               return;
-            }
+            }*/
             if ($form.formGet().tgEndTime > $form.formGet().tgDeliverTime) {
               $.yvan.msg('团购截止时间必须小于预计送货时间');
               return;

+ 2 - 1
whepi-doc/group.sql

@@ -53,4 +53,5 @@ ADD  tg_type        varchar(20)     NOT NULL DEFAULT 0          COMMENT '团购
 ADD  user_create    bigint(20)      NOT NULL DEFAULT 0          COMMENT '新增人',
 ADD  time_create    datetime(0)     NOT NULL DEFAULT CURRENT_TIMESTAMP(0) COMMENT '新增时间',
 ADD  user_update    bigint(20)      NOT NULL DEFAULT 0          COMMENT '修改人',
-ADD  time_update    datetime(0)     NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间';
+ADD  time_update    datetime(0)     NOT NULL DEFAULT CURRENT_TIMESTAMP(0) ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '修改时间';
+ADD  role_type      int(11)         NOT NULL DEFAULT 0          COMMENT '角色类型  1 业委会角色 2 指挥部' AFTER tg_min_num;

+ 1 - 0
whepi-web/src/main/java/com/bofeng/dao/JmTuangouDao.java

@@ -38,4 +38,5 @@ public interface JmTuangouDao extends BaseMapper<JmTuangou> {
   JmTuangou selectByUserId();
 
   JmTuangou getSelectOne(@Param("jmId") Long jmId);
+
 }

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

@@ -27,6 +27,7 @@ public class BuyService {
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
   public int buyGroup(Buy buy) {
     Buy buy1 = buyMapper.selectBuyOne(buy.getUserId(), buy.getJmId());
+
     if (buy1 != null) {
       JmTuangou jmTuangou = jmTuangouDao.selectJmTuangouByJmId(buy1.getJmId());
       Buy buy2 = buyMapper.selectById(buy1.getBuyId());
@@ -38,7 +39,7 @@ public class BuyService {
       }
     }
     //第一次购买团购数量大于最大上限数量不允许
-    JmTuangou jmTuangou = jmTuangouDao.selectById(buy.getJmId());
+    JmTuangou jmTuangou = jmTuangouDao.selectJmTuangouByJmId(buy.getJmId());
     if (jmTuangou.getTgMaxNum().intValue() < jmTuangou.getCurrentNum().intValue() + buy.getBuyCount().intValue()) {
       return 3;
     }

+ 2 - 0
whepi-web/src/main/resources/mapper/JmTuangouMapper.xml

@@ -86,4 +86,6 @@
     <select id="getSelectOne" resultType="com.bofeng.entity.JmTuangou">
         select *,uptown_id as uptownIds from jm_tuangou where jm_id=#{jmId}
     </select>
+
+
 </mapper>