wuwen 4 years ago
parent
commit
68ab8b54f6

+ 3 - 0
src/main/java/com/ssj/dao/sys/fx/dao/FinanceQueryDao.java

@@ -21,4 +21,7 @@ public interface FinanceQueryDao {
     
     Page<Map<String, Object>> balanceConsumeDetailList_New(Map<String, Object> params, Pageable pageable);
     
+    Page<Map<String, Object>> balanceConsumeDetailList_New2(Map<String, Object> params, Pageable pageable);
+    
+    Page<Map<String, Object>> findMerchantBalanceOldByPage(Map<String, Object> params, Pageable pageable);
 }

+ 30 - 0
src/main/java/com/ssj/dao/sys/fx/dao/impl/FinanceQueryDaoImpl.java

@@ -507,6 +507,36 @@ public class FinanceQueryDaoImpl implements FinanceQueryDao {
          return dao.findPage(selSql.toString(),queryParams.toArray(),pageable);
 	}
 
+	@Override
+	public Page<Map<String, Object>> balanceConsumeDetailList_New2(Map<String, Object> params, Pageable pageable) {
+		return null;
+	}
+
+	@Override
+	public Page<Map<String, Object>> findMerchantBalanceOldByPage(Map<String, Object> params, Pageable pageable) {
+		 StringBuilder selSql = new StringBuilder();
+         List<Object> queryParams = new ArrayList<Object>();
+         selSql.append(" SELECT t.id,t.pos_code, t.unit_name,t.type,t.port_num,t.price, ");
+         selSql.append(" (SELECT IFNULL(SUM(c.lib_service),0) from tb_lib_join_consume c WHERE c.to_merchant_id=t.id AND c.type in (1,4) AND TO_DAYS(c.create_time)>=TO_DAYS(?) AND TO_DAYS(c.create_time)<=TO_DAYS(?) ) as count_1,  ");
+         selSql.append(" (SELECT IFNULL(SUM(c.lib_service),0) from tb_lib_join_consume c WHERE c.from_merchant_id=t.id AND c.type in (2,3,5) AND TO_DAYS(c.create_time)>=TO_DAYS(?) AND TO_DAYS(c.create_time)<=TO_DAYS(?)  ) as count_2");
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         selSql.append(" from fx_merchant t ");
+         selSql.append(" where t.`status`!=4 AND t.org_code !='SSJ-FX' and t.pos_type=1  ");
+         if(!StringUtil.isEmpty(params.get("type"))){
+             selSql.append(" AND t.type=? ");
+             queryParams.add(params.get("type"));
+         }
+         if(!StringUtil.isEmpty(params.get("merchantId"))){
+             selSql.append(" AND t.id=? ");
+             queryParams.add(params.get("merchantId"));
+         }
+         selSql.append(" ORDER BY t.create_time asc  ");
+         return dao.findPage(selSql.toString(),queryParams.toArray(),pageable);
+	}
+
 	
 	
 }

+ 3 - 0
src/main/java/com/ssj/service/sys/finance/service/IFinanceService.java

@@ -21,6 +21,9 @@ public interface IFinanceService {
     
     Page<Map<String, Object>> balanceConsumeDetailList_New(Map<String, Object> params, Pageable pageable);
     
+    Page<Map<String, Object>> balanceConsumeDetailList_New2(Map<String, Object> params, Pageable pageable);
+    
+    Page<Map<String, Object>> findMerchantBalanceOldByPage(Map<String, Object> params, Pageable pageable);
     
     
 }

+ 11 - 0
src/main/java/com/ssj/service/sys/finance/service/impl/FinanceServiceImpl.java

@@ -52,4 +52,15 @@ public class FinanceServiceImpl implements IFinanceService {
 	public Page<Map<String, Object>> balanceConsumeDetailList_New(Map<String, Object> params, Pageable pageable) {
 		return dao.balanceConsumeDetailList_New(params, pageable);
 	}
+	
+	@Override
+	public Page<Map<String, Object>> balanceConsumeDetailList_New2(Map<String, Object> params, Pageable pageable) {
+		return dao.balanceConsumeDetailList_New2(params, pageable);
+	}
+
+	@Override
+	public Page<Map<String, Object>> findMerchantBalanceOldByPage(Map<String, Object> params, Pageable pageable) {
+		return dao.findMerchantBalanceOldByPage(params, pageable);
+	}
+	
 }

