Showing
1 changed file
with
48 additions
and
2 deletions
@@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; | @@ -24,6 +24,7 @@ import org.springframework.stereotype.Service; | ||
24 | import org.springframework.util.CollectionUtils; | 24 | import org.springframework.util.CollectionUtils; |
25 | 25 | ||
26 | import java.util.Arrays; | 26 | import java.util.Arrays; |
27 | +import java.util.HashMap; | ||
27 | import java.util.List; | 28 | import java.util.List; |
28 | import java.util.Map; | 29 | import java.util.Map; |
29 | import java.util.stream.Collectors; | 30 | import java.util.stream.Collectors; |
@@ -62,6 +63,26 @@ public class ChannelGroupServiceImpl implements ChannelGroupService { | @@ -62,6 +63,26 @@ public class ChannelGroupServiceImpl implements ChannelGroupService { | ||
62 | 63 | ||
63 | public static final short SMS_STATUS_FAIL = 0; | 64 | public static final short SMS_STATUS_FAIL = 0; |
64 | 65 | ||
66 | + public final static Map paramMap = new HashMap() {{ | ||
67 | + put("channelSource", "泛渠道来源"); | ||
68 | + put("channelOrderCode", "泛渠道订单号"); | ||
69 | + put("uid", "有货uid"); | ||
70 | + put("hasUid", "是否有货会员"); | ||
71 | + put("hasYHOrder", "是否存在有货订单"); | ||
72 | + put("yhOrderCode", "有货订单号"); | ||
73 | + put("unionCode", "渠道号"); | ||
74 | + put("userChannel", "渠道注册终端"); | ||
75 | + put("beginChannelOrderTime", "泛渠道订单时间"); | ||
76 | + put("endChannelOrderTime", "泛渠道订单时间"); | ||
77 | + put("beginYHOrderTime", "有货订单时间"); | ||
78 | + put("endYHOrderTime", "有货订单时间"); | ||
79 | + put("beginRegisterTime", "注册时间"); | ||
80 | + put("endRegisterTime", "注册时间"); | ||
81 | + put("beginSmsTime", "短信发送时间"); | ||
82 | + put("endSmsTime", "短信发送时间"); | ||
83 | + | ||
84 | + }}; | ||
85 | + | ||
65 | @Override | 86 | @Override |
66 | public PageChannelGroupRspBO queryChannelGroupList(ChannelGroupRequestBO channelGroupRequestBO) { | 87 | public PageChannelGroupRspBO queryChannelGroupList(ChannelGroupRequestBO channelGroupRequestBO) { |
67 | logger.info("enter queryChannelGroupList. param channelGroupRequestBO={}", channelGroupRequestBO); | 88 | logger.info("enter queryChannelGroupList. param channelGroupRequestBO={}", channelGroupRequestBO); |
@@ -182,14 +203,40 @@ public class ChannelGroupServiceImpl implements ChannelGroupService { | @@ -182,14 +203,40 @@ public class ChannelGroupServiceImpl implements ChannelGroupService { | ||
182 | for (Map.Entry<Integer,Map<String,String>> entry : conditionMap .entrySet()) { | 203 | for (Map.Entry<Integer,Map<String,String>> entry : conditionMap .entrySet()) { |
183 | Map<String,String> map = entry.getValue(); | 204 | Map<String,String> map = entry.getValue(); |
184 | StringBuffer sb = new StringBuffer(); | 205 | StringBuffer sb = new StringBuffer(); |
206 | + convertTime(map,"beginChannelOrderTime","endChannelOrderTime",sb); | ||
207 | + convertTime(map,"beginYHOrderTime","endYHOrderTime",sb); | ||
208 | + convertTime(map,"beginRegisterTime","endRegisterTime",sb); | ||
209 | + convertTime(map,"beginSmsTime","endSmsTime",sb); | ||
210 | + | ||
185 | for(Map.Entry<String,String> entry1:map.entrySet()){ | 211 | for(Map.Entry<String,String> entry1:map.entrySet()){ |
186 | - sb.append("<div>").append(entry1.getKey()).append(":").append(entry1.getValue()).append("</div>"); | 212 | + String key = entry1.getKey(); |
213 | + sb.append("<div>").append(paramMap.get(key)).append(":").append(entry1.getValue()).append("</div>"); | ||
187 | } | 214 | } |
188 | result.put(entry.getKey(),sb.toString()); | 215 | result.put(entry.getKey(),sb.toString()); |
189 | } | 216 | } |
190 | return result; | 217 | return result; |
191 | } | 218 | } |
192 | 219 | ||
220 | + private void convertTime(Map<String, String> map, String beginTimeKey, String endTimeKey, StringBuffer sb) { | ||
221 | + if(map.get(beginTimeKey)!=null || map.get(endTimeKey)!=null){ | ||
222 | + String beginTime = map.get(beginTimeKey); | ||
223 | + String endTime = map.get(endTimeKey); | ||
224 | + if(beginTime!=null){ | ||
225 | + beginTime = DateUtils.int2DateStr(Integer.parseInt(beginTime),"yyyy-MM-dd HH:mm:ss"); | ||
226 | + }else{ | ||
227 | + beginTime = ""; | ||
228 | + } | ||
229 | + if(endTime!=null){ | ||
230 | + endTime = DateUtils.int2DateStr(Integer.parseInt(endTime),"yyyy-MM-dd HH:mm:ss"); | ||
231 | + }else{ | ||
232 | + endTime = ""; | ||
233 | + } | ||
234 | + sb.append("<div>").append(paramMap.get("beginChannelOrderTime")).append(":").append( beginTime).append("-").append(endTime).append("</div>"); | ||
235 | + map.remove(beginTimeKey); | ||
236 | + map.remove(endTimeKey); | ||
237 | + } | ||
238 | + } | ||
239 | + | ||
193 | private List<ChannelGroupRspBO> toRspBOList(List<ChannelGroup> channelGroupList) { | 240 | private List<ChannelGroupRspBO> toRspBOList(List<ChannelGroup> channelGroupList) { |
194 | logger.info("enter toRspBOList. param channelGroupList={}", channelGroupList); | 241 | logger.info("enter toRspBOList. param channelGroupList={}", channelGroupList); |
195 | List<ChannelGroupRspBO> list = Lists.newArrayList(); | 242 | List<ChannelGroupRspBO> list = Lists.newArrayList(); |
@@ -197,7 +244,6 @@ public class ChannelGroupServiceImpl implements ChannelGroupService { | @@ -197,7 +244,6 @@ public class ChannelGroupServiceImpl implements ChannelGroupService { | ||
197 | return list; | 244 | return list; |
198 | } | 245 | } |
199 | 246 | ||
200 | - | ||
201 | for (int i = 0; i < channelGroupList.size(); i++) { | 247 | for (int i = 0; i < channelGroupList.size(); i++) { |
202 | ChannelGroup channelGroup = channelGroupList.get(i); | 248 | ChannelGroup channelGroup = channelGroupList.get(i); |
203 | ChannelGroupRspBO channelGroupRspBO = new ChannelGroupRspBO(); | 249 | ChannelGroupRspBO channelGroupRspBO = new ChannelGroupRspBO(); |
-
Please register or login to post a comment