Bläddra i källkod

用户行为记录

huangzhiguo 2 år sedan
förälder
incheckning
f5a1f37920

+ 9 - 0
src/main/java/com/caimei/modules/user/service/CmBehaviorRecordService.java

@@ -8,6 +8,8 @@ import com.thinkgem.jeesite.common.service.CrudService;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
+import java.io.UnsupportedEncodingException;
+import java.net.URLDecoder;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
 import java.util.Date;
@@ -43,6 +45,13 @@ public class CmBehaviorRecordService extends CrudService<CmBehaviorRecordDao, Cm
         for(CmBehaviorRecord record: cmBehaviorRecordList) {
             String time = calculationTime(record.getAccessDuration());
             record.setAccessDuration(time);
+            String decode = null;
+            try {
+                decode = URLDecoder.decode(record.getPagePath(),"UTF-8");
+            } catch (UnsupportedEncodingException e) {
+                e.printStackTrace();
+            }
+            record.setPagePath(decode);
         }
         page.setList(cmBehaviorRecordList);
         return page;

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/user/behaviorRecordDetailsList.jsp

@@ -53,7 +53,7 @@
 <table id="contentTable" class="table table-striped table-bordered table-condensed">
     <thead>
     <tr>
-        <th>页面路径</th>
+        <th style="width: 350px;">页面路径</th>
         <th>页面类型</th>
         <th>页面标签</th>
         <th>商品图片</th>

+ 1 - 1
src/main/webapp/WEB-INF/views/modules/user/behaviorRecordList.jsp

@@ -56,7 +56,7 @@
             <label>访问日期:</label>
             <input name="startTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
                    value="${cmBehaviorRecord.startTime}"
-                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> <span> > </span>
+                   onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/> <span> - </span>
             <input name="endTime" type="text" readonly="readonly" maxlength="15" class="input-mini Wdate"
                    value="${cmBehaviorRecord.endTime}"
                    onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>

+ 32 - 23
src/test/java/com/caimei/info/InfoTest.java

@@ -12,14 +12,15 @@ import com.thinkgem.jeesite.common.utils.Encodes;
 import com.thinkgem.jeesite.common.utils.StringUtils;
 import com.thinkgem.jeesite.test.service.InfomationService;
 
+import java.io.UnsupportedEncodingException;
 import java.util.List;
 
 
 public class InfoTest extends SpringTransactionalContextTests {
-	
+
 	@Autowired
 	private InfomationService infomationService;
-	
+
 	@Autowired
 	private InfoService infoService;
 
@@ -28,6 +29,14 @@ public class InfoTest extends SpringTransactionalContextTests {
 
 	@Test
 	public void test(){
+		String str = "/pages/goods/goods-classify?classType=2&id=1038&title=%E7%8E%BB%E5%B0%BF%E9%85%B8%EF%BC%88%E5%B0%8F%E5%88%86%E5%AD%90%EF%BC%89";
+		String decode="";
+		try {
+			decode = java.net.URLDecoder.decode(str,"UTF-8");
+		} catch (UnsupportedEncodingException e) {
+			e.printStackTrace();
+		}
+		System.out.println(decode);
 //		Info info = infoService.get("228");
 //		String infoContent=Encodes.unescapeHtml(info.getInfoContent());
 //		//infoContent=Encodes.urlDecode(infoContent);
@@ -50,25 +59,25 @@ public class InfoTest extends SpringTransactionalContextTests {
 
 
 	}
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 }