+ 1 - 0
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantMealServiceImpl.java

@@ -301,6 +301,7 @@ public class MerchantMealServiceImpl extends BaseServiceImpl<MerchantMeal, Strin
 					meal.setEndSignTime(endSignTime);
 				}
 				meal.setSignType(signType);
+				meal.setType(3);
 				meal.setStatus(1);
 				meal.setLibService(libService);
 				meal.setCreateTime(new Date());

+ 75 - 0
src/main/java/com/ssj/sys/controller/FinanceReportController.java

@@ -488,6 +488,81 @@ public class FinanceReportController extends BaseController {
         return "sys/finance/allList6";
     }
     
+    //小塾币情况表-结算,按月进行筛选,重构后版本
+    @RequestMapping("/balanceConsumeDetailList_New2")
+    public String balanceConsumeDetailList_New2(Model model,
+                                        @RequestParam(required = false, defaultValue = "30") int pageSize,
+                                        @RequestParam(required = false, defaultValue = "1") int pageNo) {
+
+        Map<String, Object> params = new HashMap<String, Object>();
+            
+        params.put("startMonth", request.getParameter("startMonth")==null? new SimpleDateFormat("yyyy-MM").format(new Date()):request.getParameter("startMonth"));
+        params.put("unitName", request.getParameter("unitName")==null?"":request.getParameter("unitName"));
+        addPostcodes(params);
+        
+        SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        sp.setParams(params);
+        Page<Map<String,Object>> page = financeService.balanceConsumeDetailList_New2(params, initPage(pageNo, pageSize));
+        List<Map<String,Object>> list=page.getContent();
+        for (Map<String, Object> map : list) {
+        	if(Integer.parseInt(map.get("meal_type").toString())==4) {
+        		map.put("price_1", "0");
+        	}else {
+        		map.put("price_1", "350");
+        	}
+          	map.put("sum_price_1", "0");
+        	map.put("sum_price_2", "0");
+        	map.put("sum_price_3", "0");
+        	
+        	if(map.containsKey("type")) {
+        		if(map.get("type")==null || Integer.parseInt(map.get("type").toString())!=5){
+        			map.put("external_unit_name", map.get("unit_name"));
+        			map.put("unit_name", "");
+        		}
+        	}
+        	
+        	map.put("count_1_m", "");
+        	map.put("count_2_m", "");
+        	
+        	if(map.containsKey("count_1")) {
+        		if(Integer.parseInt(map.get("count_1").toString())>0) {
+        			map.put("count_1_m", map.get("balance_month") );
+        			map.put("sum_price_1", map.get("price")!=null && StringUtils.isNotEmpty(map.get("price").toString()) ? 
+        					new BigDecimal(map.get("price").toString()).doubleValue()*
+        					0.4  
+        					: 0);
+        		}
+        	}
+        	
+        	if(map.containsKey("count_2")) {
+        		if(Integer.parseInt(map.get("count_2").toString())>0) {
+        			map.put("count_2_m", map.get("balance_month") );
+        			map.put("sum_price_2", map.get("price_1")!=null && StringUtils.isNotEmpty(map.get("price_1").toString()) ? 
+        					new BigDecimal(map.get("price_1").toString()).doubleValue()*
+        					new BigDecimal(map.get("count_2").toString()).intValue()
+        					*0.4 
+        					: 0);
+        		}else {
+        			map.put("price_1", "0");
+        		}
+        	}
+        	
+        	map.put("sum_price_3", new BigDecimal(map.get("sum_price_1").toString()).doubleValue()+new BigDecimal(map.get("sum_price_2").toString()).doubleValue());
+
+		}
+        
+        
+        sp.setRowCnt((int) page.getTotalElements());
+        model.addAttribute("list",list);
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        model.addAttribute("search", params);
+        return "sys/finance/allList6";
+    }
+    
     
     
     

+ 123 - 2
src/main/java/com/ssj/sys/controller/FxController.java

@@ -72,6 +72,7 @@ import com.ssj.framework.files.service.FileInfoService;
 import com.ssj.framework.idworker.IdWorker;
 import com.ssj.service.conch.conch.service.ConchDerverService;
 import com.ssj.service.conch.parents.v1.dto.PositionSchoolV1Dto;
