Browse Source

商户相关

wuwen 5 năm trước cách đây
mục cha
commit
9c86eed1aa

+ 33 - 33
.classpath

@@ -1,33 +1,33 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="src" output="target/classes" path="src/main/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
-		<attributes>
-			<attribute name="optional" value="true"/>
-			<attribute name="maven.pomderived" value="true"/>
-			<attribute name="test" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
-		<attributes>
-			<attribute name="maven.pomderived" value="true"/>
-		</attributes>
-	</classpathentry>
-	<classpathentry kind="output" path="target/classes"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="src" output="target/classes" path="src/main/java">
+		<attributes>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="src" output="target/test-classes" path="src/test/java">
+		<attributes>
+			<attribute name="test" value="true"/>
+			<attribute name="optional" value="true"/>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry exported="true" kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+			<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry exported="true" kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JDK8">
+		<attributes>
+			<attribute name="maven.pomderived" value="true"/>
+		</attributes>
+	</classpathentry>
+	<classpathentry kind="output" path="target/classes"/>
+</classpath>

+ 18 - 0
.settings/org.eclipse.core.resources.prefs

@@ -1,4 +1,22 @@
 eclipse.preferences.version=1
 encoding//src/main/java=UTF-8
 encoding//src/main/resources=utf-8
+encoding//src/main/resources/templates/sys/analysis/week.html=UTF-8
+encoding//src/main/resources/templates/sys/award/material/edit.html=UTF-8
+encoding//src/main/resources/templates/sys/award/material/list.html=UTF-8
+encoding//src/main/resources/templates/sys/award/material/number.html=UTF-8
+encoding//src/main/resources/templates/sys/award/sncode/ems.html=UTF-8
+encoding//src/main/resources/templates/sys/award/sncode/list.html=UTF-8
+encoding//src/main/resources/templates/sys/finance/allList4.html=UTF-8
+encoding//src/main/resources/templates/sys/finance/allList6.html=UTF-8
+encoding//src/main/resources/templates/sys/fx/consumeList.html=UTF-8
+encoding//src/main/resources/templates/sys/fx/merchantAdd.html=UTF-8
+encoding//src/main/resources/templates/sys/fx/merchantAllList.html=UTF-8
+encoding//src/main/resources/templates/sys/fx/merchantAllMain.html=UTF-8
+encoding//src/main/resources/templates/sys/fx/merchantAllot.html=UTF-8
+encoding//src/main/resources/templates/sys/fx/merchantInfo.html=UTF-8
+encoding//src/main/resources/templates/sys/train/file_list.html=UTF-8
+encoding//src/main/resources/templates/sys/train/pace_list_info.html=UTF-8
+encoding//src/main/resources/templates/sys/train/user_edit.html=UTF-8
+encoding//src/main/resources/templates/sys/train/user_list.html=UTF-8
 encoding/<project>=UTF-8

+ 11 - 10
.settings/org.eclipse.wst.common.component

@@ -1,10 +1,11 @@
-<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
-    <wb-module deploy-name="ssj-sys">
-        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
-        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
-        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
-        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
-        <property name="context-root" value="ssj-sys"/>
-        <property name="java-output-path" value="/v_sys/target/classes"/>
-    </wb-module>
-</project-modules>
+<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
+    <wb-module deploy-name="ssj-sys">
+        <wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
+        <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
+        <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/test/java"/>
+        <property name="context-root" value="ssj-sys"/>
+        <property name="java-output-path" value="/v_sys/target/classes"/>
+    </wb-module>
+</project-modules>

+ 1 - 0
src/main/java/com/ssj/api/controller/ApiMerchantController.java

