Authored by linlong

update

... ... @@ -24,6 +24,7 @@ import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
... ... @@ -62,6 +63,26 @@ public class ChannelGroupServiceImpl implements ChannelGroupService {
public static final short SMS_STATUS_FAIL = 0;
public final static Map paramMap = new HashMap() {{
put("channelSource", "泛渠道来源");
put("channelOrderCode", "泛渠道订单号");
put("uid", "有货uid");
put("hasUid", "是否有货会员");
put("hasYHOrder", "是否存在有货订单");
put("yhOrderCode", "有货订单号");
put("unionCode", "渠道号");
put("userChannel", "渠道注册终端");
put("beginChannelOrderTime", "泛渠道订单时间");
put("endChannelOrderTime", "泛渠道订单时间");
put("beginYHOrderTime", "有货订单时间");
put("endYHOrderTime", "有货订单时间");
put("beginRegisterTime", "注册时间");
put("endRegisterTime", "注册时间");
put("beginSmsTime", "短信发送时间");
put("endSmsTime", "短信发送时间");
}};
@Override
public PageChannelGroupRspBO queryChannelGroupList(ChannelGroupRequestBO channelGroupRequestBO) {
logger.info("enter queryChannelGroupList. param channelGroupRequestBO={}", channelGroupRequestBO);
... ... @@ -182,14 +203,40 @@ public class ChannelGroupServiceImpl implements ChannelGroupService {
for (Map.Entry<Integer,Map<String,String>> entry : conditionMap .entrySet()) {
Map<String,String> map = entry.getValue();
StringBuffer sb = new StringBuffer();
convertTime(map,"beginChannelOrderTime","endChannelOrderTime",sb);
convertTime(map,"beginYHOrderTime","endYHOrderTime",sb);
convertTime(map,"beginRegisterTime","endRegisterTime",sb);
convertTime(map,"beginSmsTime","endSmsTime",sb);
for(Map.Entry<String,String> entry1:map.entrySet()){
sb.append("<div>").append(entry1.getKey()).append(":").append(entry1.getValue()).append("</div>");
String key = entry1.getKey();
sb.append("<div>").append(paramMap.get(key)).append(":").append(entry1.getValue()).append("</div>");
}
result.put(entry.getKey(),sb.toString());
}
return result;
}
private void convertTime(Map<String, String> map, String beginTimeKey, String endTimeKey, StringBuffer sb) {
if(map.get(beginTimeKey)!=null || map.get(endTimeKey)!=null){
String beginTime = map.get(beginTimeKey);
String endTime = map.get(endTimeKey);
if(beginTime!=null){
beginTime = DateUtils.int2DateStr(Integer.parseInt(beginTime),"yyyy-MM-dd HH:mm:ss");
}else{
beginTime = "";
}
if(endTime!=null){
endTime = DateUtils.int2DateStr(Integer.parseInt(endTime),"yyyy-MM-dd HH:mm:ss");
}else{
endTime = "";
}
sb.append("<div>").append(paramMap.get("beginChannelOrderTime")).append(":").append( beginTime).append("-").append(endTime).append("</div>");
map.remove(beginTimeKey);
map.remove(endTimeKey);
}
}
private List<ChannelGroupRspBO> toRspBOList(List<ChannelGroup> channelGroupList) {
logger.info("enter toRspBOList. param channelGroupList={}", channelGroupList);
List<ChannelGroupRspBO> list = Lists.newArrayList();
... ... @@ -197,7 +244,6 @@ public class ChannelGroupServiceImpl implements ChannelGroupService {
return list;
}
for (int i = 0; i < channelGroupList.size(); i++) {
ChannelGroup channelGroup = channelGroupList.get(i);
ChannelGroupRspBO channelGroupRspBO = new ChannelGroupRspBO();
... ...