Переглянути джерело

Merge remote-tracking branch 'origin/master'

shenhao 4 роки тому
батько
коміт
655e15ca2c

+ 31 - 4
src/main/java/com/ssj/api/controller/ApiMerchantController.java

@@ -24,6 +24,7 @@ import com.ssj.framework.core.util.ResponseConstant;
 import com.ssj.framework.core.util.ResponseEntity;
 import com.ssj.service.sys.fx.service.MerchantService;
 import com.ssj.service.weixin.library.service.ILibJoinConsumeService;
+import com.ssj.service.weixin.sales.service.LibVipServiceService;
 
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -39,6 +40,8 @@ public class ApiMerchantController extends BaseController {
 	@Autowired
 	private ILibJoinConsumeService  libJoinConsumeService;
 	
+	@Autowired
+	private LibVipServiceService  libVipServiceService;
 	
 	
 	//1:激活日期之前,生成一条数据为0的记录,重新设置激活日期,设置下一个结算日。
@@ -53,7 +56,7 @@ public class ApiMerchantController extends BaseController {
 	@IgnoreSecurity
 	@RequestMapping(value = "/service")
     @ApiOperation(value = "获取商户套餐信息接口",  notes = "获取商户套餐信息接口")
-    public ResponseEntity getAccessToken(@RequestBody ServiceVo requestVO) {
+    public ResponseEntity service(@RequestBody ServiceVo requestVO) {
 		logger.info("第三方调用接口【service】,请求参数:"+JSONObject.toJSONString(requestVO));
         ResponseEntity responseEntity = new ResponseEntity();
         Map<String,Object> data=new HashMap<String, Object>();
@@ -66,7 +69,11 @@ public class ApiMerchantController extends BaseController {
         			if(consumes==null || consumes.size()<=0) {
         				logger.info("第三方调用接口【service】,商户产生激活期:"+merchant.getId());
         				
-	        			merchant.setCurIsSummary(0);
+        				if(merchant.getComputeTime()==null) {
+        					merchant.setCurIsSummary(1);
+        				}else {
+        					merchant.setCurIsSummary(0);
+        				}
 	        			merchant.setActiveTime(new Date());
 						merchant.setCurSummaryTime(new Date());
 						merchant.setNextSummaryTime(DateHelper.getMonthDate(merchant.getCurSummaryTime(),1));
@@ -84,6 +91,23 @@ public class ApiMerchantController extends BaseController {
 						consume.setRemarks("激活期扣费【服务包扣费】-来源开放接口");
 						consume.setCreateTime(new Date());
 						libJoinConsumeService.save(consume);
+						
+						
+						if(merchant.getComputeTime()==null) {
+							DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+							//调用openApi接口
+							libVipServiceService.openApiServiceCRM(
+									3,
+									merchant.getLibId(), 
+									merchant.getSignType(),
+									merchant.getMealType(),
+									merchant.getLibService(),
+									merchant.getStartActiveTime()!=null ? format.format(merchant.getStartActiveTime()) : "",
+									merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : format.format(merchant.getActiveTime()),
+									merchant.getComputeTime()!=null ? 
+											format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : 
+												format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth())));
+						}
         			}else {
         				
         				//自主激活的第一条都要记录,所以判断之前的数据是否有自主激活的,没有就保存一条。
@@ -115,8 +139,11 @@ public class ApiMerchantController extends BaseController {
         		data.put("id", merchant.getId());
         		data.put("libId", merchant.getLibId());
         		data.put("startActiveTime", merchant.getStartActiveTime()!=null ?  format.format(merchant.getStartActiveTime()) : "");
-        		data.put("summaryTime", merchant.getComputeTime()!=null ?  format.format(merchant.getComputeTime()) : "");
-        		data.put("endSummaryTime", merchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : "");
+        		data.put("summaryTime", merchant.getComputeTime()!=null ? 
+        				format.format(merchant.getComputeTime()) :  format.format(merchant.getActiveTime()));
+        		data.put("endSummaryTime", merchant.getComputeTime()!=null ? 
+        				format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : 
+        					format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth())) );
         		data.put("signType", merchant.getSignType());
         		data.put("mealType", merchant.getMealType());
         		data.put("libService", merchant.getLibService());

+ 8 - 2
src/main/java/com/ssj/dao/weixin/library/dao/impl/ILibJoinConsumeQueryDaoImpl.java

@@ -33,8 +33,14 @@ public class ILibJoinConsumeQueryDaoImpl   implements ILibJoinConsumeQueryDao {
 			queryParams.add(params.get("remarks"));
 		}
 		if(params.containsKey("type") && StringUtils.isNotEmpty(params.getOrDefault("type","").toString())) {
-			selSql.append(" AND t.type =?  ");
-			queryParams.add(params.get("type"));
+			if(params.get("type").toString().equals("-1")) {
+				selSql.append(" AND t.type in (1,2,3,4,5)  ");
+			}else if(params.get("type").toString().equals("-2")) {
+				selSql.append(" AND t.type in (6,7,8,9,10,11)  ");
+			} else {
+				selSql.append(" AND t.type =?  ");
+				queryParams.add(params.get("type"));
+			}
 		}
 		if(params.containsKey("startTime") && StringUtils.isNotEmpty(params.getOrDefault("startTime","").toString())) {
 			selSql.append(" AND TO_DAYS(t.create_time)>=TO_DAYS(?)  ");

+ 15 - 13
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantServiceImpl.java

@@ -1519,7 +1519,10 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 				
 				//如果修改了套餐的模式,就重新处理数据 加油包
 				if(!oldmerchant.getSignType().equals(merchant.getSignType())) {
-					List<MerchantSign> merchantSigns=merchantSignService.findMerchantSignByMerchantIdGTTime(oldmerchant.getId(),oldmerchant.getComputeTime(),0);
+					List<MerchantSign> merchantSigns=merchantSignService.findMerchantSignByMerchantIdGTTime(
+							oldmerchant.getId(),
+							oldmerchant.getComputeTime()!=null ? oldmerchant.getComputeTime() : oldmerchant.getActiveTime(),
+							0);
 					Integer signNum=0;
 					for (MerchantSign merchantSign : merchantSigns) {
 						signNum=signNum+merchantSign.getLibService();
@@ -1557,9 +1560,6 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 						libJoin.setLibService(oldmerchant.getLibService());
 						libJoin.setPlatformService(oldmerchant.getPlatformService());
 						
-						libJoin.setSignType(oldmerchant.getSignType());
-						libJoin.setSignTime(oldmerchant.getSignTime());
-						libJoin.setEndSignTime(oldmerchant.getEndSignTime());
 						libJoinService.save(libJoin);
 					}	
 				}
@@ -1578,7 +1578,7 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 							consume.setType(6);
 							consume.setSignType(merchant.getSignType());
 							consume.setComputeNum(merchant.getCurIsSummary());
-							consume.setRemarks("服务包开通【服务包更改:第"+i+"月】");
+							consume.setRemarks("服务包开通【服务包开通:第"+i+"月】");
 							consume.setCreateTime(new Date());
 							libJoinConsumeService.save(consume);
 						}
@@ -1593,8 +1593,11 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 							oldmerchant.getMealType(),
 							oldmerchant.getLibService(),
 							oldmerchant.getStartActiveTime()!=null ? format.format(oldmerchant.getStartActiveTime()) : "",
-							oldmerchant.getComputeTime()!=null ? format.format(oldmerchant.getComputeTime()) : "",
-							oldmerchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(oldmerchant.getComputeTime(),oldmerchant.getLibServiceMonth())) : "");
+							oldmerchant.getComputeTime()!=null ? format.format(oldmerchant.getComputeTime()) : format.format(oldmerchant.getActiveTime()),
+							oldmerchant.getComputeTime()!=null ? 
+									format.format(DateHelper.getMonthDate(oldmerchant.getComputeTime(),oldmerchant.getLibServiceMonth())) : 
+										format.format(DateHelper.getMonthDate(oldmerchant.getActiveTime(),oldmerchant.getLibServiceMonth()))
+							);
 				}
 				
 				
