Просмотр исходного кода

Merge branch 'master' of http://git.dayaedu.com/yonge/mec

zouxuan 5 лет назад
Родитель
Сommit
bbc2ef4e4e

+ 4 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -439,6 +439,8 @@ public class ContractServiceImpl implements ContractService {
 		params.put("paymentcalender", "一次性");
 		params.put("paymentcalender", "一次性");
 		
 		
 		params.put("isShowVisualSeal", false);
 		params.put("isShowVisualSeal", false);
+		
+		params.put("ownershipType", "OWN");
 
 
 		templateEngine.render(params, "courses.ftl", srcFile);
 		templateEngine.render(params, "courses.ftl", srcFile);
 
 
@@ -505,6 +507,8 @@ public class ContractServiceImpl implements ContractService {
 		params.put("paymentcalender", "一次性");
 		params.put("paymentcalender", "一次性");
 		
 		
 		params.put("isShowVisualSeal", true);
 		params.put("isShowVisualSeal", true);
+		
+		params.put("ownershipType", "OWN");
 
 
 		templateEngine.render(params, "courses.ftl", srcFile);
 		templateEngine.render(params, "courses.ftl", srcFile);
 
 

+ 9 - 0
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupServiceImpl.java

@@ -83,6 +83,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 
 
     @Autowired
     @Autowired
     private CourseScheduleDao courseScheduleDao;
     private CourseScheduleDao courseScheduleDao;
+    
+    @Autowired
+    private CourseScheduleService courseScheduleService;
 
 
     @Autowired
     @Autowired
     private ClassGroupDao classGroupDao;
     private ClassGroupDao classGroupDao;
@@ -603,6 +606,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 			if (studentRegistration == null) {
 			if (studentRegistration == null) {
 				throw new BizException("用户注册信息不存在");
 				throw new BizException("用户注册信息不存在");
 			}
 			}
+			// 删除未上课
+			courseScheduleService.batchDeleteMusicGroupCourseWithStudent(musicGroupId, userId, GroupType.MUSIC);
+			
 			// 退团
 			// 退团
 			studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
 			studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
 			studentRegistration.setUpdateTime(date);
 			studentRegistration.setUpdateTime(date);
@@ -683,6 +689,9 @@ public class MusicGroupServiceImpl extends BaseServiceImpl<String, MusicGroup> i
 		if (studentRegistration == null) {
 		if (studentRegistration == null) {
 			throw new BizException("用户注册信息不存在");
 			throw new BizException("用户注册信息不存在");
 		}
 		}
+		// 删除未上课
+		courseScheduleService.batchDeleteMusicGroupCourseWithStudent(musicGroupId, userId, GroupType.MUSIC);
+		
 		// 退团
 		// 退团
 		studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
 		studentRegistration.setMusicGroupStatus(ClassGroupStudentStatusEnum.QUIT);
 		studentRegistration.setUpdateTime(date);
 		studentRegistration.setUpdateTime(date);

+ 1 - 1
mec-biz/src/main/resources/config/mybatis/VipGroupActivityMapper.xml

@@ -117,7 +117,7 @@
 	<sql id="queryCondition">
 	<sql id="queryCondition">
 		<where>
 		<where>
 			vga.del_flag_=0
 			vga.del_flag_=0
-			AND dbo.INTE_ARRAY(organ_id_,#{organId})
+			AND INTE_ARRAY(organ_id_,#{organId})
 		</where>
 		</where>
 	</sql>
 	</sql>
 
 

+ 35 - 0
mec-biz/src/main/resources/sql/function.sql

@@ -0,0 +1,35 @@
+delimiter //
+-- 集合交集检查函数
+-- @param varchar(255) setA A 集合 如 "1,3,5,9"
+-- @param varchar(255) setB B 集合 如 "8,2,3,7"
+-- @return int(1) B 集合内单元在 A集合 内存在则返回 1 否则返回 0
+CREATE FUNCTION `INTE_ARRAY` (setA varchar(255),setB varchar(255)) RETURNS int(1)
+BEGIN
+    DECLARE idx INT DEFAULT 0 ; -- B 集合单元索引 
+    DECLARE len INT DEFAULT 0;-- B 集合表达式长度
+    DECLARE llen INT DEFAULT 0;-- 最后检查位置
+    DECLARE clen INT DEFAULT 0;-- 当前检查位置
+    DECLARE tmpStr varchar(255);-- 临时检查数据集
+    DECLARE curt varchar(255);-- B 当前检查的单元
+    SET len = LENGTH(setB);
+    WHILE idx < len DO
+        SET idx = idx + 1;
+        SET tmpStr = SUBSTRING_INDEX(setB,",",idx);
+        SET clen = LENGTH(tmpStr);
+-- 获取当前 setB 中的单元
+        IF idx = 1 THEN SET curt = tmpStr;
+        ELSE SET curt = SUBSTRING(setB,llen+2,clen-llen-1);
+        END IF;
+-- 检查是否存在于 setA 中
+        IF FIND_IN_SET(curt,setA) > 0 THEN RETURN 1;
+        END IF;
+-- 当前检查终点与上次检查终点相同则跳出
+        IF clen <= llen THEN RETURN 0;
+        END IF;
+ 
+        SET llen = clen;
+    END WHILE;
+    RETURN 0;
+END;
+//
+delimiter ;

+ 13 - 0
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupActivityController.java

@@ -2,7 +2,9 @@ package com.ym.mec.web.controller;
 
 
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.client.SysUserFeignService;
 import com.ym.mec.auth.api.entity.SysUser;
 import com.ym.mec.auth.api.entity.SysUser;
+import com.ym.mec.biz.dal.dao.EmployeeDao;
 import com.ym.mec.biz.dal.dto.VipGroupActivityAddDto;
 import com.ym.mec.biz.dal.dto.VipGroupActivityAddDto;
+import com.ym.mec.biz.dal.entity.Employee;
 import com.ym.mec.biz.dal.page.VipGroupActivityQueryInfo;
 import com.ym.mec.biz.dal.page.VipGroupActivityQueryInfo;
 import com.ym.mec.biz.service.VipGroupActivityService;
 import com.ym.mec.biz.service.VipGroupActivityService;
 import com.ym.mec.common.controller.BaseController;
 import com.ym.mec.common.controller.BaseController;
@@ -11,6 +13,7 @@ import com.ym.mec.common.exception.BizException;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiOperation;
 
 
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
@@ -31,6 +34,8 @@ public class VipGroupActivityController extends BaseController {
     private VipGroupActivityService vipGroupActivityService;
     private VipGroupActivityService vipGroupActivityService;
     @Autowired
     @Autowired
     private SysUserFeignService sysUserFeignService;
     private SysUserFeignService sysUserFeignService;
+	@Autowired
+	private EmployeeDao employeeDao;
 
 
     @ApiOperation(value = "新增vip课活动方案")
     @ApiOperation(value = "新增vip课活动方案")
     @PostMapping("/addVipGroupActivity")
     @PostMapping("/addVipGroupActivity")
@@ -51,6 +56,14 @@ public class VipGroupActivityController extends BaseController {
         if(sysUser.getOrganId() != null){
         if(sysUser.getOrganId() != null){
             queryInfo.setOrganId(sysUser.getOrganId());
             queryInfo.setOrganId(sysUser.getOrganId());
         }
         }
+		if (!sysUser.getIsSuperAdmin()) {
+			if (StringUtils.isEmpty(sysUser.getOrganId())) {
+				Employee employee = employeeDao.get(sysUser.getId());
+				queryInfo.setOrganId(employee.getOrganIdList());
+			}
+		} else {
+			queryInfo.setOrganId(null);
+		}
         return succeed(vipGroupActivityService.queryPage(queryInfo));
         return succeed(vipGroupActivityService.queryPage(queryInfo));
     }
     }
 
 

+ 5 - 3
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupCategoryController.java

@@ -46,11 +46,13 @@ public class VipGroupCategoryController extends BaseController {
 		if (sysUser == null) {
 		if (sysUser == null) {
 			return failed("用户信息获取失败");
 			return failed("用户信息获取失败");
 		}
 		}
-		if(!sysUser.getIsSuperAdmin()){
-			if(StringUtils.isEmpty(organId)){
+		if (!sysUser.getIsSuperAdmin()) {
+			if (StringUtils.isEmpty(organId)) {
 				Employee employee = employeeDao.get(sysUser.getId());
 				Employee employee = employeeDao.get(sysUser.getId());
-				organId=employee.getOrganIdList();
+				organId = employee.getOrganIdList();
 			}
 			}
+		} else {
+			organId = null;
 		}
 		}
 		return succeed(vipGroupCategoryService.findAllByOrgan(organId));
 		return succeed(vipGroupCategoryService.findAllByOrgan(organId));
 	}
 	}

+ 2 - 0
mec-web/src/main/java/com/ym/mec/web/controller/VipGroupManageController.java

@@ -88,6 +88,8 @@ public class VipGroupManageController extends BaseController {
                 Employee employee = employeeDao.get(sysUser.getId());
                 Employee employee = employeeDao.get(sysUser.getId());
                 queryInfo.setOrganId(employee.getOrganIdList());
                 queryInfo.setOrganId(employee.getOrganIdList());
             }
             }
+        } else{
+        	queryInfo.setOrganId(null);
         }
         }
         return succeed(vipGroupService.findVipGroups(queryInfo));
         return succeed(vipGroupService.findVipGroups(queryInfo));
     }
     }