wuwen 5 роки тому
батько
коміт
26bc2c9c6d

+ 23 - 16
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantServiceImpl.java

@@ -1415,7 +1415,9 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 		Response response=new Response();
 		
 		if(StringUtils.isNotEmpty(merchant.getId())){
-			
+				
+				boolean isSignType=false;
+				boolean isServiceMonth=false;
 				Merchant oldmerchant =this.getById(merchant.getId());
 				
 				if(StringUtils.isNotEmpty(merchant.getLibId())) {
@@ -1426,6 +1428,13 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 					}
 				}
 				
+				
+				if(!oldmerchant.getSignType().equals(merchant.getSignType())) {
+					isSignType=true;
+				}
+				if(!oldmerchant.getLibServiceMonth().equals(merchant.getLibServiceMonth())) {
+					isServiceMonth=true;
+				}
 				oldmerchant.setDeputyName(merchant.getDeputyName());
 				oldmerchant.setDeputyPhone(merchant.getDeputyPhone());
 				oldmerchant.setLegalPerson(merchant.getLegalPerson());
@@ -1508,21 +1517,6 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 						consume.setCreateTime(new Date());
 						libJoinConsumeService.save(consume);
 					}
-					
-					
-					//旧套餐大于新套餐的话,就服务降级
-					if(oldmerchant.getSignType()>merchant.getSignType()
-							&& StringUtils.isNotEmpty(oldmerchant.getLibId()) 
-							&& merchant.getCurSummaryTime()!=null) {
-						
-						//调用openApi接口
-						DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
-						libVipServiceService.openApiServiceCRM(
-								3,
-								oldmerchant.getLibId(), 
-								oldmerchant.getLibService(),
-								format.format(DateHelper.getMonthDate(merchant.getCurSummaryTime(),merchant.getLibServiceMonth())));
-					}
 					//更新套餐
 					oldmerchant.setSignType(merchant.getSignType());
 				}
@@ -1544,6 +1538,19 @@ public class MerchantServiceImpl extends BaseServiceImpl<Merchant, String> imple
 					}	
 				}
 				
+				
+				//旧套餐大于新套餐的话,就服务降级
+				if(isSignType || isServiceMonth) {
+					//调用openApi接口
+					DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
+					libVipServiceService.openApiServiceCRM(
+							3,
+							oldmerchant.getLibId(), 
+							oldmerchant.getLibService(),
+							format.format(DateHelper.getMonthDate(oldmerchant.getCurSummaryTime(),oldmerchant.getLibServiceMonth())));
+				}
+				
+				
 				this.syncRecordByMerchant(curadmin.getLoginName(), oldmerchant.getId(),"", "修改套餐商户");
 				
 		}else{

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

@@ -1712,7 +1712,7 @@ public class LibVipServiceServiceImpl extends BaseServiceImpl<LibVipService, Str
 		String accessKey="Zhidian@34889_";
 		
 		String accessToken=createOpenToken(appid, accessKey);
-		String url=host+"/api/parents/share/dealServiceCRM?appid="+appid+"&accessToken="+accessToken;
+		String url="https://master.sharingschool.com/open/api/parents/share/dealServiceCRM?appid="+appid+"&accessToken="+accessToken;
 		
 		JSONObject json=new JSONObject();
 		json.put("type", type);