+import com.ssj.service.sys.finance.service.IFinanceService;
 import com.ssj.service.sys.fx.service.DeviceActService;
 import com.ssj.service.sys.fx.service.DevicePartsActService;
 import com.ssj.service.sys.fx.service.DevicePartsService;
@@ -147,6 +148,9 @@ public class FxController  extends BaseController {
 	private ILibJoinService libJoinService;
 	
 	@Autowired
+	private IFinanceService financeService;
+	
+	@Autowired
 	private ILibJoinConsumeService libJoinConsumeService;
 	
 	@Autowired
@@ -3932,6 +3936,84 @@ public class FxController  extends BaseController {
 	   }  
  	
  	
+ 	@RequestMapping(value = "/exportMerchantBalanceOldList", method = RequestMethod.POST)
+    @ResponseBody
+    public void exportMerchantBalanceOldList( HttpServletRequest request, HttpServletResponse response) {  
+    	ServletOutputStream os = null;
+    	try { 
+    		String libName="塾币结存流水列表";
+    		os = response.getOutputStream(); //获得输出流  
+    		response.reset();   //清空输出流  
+    		String fileName = new String(libName.getBytes("gb2312"), "ISO8859-1") +".xlsx";  
+    		response.setHeader("Content-disposition", "attachment; filename="+ fileName); //设定输出文件头  
+    		response.setContentType("application/vnd.ms-excel;charset=UTF-8");
+    		response.setCharacterEncoding("utf-8");
+		
+		  	Map<String, Object> params = new HashMap<String, Object>();
+	        params.put("merchantId", request.getParameter("merchantId")==null?"":request.getParameter("merchantId"));
+	        params.put("type", request.getParameter("type")==null?"":request.getParameter("type"));
+	        params.put("createTime", request.getParameter("createTime")==null?"2020-10-09":request.getParameter("createTime"));
+	        params.put("endCreateTime", request.getParameter("endCreateTime")==null?DateHelper.format(new Date(), "yyyy-MM-dd") :request.getParameter("endCreateTime"));
+	        
+	        Page<Map<String, Object>> page = financeService.findMerchantBalanceOldByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"createTime"}));
+	        
+	        List<Map<String, Object>> mapList=page.getContent();
+	        for (Map<String, Object> map : mapList) {
+	    		map.put("pr_1",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*(Integer.parseInt(map.get("count_1").toString()))).setScale(2, RoundingMode.UP).doubleValue());
+	    		map.put("pr_2",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*(Integer.parseInt(map.get("count_2").toString()))).setScale(2, RoundingMode.UP).doubleValue());
+	    		map.put("count_3",new BigDecimal(map.get("count_1").toString()).doubleValue()-new BigDecimal(map.get("count_2").toString()).doubleValue());
+	    		map.put("pr_3",new BigDecimal(map.get("pr_1").toString()).doubleValue()-new BigDecimal(map.get("pr_2").toString()).doubleValue());
+		   
+	        	switch (map.get("type").toString()) {
+					case "1":
+						map.put("type","直接签约(塾币模式)");
+						break;
+					case "2":
+						map.put("type","内部消耗");
+						break;
+					case "3":
+						map.put("type","外部签约");
+						break;
+					case "4":
+						map.put("type","内部不结算(财务)");
+						break;
+					case "5":
+						map.put("type","直接签约(端口模式)");
+						break;
+					default:
+						break;
+					}
+				}
+	        
+		        List<ExcelColumn> myColumns3 = new ArrayList<ExcelColumn>();
+		   		myColumns3.add(new ExcelColumn("商户账号", "pos_code", 20));
+		   		myColumns3.add(new ExcelColumn("商户名称", "unit_name", 20));
+		   		myColumns3.add(new ExcelColumn("商户类型", "type", 20));
+		   		myColumns3.add(new ExcelColumn("签约端口数", "port_num", 20));
+		   		myColumns3.add(new ExcelColumn("本期增加数量", "count_1", 20));
+		   		myColumns3.add(new ExcelColumn("本期增加金额", "pr_1", 20));
+		   		myColumns3.add(new ExcelColumn("本期减少数量", "count_2", 20));
+		   		myColumns3.add(new ExcelColumn("本期减少金额", "pr_2", 20));
+		   		myColumns3.add(new ExcelColumn("结存数量", "count_3", 20));
+		   		myColumns3.add(new ExcelColumn("结存金额", "pr_3", 20));
+		   		
+				CustomizeToExcel.downFile(myColumns3, mapList, os);
+		   	}catch (IOException e) {  
+		   		e.printStackTrace();  
+		   	}catch (Exception e1){
+		   		e1.printStackTrace();
+		   	}finally{
+		   		if(os != null){
+		   			try {
+		   				os.flush();
+		   				os.close(); 
+		   			} catch (IOException e) {
+		   				e.printStackTrace();
+		   			}  
+		   		}
+		   	}
+	   }  
+ 	
  	
  	@RequestMapping(value = "/exportMerchantActiveCapList", method = RequestMethod.POST)
     @ResponseBody
