Authored by mingdan.ge

cps三期后台管理功能

1 -package com.yoho.unions.common.enums;  
2 -  
3 -import com.alibaba.fastjson.JSONArray;  
4 -import com.alibaba.fastjson.JSONObject;  
5 -  
6 -import java.util.HashMap;  
7 -import java.util.Map;  
8 -  
9 -/**  
10 - * Created by mingdan.ge on 2018/6/21.  
11 - */  
12 -public enum SocialMediaSectionEnum {  
13 - one(1,1,10000),  
14 - two(2,10001,20000),  
15 - three(3,20001,30000);  
16 -  
17 - private int no;  
18 - private int start;  
19 - private int end;  
20 -  
21 - SocialMediaSectionEnum(int no, int start, int end) {  
22 - this.no = no;  
23 - this.start = start;  
24 - this.end = end;  
25 - }  
26 -  
27 - public static Map<Integer, String> getAllSection(String separator) {  
28 - Map<Integer, String> map = new HashMap<>();  
29 - for (SocialMediaSectionEnum e : values()) {  
30 - map.put(e.getNo(), e.getStart() + separator + e.getEnd());  
31 - }  
32 - return map;  
33 - }  
34 - public static JSONArray getAllSectionArray(String separator) {  
35 - JSONArray jsonArray = new JSONArray();  
36 - for (SocialMediaSectionEnum e : values()) {  
37 - JSONObject jsonObject = new JSONObject();  
38 - jsonObject.put("no",e.getNo());  
39 - jsonObject.put("desc", e.getStart() + separator + e.getEnd());  
40 - jsonArray.add(jsonObject);  
41 - }  
42 - return jsonArray;  
43 - }  
44 -  
45 - public static String getSectionByNo(int no,String separator) {  
46 - for (SocialMediaSectionEnum e : values()) {  
47 - if (e.getNo() == no) {  
48 - return e.getStart() + separator + e.getEnd();  
49 - }  
50 - }  
51 - return null;  
52 - }  
53 - public static SocialMediaSectionEnum getEnumByNo(int no) {  
54 - for (SocialMediaSectionEnum e : values()) {  
55 - if (e.getNo() == no) {  
56 - return e;  
57 - }  
58 - }  
59 - return null;  
60 - }  
61 -  
62 - public int getNo() {  
63 - return no;  
64 - }  
65 -  
66 - public void setNo(int no) {  
67 - this.no = no;  
68 - }  
69 -  
70 - public int getStart() {  
71 - return start;  
72 - }  
73 -  
74 - public void setStart(int start) {  
75 - this.start = start;  
76 - }  
77 -  
78 - public int getEnd() {  
79 - return end;  
80 - }  
81 -  
82 - public void setEnd(int end) {  
83 - this.end = end;  
84 - }  
85 -}  
@@ -16,11 +16,11 @@ public interface UnionShareUserApplyMapper { @@ -16,11 +16,11 @@ public interface UnionShareUserApplyMapper {
16 int insertSelective(UnionShareUserApply record); 16 int insertSelective(UnionShareUserApply record);
17 17
18 UnionShareUserApply selectByPrimaryKey(Integer id); 18 UnionShareUserApply selectByPrimaryKey(Integer id);
19 - List<UnionShareUserApply> selectByIds(List<Integer> id); 19 + List<UnionShareUserApply> selectByIds(@Param("ids")Set<Integer> ids);
20 20
21 int updateByPrimaryKeySelective(UnionShareUserApply record); 21 int updateByPrimaryKeySelective(UnionShareUserApply record);
22 22
23 - int updateStatus(@Param("ids")List<Integer> ids,@Param("oldState")Integer oldState,@Param("newState")Integer newState,@Param("time")Integer time); 23 + int updateStatus(@Param("ids")Set<Integer> ids,@Param("oldState")Integer oldState,@Param("newState")Integer newState,@Param("time")Integer time);
24 24
25 int updateByPrimaryKey(UnionShareUserApply record); 25 int updateByPrimaryKey(UnionShareUserApply record);
26 26
@@ -24,6 +24,15 @@ @@ -24,6 +24,15 @@
24 from union_share_user_apply 24 from union_share_user_apply
25 where id = #{id,jdbcType=INTEGER} 25 where id = #{id,jdbcType=INTEGER}
26 </select> 26 </select>
  27 + <select id="selectByIds" resultMap="BaseResultMap" >
  28 + select
  29 + <include refid="Base_Column_List" />
  30 + from union_share_user_apply
  31 + where id in
  32 + <foreach collection="ids" open="(" close=")" item="id" separator=",">
  33 + #{id}
  34 + </foreach>
  35 + </select>
27 <select id="selectByCondition" 36 <select id="selectByCondition"
28 resultType="com.yoho.service.model.union.response.UnionShareUserApplyListBo" 37 resultType="com.yoho.service.model.union.response.UnionShareUserApplyListBo"
29 parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo"> 38 parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo">
@@ -52,8 +61,16 @@ @@ -52,8 +61,16 @@
52 <if test="status != null"> 61 <if test="status != null">
53 and status = #{status} 62 and status = #{status}
54 </if> 63 </if>
  64 + <if test="endTime != null">
  65 + and create_time &lt;= #{endTime}
  66 + </if>
  67 + <if test="beginTime != null">
  68 + and create_time &gt;= #{beginTime}
  69 + </if>
55 order by id desc 70 order by id desc
  71 + <if test="!queryAll">
56 limit #{start},#{size} 72 limit #{start},#{size}
  73 + </if>
57 </select> 74 </select>
58 <select id="selectTotalByCondition" resultType="java.lang.Integer" 75 <select id="selectTotalByCondition" resultType="java.lang.Integer"
59 parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo"> 76 parameterType="com.yoho.service.model.union.request.UnionShareUserApplyListReqBo">
@@ -81,6 +98,12 @@ @@ -81,6 +98,12 @@
81 <if test="status != null"> 98 <if test="status != null">
82 and status = #{status} 99 and status = #{status}
83 </if> 100 </if>
  101 + <if test="endTime != null">
  102 + and create_time &lt;= #{endTime}
  103 + </if>
  104 + <if test="beginTime != null">
  105 + and create_time &gt;= #{beginTime}
  106 + </if>
84 </select> 107 </select>
85 <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" > 108 <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
86 delete from union_share_user_apply 109 delete from union_share_user_apply
@@ -205,6 +228,18 @@ @@ -205,6 +228,18 @@
205 </set> 228 </set>
206 where id = #{id,jdbcType=INTEGER} 229 where id = #{id,jdbcType=INTEGER}
207 </update> 230 </update>
  231 + <update id="updateStatus" parameterType="com.yoho.unions.dal.model.UnionShareUserApply" >
  232 + update union_share_user_apply
  233 + <set >
  234 + status = #{newState,jdbcType=TINYINT},
  235 + check_time = #{time,jdbcType=INTEGER},
  236 + </set>
  237 + where id in
  238 + <foreach collection="ids" open="(" close=")" item="id" separator=",">
  239 + #{id}
  240 + </foreach>
  241 + and status = #{oldState,jdbcType=TINYINT}
  242 + </update>
208 <update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.UnionShareUserApply" > 243 <update id="updateByPrimaryKey" parameterType="com.yoho.unions.dal.model.UnionShareUserApply" >
209 update union_share_user_apply 244 update union_share_user_apply
210 set uid = #{uid,jdbcType=INTEGER}, 245 set uid = #{uid,jdbcType=INTEGER},
  1 +package com.yoho.unions.server.service.impl;
  2 +
  3 +import com.alibaba.fastjson.JSONObject;
  4 +import com.yoho.service.model.union.request.UnionShareUserApplyListReqBo;
  5 +import com.yoho.service.model.union.response.UnionShareUserApplyListBo;
  6 +import com.yoho.unions.common.enums.SocialMediaTypeEnum;
  7 +import com.yoho.unions.common.service.IBusinessExportService;
  8 +import com.yoho.unions.dal.UnionShareUserApplyMapper;
  9 +import org.springframework.beans.factory.annotation.Autowired;
  10 +import org.springframework.stereotype.Service;
  11 +
  12 +import java.util.List;
  13 +
  14 +/**
  15 + * CPS联盟用户申请导出
  16 + * Created by mingdan.ge on 2018/6/27.
  17 + * http://localhost/union//html/unionshare/unionShareUserApplys.html
  18 + */
  19 +@Service
  20 +public class UnionShareApplyExportImpl implements IBusinessExportService {
  21 +
  22 + @Autowired
  23 + UnionShareUserApplyMapper unionShareUserApplyMapper;
  24 +
  25 + @Override
  26 + public Class getDataClass() {
  27 + return UnionShareUserApplyListBo.class;
  28 + }
  29 +
  30 + @Override
  31 + public List<? extends Object> batchExport(String confStr){
  32 + UnionShareUserApplyListReqBo req = JSONObject.parseObject(confStr, UnionShareUserApplyListReqBo.class);
  33 + req.setQueryAll(true);
  34 + List<UnionShareUserApplyListBo> applys=this.unionShareUserApplyMapper.selectByCondition(req);
  35 + for(UnionShareUserApplyListBo bo:applys){
  36 + bo.setSocialMediaType(null==bo.getSocialMediaType()?null: SocialMediaTypeEnum.getNameByType(Integer.parseInt(bo.getSocialMediaType())));
  37 + }
  38 + return applys;
  39 +
  40 + }
  41 +}
@@ -26,6 +26,7 @@ import com.yoho.unions.server.service.IUnionShareService; @@ -26,6 +26,7 @@ import com.yoho.unions.server.service.IUnionShareService;
26 import com.yoho.unions.utils.DateUtils; 26 import com.yoho.unions.utils.DateUtils;
27 import com.yoho.unions.utils.ImagesHelper; 27 import com.yoho.unions.utils.ImagesHelper;
28 import org.apache.commons.collections.CollectionUtils; 28 import org.apache.commons.collections.CollectionUtils;
  29 +import org.apache.commons.lang3.ArrayUtils;
29 import org.apache.commons.lang3.StringUtils; 30 import org.apache.commons.lang3.StringUtils;
30 import org.slf4j.Logger; 31 import org.slf4j.Logger;
31 import org.slf4j.LoggerFactory; 32 import org.slf4j.LoggerFactory;
@@ -40,6 +41,7 @@ import java.text.DecimalFormat; @@ -40,6 +41,7 @@ import java.text.DecimalFormat;
40 import java.util.*; 41 import java.util.*;
41 import java.util.concurrent.TimeUnit; 42 import java.util.concurrent.TimeUnit;
42 import java.util.concurrent.atomic.AtomicInteger; 43 import java.util.concurrent.atomic.AtomicInteger;
  44 +import java.util.stream.Collectors;
43 45
44 46
45 /** 47 /**
@@ -289,7 +291,6 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport @@ -289,7 +291,6 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
289 List<UnionShareUserApplyListBo> applys=this.unionShareUserApplyMapper.selectByCondition(parm); 291 List<UnionShareUserApplyListBo> applys=this.unionShareUserApplyMapper.selectByCondition(parm);
290 for(UnionShareUserApplyListBo bo:applys){ 292 for(UnionShareUserApplyListBo bo:applys){
291 bo.setSocialMediaType(null==bo.getSocialMediaType()?null:SocialMediaTypeEnum.getNameByType(Integer.parseInt(bo.getSocialMediaType()))); 293 bo.setSocialMediaType(null==bo.getSocialMediaType()?null:SocialMediaTypeEnum.getNameByType(Integer.parseInt(bo.getSocialMediaType())));
292 - bo.setSocialMediaFans(null==bo.getSocialMediaFans()?null: SocialMediaSectionEnum.getSectionByNo(Integer.parseInt(bo.getSocialMediaFans()),"-"));  
293 } 294 }
294 PageResponseBO<UnionShareUserApplyListBo> result=new PageResponseBO<>(); 295 PageResponseBO<UnionShareUserApplyListBo> result=new PageResponseBO<>();
295 result.setList(applys); 296 result.setList(applys);
@@ -305,35 +306,17 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport @@ -305,35 +306,17 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
305 */ 306 */
306 @Override 307 @Override
307 public int refuseApply(IdOrIdsBo req){ 308 public int refuseApply(IdOrIdsBo req){
308 - if (req.getId() != null) {  
309 - //单个操作  
310 - UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectByPrimaryKey(req.getId());  
311 - if (unionShareUserApply == null || unionShareUserApply.getStatus() > 1) {  
312 - return 0;  
313 - }  
314 - UnionShareUserApply updateReq = new UnionShareUserApply();  
315 - updateReq.setId(req.getId());  
316 - updateReq.setStatus((byte) 3);//状态:1-申请中,2-通过,3-拒绝  
317 - updateReq.setCheckTime(DateUtil.getCurrentTimeSecond());  
318 - int result=unionShareUserApplyMapper.updateByPrimaryKeySelective(updateReq);  
319 - redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),unionShareUserApply.getUid());  
320 - return result;  
321 - } else {  
322 - //批量操作  
323 - List<UnionShareUserApply> unionShareUserApplies = unionShareUserApplyMapper.selectByIds(Arrays.asList(req.getIdArray()));  
324 - if (CollectionUtils.isEmpty(unionShareUserApplies)) {  
325 - return 0;  
326 - }  
327 - List<Integer> ids = new ArrayList<>();  
328 - unionShareUserApplies.forEach(u->{  
329 - ids.add(u.getId());  
330 - });  
331 - int result=unionShareUserApplyMapper.updateStatus(ids,1,3,DateUtil.getCurrentTimeSecond());  
332 - unionShareUserApplies.forEach(u->{  
333 - redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),u.getUid());  
334 - });  
335 - return result; 309 + UnionShareUserApply unionShareUserApply = unionShareUserApplyMapper.selectByPrimaryKey(req.getId());
  310 + if (unionShareUserApply == null || unionShareUserApply.getStatus() > 1) {
  311 + return 0;
336 } 312 }
  313 + UnionShareUserApply updateReq = new UnionShareUserApply();
  314 + updateReq.setId(req.getId());
  315 + updateReq.setStatus((byte) 3);//状态:1-申请中,2-通过,3-拒绝
  316 + updateReq.setCheckTime(DateUtil.getCurrentTimeSecond());
  317 + int result=unionShareUserApplyMapper.updateByPrimaryKeySelective(updateReq);
  318 + redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),unionShareUserApply.getUid());
  319 + return result;
