wuwen 4 years ago
parent
commit
4b27534a86

+ 10 - 0
src/main/java/com/ssj/bean/sys/fx/domain/MerchantSignOrder.java

@@ -25,6 +25,8 @@ public class MerchantSignOrder extends BaseEntity {
     
     private Double unitPrice;
     
+    private Double price;
+    
     private Date createTime;
     
     private Date updateTime;
@@ -103,5 +105,13 @@ public class MerchantSignOrder extends BaseEntity {
 		this.remarks = remarks;
 	}
 
+	public Double getPrice() {
+		return price;
+	}
+
+	public void setPrice(Double price) {
+		this.price = price;
+	}
+
 	
 }

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

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

+ 126 - 1
src/main/java/com/ssj/dao/sys/fx/dao/impl/FinanceQueryDaoImpl.java

@@ -542,6 +542,10 @@ public class FinanceQueryDaoImpl implements FinanceQueryDao {
 		 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('2020-10-09') AND TO_DAYS(c.create_time)<TO_DAYS(?) ) as init_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('2020-10-09') AND TO_DAYS(c.create_time)<TO_DAYS(?)  ) as init_2, ");
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
          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"));
@@ -549,7 +553,7 @@ public class FinanceQueryDaoImpl implements FinanceQueryDao {
          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  ");
+         selSql.append(" where t.`status`!=4 AND t.org_code !='SSJ-FX' and t.pos_type=1 and t.type=1  ");
          if(!StringUtil.isEmpty(params.get("type"))){
              selSql.append(" AND t.type=? ");
              queryParams.add(params.get("type"));
@@ -561,6 +565,127 @@ public class FinanceQueryDaoImpl implements FinanceQueryDao {
          selSql.append(" ORDER BY t.create_time asc  ");
          return dao.findPage(selSql.toString(),queryParams.toArray(),pageable);
 	}
+	
+	
+	
+	@Override
+	public Page<Map<String, Object>> findMerchantBalanceByPage(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, ");
+         
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( c.lib_service ), 0 ) FROM fx_merchant_meal c WHERE c.merchant_id = t.id AND TO_DAYS( c.sign_time )< TO_DAYS( ? ) ");
+         selSql.append("  ) AS init_1, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( c.lib_service ), 0 ) FROM fx_merchant_meal c WHERE c.merchant_id = t.id AND TO_DAYS( c.end_sign_time )< TO_DAYS( ? )  ");
+         selSql.append("  ) AS init_2, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( c.lib_service ), 0 ) FROM fx_merchant_sign c WHERE c.merchant_id = t.id AND TO_DAYS( c.sign_time )< TO_DAYS( ? )  ");
+         selSql.append("  ) AS init_3, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( c.lib_service ), 0 ) FROM fx_merchant_sign c WHERE c.merchant_id = t.id AND TO_DAYS( c.end_sign_time )< TO_DAYS( ? )  ");
+         selSql.append("  ) AS init_4,");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( o.unit_price ), 0 ) FROM fx_merchant_meal c LEFT JOIN fx_merchant_meal_order o ON c.order_id=o.id WHERE c.merchant_id = t.id AND TO_DAYS( c.sign_time )< TO_DAYS( ? ) ");
+         selSql.append("  ) AS ir_1, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( o.unit_price ), 0 ) FROM fx_merchant_meal c LEFT JOIN fx_merchant_meal_order o ON c.order_id=o.id WHERE c.merchant_id = t.id AND TO_DAYS( c.end_sign_time )< TO_DAYS( ?)  ");
+         selSql.append("  ) AS ir_2, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( o.unit_price ), 0 ) FROM fx_merchant_sign c LEFT JOIN fx_merchant_sign_order o ON c.order_id=o.id WHERE c.merchant_id = t.id  AND TO_DAYS( c.sign_time )< TO_DAYS( ? ) ");
+         selSql.append("  ) AS ir_3, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( o.unit_price ), 0 ) FROM fx_merchant_sign c LEFT JOIN fx_merchant_sign_order o ON c.order_id=o.id WHERE c.merchant_id = t.id AND TO_DAYS( c.end_sign_time )< TO_DAYS( ? )  ");
+         selSql.append("  ) AS ir_4, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL(SUM( c.price ), 0 ) FROM fx_merchant_plat_order c WHERE c.merchant_id = t.id AND TO_DAYS( c.create_time )< TO_DAYS( ? )  ");
+         selSql.append("  ) AS ir_5, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL(SUM( c.price ), 0 ) FROM fx_merchant_plat_order c  WHERE c.merchant_id = t.id AND TO_DAYS( c.create_time )< TO_DAYS( ? ) ");
+         selSql.append("  ) AS ir_6, ");
+         
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( c.lib_service ), 0 ) FROM fx_merchant_meal c WHERE c.merchant_id = t.id AND TO_DAYS( c.sign_time )>= TO_DAYS( ? ) AND TO_DAYS( c.sign_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS count_1, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( c.lib_service ), 0 ) FROM fx_merchant_meal c WHERE c.merchant_id = t.id AND TO_DAYS( c.end_sign_time )>= TO_DAYS( ? ) AND TO_DAYS( c.end_sign_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS count_2, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( c.lib_service ), 0 ) FROM fx_merchant_sign c WHERE c.merchant_id = t.id AND TO_DAYS( c.sign_time )>= TO_DAYS( ? ) AND TO_DAYS( c.sign_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS count_3, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( c.lib_service ), 0 ) FROM fx_merchant_sign c WHERE c.merchant_id = t.id AND TO_DAYS( c.end_sign_time )>= TO_DAYS( ? ) AND TO_DAYS( c.end_sign_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS count_4,");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( o.unit_price ), 0 ) FROM fx_merchant_meal c LEFT JOIN fx_merchant_meal_order o ON c.order_id=o.id WHERE c.merchant_id = t.id AND TO_DAYS( c.sign_time )>= TO_DAYS( ? ) AND TO_DAYS( c.sign_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS pr_1, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( o.unit_price ), 0 ) FROM fx_merchant_meal c LEFT JOIN fx_merchant_meal_order o ON c.order_id=o.id WHERE c.merchant_id = t.id AND TO_DAYS( c.end_sign_time )>= TO_DAYS( ?) AND TO_DAYS( c.end_sign_time )<= TO_DAYS(?) ");
+         selSql.append("  ) AS pr_2, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( o.unit_price ), 0 ) FROM fx_merchant_sign c LEFT JOIN fx_merchant_sign_order o ON c.order_id=o.id WHERE c.merchant_id = t.id  AND TO_DAYS( c.sign_time )>= TO_DAYS( ? ) AND TO_DAYS( c.sign_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS pr_3, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL( SUM( o.unit_price ), 0 ) FROM fx_merchant_sign c LEFT JOIN fx_merchant_sign_order o ON c.order_id=o.id WHERE c.merchant_id = t.id AND TO_DAYS( c.end_sign_time )>= TO_DAYS( ? ) AND TO_DAYS( c.end_sign_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS pr_4, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL(SUM( c.price ), 0 ) FROM fx_merchant_plat_order c WHERE c.merchant_id = t.id AND TO_DAYS( c.create_time )>= TO_DAYS( ? ) AND TO_DAYS( c.create_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS pr_5, ");
+         selSql.append("  ( ");
+         selSql.append("  	SELECT IFNULL(SUM( c.price ), 0 ) FROM fx_merchant_plat_order c  WHERE c.merchant_id = t.id AND TO_DAYS( c.create_time )>= TO_DAYS( ? ) AND TO_DAYS( c.create_time )<= TO_DAYS(? ) ");
+         selSql.append("  ) AS pr_6 ");
+         
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("createTime"));
+        
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         
+         queryParams.add(params.get("createTime"));
+         queryParams.add(params.get("endCreateTime"));
+         
+         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 and t.type=5  ");
+         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);
+	}
 
 	
 	