@@ -1718,10 +1721,6 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 						libJoin.setLibService(merchant.getLibService());
 						libJoin.setPlatformService(merchant.getPlatformService());
 						
-						libJoin.setSignType(merchant.getSignType());
-						libJoin.setSignTime(merchant.getSignTime());
-						libJoin.setEndSignTime(merchant.getEndSignTime());
-						
 						libJoinService.save(libJoin);
 					}	
 				}
@@ -1752,8 +1751,11 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 							merchant.getMealType(),
 							merchant.getLibService(),
 							merchant.getStartActiveTime()!=null ? format.format(merchant.getStartActiveTime()) : "",
-							merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : "",
-							merchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : "");
+							merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : format.format(merchant.getActiveTime()),
+							merchant.getComputeTime()!=null ? 
+									format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : 
+										format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth()))
+							);
 				}
 				
 				this.syncRecordByMerchant(curadmin.getLoginName(), merchant.getId(),"", "新增套餐商户");

+ 76 - 16
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantSignServiceImpl.java

@@ -121,8 +121,10 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 							merchant.getMealType(),
 							merchant.getLibService(),
 							merchant.getStartActiveTime()!=null ? format.format(merchant.getStartActiveTime()) : "",
-							merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : "",
-							merchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : "" );
+							merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : format.format(merchant.getActiveTime()),
+							merchant.getComputeTime()!=null ? 
+									format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : 
+										format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth())));
 				} catch (Exception e) {
 					e.printStackTrace();
 					logger.error("1:处理加油包过期数据,异常:"+e.getMessage());
@@ -150,7 +152,11 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 					consume.setType(10);
 					consume.setComputeNum(merchantSign.getNum());
 					consume.setSignType(merchant.getSignType());
-					consume.setRemarks("加油包激活【加油包激活】");
+					if(merchantSign.getSignType().equals(4)) {
+						consume.setRemarks("加油包开通【新模式月包】");
+					}else {
+						consume.setRemarks("加油包开通【新模式量包】");
+					}
 					consume.setCreateTime(new Date());
 					libJoinConsumeService.save(consume);
 					
@@ -163,8 +169,11 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 							merchant.getMealType(),
 							merchant.getLibService(),
 							merchant.getStartActiveTime()!=null ? format.format(merchant.getStartActiveTime()) : "",
-							merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : "",
-							merchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : "" );
+							merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : format.format(merchant.getActiveTime()),
+							merchant.getComputeTime()!=null ? 
+									format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : 
+										format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth()))
+										);
 					
 				} catch (Exception e) {
 					e.printStackTrace();
@@ -178,6 +187,11 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 			List<Merchant> activeMerchants=merchantService.findMerchantSignByActiveTime();
 			for (Merchant merchant : activeMerchants) {
 				try {
+					//如果开始计费时间为null,就不处理
+					if(merchant.getComputeTime()==null) {
+						continue;
+					}
+					
 					merchant.setCurIsSummary(0);
 					merchant.setCurSummaryTime(new Date());
 					merchant.setNextSummaryTime(DateHelper.getMonthDate(merchant.getCurSummaryTime(),1));
@@ -203,11 +217,50 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 			}
 			
 			
-			//3:处理激活日期的下一结算日数据,再生成一条0的结算数据,CurIsSummary=0的,设置下一个结算时间。
+			
+			//3:处理激活日期的数据,设置下一个结算日,CurIsSummary=1
+		    //注:如果在激活日期之前的时间,设置下一个结算日,CurIsSummary=1
+			for (Merchant merchant : activeMerchants) {
+				try {
+					
+					if(merchant.getComputeTime()==null) {
+						merchant.setCurIsSummary(1);
+						merchant.setCurSummaryTime(new Date());
+						merchant.setNextSummaryTime(DateHelper.getMonthDate(merchant.getCurSummaryTime(),1));
+						merchantService.save(merchant);
+						
+						//记录
+						TbLibJoinConsume consume=new TbLibJoinConsume();
+						consume.setFromLibId(merchant.getLibId());
+						consume.setFromMerchantId(merchant.getId());
+						consume.setLibService(merchant.getLibService());
+						consume.setPlatformService(0);
+						consume.setType(7);
+						consume.setComputeNum(merchant.getCurIsSummary());
+						consume.setSignType(merchant.getSignType());
+						consume.setRemarks("激活期扣费【服务包扣费】");
+						consume.setCreateTime(new Date());
+						libJoinConsumeService.save(consume);
+					}
+					
+				} catch (Exception e) {
+					e.printStackTrace();
+					logger.error("3:处理商户系统激活日期数据,异常:"+e.getMessage());
+				}
+			}
+			
+			
+			
+			//4:处理激活日期的下一结算日数据,再生成一条0的结算数据,CurIsSummary=0的,设置下一个结算时间。
 		    //注:设置当前的时间
 			List<Merchant> activeEndMerchants=merchantService.findMerchantSignBySummaryTime();
 			for (Merchant merchant : activeEndMerchants) {
 				
+				//如果开始计费时间为null,就不处理
+				if(merchant.getComputeTime()==null) {
+					continue;
+				}
+				
 				//只有在激活期的商户才处理数据。
 				if(merchant.getCurIsSummary()==null || merchant.getCurIsSummary()==0) {
 					try {
@@ -248,17 +301,21 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 
 					} catch (Exception e) {
 						e.printStackTrace();
-						logger.error("3:处理商户激活结算日期数据,异常:"+e.getMessage());
+						logger.error("4:处理商户激活结算日期数据,异常:"+e.getMessage());
 					}
 				}
 			}
 			
 			
 			
-			//4:处理开始计费日期,生成一条真实的数据30,设置当前的时间, 设置下一个结算日,CurIsSummary=+1,真实开始结算。
+			//5:处理开始计费日期,生成一条真实的数据30,设置当前的时间, 设置下一个结算日,CurIsSummary=+1,真实开始结算。
 			List<Merchant> computeMerchants=merchantService.findMerchantSignByComputeTime();
 			for (Merchant merchant : computeMerchants) {
 				try {
+					//如果开始计费时间为null,就不处理
+					if(merchant.getComputeTime()==null) {
+						continue;
+					}
 					
 					//记录激活期的结算
 					TbLibJoinConsume consume=new TbLibJoinConsume();
@@ -294,13 +351,13 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 
 				} catch (Exception e) {
 					e.printStackTrace();
-					logger.error("2:处理商户系统激活日期数据,异常:"+e.getMessage());
+					logger.error("5:处理商户系统激活日期数据,异常:"+e.getMessage());
 				}
 			}
 			
 			
 			
-			//5:处理商户结算的数据
+			//6:处理商户结算的数据
 			List<Merchant> summaryMerchants=merchantService.findMerchantSignBySummaryTime();
 			for (Merchant merchant : summaryMerchants) {
 				try {
@@ -377,7 +434,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 					
 				} catch (Exception e) {
 					e.printStackTrace();
-					logger.error("2:处理商户结算的数据,异常:"+e.getMessage());
+					logger.error("6:处理商户结算的数据,异常:"+e.getMessage());
 				}
 				
 			}
@@ -398,13 +455,13 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 		
 		//开始计费时间是否大等于今天。
 		boolean isGTDay=false;
-		Date computeTime=merchant.getComputeTime();
+		Date computeTime=merchant.getComputeTime()!=null ? merchant.getComputeTime(): merchant.getActiveTime();
 		if(computeTime.getTime()<=new Date().getTime()) {
 			computeTime=new Date();
 			isGTDay=true;
 		}
 
-		String remarks="加油包开通【新模式】";
+		String remarks="加油包开通【新模式月包】";
 		Calendar cal = Calendar.getInstance();
 		cal.setTime(computeTime);
 		switch (signType) {
@@ -491,7 +548,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 			break;
 		}
 		
-		if(merchant.getComputeTime().getTime()<=new Date().getTime()) {
+		if(computeTime.getTime()<=new Date().getTime()) {
 			TbLibJoinConsume consume=null;
 			switch (signType) {
 			case 4:
@@ -544,8 +601,11 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 						merchant.getMealType(),
 						merchant.getLibService(),
 						merchant.getStartActiveTime()!=null ? format.format(merchant.getStartActiveTime()) : "",
-						merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : "",
-						merchant.getComputeTime()!=null ? format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : "" );
+						merchant.getComputeTime()!=null ? format.format(merchant.getComputeTime()) : format.format(merchant.getActiveTime()),
+						merchant.getComputeTime()!=null ? 
+								format.format(DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth())) : 
+									format.format(DateHelper.getMonthDate(merchant.getActiveTime(),merchant.getLibServiceMonth())) 
+									);
 			}
 		}
 		

