Selaa lähdekoodia

修改 活动地址添加地图选点功能

huZhiHao 6 vuotta sitten
vanhempi
commit
f18fe7a886

+ 8 - 6
src/main/java/platform/modules/api/web/ActivityOpenController.java

@@ -1,7 +1,5 @@
 package platform.modules.api.web;
 
-import com.alibaba.fastjson.JSON;
-import org.apache.commons.io.IOUtils;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.util.CollectionUtils;
@@ -10,7 +8,6 @@ import platform.common.Constant;
 import platform.common.annotation.OperationLog;
 import platform.common.base.controller.BaseController;
 import platform.common.util.ShiroUtils;
-import platform.common.util.WxAppUtil;
 import platform.modules.build.entity.Company;
 import platform.modules.build.service.CompanyService;
 import platform.modules.government.dto.ParamRegistration;
@@ -107,9 +104,14 @@ public class ActivityOpenController extends BaseController {
     public ResponseMessage getActivityDetail(@RequestParam("activity_id") String id, @RequestParam("phone") String phone) {
 
         List<ActivityRegistration> activityRegistrationList = activityRegistrationService.getCurrRegUsers(id, phone);
-        if (CollectionUtils.isEmpty(activityRegistrationList))
-            return ResponseMessage.success("查询成功!", false);
-        return ResponseMessage.success("查询成功!", true);
+        if (!CollectionUtils.isEmpty(activityRegistrationList)){
+            for (ActivityRegistration activityRegistration : activityRegistrationList) {
+                if(!Objects.equals("3",activityRegistration.getReview_state())){
+                    return ResponseMessage.success("查询成功!", true);
+                }
+            }
+        }
+        return ResponseMessage.success("查询成功!", false);
     }
 
     /**

+ 13 - 0
src/main/java/platform/modules/government/web/ActivityController.java

@@ -1076,5 +1076,18 @@ public class ActivityController extends BaseController {
         is.close();
         os.close();
     }
+
+    /**
+     * 跳转到地图
+     *
+     * @return
+     * @throws Exception
+     */
+    @GetMapping(value = "/map")
+    public String toMap() throws Exception {
+        log.info("跳转到地图!");
+
+        return BASE_GOVERNMENT_PATH + "map_component/map";
+    }
 }
 

+ 2 - 0
src/main/java/platform/modules/sys/entity/ActivityDetail.java

@@ -21,6 +21,8 @@ public class ActivityDetail extends BaseEntity {
 
     private String activity_location;
 
+    private String lat_lng;
+
     private String activity_starttime;
 
     private String activity_endtime;

+ 2 - 0
src/main/resources/mapper/sys/ActivityDetailDao.xml

@@ -125,6 +125,7 @@
 			detail.activity_type activity_type,
 			detail.activity_title activity_title,
 			detail.activity_location activity_location,
+			detail.lat_lng lat_lng,
 			detail.activity_starttime activity_starttime,
 			detail.activity_endtime activity_endtime,
 			detail.activity_state activity_state,
@@ -175,6 +176,7 @@
         <result column="activity_type" property="activity_type"/>
         <result column="activity_title" property="activity_title"/>
         <result column="activity_location" property="activity_location"/>
+        <result column="lat_lng" property="lat_lng"/>
         <result column="activity_starttime" property="activity_starttime"/>
         <result column="activity_endtime" property="activity_endtime"/>
         <result column="activity_state" property="activity_state"/>

+ 6 - 0
src/main/resources/static/js/government/activity/activity_add.js

@@ -171,3 +171,9 @@ function activity_addPush(title, url, w, h) {
     layer_show(title, pagePath + url, w, h);
 }
 
+function activity_map(title, url, w, h) {
+
+    var index = layer_show(title, pagePath + url, w, h);
+    // layer.full(index);
+}
+

+ 6 - 0
src/main/resources/static/js/government/activity/activity_edit.js

@@ -171,3 +171,9 @@ function activity_addPush(title, url, w, h) {
     layer_show(title, pagePath + url, w, h);
 }
 
+function activity_map(title, url, w, h) {
+
+    var index = layer_show(title, pagePath + url, w, h);
+    // layer.full(index);
+}
+

+ 14 - 5
src/main/resources/templates/admin/government/activity_add.html

@@ -80,16 +80,25 @@
             <div class="formControls col-xs-8 col-sm-9">
                 <input type="text" class="input-text" value="" placeholder="请输入活动地点" th:id="activity_location"
                        th:name="activity_location"/>
+                <input hidden type="text" class="input-text" value="" th:id="lat_lng" th:name="lat_lng"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-2"></label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <a class="btn btn-primary radius"
+                   th:onclick="'javascript:activity_map(\'地图选址\',\'/government/activity/map\',\'1000\',\'700\');'"><i
+                        class="Hui-iconfont"></i>地图选址</a>
             </div>
         </div>
         <div class="row cl">
             <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span><span>活动开始时间:</span></label>
             <div class="formControls col-xs-8 col-sm-9">
-            <input type="text" class="input-text" id="activity_starttime" name="activity_starttime"
-                   th:id="activity_starttime" th:name="activity_starttime" style="float:left; width: 150px;"/>
-            <input class="Wdate input-text" type="text" th:id="activity_starttimeIE" th:name="activity_starttime"
-                   style="float:left; width: 150px;"
-                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',maxDate:'#F{$dp.$D(\'activity_endtimeIE\')}',isShowClear:true,readOnly:true})"/>
+                <input type="text" class="input-text" id="activity_starttime" name="activity_starttime"
+                       th:id="activity_starttime" th:name="activity_starttime" style="float:left; width: 150px;"/>
+                <input class="Wdate input-text" type="text" th:id="activity_starttimeIE" th:name="activity_starttime"
+                       style="float:left; width: 150px;"
+                       onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm',maxDate:'#F{$dp.$D(\'activity_endtimeIE\')}',isShowClear:true,readOnly:true})"/>
             </div>
         </div>
         <div class="row cl">

+ 9 - 0
src/main/resources/templates/admin/government/activity_edit.html

@@ -65,6 +65,15 @@
             <div class="formControls col-xs-8 col-sm-9">
                 <input type="text" class="input-text" th:value="${activity.activity_location}" placeholder="请输入活动地点"
                        th:id="activity_location" th:name="activity_location"/>
+                <input hidden type="text" class="input-text" value="" th:value="${activity.lat_lng}" th:id="lat_lng" th:name="lat_lng"/>
+            </div>
+        </div>
+        <div class="row cl">
+            <label class="form-label col-xs-4 col-sm-2"></label>
+            <div class="formControls col-xs-8 col-sm-9">
+                <a class="btn btn-primary radius"
+                   th:onclick="'javascript:activity_map(\'地图选址\',\'/government/activity/map\',\'1000\',\'700\');'"><i
+                        class="Hui-iconfont"></i>地图选址</a>
             </div>
         </div>
         <div class="row cl">