337 320
338 } 321 }
339 /** 322 /**
@@ -356,23 +339,35 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport @@ -356,23 +339,35 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
356 updateReq.setCheckTime(DateUtil.getCurrentTimeSecond()); 339 updateReq.setCheckTime(DateUtil.getCurrentTimeSecond());
357 int result=unionShareUserApplyMapper.updateByPrimaryKeySelective(updateReq); 340 int result=unionShareUserApplyMapper.updateByPrimaryKeySelective(updateReq);
358 if (result > 0) { 341 if (result > 0) {
359 - //todo 绑定unionType 342 + // 绑定unionType
360 relateUnionType(unionShareUserApply.getUid()); 343 relateUnionType(unionShareUserApply.getUid());
361 } 344 }
362 redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),unionShareUserApply.getUid()); 345 redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),unionShareUserApply.getUid());
363 return result; 346 return result;
364 } else { 347 } else {
365 //批量操作 348 //批量操作
366 - List<UnionShareUserApply> unionShareUserApplies = unionShareUserApplyMapper.selectByIds(Arrays.asList(req.getIdArray())); 349 + Set<Integer> idSet = Arrays.stream(req.getIds().split(",")).map(s->{
  350 + Integer skn = null;
  351 + try {
  352 + skn = Integer.valueOf(s);
  353 + } catch (NumberFormatException e) {
  354 + }
  355 + return skn;
  356 + }).collect(Collectors.toSet());
  357 +
  358 + int currentTimeSecond = DateUtil.getCurrentTimeSecond();
  359 + int result=unionShareUserApplyMapper.updateStatus(idSet,1,2, currentTimeSecond);
  360 + if (result == 0) {
  361 + return 0;
  362 + }
  363 + List<UnionShareUserApply> unionShareUserApplies = unionShareUserApplyMapper.selectByIds(idSet);
367 if (CollectionUtils.isEmpty(unionShareUserApplies)) { 364 if (CollectionUtils.isEmpty(unionShareUserApplies)) {
368 return 0; 365 return 0;
369 } 366 }
370 - List<Integer> ids = new ArrayList<>();  
371 - unionShareUserApplies.forEach(u->{  
372 - ids.add(u.getId());  
373 - });  
374 - int result=unionShareUserApplyMapper.updateStatus(ids,1,2,DateUtil.getCurrentTimeSecond());  
375 unionShareUserApplies.forEach(u->{ 367 unionShareUserApplies.forEach(u->{
  368 + if (u.getCheckTime() != currentTimeSecond) {
  369 + return;
  370 + }
376 relateUnionType(u.getUid()); 371 relateUnionType(u.getUid());
377 redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),u.getUid()); 372 redisHashCache.delete(ShareOrdersKeyEnum.UNION_TYPE.getPreKey(),u.getUid());
378 }); 373 });
@@ -485,7 +480,6 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport @@ -485,7 +480,6 @@ public class UnionShareServiceImpl implements IUnionShareService,IBusinessExport
485 public Map<String,JSONArray> getSocialMediaBasicParams(){ 480 public Map<String,JSONArray> getSocialMediaBasicParams(){
486 logger.info("getBankList"); 481 logger.info("getBankList");
487 Map<String, JSONArray> result = new HashMap<>(); 482 Map<String, JSONArray> result = new HashMap<>();
488 - result.put("section", SocialMediaSectionEnum.getAllSectionArray("-"));  
489 result.put("mediaType", SocialMediaTypeEnum.getAllTypeArray()); 483 result.put("mediaType", SocialMediaTypeEnum.getAllTypeArray());
490 return result; 484 return result;
491 } 485 }
@@ -119,6 +119,7 @@ @@ -119,6 +119,7 @@
119 <entry key="channelUserServiceImpl" value-ref="channelUserServiceImpl"/> 119 <entry key="channelUserServiceImpl" value-ref="channelUserServiceImpl"/>
120 <entry key="userOrdersServiceImpl" value-ref="userOrdersServiceImpl"/> 120 <entry key="userOrdersServiceImpl" value-ref="userOrdersServiceImpl"/>
121 <entry key="unionShareServiceImpl" value-ref="unionShareServiceImpl"/> 121 <entry key="unionShareServiceImpl" value-ref="unionShareServiceImpl"/>
  122 + <entry key="unionShareApplyExportImpl" value-ref="unionShareApplyExportImpl"/>
122 <entry key="userRegisterBuyInfoserviceImpl" value-ref="userRegisterBuyInfoserviceImpl"/> 123 <entry key="userRegisterBuyInfoserviceImpl" value-ref="userRegisterBuyInfoserviceImpl"/>
123 </util:map> 124 </util:map>
124 125
@@ -25,9 +25,6 @@ @@ -25,9 +25,6 @@
25 <label>社交媒体账号:</label> 25 <label>社交媒体账号:</label>
26 <input class="easyui-textbox" id="socialMediaAccount" name="socialMediaAccount"> 26 <input class="easyui-textbox" id="socialMediaAccount" name="socialMediaAccount">
27 </input> 27 </input>
28 - <label>社交媒体粉丝数:</label>  
29 - <input class="easyui-combobox" id="socialMediaFans" name="socialMediaFans">  
30 - </input>  
31 <label>状态:</label> 28 <label>状态:</label>
32 <input class="easyui-combobox" id="status" name="status" 29 <input class="easyui-combobox" id="status" name="status"
33 data-options="valueField: 'value', 30 data-options="valueField: 'value',
@@ -43,7 +40,18 @@ @@ -43,7 +40,18 @@
43 value: '3' 40 value: '3'
44 }]"> 41 }]">
45 </input> 42 </input>
  43 +
  44 + </div>
  45 + <div style="margin-left: 10px;margin-top: 10px">
  46 + <label>开始时间:</label>
  47 + <input class="easyui-datetimebox" id="beginTime" name="beginTime">
  48 + </input>
  49 + <label>结束时间:</label>
  50 + <input class="easyui-datetimebox" id="endTime" name="endTime">
  51 + </input>
46 <a id="searchBtn" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">查询</a> 52 <a id="searchBtn" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">查询</a>
  53 + <a id="passButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">批量通过</a>
  54 + <a id="exportButton" style="margin-left: 20px" class="easyui-linkbutton btn-primary" data-options="iconCls:'icon-more'">导出</a>
47 </div> 55 </div>
48 </form> 56 </form>
49 </div> 57 </div>
@@ -57,7 +65,6 @@ @@ -57,7 +65,6 @@
57 $(function () { 65 $(function () {
58 66
59 var _socialMediaTypeSelector = $("#socialMediaType"); 67 var _socialMediaTypeSelector = $("#socialMediaType");
60 - var _socialMediaFansSelector = $("#socialMediaFans");  
61 $.ajax({ 68 $.ajax({
62 type: 'POST', 69 type: 'POST',
63 url: contextPath + "/UnionShareRest/getSocialMediaBasicParams", 70 url: contextPath + "/UnionShareRest/getSocialMediaBasicParams",
@@ -72,9 +79,6 @@ @@ -72,9 +79,6 @@
72 _socialMediaTypeSelector.combobox({valueField: 'type', 79 _socialMediaTypeSelector.combobox({valueField: 'type',
73 textField: 'name', 80 textField: 'name',
74 data:res.data.mediaType}); 81 data:res.data.mediaType});
75 - _socialMediaFansSelector.combobox({valueField: 'no',  
76 - textField: 'desc',  
77 - data:res.data.section});  
78 } 82 }
79 } else { 83 } else {
80 $.messager.alert("失败", res.message, "error"); 84 $.messager.alert("失败", res.message, "error");
@@ -143,19 +147,9 @@ @@ -143,19 +147,9 @@
143 align: "center" 147 align: "center"
144 }, { 148 }, {
145 title: "状态", 149 title: "状态",
146 - field: "status", 150 + field: "statusStr",
147 width: 200, 151 width: 200,
148 - align: "center",  
149 - formatter: function (value, rowData, rowIndex) {  
150 - //状态:1-申请中,2-通过,3-拒绝  
151 - if(rowData.status == 1) {  
152 - return "申请中";  
153 - }else if(rowData.status == 2) {  
154 - return "通过";  
155 - }else if(rowData.status == 3) {  
156 - return "拒绝";  
157 - }  
158 - } 152 + align: "center"
159 }, { 153 }, {
160 title: "申请时间", 154 title: "申请时间",
161 field: "createTime", 155 field: "createTime",
@@ -213,7 +207,7 @@ @@ -213,7 +207,7 @@
213 function pass(id) { 207 function pass(id) {
214 var paramObj={}; 208 var paramObj={};
215 if(id==null) { 209 if(id==null) {
216 - paramObj.idArray = checkedItems; 210 + paramObj.ids = checkedItems.toString();
217 }else { 211 }else {
218 paramObj.id = id; 212 paramObj.id = id;
219 } 213 }
@@ -279,15 +273,7 @@ @@ -279,15 +273,7 @@
279 iconCls : "icon-search", 273 iconCls : "icon-search",
280 onClick : function() { 274 onClick : function() {
281 checkedItems=[]; 275 checkedItems=[];
282 - var param = {  
283 - uid:$("#uid").val(),  
284 - name:$("#name").val(),  
285 - socialMediaType:$("#socialMediaType").combobox('getValue'),  
286 - socialMediaAccount:$("#socialMediaAccount").val(),  
287 - socialMediaFans:$("#socialMediaFans").combobox('getValue'),  
288 - status:$("#status").combobox('getValue'),  
289 - mobile:$("#mobile").val()  
290 - }; 276 + var param = getParams();
291 $("#userApplyTable").myDatagrid("load", param); 277 $("#userApplyTable").myDatagrid("load", param);
292 } 278 }
293 }); 279 });
@@ -300,8 +286,41 @@ @@ -300,8 +286,41 @@
300 } 286 }
301 }); 287 });
302 } 288 }
  289 + $("#passButton").linkbutton({
  290 + onClick : function() {
  291 + if (checkedItems.length == 0) {
  292 + $.messager.alert('提示','请选择要审核通过的数据');
  293 + return;
  294 + }
  295 + pass(null);
  296 + }
  297 + });
303 298
  299 + $("#exportButton").linkbutton({
  300 + onClick : function() {
  301 + window.open(contextPath + "/batch/export.do?type=unionShareApplyExportImpl&queryConf=" + escape(JSON.stringify(getParams())));
  302 +// window.open(contextPath + "/batch/export.do?type=unionShareApplyExportImpl&queryConf=" + getParams());
  303 + }
  304 + });
304 var fileview = $.extend({}, $.fn.datagrid.defaults.view, { onAfterRender: function (target) { isCheckItem(); } }); 305 var fileview = $.extend({}, $.fn.datagrid.defaults.view, { onAfterRender: function (target) { isCheckItem(); } });
  306 + function getParams() {
  307 + var param = {
  308 + uid:$("#uid").val(),
  309 + name:$("#name").val(),
  310 + socialMediaType:$("#socialMediaType").combobox('getValue'),
  311 + socialMediaAccount:$("#socialMediaAccount").val(),
  312 + status:$("#status").combobox('getValue'),
  313 + mobile:$("#mobile").val()
  314 + };
  315 + if ($("#beginTime").datetimebox('getValue')!='')
  316 + {
  317 + param.beginTime = parseInt(new Date($("#beginTime").datetimebox('getValue')).getTime() / 1000)
  318 + }
  319 + if ($("#endTime").datetimebox('getValue') != ''){
  320 + param.endTime = parseInt(new Date($("#endTime").datetimebox('getValue')).getTime() / 1000)
  321 + }
  322 + return param;
  323 + }
305 324
306 function isCheckItem() { 325 function isCheckItem() {
307 for (var i = 0; i < checkedItems.length; i++) { 326 for (var i = 0; i < checkedItems.length; i++) {