+ 1 - 1
src/main/java/com/ssj/service/sys/role/service/impl/AdminServiceImpl.java

@@ -198,7 +198,7 @@ public class AdminServiceImpl extends BaseServiceImpl<Admin, String> implements
 				consume.setPlatformService(0);
 				consume.setType(1);
 				consume.setSignType(merchant.getSignType());
-				consume.setRemarks("充值【套餐模式开通】");
+				consume.setRemarks("服务包开通【服务包开通】");
 				consume.setCreateTime(new Date());
 				libJoinConsumeService.save(consume);
 			}

+ 1 - 1
src/main/java/com/ssj/service/weixin/sales/service/impl/LibVipServiceServiceImpl.java

@@ -1728,7 +1728,7 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
      */
     Date getEndDate(String vipId, String libId) {
         Merchant merchant=merchantService.getMerchantByLibId(libId);
-        return DateHelper.getMonthDate(merchant.getComputeTime(),merchant.getLibServiceMonth());
+        return DateHelper.getMonthDate(merchant.getComputeTime()!=null ? merchant.getComputeTime() : merchant.getActiveTime() ,merchant.getLibServiceMonth());
     }
 
 

+ 35 - 4
src/main/java/com/ssj/sys/controller/FinanceReportController.java

@@ -433,14 +433,47 @@ public class FinanceReportController extends BaseController {
         Page<Map<String,Object>> page = financeService.balanceConsumeDetailList_New(params, initPage(pageNo, pageSize));
         List<Map<String,Object>> list=page.getContent();
         for (Map<String, Object> map : list) {
+        	map.put("price_1", "700");
+          	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())!=1){
+        		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);
+        		}
+        	}
+        	
+        	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());
@@ -552,7 +585,7 @@ public class FinanceReportController extends BaseController {
             	map.put("sum_price_3", "0");
             	
             	if(map.containsKey("type")) {
-            		if(map.get("type")==null || Integer.parseInt(map.get("type").toString())!=1){
+            		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", "");
             		}
@@ -619,9 +652,7 @@ public class FinanceReportController extends BaseController {
             myColumns3.add(new ExcelColumn("月份", "balance_month", 20));
             myColumns3.add(new ExcelColumn("商户账号", "pos_code", 20));
             myColumns3.add(new ExcelColumn("商户编码", "org_code", 20));
-            myColumns3.add(new ExcelColumn("商户级别", "level_name", 20));
             myColumns3.add(new ExcelColumn("签约商户", "unit_name", 20));
-            myColumns3.add(new ExcelColumn("非签约商户", "external_unit_name", 20));
            
             myColumns3.add(new ExcelColumn("套餐名称", "meal_type", 20));
             myColumns3.add(new ExcelColumn("服务包名称", "sign_type", 20));

+ 36 - 16
src/main/java/com/ssj/sys/controller/FxController.java

@@ -1352,10 +1352,6 @@ public class FxController  extends BaseController {
 				response.failure("新模式的结束激活日期不可为空");
 		        return response;
 			}
-			if(StringUtils.isEmpty(computeTimeStr)) {
-				response.failure("新模式的计费开始日不可为空");
-		        return response;
-			}
 			if(merchant.getLibServiceMonth()==null || merchant.getLibServiceMonth()<=0) {
 				response.failure("新模式的充值月份数不可小于0");
 		        return response;
@@ -1877,7 +1873,9 @@ public class FxController  extends BaseController {
 						monthStr=obj.getLibServiceMonth()+"/"+obj.getCurIsSummary();
 						startActiveTimeStr=DateHelper.format(obj.getStartActiveTime(), "yyyy-MM-dd") ;
 						activeTimeStr=DateHelper.format(obj.getActiveTime(), "yyyy-MM-dd") ;
-						computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						if(obj.getComputeTime()!=null) {
+							computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						}
 						libService_1=obj.getLibService()+"";
 						break;
 					case "2":
@@ -1885,7 +1883,9 @@ public class FxController  extends BaseController {
 						monthStr=obj.getLibServiceMonth()+"/"+obj.getCurIsSummary();
 						startActiveTimeStr=DateHelper.format(obj.getStartActiveTime(), "yyyy-MM-dd") ;
 						activeTimeStr=DateHelper.format(obj.getActiveTime(), "yyyy-MM-dd") ;
-						computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						if(obj.getComputeTime()!=null) {
+							computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						}
 						libService_1=obj.getLibService()+"";
 						break;
 					case "3":
@@ -1893,7 +1893,9 @@ public class FxController  extends BaseController {
 						monthStr=obj.getLibServiceMonth()+"/"+obj.getCurIsSummary();
 						startActiveTimeStr=DateHelper.format(obj.getStartActiveTime(), "yyyy-MM-dd") ;
 						activeTimeStr=DateHelper.format(obj.getActiveTime(), "yyyy-MM-dd") ;
-						computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						if(obj.getComputeTime()!=null) {
+							computeTimeStr=DateHelper.format(obj.getComputeTime(), "yyyy-MM-dd") ;
+						}
 						libService_1=obj.getLibService()+"";
 						break;
 					default:
@@ -2137,11 +2139,11 @@ public class FxController  extends BaseController {
 	        HttpSession session = request.getSession();
 	        Admin admin =(Admin) session.getAttribute("admin");
 			Merchant merchant=merchantService.getMerchantByPosCode(admin.getLoginName());
-	        if(merchant!=null && !merchant.getOrgCode().equals("SSJ-FX")){
-				 params.put("from_merchant_id", merchant.getId());
-			}else{
+//	        if(merchant!=null && !merchant.getOrgCode().equals("SSJ-FX")){
+//				 params.put("from_merchant_id", merchant.getId());
+//			}else{
 				params.put("from_merchant_id", "");
-			}
+//			}
 	        params.put("type", request.getParameter("type")==null?"1":request.getParameter("type"));
 	        params.put("batchCode", request.getParameter("batchCode")==null?"":request.getParameter("batchCode"));
 	      
@@ -2643,19 +2645,37 @@ public class FxController  extends BaseController {
 		 	        for (Map<String, Object> map : list) {
 						switch (map.get("type").toString()) {
 							case "1":
-								map.put("type", "充值");
+								map.put("type", "塾币充值【旧模式】");
 								break;
 							case "2":
-								map.put("type", "消费");
+								map.put("type", "塾币消费【旧模式】");
 								break;
 							case "3":
-								map.put("type", "服务扣除");
+								map.put("type", "服务扣除【旧模式】");
 								break;
 							case "4":
-								map.put("type", "上级分配币");
+								map.put("type", "上级分配币【旧模式】 ");
 								break;
 							case "5":
-								map.put("type", "向下分配币");
+								map.put("type", "向下分配币【旧模式】");
+								break;
+							case "6":
+								map.put("type", "服务包开通【新模式】");
+								break;
+							case "7":
+								map.put("type", "服务包激活【新模式】");
+								break;
+							case "8":
+								map.put("type", "服务包结算【新模式】");
+								break;
+							case "9":
+								map.put("type", "加油包开通【新模式】");
+								break;
+							case "10":
+								map.put("type", "加油包激活【新模式】");
+								break;
+							case "11":
+								map.put("type", "加油包结算【新模式】");
 								break;
 							default:
 								map.put("type", "");

+ 19 - 4
src/main/resources/templates/sys/finance/allList6.html

@@ -16,6 +16,17 @@
 	.date_width{
 	     width: 150px;
 	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	#mealServiceAdd .zwfb_shop_table {
+		margin-top: 10px
+	}
+	
+	
 </style>
 <body>
 <div class="place">
@@ -51,7 +62,6 @@
 				<th style="width: 50px;">序号</th>
 				<th>签约帐号</th>
 				<th>签约商户</th>
-				<th>非签约商户</th>
 				
 				<th>套餐名称</th>
 		    	<th>服务包名称</th>
@@ -60,13 +70,16 @@
 		    	<th>总有效服务数</th>
 		    	<th>总结束服务数</th>
 		    	<th>结算月份</th>
-
+		    	<th>服务包结算金额</th>
 		    	
+
 		    	<th style="color: red">加油包/月金额</th>
 		    	<th style="color: red">加油包/有效服务数</th>
 		    	<th style="color: red">加油包/结束服务数</th>
 		    	<th style="color: red">加油包/结算月份</th>
-		    	<th style="color: red">加油包/结算数量</th>
+		    	<th style="color: red">加油包/结算数</th>
+		    	<th style="color: red">加油包结算金额</th>
+		    	<th >总结算金额</th>
 		    </tr>
 		</thead>
 		<tbody>
@@ -74,7 +87,6 @@
 					<td th:text="${itemStat.count}"></td>
 					<td th:text="${item.get('pos_code')}"></td>
 					<td th:text="${item.get('unit_name')}"></td>
-					<td th:text="${item.get('external_unit_name')}"></td>
 					<td  th:switch="${item.meal_type}">
 					   <span th:case="1" >优选套餐</span>
 					   <span th:case="2" >VIP套餐</span>
@@ -89,12 +101,15 @@
 					<td th:text="${item.get('sum_1')}"></td>
 					<td th:text="${item.get('sum_2')}"></td>
 					<td th:text="${item.get('count_1')>0 ? item.get('balance_month') : ''   }"></td>
+					<td th:text="${item.get('sum_price_1')}"></td>
 	
 					<td th:text="700"></td>
 					<td th:text="${item.get('sum_3')}"></td>
 					<td th:text="${item.get('sum_4')}"></td>
 					<td th:text="${item.get('count_2')>0 ? item.get('balance_month') : ''   }"></td>
 					<td th:text="${item.get('count_2')>0 ? item.get('count_2') : ''   }"></td>
+					<td th:text="${item.get('sum_price_2')}"></td>
+					<td th:text="${item.get('sum_price_3')}"></td>
 			</tr>
 		</tbody>
 	</table>

+ 4 - 0
src/main/resources/templates/sys/fx/consumeList.html

@@ -46,10 +46,14 @@
 					<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>
 				<select class="scinput select_width"  name="type"   style="width: 150px;" >
 					<option value="" th:selected="${search.get('type')+'' eq '' ? 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="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>

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

@@ -172,7 +172,7 @@ dtext{
 			</li>
 			
 			<li>
-				<label><b >【服务包模式】</b>计费开始日期:<b >*</b></label>
+				<label><b >【服务包模式】</b>计费开始日期:<b ></b></label>
 				<input type="text"  class="dfinput fl"  id="computeTime" name="computeTime"  onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',autoPickDate:true})" autocomplete="off" th:value="${#dates.format(merchant.computeTime, 'yyyy-MM-dd')}" placeholder="计费开始日期">
 			</li>