@@ -88,6 +88,7 @@ public class ApiMerchantController extends BaseController {
 	        	DateFormat format = new SimpleDateFormat("yyyy-MM-dd");
         		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("signType", merchant.getSignType());

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

@@ -470,7 +470,7 @@ public class FinanceQueryDaoImpl implements FinanceQueryDao {
          selSql.append(" IFNULL((SELECT SUM(c.lib_service) from tb_lib_join_consume c WHERE c.from_merchant_id=t.id AND c.type=10 AND DATE_FORMAT(c.create_time,'%Y-%m')=? ),0) as sum_3, ");
          selSql.append(" IFNULL((SELECT SUM(c.lib_service) from tb_lib_join_consume c WHERE c.from_merchant_id=t.id AND c.type=11 AND DATE_FORMAT(c.create_time,'%Y-%m')=? ),0) as sum_4, ");
          selSql.append(" (SELECT COUNT(*) from tb_lib_join_consume c WHERE c.from_merchant_id=t.id AND c.type=7 AND DATE_FORMAT(c.create_time,'%Y-%m')=? ) as count_1, ");
-         selSql.append(" (SELECT SUM(c.compute_num) from tb_lib_join_consume c WHERE c.from_merchant_id=t.id AND c.type=10 AND DATE_FORMAT(c.create_time,'%Y-%m')=? ) as count_2, ");
+         selSql.append(" IFNULL((SELECT SUM(c.compute_num) from tb_lib_join_consume c WHERE c.from_merchant_id=t.id AND c.type=10 AND DATE_FORMAT(c.create_time,'%Y-%m')=? ),0) as count_2, ");
          selSql.append(" ? as balance_month ");
          queryParams.add(params.get("startMonth"));
          queryParams.add(params.get("startMonth"));

+ 50 - 29
src/main/java/com/ssj/service/sys/fx/service/impl/MerchantSignServiceImpl.java

@@ -89,6 +89,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 					merchantSign.setStatus(1);
 					merchantSign.setUpdateTime(new Date());
 					this.save(merchantSign);
+					
 					Merchant merchant = merchantService.getById(merchantSign.getMerchantId());
 					merchant.setLibService(merchant.getLibService()-merchantSign.getLibService());
 					merchantService.save(merchant);
@@ -96,13 +97,6 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 					//同步商户表与机构表
 					this.syncMerchantByLibJoin(merchant);
 					
-					//如果加油包过期后,现有的学生大于商户的套餐人数, 就全部学生停止服务。
-					if(StringUtils.isNotEmpty(merchant.getLibId())) {
-						List<LibVip> libVips=libVipService.findByLibId(merchant.getLibId());
-						if(libVips.size()>merchant.getLibService()) {
-							//这里需要调用灿哥的代码。
-						}
-					}
 					//记录加油包记录
 					TbLibJoinConsume consume=new TbLibJoinConsume();
 					consume.setFromLibId(merchant.getLibId());
@@ -149,6 +143,16 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 					consume.setRemarks("加油包激活【加油包激活】");
 					consume.setCreateTime(new Date());
 					libJoinConsumeService.save(consume);
+					
+					
+					//调用openApi接口
+					libVipServiceService.openApiServiceCRM(
+							1,
+							merchant.getLibId(), 
+							merchant.getSignType(),
+							merchant.getLibService(),
+							null);
+					
 				} catch (Exception e) {
 					e.printStackTrace();
 					logger.error("1:处理加油包激活数据,异常:"+e.getMessage());
@@ -170,7 +174,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 					TbLibJoinConsume consume=new TbLibJoinConsume();
 					consume.setFromLibId(merchant.getLibId());
 					consume.setFromMerchantId(merchant.getId());
-					consume.setLibService(0);
+					consume.setLibService(merchant.getLibService());
 					consume.setPlatformService(0);
 					consume.setType(7);
 					consume.setComputeNum(merchant.getCurIsSummary());
@@ -194,24 +198,41 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 				//只有在激活期的商户才处理数据。
 				if(merchant.getCurIsSummary()==null || merchant.getCurIsSummary()==0) {
 					try {
-						merchant.setCurIsSummary(0);
-						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(0);
-						consume.setPlatformService(0);
-						consume.setType(8);
-						consume.setComputeNum(merchant.getCurIsSummary());
-						consume.setSignType(merchant.getSignType());
-						consume.setRemarks("激活期失效【服务包失效】");
-						consume.setCreateTime(new Date());
-						libJoinConsumeService.save(consume);
-						
+						//如果当前日期还是小于开始计费日期,再生一条激活的记录
+						if(merchant.getComputeTime().getTime()>new Date().getTime()) {
+							
+							merchant.setCurIsSummary(0);
+							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(8);
+							consume.setComputeNum(merchant.getCurIsSummary());
+							consume.setSignType(merchant.getSignType());
+							consume.setRemarks("激活期失效【服务包失效】");
+							consume.setCreateTime(new Date());
+							libJoinConsumeService.save(consume);
+							
+							
+							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());
@@ -230,7 +251,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 					TbLibJoinConsume consume=new TbLibJoinConsume();
 					consume.setFromLibId(merchant.getLibId());
 					consume.setFromMerchantId(merchant.getId());
-					consume.setLibService(0);
+					consume.setLibService(merchant.getLibService());
 					consume.setPlatformService(0);
 					consume.setType(8);
 					consume.setComputeNum(merchant.getCurIsSummary());
@@ -284,7 +305,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 					TbLibJoinConsume consume=new TbLibJoinConsume();
 					consume.setFromLibId(merchant.getLibId());
 					consume.setFromMerchantId(merchant.getId());
-					consume.setLibService(0);
+					consume.setLibService(merchant.getLibService());
 					consume.setSignType(merchant.getSignType());
 					consume.setPlatformService(0);
 					consume.setType(8);
@@ -330,7 +351,7 @@ public class MerchantSignServiceImpl extends BaseServiceImpl<MerchantSign, Strin
 						consume=new TbLibJoinConsume();
 						consume.setFromLibId(merchant.getLibId());
 						consume.setFromMerchantId(merchant.getId());
-						consume.setLibService(0);
+						consume.setLibService(merchant.getLibService());
 						consume.setPlatformService(0);
 						consume.setType(7);
 						consume.setComputeNum(merchant.getCurIsSummary());

+ 2 - 2
src/main/java/com/ssj/sys/interceptor/LoginInterceptor.java

@@ -183,9 +183,9 @@ public class LoginInterceptor extends HandlerInterceptorAdapter{
     }
 
     public static void initModelAndView(HttpServletRequest request, ModelAndView modelAndView) throws Exception {
-       // modelAndView.addObject("sysUrl", "https://sys.sharingschool.com");
+        //modelAndView.addObject("sysUrl", "https://sys.sharingschool.com");
         modelAndView.addObject("sysUrl", PropertiesUtil.getValue("sys_url")+"/ssj");
-       // modelAndView.addObject("sysUrl", "http://127.0.0.1:8080");
+        modelAndView.addObject("sysUrl", "http://127.0.0.1:8080");
         modelAndView.addObject("imgUrl", PropertiesUtil.getValue("STATIC_FILE_URL"));
 
     }

+ 1 - 1
src/main/resources/application-common-dev.properties

@@ -50,7 +50,7 @@ spring.redis.cluster.pool.min-idle=0
 
 spring.jmx.enabled=false
 
-spring.rabbitmq.host=172.18.121.4
+spring.rabbitmq.host=127.0.0.1
 spring.rabbitmq.port=5672
 spring.rabbitmq.username=admin1
 spring.rabbitmq.password=admin1