guojing 5 rokov pred
rodič
commit
29d685c89f

+ 4 - 35
admin-ui/app/whepi/tugou/dialogTugou.js

@@ -97,28 +97,18 @@ define(function (require) {
 
               },
             },{
-              name: 'tgSupplier',
+              name: 'tgPrice',
               label: '单价',
               readonly: context.isEdit ? true : false,
               maxlength: 4, validType: 'integer',
               width: 450, height: 35,
             },
               {
-                name: 'tgPrice',
-                label: '供应商',
+                name: 'tgSupplier',
+                label: '指挥者',
                 xtype: 'hidden',
+                value:'指挥者',
               }
-              /*{
-                name: 'tgTitle',
-                label: '发布标题',
-                readonly: true,
-                value: value,
-                width: 450,
-                height: 35, validType: 'isBlank',
-                onRender: function () {
-                  $combRow = $(this);
-                }
-              }*/
             ],
             [{
               name: 'tgGoods', label: '套餐描述',
@@ -127,13 +117,6 @@ define(function (require) {
               readonly: context.isEdit ? true : false,
               height: '100px', multiline: true,
             }],
-        /*    [{
-              name: 'tgPrice',
-              label: '单价',
-              readonly: context.isEdit ? true : false,
-              maxlength: 4, validType: 'integer',
-              required: true, width: 450, height: 35,
-            }],*/
             [{
               name: 'tgMinNum',
               label: '最低配送',
@@ -166,26 +149,12 @@ define(function (require) {
                 readonly: context.isEdit ? true : false,
                 required: true, maxlength: 11,
               }],
-            /* [{
-               name: 'remark',
-               label: '备注',
-               multiline: true,
-               width: 900,
-               height: '100px',
-               maxlength: 100,
-             }]*/
           ],
         }
       },
       buttons: [
         {
           text: "保存", iconCls: "fa fa-save", onClick: function () {
-            if (isLoading === true) {
-              return;
-            }
-            else {
-              isLoading = true;
-            }
             if ($form.formGet().uptownIds == '') {
               $.yvan.msg('请先选择小区');
               return;

+ 37 - 17
admin-ui/app/whepi/tugou/tugou.js

@@ -132,26 +132,26 @@ define(function (require) {
           },
           {
             text: '取消', iconCls: 'fa fa-times-circle', onClick: function () {
-              debugger;
               var row = $grid1.rowData();
               if (!row) {
                 $.yvan.msg('请先选择一行数据');
                 return;
               }
-              if (row.pubStatus != 1) {
-                $.yvan.msg('草稿状态才能发布');
+              if (row.tgStatus != 1) {
+                $.yvan.msg('在团状态才能取消');
                 return;
               }
-              $.yvan.confirm('是否' + "<span style='color: green; font-weight:bold;'>发布</span>" + '[' + (row.joName) + ']任务?', {
+              $.yvan.confirm('是否' + "<span style='color: red; font-weight:bold;'>取消</span>" + '[' + (row.tgTitle) + ']吗?', {
                 yes: function (index) {
                   $.yvan.ajax({
                     method: 'post',
-                    url: api('/record/CustInfo/updatePub'),///wms/inv/updateFaBuPC
+                    url: api('/yeweihui/updateStatus'),
                     data: {
-                      joId: row.joId,
+                      jmId: row.jmId,
+                      tgStatus: 4,
                     },
                     success: function (data) {
-                      $.yvan.msg('发布成功');
+                      $.yvan.msg('取消成功');
                       $grid1.reload();
                     }
                   });
@@ -161,26 +161,26 @@ define(function (require) {
           },
           {
             text: '完成', iconCls: 'fa fa-circle-o-notch', onClick: function () {
-              debugger;
               var row = $grid1.rowData();
               if (!row) {
                 $.yvan.msg('请先选择一行数据');
                 return;
               }
-              if (row.pubStatus != 1) {
-                $.yvan.msg('草稿状态才能发布');
+              if (row.tgStatus != 1) {
+                $.yvan.msg('在团状态才能完成');
                 return;
               }
               $.yvan.confirm('是否' + "<span style='color: green; font-weight:bold;'>发布</span>" + '[' + (row.joName) + ']任务?', {
                 yes: function (index) {
                   $.yvan.ajax({
                     method: 'post',
-                    url: api('/record/CustInfo/updatePub'),///wms/inv/updateFaBuPC
+                    url: api('/yeweihui/updateStatus'),
                     data: {
-                      joId: row.joId,
+                      jmId: row.jmId,
+                      tgStatus: 2,
                     },
                     success: function (data) {
-                      $.yvan.msg('发布成功');
+                      $.yvan.msg('完成');
                       $grid1.reload();
                     }
                   });
@@ -190,8 +190,14 @@ define(function (require) {
           },
           {
             text: '查看需求详情', iconCls: 'fa fa-search', onClick: function () {
+              var row = $grid1.rowData();
+              if (!row) {
+                $.yvan.msg('请先选择一行数据');
+                return;
+              }
               $.yvan.showDialog(this,
                 require('/app/whepi/tugou/import.js')({
+                  jmId: row.jmId,
                   confirm: function () {
                     $grid1.reload();
                   },
@@ -230,10 +236,22 @@ define(function (require) {
                 [
                   [
                     {field: 'jmId', title: '信息id', hidden: true},
-                    {field: 'uptown_id', title: '小区id', maxWidth: 200, align: 'left', hidden: true},
-                    /*  {field: 'uptownName', title: '小区', maxWidth: 200, align: 'left',},*/
-                    {field: 'tgTitle', title: '标题', maxWidth: 200, align: 'left',},
-                    {field: 'tgTitle', title: '需求类型', maxWidth: 200, align: 'left',},
+                    {field: 'tgTitle', title: '标题', maxWidth: 200, align: 'left'},
+                    {
+                      field: 'tgType', title: '需求类型', maxWidth: 200, align: 'left', formatter: function (value) {
+                        if (value == 1) {
+                          return '食蔬采购';
+                        } else if (value == 2) {
+                          return '药品采购';
+                        } else if (value == 3) {
+                          return '医疗服务';
+                        } else if (value == 4) {
+                          return '生活用品';
+                        } else if (value == 5) {
+                          return '其他服务';
+                        }
+                      }
+                    },
                     {field: 'tgSupplier', title: '组织者', maxWidth: 200,},
                     {
                       field: 'tgGoods',
@@ -279,6 +297,8 @@ define(function (require) {
                       },
                     },
                     {field: 'tgStatus', title: '状态', hidden: true},
+                    {field: 'timeCreate', title: '创建时间', align: 'center'},
+                    {field: 'timeUpdate', title: '修改时间', align: 'center'},
                   ]
                 ]
             }

+ 1 - 2
whepi-web/src/main/java/com/bofeng/entity/JmTuangou.java

@@ -36,7 +36,7 @@ public class JmTuangou implements Serializable {
     /**
      * 团购标题
      */
-    private String tgType;
+    private Integer tgType;
 
     /**
      * 团购供应商
@@ -89,7 +89,6 @@ public class JmTuangou implements Serializable {
     @TableField(exist = false)
     private String deliverTime;
 
-    @TableField(exist = false)
     private Integer roleType;
 
     /**

+ 25 - 14
whepi-web/src/main/java/com/bofeng/service/JmTuangouService.java

@@ -17,6 +17,7 @@ import org.springframework.transaction.annotation.Transactional;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Arrays;
+import java.util.Calendar;
 import java.util.Date;
 import java.util.List;
 
@@ -86,7 +87,9 @@ public class JmTuangouService {
 
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
   public Integer whepiTuangouPublish(String uptownIds, JmTuangou jmTuangou) {
-
+    Calendar cal = Calendar.getInstance();
+    int moth = cal.get(Calendar.MONTH) + 1;
+    int date = cal.get(Calendar.DAY_OF_MONTH);
     Integer success = 0;
     List<String> uptownIdArray = Arrays.asList(uptownIds.split(","));
     for (String uptownId : uptownIdArray) {
@@ -96,21 +99,24 @@ public class JmTuangouService {
       jmTuangou.setUptownId(Long.parseLong(uptownId));
 
       jmTuangou.setTgStatus(1);
+      jmTuangou.setRoleType(1);
+      jmTuangou.setUserUpdate(JwtHelper.getUserId());
+
+      if (jmTuangou.getTgType() == 1) {
+        jmTuangou.setTgTitle("食蔬采购需求统计(指挥部" + moth + "月" + date + "日)");
 
-            /*SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm");
+      } else if (jmTuangou.getTgType() == 2) {
+        jmTuangou.setTgTitle("药品采购需求统计((指挥部" + moth + "月" + date + "日)");
 
-            Date tgEndTime = new Date();
-            Date tgDeliverTime = new Date();
-            try {
-                tgEndTime = sdf.parse(jmTuangou.getEndTime());
-                tgDeliverTime = sdf.parse(jmTuangou.getDeliverTime());
-            }
-            catch (ParseException e) {
-                e.printStackTrace();
-            }
+      } else if (jmTuangou.getTgType() == 3) {
+        jmTuangou.setTgTitle("医疗服务需求统计((指挥部" + moth + "月" + date + "日)");
 
-            jmTuangou.setTgEndTime(jmTuangou.gettgEndTime);
-            jmTuangou.setTgDeliverTime(tgDeliverTime);*/
+      } else if (jmTuangou.getTgType() == 4) {
+        jmTuangou.setTgTitle("生活用品需求统计((指挥部" + moth + "月" + date + "日)");
+      } else if (jmTuangou.getTgType() == 5) {
+        jmTuangou.setTgTitle("其他服务需求统计((指挥部" + moth + "月" + date + "日)");
+
+      }
       jmTuangou.setUserId(JwtHelper.getUserId());
       success = jmTuangouDao.insert(jmTuangou);
       if (success == 1) {
@@ -182,7 +188,7 @@ public class JmTuangouService {
   }
 
   @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
-  public JmTuangou getSelectOne(Long jmId){
+  public JmTuangou getSelectOne(Long jmId) {
     buyService.updateStatus();
     return jmTuangouDao.getSelectOne(jmId);
   }
@@ -191,4 +197,9 @@ public class JmTuangouService {
   public Integer zhihuibuUpdateStatus(Long jmId, Long status) {
     return jmTuangouDao.updateStatusByJmId(jmId, status);
   }
+
+  @Transactional(rollbackFor = Exception.class, propagation = Propagation.REQUIRED)
+  public int updateStatus(Long jmId,Long tgStatus){
+    return jmTuangouDao.updateStatusByJmId(jmId,tgStatus);
+  }
 }

+ 6 - 0
whepi-web/src/main/java/com/bofeng/wx/controller/YeWeiHuiController.java

@@ -435,4 +435,10 @@ public class YeWeiHuiController {
     List<JmTuangouMember> members = jmTuangouMemberService.querMemberListByJmId(jmId);
     return Model.newSuccess(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));
+  }
 }

+ 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