@@ -4092,7 +4174,7 @@ public class FxController  extends BaseController {
     		myColumns3.add(new ExcelColumn("月单价(成本)", "unit_price", 20));
     		myColumns3.add(new ExcelColumn("购买时间", "create_time", 20));
     		
-			CustomizeToExcel.downFile(myColumns3, page.getContent(), os);
+			CustomizeToExcel.downFile(myColumns3, mapList, os);
     	}catch (IOException e) {  
     		e.printStackTrace();  
     	}catch (Exception e1){
@@ -4156,7 +4238,7 @@ public class FxController  extends BaseController {
     		myColumns3.add(new ExcelColumn("结束日期", "end_sign_time", 20));
     		myColumns3.add(new ExcelColumn("购买时间", "create_time", 20));
     		
-			CustomizeToExcel.downFile(myColumns3, page.getContent(), os);
+			CustomizeToExcel.downFile(myColumns3, mapList, os);
     	}catch (IOException e) {  
     		e.printStackTrace();  
     	}catch (Exception e1){
@@ -4675,6 +4757,45 @@ public class FxController  extends BaseController {
     }
 	
 	
+	//塾币结存表
+	@RequestMapping("/merchantBalanceOldList")
+    public String merchantBalanceOldList(Model model,
+            @RequestParam(required = false, defaultValue = "100") int pageSize,
+            @RequestParam(required = false, defaultValue = "1") int pageNo)throws Exception {
+		
+        Map<String, Object> params = new HashMap<String, Object>();
+        params.put("merchantId", request.getParameter("merchantId")==null?"":request.getParameter("merchantId"));
+        params.put("type", request.getParameter("type")==null?"":request.getParameter("type"));
+        params.put("createTime", request.getParameter("createTime")==null?"2020-10-09":request.getParameter("createTime"));
+        params.put("endCreateTime", request.getParameter("endCreateTime")==null?DateHelper.format(new Date(), "yyyy-MM-dd") :request.getParameter("endCreateTime"));
+        
+
+        SplitPage sp = new SplitPage();
+        sp.setAction(request.getRequestURI());
+        sp.setPageNo(pageNo);
+        sp.setPageSize(pageSize);
+        sp.setParams(params);
+        Page<Map<String, Object>> page = financeService.findMerchantBalanceOldByPage(params, initPage(pageNo, pageSize, Direction.DESC, new String[]{"createTime"}));
+        sp.setRowCnt((int) page.getTotalElements());
+        
+        List<Map<String, Object>> mapList=page.getContent();
+        for (Map<String, Object> map : mapList) {
+    		map.put("pr_1",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*(Integer.parseInt(map.get("count_1").toString()))).setScale(2, RoundingMode.UP).doubleValue());
+    		map.put("pr_2",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*(Integer.parseInt(map.get("count_2").toString()))).setScale(2, RoundingMode.UP).doubleValue());
+    		map.put("count_3",new BigDecimal(map.get("count_1").toString()).doubleValue()-new BigDecimal(map.get("count_2").toString()).doubleValue());
+    		map.put("pr_3",new BigDecimal(map.get("pr_1").toString()).doubleValue()-new BigDecimal(map.get("pr_2").toString()).doubleValue());
+		}
+        model.addAttribute("list", mapList);
+        model.addAttribute("listNavigatHtml", sp.getSysPaginHtml());
+        model.addAttribute("page", sp);
+        model.addAttribute("search", params);
+        List<Merchant> list=merchantService.findMerchantByPage();
+		model.addAttribute("poslist", list);
+        return "sys/fx/merchantBalanceOldList";
+    }
+	
+	
+	
 	
 	
 	