+ 5 - 5
src/main/java/com/ssj/dao/sys/fx/dao/impl/FxQueryDaoImpl.java

@@ -748,9 +748,9 @@ public class FxQueryDaoImpl implements FxQueryDao {
 	public Page<Map<String, Object>> findMerchantSignOrderByPage(Map<String, Object> params, Pageable initPage) {
 		StringBuilder selSql = new StringBuilder();
         List<Object> queryParams = new ArrayList<Object>();
-        selSql.append(" SELECT t.*,(t.unit_price * t.num) as price,m.unit_name,m.type as merchant_type from fx_merchant_sign_order t  ");
+        selSql.append(" SELECT t.*,m.unit_name,m.type as merchant_type from fx_merchant_sign_order t  ");
         selSql.append(" LEFT JOIN fx_merchant m ON t.merchant_id=m.id  ");
-        selSql.append(" where 1=1 ");
+        selSql.append(" where 1=1 and m.type=5 ");
         if(!"".equals(params.get("merchantId"))){
             selSql.append(" and t.merchant_id=? ");
             queryParams.add(params.get("merchantId"));
@@ -784,7 +784,7 @@ public class FxQueryDaoImpl implements FxQueryDao {
         List<Object> queryParams = new ArrayList<Object>();
         selSql.append(" SELECT t.*,m.unit_name,m.type as merchant_type from fx_merchant_meal_order t  ");
         selSql.append(" LEFT JOIN fx_merchant m ON t.merchant_id=m.id  ");
-        selSql.append(" where 1=1 ");
+        selSql.append(" where 1=1 and m.type=5 ");
         if(!"".equals(params.get("merchantId"))){
             selSql.append(" and t.merchant_id=? ");
             queryParams.add(params.get("merchantId"));
@@ -876,7 +876,7 @@ public class FxQueryDaoImpl implements FxQueryDao {
         List<Object> queryParams = new ArrayList<Object>();
         selSql.append(" SELECT t.*,m.unit_name,m.type as merchant_type from fx_merchant_plat_order t  ");
         selSql.append(" LEFT JOIN fx_merchant m ON t.merchant_id=m.id  ");
-        selSql.append(" where 1=1 ");
+        selSql.append(" where 1=1 and m.type=5 ");
         if(!"".equals(params.get("merchantId"))){
             selSql.append(" and t.merchant_id=? ");
             queryParams.add(params.get("merchantId"));
@@ -905,7 +905,7 @@ public class FxQueryDaoImpl implements FxQueryDao {
         selSql.append(" 	SELECT m.id,m.type as merchant_type,m.pos_code,m.unit_name,t.unit_price,t.price,t.buy_month,t.give_month,t.sign_type,t.type,t.lib_service,t.create_time as time,1 as cap_type from fx_merchant_meal_order t    ");
         selSql.append("  	LEFT JOIN fx_merchant m ON t.merchant_id=m.id ");
         selSql.append("  UNION ALL");
-        selSql.append("  	SELECT m.id,m.type as merchant_type,m.pos_code,m.unit_name,o.unit_price,o.price,o.buy_month,o.give_month,o.sign_type,o.type,t.lib_service,t.sign_time as time,2 as cap_type from fx_merchant_meal t  ");
+        selSql.append("  	SELECT m.id,m.type as merchant_type,m.pos_code,m.unit_name,IF(t.remarks='开始收费期',0,o.unit_price),IF(t.remarks='开始收费期',0,o.price),o.buy_month,o.give_month,o.sign_type,o.type,t.lib_service,t.sign_time as time,2 as cap_type from fx_merchant_meal t  ");
         selSql.append("  	LEFT JOIN fx_merchant m ON t.merchant_id=m.id ");
         selSql.append(" 	LEFT JOIN fx_merchant_meal_order o ON t.order_id=o.id where t.status=1 and t.type>1 ");//激活期的流水,不统计到资金流水表
         selSql.append("  UNION ALL");

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

@@ -25,5 +25,6 @@ public interface IFinanceService {
     
     Page<Map<String, Object>> findMerchantBalanceOldByPage(Map<String, Object> params, Pageable pageable);
     
+    Page<Map<String, Object>> findMerchantBalanceByPage(Map<String, Object> params, Pageable pageable); 
     
 }

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

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

+ 1 - 1
src/main/java/com/ssj/service/sys/fx/service/MerchantSignService.java

@@ -14,7 +14,7 @@ public interface MerchantSignService extends BaseService<MerchantSign, String> {
 	
 	Page<Map<String, Object>> findMerchantSignStatusByPage(Map<String, Object> params, Pageable initPage);
 	
-	void saveMerchantSign(String merchantId,Integer type,Integer num,Integer libService,String signTime,Double unitPrice);
+	void saveMerchantSign(String merchantId,Integer type,Integer num,Integer libService,String signTime,Double unitPrice,Double price);
 	
 	public int getMerchantSignByCurLibService(String merchantId);
 	

+ 3 - 1
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantSignServiceImpl.java

@@ -73,7 +73,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 
 
 	@Override
-	public void saveMerchantSign(String merchantId, Integer type, Integer num, Integer libService, String signTime,Double unitPrice) {
+	public void saveMerchantSign(String merchantId, Integer type, Integer num, Integer libService, String signTime,Double unitPrice,Double price) {
 		List<MerchantSign> list =new ArrayList<MerchantSign>();
 		MerchantSignOrder signOrder=new MerchantSignOrder();
 		if(type==1) {
@@ -83,6 +83,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 			signOrder.setSignTime(DateHelper.parseDate(signTime,"yyyy-MM-dd"));
 			signOrder.setType(type);
 			signOrder.setUnitPrice(unitPrice);
+			signOrder.setPrice(price);
 			signOrder.setCreateTime(new Date());
 			merchantSignOrderService.save(signOrder);
 			
@@ -108,6 +109,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 			signOrder.setSignTime(DateHelper.parseDate(signTime,"yyyy-MM-dd"));
 			signOrder.setType(type);
 			signOrder.setUnitPrice(unitPrice);
+			signOrder.setPrice(price);
 			signOrder.setCreateTime(new Date());
 			merchantSignOrderService.save(signOrder);
 			

+ 6 - 11
src/main/java/com/ssj/sys/controller/FinanceReportController.java

@@ -648,11 +648,12 @@ public class FinanceReportController extends BaseController {
             response.setContentType("application/vnd.ms-excel;charset=UTF-8");
             response.setCharacterEncoding("utf-8");
             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"));
+            params.put("merchantId", request.getParameter("merchantId")==null?"":request.getParameter("merchantId"));
             addPostcodes(params);
-            Page<Map<String,Object>> page = financeService.balanceConsumeDetailList_New(params, initPage(1, 100000));
             
+            Page<Map<String,Object>> page = financeService.balanceConsumeDetailList_New2(params, initPage(1, 10000));
             List<Map<String,Object>> list=page.getContent();
             for (Map<String, Object> map : list) {
             	if(Integer.parseInt(map.get("meal_type").toString())==4) {
@@ -664,6 +665,7 @@ public class FinanceReportController extends BaseController {
             	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"));
@@ -710,15 +712,13 @@ public class FinanceReportController extends BaseController {
             	map.put("count_1_m", "");
             	map.put("count_2_m", "");
             	
-            	if(map.containsKey("count_1")) {
-            		if(Integer.parseInt(map.get("count_1").toString())>0) {
+            	if(map.containsKey("moid")) {
+            		if(map.get("moid")!=null) {
             			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);
-            		}else {
-            			map.put("price", "0");
             		}
             	}
             	
@@ -734,7 +734,6 @@ public class FinanceReportController extends BaseController {
             			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());
     		}
             
@@ -748,15 +747,11 @@ public class FinanceReportController extends BaseController {
             myColumns3.add(new ExcelColumn("服务包名称", "sign_type", 20));
             
             myColumns3.add(new ExcelColumn("服务包/月金额", "price", 20));
-//            myColumns3.add(new ExcelColumn("总有效服务数", "sum_1", 20));
-//            myColumns3.add(new ExcelColumn("总结束服务数", "sum_2", 20));
             myColumns3.add(new ExcelColumn("服务包/结算月份", "count_1_m", 20));
             
             myColumns3.add(new ExcelColumn("服务包应结算金额", "sum_price_1", 20));
             
             myColumns3.add(new ExcelColumn("加油包/月金额", "price_1", 20));
-//            myColumns3.add(new ExcelColumn("加油包/有效服务数", "sum_3", 20));
-//            myColumns3.add(new ExcelColumn("加油包/结束服务数", "sum_4", 20));
             myColumns3.add(new ExcelColumn("加油包/结算月份", "count_2_m", 20));
             myColumns3.add(new ExcelColumn("加油包/结算数量", "count_2", 20));
             

+ 172 - 5
src/main/java/com/ssj/sys/controller/FxController.java

@@ -3633,8 +3633,8 @@ public class FxController  extends BaseController {
     		myColumns3.add(new ExcelColumn("商户类型", "merchant_type", 20));
     		myColumns3.add(new ExcelColumn("加油包类型", "type", 20));
     		myColumns3.add(new ExcelColumn("购买数量", "num", 20));
-    		myColumns3.add(new ExcelColumn("成本价", "unit_price", 20));
-    		myColumns3.add(new ExcelColumn("收入总价", "price", 20));
+    		myColumns3.add(new ExcelColumn("单价(成本)", "unit_price", 20));
+    		myColumns3.add(new ExcelColumn("总价(收入)", "price", 20));
     		myColumns3.add(new ExcelColumn("服务总人数", "lib_service", 20));
     		myColumns3.add(new ExcelColumn("激活时间", "sign_time", 20));
     		myColumns3.add(new ExcelColumn("购买时间", "create_time", 20));
@@ -4024,9 +4024,13 @@ public class FxController  extends BaseController {
 	        
 	        List<Map<String, Object>> mapList=page.getContent();
 	        for (Map<String, Object> map : mapList) {
+	        	map.put("init_3",new BigDecimal(map.get("init_1").toString()).doubleValue()-new BigDecimal(map.get("init_2").toString()).doubleValue());
+	    		map.put("ir_1",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*new BigDecimal(map.get("init_3").toString()).doubleValue()).setScale(2, RoundingMode.UP).doubleValue());
+	        	
 	    		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("count_3",new BigDecimal(map.get("count_1").toString()).intValue()-new BigDecimal(map.get("count_2").toString()).intValue());
 	    		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()) {
@@ -4055,6 +4059,8 @@ public class FxController  extends BaseController {
 		   		myColumns3.add(new ExcelColumn("商户名称", "unit_name", 20));
 		   		myColumns3.add(new ExcelColumn("商户类型", "type", 20));
 		   		myColumns3.add(new ExcelColumn("签约端口数", "port_num", 20));
+		   		myColumns3.add(new ExcelColumn("期初数量", "init_3", 20));
+		   		myColumns3.add(new ExcelColumn("期初金额", "ir_1", 20));
 		   		myColumns3.add(new ExcelColumn("本期增加数量", "count_1", 20));
 		   		myColumns3.add(new ExcelColumn("本期增加金额", "pr_1", 20));
 		   		myColumns3.add(new ExcelColumn("本期减少数量", "count_2", 20));
@@ -4080,6 +4086,106 @@ public class FxController  extends BaseController {
 	   }  
  	
  	
+ 	
+ 	@RequestMapping(value = "/exportMerchantBalanceList", method = RequestMethod.POST)
+    @ResponseBody
+    public void exportMerchantBalanceList( 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-01-01":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.findMerchantBalanceByPage(params, initPage(1, 10000, Direction.DESC, new String[]{"createTime"}));
+	        
+	        List<Map<String, Object>> mapList=page.getContent();
+	        for (Map<String, Object> map : mapList) {
+	        	//期初
+	    		map.put("init_5",(Integer.parseInt(map.get("init_1").toString())+Integer.parseInt(map.get("init_3").toString()))
+	    				-(Integer.parseInt(map.get("init_2").toString())+Integer.parseInt(map.get("init_4").toString())));
+	    		map.put("ir_7",new BigDecimal(
+	    					(new BigDecimal(map.get("ir_1").toString()).doubleValue()+new BigDecimal(map.get("ir_3").toString()).doubleValue()+new BigDecimal(map.get("ir_5").toString()).doubleValue())
+	    					-(new BigDecimal(map.get("ir_2").toString()).doubleValue()+new BigDecimal(map.get("ir_4").toString()).doubleValue()+new BigDecimal(map.get("ir_6").toString()).doubleValue())   
+	    				).setScale(2, RoundingMode.UP).doubleValue());
+	    		
+	    		//本期增加
+	    		map.put("count_5",(Integer.parseInt(map.get("count_1").toString())+Integer.parseInt(map.get("count_3").toString())));
+	    		map.put("pr_7",new BigDecimal(
+	    					(new BigDecimal(map.get("pr_1").toString()).doubleValue()+new BigDecimal(map.get("pr_3").toString()).doubleValue()+new BigDecimal(map.get("pr_5").toString()).doubleValue())
+	    				).setScale(2, RoundingMode.UP).doubleValue());
+	    		
+	    		//本期减少
+	    		map.put("count_6",(Integer.parseInt(map.get("count_2").toString())+Integer.parseInt(map.get("count_4").toString())));
+	    		map.put("pr_8",new BigDecimal(
+	    					(new BigDecimal(map.get("pr_1").toString()).doubleValue()+new BigDecimal(map.get("pr_4").toString()).doubleValue()+new BigDecimal(map.get("pr_6").toString()).doubleValue())
+	    				).setScale(2, RoundingMode.UP).doubleValue());
+	    		
+	    		//本期结存
+	    		map.put("count_7",new BigDecimal(map.get("count_5").toString()).intValue()-new BigDecimal(map.get("count_6").toString()).intValue());
+	    		map.put("pr_9",new BigDecimal(map.get("pr_7").toString()).doubleValue()-new BigDecimal(map.get("pr_8").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("期初数量", "init_5", 20));
+		   		myColumns3.add(new ExcelColumn("期初金额", "ir_7", 20));
+		   		myColumns3.add(new ExcelColumn("本期增加数量", "count_5", 20));
+		   		myColumns3.add(new ExcelColumn("本期增加金额", "pr_7", 20));
+		   		myColumns3.add(new ExcelColumn("本期减少数量", "count_6", 20));
+		   		myColumns3.add(new ExcelColumn("本期减少金额", "pr_8", 20));
+		   		myColumns3.add(new ExcelColumn("结存数量", "count_7", 20));
+		   		myColumns3.add(new ExcelColumn("结存金额", "pr_9", 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
     public void exportMerchantActiveCapList( HttpServletRequest request, HttpServletResponse response) {  
@@ -4849,6 +4955,9 @@ public class FxController  extends BaseController {
         
         List<Map<String, Object>> mapList=page.getContent();
         for (Map<String, Object> map : mapList) {
+    		map.put("init_3",new BigDecimal(map.get("init_1").toString()).doubleValue()-new BigDecimal(map.get("init_2").toString()).doubleValue());
+    		map.put("ir_1",new BigDecimal(new BigDecimal(map.get("price").toString()).doubleValue()*new BigDecimal(map.get("init_3").toString()).doubleValue()).setScale(2, RoundingMode.UP).doubleValue());
+    		
     		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());
@@ -4864,6 +4973,64 @@ public class FxController  extends BaseController {
     }
 	
 	
+		//塾币结存表
+		@RequestMapping("/merchantBalanceList")
+	    public String merchantBalanceList(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-01-01":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.findMerchantBalanceByPage(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("init_5",(Integer.parseInt(map.get("init_1").toString())+Integer.parseInt(map.get("init_3").toString()))
+	    				-(Integer.parseInt(map.get("init_2").toString())+Integer.parseInt(map.get("init_4").toString())));
+	    		map.put("ir_7",new BigDecimal(
+	    					(new BigDecimal(map.get("ir_1").toString()).doubleValue()+new BigDecimal(map.get("ir_3").toString()).doubleValue()+new BigDecimal(map.get("ir_5").toString()).doubleValue())
+	    					-(new BigDecimal(map.get("ir_2").toString()).doubleValue()+new BigDecimal(map.get("ir_4").toString()).doubleValue()+new BigDecimal(map.get("ir_6").toString()).doubleValue())   
+	    				).setScale(2, RoundingMode.UP).doubleValue());
+	    		
+	    		//本期增加
+	    		map.put("count_5",(Integer.parseInt(map.get("count_1").toString())+Integer.parseInt(map.get("count_3").toString())));
+	    		map.put("pr_7",new BigDecimal(
+	    					(new BigDecimal(map.get("pr_1").toString()).doubleValue()+new BigDecimal(map.get("pr_3").toString()).doubleValue()+new BigDecimal(map.get("pr_5").toString()).doubleValue())
+	    				).setScale(2, RoundingMode.UP).doubleValue());
+	    		
+	    		//本期减少
+	    		map.put("count_6",(Integer.parseInt(map.get("count_2").toString())+Integer.parseInt(map.get("count_4").toString())));
+	    		map.put("pr_8",new BigDecimal(
+	    					(new BigDecimal(map.get("pr_1").toString()).doubleValue()+new BigDecimal(map.get("pr_4").toString()).doubleValue()+new BigDecimal(map.get("pr_6").toString()).doubleValue())
+	    				).setScale(2, RoundingMode.UP).doubleValue());
+	    		
+	    		//本期结存
+	    		map.put("count_7",new BigDecimal(map.get("count_5").toString()).doubleValue()-new BigDecimal(map.get("count_6").toString()).doubleValue());
+	    		map.put("pr_9",new BigDecimal(map.get("pr_7").toString()).doubleValue()-new BigDecimal(map.get("pr_8").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/merchantBalanceList";
+	    }
+	
+	
 	
 	
 	
@@ -5028,7 +5195,7 @@ public class FxController  extends BaseController {
 	
 	@RequestMapping(value="/saveMerchantSign")
 	@ResponseBody
-	public Response saveMerchantSign(Model model, String id,Integer type,Integer num,Integer libService,String signTime,Double unitPrice) {
+	public Response saveMerchantSign(Model model, String id,Integer type,Integer num,Integer libService,String signTime,Double unitPrice,Double price) {
 		Response response = new  Response();
 		if(type==null) {
 			response.failure("请选择购买的加油包");
@@ -5042,7 +5209,7 @@ public class FxController  extends BaseController {
 			response.failure("激活日期不可为空");
 			return response;
 		}
-		merchantSignService.saveMerchantSign(id, type, num, libService, signTime, unitPrice);
+		merchantSignService.saveMerchantSign(id, type, num, libService, signTime, unitPrice,price);
 		response.success("操作成功");
 		return response;
 	}

+ 14 - 22
src/main/resources/templates/sys/fx/merchantBalanceList.html

@@ -28,7 +28,7 @@
 	</ul>
 </div>
 <div class="rightinfo">
-	<form id="seachform" th:action="@{/sys/fx/merchantBalanceOldList.html}" method="post">
+	<form id="seachform" th:action="@{/sys/fx/merchantBalanceList.html}" method="post">
 	<ul class="seachform">
 		<li>
 			<label>所有商户:</label>
@@ -48,17 +48,6 @@
 		  <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="查询" />
@@ -78,7 +67,8 @@
 		    	<th>商户账号</th>
 		        <th>商户名称</th>
 		        <th>商户类型</th>
-		    	<th>签约端口数</th>
+		    	<th>期初数量</th>
+		    	<th>期初金额</th>
 		    	<th>本期增加数量</th>
 		    	<th>本期增加金额</th>
 		        <th>本期减少数量</th>
@@ -98,16 +88,18 @@
 					   <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.init_5}"></td>
+					<td th:text="${item.ir_7}"></td>
+					
+					<td th:text="${item.count_5}"></td>
+					<td th:text="${item.pr_7}"></td>
 					
-					<td th:text="${item.count_2}"></td>
-					<td th:text="${item.pr_2}"></td>
+					<td th:text="${item.count_6}"></td>
+					<td th:text="${item.pr_8}"></td>
 					
-					<td th:text="${item.count_3}"></td>
-					<td th:text="${item.pr_3}"></td>
+					<td th:text="${item.count_7}"></td>
+					<td th:text="${item.pr_9}"></td>
 			</tr>
 		</tbody>
 	</table>
@@ -133,9 +125,9 @@ $(function(){
 
 
 $("#button").on('click',function(){
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportMerchantCapOldList";
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/exportMerchantBalanceList";
 	$("#seachform").submit();
-	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/merchantCapOldList.html";
+	document.getElementById("seachform").action = "[[${sysUrl}]]/sys/fx/merchantBalanceList.html";
 });
 </script>
 

+ 5 - 10
src/main/resources/templates/sys/fx/merchantBalanceOldList.html

@@ -48,16 +48,6 @@
 		  <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="查询" />
@@ -78,6 +68,8 @@
 		        <th>商户名称</th>
 		        <th>商户类型</th>
 		    	<th>签约端口数</th>
+		    	<th>期初数量</th>
+		    	<th>期初金额</th>
 		    	<th>本期增加数量</th>
 		    	<th>本期增加金额</th>
 		        <th>本期减少数量</th>
@@ -99,6 +91,9 @@
 					</td>
 					<td th:text="${item.port_num}"></td>
 					
+					<td th:text="${item.init_1}"></td>
+					<td th:text="${item.ir_1}"></td>
+					
 					<td th:text="${item.count_1}"></td>
 					<td th:text="${item.pr_1}"></td>
 					

+ 0 - 11
src/main/resources/templates/sys/fx/merchantMealOrderList.html

@@ -59,17 +59,6 @@
 		  <input style="width: 150px;" name="endSignTime" type="text" class="scinput"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${search.get('endSignTime')}" 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('merchantType') eq '5' ? true : false}">直接签约(端口模式)</option>
-				<option value="1"  th:selected="${search.get('merchantType') eq '1' ? true : false}">直接签约(塾币模式)</option>
-				<option value="2"  th:selected="${search.get('merchantType') eq '2' ? true : false}">内部消耗</option>
-				<option value="3"  th:selected="${search.get('merchantType') eq '3' ? true : false}">外部签约</option>
-				<option value="4"  th:selected="${search.get('merchantType') eq '4' ? true : false}">内部不结算(财务)</option>
-			</select>
-	    </li>
 		
 		<li>
 			<input type="button" class="scbtn" value="查询" />

+ 1 - 11
src/main/resources/templates/sys/fx/merchantPlatOrderList.html

@@ -48,17 +48,7 @@
 		  <input style="width: 150px;" name="endSignTime" type="text" class="scinput"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${search.get('endSignTime')}" 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('merchantType') eq '5' ? true : false}">直接签约(端口模式)</option>
-				<option value="1"  th:selected="${search.get('merchantType') eq '1' ? true : false}">直接签约(塾币模式)</option>
-				<option value="2"  th:selected="${search.get('merchantType') eq '2' ? true : false}">内部消耗</option>
-				<option value="3"  th:selected="${search.get('merchantType') eq '3' ? true : false}">外部签约</option>
-				<option value="4"  th:selected="${search.get('merchantType') eq '4' ? true : false}">内部不结算(财务)</option>
-			</select>
-	    </li>
+		
 		
 		<li>
 			<input type="button" class="scbtn" value="查询" />

+ 21 - 2
src/main/resources/templates/sys/fx/merchantSignAdd.html

@@ -281,7 +281,7 @@
 		      </tr>
 		      
 		     <tr valign="top">
-	  			<td align="right" width="70" style="line-height: 30px;font-weight: 700">成本价:</td>
+	  			<td align="right" width="70" style="line-height: 30px;font-weight: 700">单价(成本):</td>
 	  	        <td>
 		        	<ul class="nmb_jj">
 			            <li>
@@ -290,6 +290,21 @@
 		          </ul>
 		        </td>
 		      </tr>
+		      <tr>
+		        <td height="20"></td>
+		        <td></td>
+		      </tr>
+		      
+		     <tr valign="top">
+	  			<td align="right" width="70" style="line-height: 30px;font-weight: 700">总价(收入):</td>
+	  	        <td>
+		        	<ul class="nmb_jj">
+			            <li>
+			              <input name="price" id="price" type="text" value="0" class="srkk" style="width: 115px;"><i> 元</i>
+			            </li>
+		          </ul>
+		        </td>
+		      </tr>
 		   	 <tr>
 		        <td height="20"></td>
 		        <td></td>
@@ -316,7 +331,8 @@
 	    	<th >购买数量</th>
 	    	<th >服务人数</th>
 	    	<th >激活日期 </th>
-	    	<th >成本价</th>
+	    	<th >单价(成本)</th>
+	    	<th >总价(收入)</th>
 	    	<th >购买时间</th>
 	    </tr> 
 	</thead>
@@ -331,6 +347,7 @@
 	    	<td th:text="${item.libService}"></td>
 	    	<td th:text="${#dates.format(item.signTime, 'yyyy-MM-dd')}"> </td>
 	    	<td th:text="${item.unitPrice}"></td>
+	    	<td th:text="${item.price}"></td>
 	    	<td th:text="${item.createTime}"></td>
 	    </tr> 
 	   
@@ -369,6 +386,7 @@
 				var num=$("#service_num").val();
 				var signTime=$("#signTime").val();
 				var unitPrice=$("#unitPrice").val();
+				var price=$("#price").val();
 				var libService=$(".sign_type_select_on").data("lib_service");
 				
 				var url="[[${sysUrl}]]/sys/fx/saveMerchantSign";
@@ -378,6 +396,7 @@
 			        'num':num,
 			        'signTime':signTime,
 			        'unitPrice':unitPrice,
+			        'price':price,
 			        'libService':libService
 			    };
 				$.post(url,params,function(data){

+ 2 - 13
src/main/resources/templates/sys/fx/merchantSignOrderList.html

@@ -56,17 +56,6 @@
 		  <input style="width: 150px;" name="endSignTime" type="text" class="scinput"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" th:value="${search.get('endSignTime')}" 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('merchantType') eq '5' ? true : false}">直接签约(端口模式)</option>
-				<option value="1"  th:selected="${search.get('merchantType') eq '1' ? true : false}">直接签约(塾币模式)</option>
-				<option value="2"  th:selected="${search.get('merchantType') eq '2' ? true : false}">内部消耗</option>
-				<option value="3"  th:selected="${search.get('merchantType') eq '3' ? true : false}">外部签约</option>
-				<option value="4"  th:selected="${search.get('merchantType') eq '4' ? true : false}">内部不结算(财务)</option>
-			</select>
-	    </li>
 		
 		
 		<li>
@@ -89,8 +78,8 @@
 		        <th>商户类型</th>
 		    	<th>加油包类型</th>
 		    	<th>购买数量</th>
-		    	<th>成本价</th>
-		    	<th>收入总价</th>
+		    	<th>单价(成本)</th>
+		    	<th>总价(收入)</th>
 		        <th>服务总人数</th>
 		        <th>激活时间</th>
 		        <th>购买时间</th>