+ 142 - 0
src/main/resources/templates/sys/fx/merchantBalanceList.html

@@ -0,0 +1,142 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>爱加</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+<link href="sys/css/jquery.searchableSelect.css" th:href="@{/static/sys/css/jquery.searchableSelect.css}" rel="stylesheet"/>
+<script src="js/layer/layer.js" th:src="@{/static/sys/js/jquery.searchableSelect.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">结存管理</a></li>
+		<li><a href="#">塾币商户结存流水</a></li>
+	</ul>
+</div>
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/fx/merchantBalanceOldList.html}" method="post">
+	<ul class="seachform">
+		<li>
+			<label>所有商户:</label>
+			<select class="scinput select_width"  name="merchantId"   id="merchantId" style="width: 150px;" >
+				<option value="">全部</option>
+				<option th:each="item:${poslist}"  th:selected="${search.get('merchantId') eq item.id ? true : false}" th:value="${item.id}">[[${item.unitName}]]</option>
+			</select>
+		</li>
+
+		 <li>
+		 <label>开始日期:</label>
+		  <input style="width: 150px;" name="createTime" type="text" class="scinput"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${search.get('createTime')}" autocomplete="off"  placeholder="开始日期" />
+	    </li>
+	    
+	    <li>
+		 <label>结束日期:</label>
+		  <input style="width: 150px;" name="endCreateTime" type="text" class="scinput"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${search.get('endCreateTime')}" autocomplete="off"  placeholder="结束日期" />
+	    </li>
+	    
+	     <li>
+		 <label>商户类型</label>
+		 	<select class="scinput select_width" name="merchantType" id="merchantType"   style="width: 150px;" >
+		 	 	<option value="" >全部</option>
+				<option value="5"  th:selected="${search.get('type') eq '5' ? true : false}">直接签约(端口模式)</option>
+				<option value="1"  th:selected="${search.get('type') eq '1' ? true : false}">直接签约(塾币模式)</option>
+				<option value="2"  th:selected="${search.get('type') eq '2' ? true : false}">内部消耗</option>
+				<option value="3"  th:selected="${search.get('type') eq '3' ? true : false}">外部签约</option>
+				<option value="4"  th:selected="${search.get('type') eq '4' ? true : false}">内部不结算(财务)</option>
+			</select>
+	    </li>
+	    
+		<li>
+			<input type="button" class="scbtn" value="查询" />
+		</li>
+	</ul>
+	</form>
+	
+	<ul class="seachform">
+		<li>
+			<input type="button" id="button" class="scbtn" value="导出明细" />
+		</li>
+	</ul>
+	
+	<table class="tablelist">
+		<thead>
+		    <tr>
+		    	<th>商户账号</th>
+		        <th>商户名称</th>
+		        <th>商户类型</th>
+		    	<th>签约端口数</th>
+		    	<th>本期增加数量</th>
+		    	<th>本期增加金额</th>
+		        <th>本期减少数量</th>
+		        <th>本期减少金额</th>
+		        <th>结存数量</th> 
+		        <th>结存金额</th> 
+		    </tr>
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+					<td th:text="${item.pos_code}"></td>
+					<td th:text="${item.unit_name}"></td>
+					<td th:switch="${item.type}">
+					   <span th:case="1" >直接签约(塾币模式)</span>
+					   <span th:case="2" >内部消耗</span>
+					   <span th:case="3" >外部签约</span>
+					   <span th:case="4" >内部不结算(财务)</span>
+					   <span th:case="5" >直接签约(端口模式)</span>
+					</td>
+					<td th:text="${item.port_num}"></td>
+					
+					<td th:text="${item.count_1}"></td>
+					<td th:text="${item.pr_1}"></td>
+					
+					<td th:text="${item.count_2}"></td>
+					<td th:text="${item.pr_2}"></td>
+					
+					<td th:text="${item.count_3}"></td>
+					<td th:text="${item.pr_3}"></td>
+			</tr>
+		</tbody>
+	</table>
+	
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+</div>
+
+</body>
+<script type="text/javascript">
+
+</script>
+
+<script type="text/javascript">
+
+$(function(){
+	$('#merchantId').searchableSelect();
+});
+
+
+$("#button").on('click',function(){
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportMerchantCapOldList";
+	$("#seachform").submit();
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/merchantCapOldList.html";
+});
+</script>
+
+</html>

+ 141 - 0
src/main/resources/templates/sys/fx/merchantBalanceOldList.html

@@ -0,0 +1,141 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>爱加</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+<link href="sys/css/jquery.searchableSelect.css" th:href="@{/static/sys/css/jquery.searchableSelect.css}" rel="stylesheet"/>
+<script src="js/layer/layer.js" th:src="@{/static/sys/js/jquery.searchableSelect.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">结存管理</a></li>
+		<li><a href="#">塾币商户结存流水</a></li>
+	</ul>
+</div>
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/fx/merchantBalanceOldList.html}" method="post">
+	<ul class="seachform">
+		<li>
+			<label>所有商户:</label>
+			<select class="scinput select_width"  name="merchantId"   id="merchantId" style="width: 150px;" >
+				<option value="">全部</option>
+				<option th:each="item:${poslist}"  th:selected="${search.get('merchantId') eq item.id ? true : false}" th:value="${item.id}">[[${item.unitName}]]</option>
+			</select>
+		</li>
+
+		 <li>
+		 <label>开始日期:</label>
+		  <input style="width: 150px;" name="createTime" type="text" class="scinput"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${search.get('createTime')}" autocomplete="off"  placeholder="开始日期" />
+	    </li>
+	    
+	    <li>
+		 <label>结束日期:</label>
+		  <input style="width: 150px;" name="endCreateTime" type="text" class="scinput"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${search.get('endCreateTime')}" autocomplete="off"  placeholder="结束日期" />
+	    </li>
+	    
+	     <li>
+		 <label>商户类型</label>
+		 	<select class="scinput select_width" name="type" id="type"   style="width: 150px;" >
+		 	 	<option value="" >全部</option>
+				<option value="1"  th:selected="${search.get('type') eq '1' ? true : false}">直接签约(塾币模式)</option>
+				<option value="2"  th:selected="${search.get('type') eq '2' ? true : false}">内部消耗</option>
+				<option value="3"  th:selected="${search.get('type') eq '3' ? true : false}">外部签约</option>
+				<option value="4"  th:selected="${search.get('type') eq '4' ? true : false}">内部不结算(财务)</option>
+			</select>
+	    </li>
+	    
+		<li>
+			<input type="button" class="scbtn" value="查询" />
+		</li>
+	</ul>
+	</form>
+	
+	<ul class="seachform">
+		<li>
+			<input type="button" id="button" class="scbtn" value="导出明细" />
+		</li>
+	</ul>
+	
+	<table class="tablelist">
+		<thead>
+		    <tr>
+		    	<th>商户账号</th>
+		        <th>商户名称</th>
+		        <th>商户类型</th>
+		    	<th>签约端口数</th>
+		    	<th>本期增加数量</th>
+		    	<th>本期增加金额</th>
+		        <th>本期减少数量</th>
+		        <th>本期减少金额</th>
+		        <th>结存数量</th> 
+		        <th>结存金额</th> 
+		    </tr>
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+					<td th:text="${item.pos_code}"></td>
+					<td th:text="${item.unit_name}"></td>
+					<td th:switch="${item.type}">
+					   <span th:case="1" >直接签约(塾币模式)</span>
+					   <span th:case="2" >内部消耗</span>
+					   <span th:case="3" >外部签约</span>
+					   <span th:case="4" >内部不结算(财务)</span>
+					   <span th:case="5" >直接签约(端口模式)</span>
+					</td>
+					<td th:text="${item.port_num}"></td>
+					
+					<td th:text="${item.count_1}"></td>
+					<td th:text="${item.pr_1}"></td>
+					
+					<td th:text="${item.count_2}"></td>
+					<td th:text="${item.pr_2}"></td>
+					
+					<td th:text="${item.count_3}"></td>
+					<td th:text="${item.pr_3}"></td>
+			</tr>
+		</tbody>
+	</table>
+	
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+</div>
+
+</body>
+<script type="text/javascript">
+
+</script>
+
+<script type="text/javascript">
+
+$(function(){
+	$('#merchantId').searchableSelect();
+});
+
+
+$("#button").on('click',function(){
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportMerchantCapOldList";
+	$("#seachform").submit();
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/merchantCapOldList.html";
+});
+</script>
+
+</html>