فهرست منبع

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

zouxuan 5 سال پیش
والد
کامیت
10f8d4a633

+ 11 - 0
mec-biz/src/main/java/com/ym/mec/biz/dal/dto/StudentApplyDetailDto.java

@@ -8,6 +8,9 @@ import com.ym.mec.common.page.QueryInfo;
 
 public class StudentApplyDetailDto{
 
+    @ApiModelProperty(value = "学生报名编号",required = false)
+    private Long id;
+
     @ApiModelProperty(value = "学生姓名",required = false)
     private String studentName;
 
@@ -131,4 +134,12 @@ public class StudentApplyDetailDto{
     public void setPaymentStatus(String paymentStatus) {
         this.paymentStatus = paymentStatus;
     }
+
+    public Long getId() {
+        return id;
+    }
+
+    public void setId(Long id) {
+        this.id = id;
+    }
 }

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/dal/enums/SalarySettlementTypeEnum.java

@@ -11,7 +11,8 @@ public enum SalarySettlementTypeEnum implements BaseEnum<String,SalarySettlement
     TEACHER_DEFAULT("TEACHER_DEFAULT","老师默认课酬"),
     RATIO_DISCOUNT("RATIO_DISCOUNT","课程单价比例折扣"),
     FIXED_SALARY("FIXED_SALARY","固定课酬"),
-    GRADIENT_SALARY("GRADIENT_SALARY","梯度课酬");
+    GRADIENT_SALARY("GRADIENT_SALARY","梯度课酬"),
+    CLASSROOM_SALARY("CLASSROOM_SALARY","课堂课酬");
 
     private String code;
 

+ 4 - 4
mec-biz/src/main/java/com/ym/mec/biz/service/ContractService.java

@@ -64,17 +64,17 @@ public interface ContractService {
 	 * 传递商品协议
 	 * @param userId
 	 * @param musicGroupId
-	 * @param musicGroupSubjectGoodsGroupIds
+	 * @param goodsIds
 	 * @return
 	 */
-	boolean transferGoodsContract(Integer userId, String musicGroupId, String musicGroupSubjectGoodsGroupIds);
+	boolean transferGoodsContract(Integer userId, String musicGroupId, String goodsIds);
 
 	/**
 	 * 查询商品协议
 	 * @param userId
 	 * @param musicGroupId
-	 * @param musicGroupSubjectGoodsGroupIds
+	 * @param goodsIds
 	 * @return
 	 */
-	String queryGoodsContract(Integer userId, String musicGroupId, String musicGroupSubjectGoodsGroupIds);
+	String queryGoodsContract(Integer userId, String musicGroupId, String goodsIds);
 }

+ 19 - 8
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupServiceImpl.java

@@ -186,14 +186,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             classGroupIdList.add(classGroup.getId());
         }
 
-        List<ImGroupMember> imGroupMemberList = new ArrayList<>();
-        List<ClassGroupStudentMapper> classGroupStudentMappers = classGroupStudentMapperDao.findByClassGroups(classGroupIdList);
-
-        for (ClassGroupStudentMapper classGroupStudentMapper : classGroupStudentMappers) {
-            if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) continue;
-            imGroupMemberList.add(new ImGroupMember(classGroupStudentMapper.getUserId().toString()));
-        }
-
         //1、插入班级
         ClassGroup classGroup = new ClassGroup();
         classGroup.setMusicGroupId(musicGroupId);
@@ -206,6 +198,25 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
         classGroup.setUpdateTime(date);
         insert(classGroup);
 
+        List<ImGroupMember> imGroupMemberList = new ArrayList<>();
+        List<ClassGroupStudentMapper> mixClassGroupStudentMappers = new ArrayList<>();
+        List<ClassGroupStudentMapper> classGroupStudentMappers = classGroupStudentMapperDao.findByClassGroups(classGroupIdList);
+
+        for (ClassGroupStudentMapper classGroupStudentMapper : classGroupStudentMappers) {
+            ClassGroupStudentMapper mixClassGroupStudentMapper = new ClassGroupStudentMapper();
+            if (classGroupStudentMapper.getStatus().equals(ClassGroupStudentStatusEnum.QUIT)) continue;
+            mixClassGroupStudentMapper.setMusicGroupId(musicGroupId);
+            mixClassGroupStudentMapper.setClassGroupId(classGroup.getId());
+            mixClassGroupStudentMapper.setUserId(classGroupStudentMapper.getUserId());
+            mixClassGroupStudentMapper.setCreateTime(date);
+            mixClassGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
+            mixClassGroupStudentMappers.add(mixClassGroupStudentMapper);
+
+            imGroupMemberList.add(new ImGroupMember(classGroupStudentMapper.getUserId().toString()));
+        }
+        //插入学生关联关系
+        classGroupStudentMapperDao.classGroupStudentsInsert(mixClassGroupStudentMappers);
+
         //2、插入班级关联关系
         List<ClassGroupRelation> classGroupRelationList = new ArrayList<>();
         for (ClassGroup cGroup : classGroups) {

+ 2 - 1
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ClassGroupStudentMapperServiceImpl.java

@@ -143,7 +143,8 @@ public class ClassGroupStudentMapperServiceImpl extends BaseServiceImpl<Long, Cl
             classGroupStudentMapper.setStatus(ClassGroupStudentStatusEnum.NORMAL);
             classGroupStudentMappers.add(classGroupStudentMapper);
             if (classGroup.getType().equals(ClassGroupTypeEnum.NORMAL)) {
-                StudentRegistration studentRegistration = studentRegistrationService.get(Long.parseLong(userIdStr));
+                StudentRegistration studentRegistration = studentRegistrationService.queryByUserIdAndMusicGroupId(Integer.parseInt(userIdStr),classGroup.getMusicGroupId());
+                studentRegistration.setClassGroupId(classGroupId);
                 studentRegistrationService.update(studentRegistration);
             }
         }

+ 16 - 25
mec-biz/src/main/java/com/ym/mec/biz/service/impl/ContractServiceImpl.java

@@ -22,7 +22,6 @@ import com.ym.mec.biz.dal.dao.MusicGroupPaymentCalenderDao;
 import com.ym.mec.biz.dal.dto.StudentInfo;
 import com.ym.mec.biz.dal.entity.Goods;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
-import com.ym.mec.biz.dal.entity.MusicGroupSubjectGoodsGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupSubjectPlan;
 import com.ym.mec.biz.dal.entity.StudentRegistration;
 import com.ym.mec.biz.dal.entity.Subject;
@@ -70,7 +69,7 @@ public class ContractServiceImpl implements ContractService {
 
 	@Autowired
 	private MusicGroupPaymentCalenderDao musicGroupPaymentCalenderDao;
-	
+
 	@Autowired
 	private MusicGroupSubjectGoodsGroupService musicGroupSubjectGoodsGroupService;
 
@@ -85,7 +84,7 @@ public class ContractServiceImpl implements ContractService {
 
 	@Autowired
 	private StoragePlugin storagePlugin;
-	
+
 	@Autowired
 	private GoodsService goodsService;
 
@@ -130,10 +129,10 @@ public class ContractServiceImpl implements ContractService {
 
 		if (sysUserTsign == null) {
 			SysUser user = sysUserFeignService.queryUserById(userId);
-			if(user == null){
+			if (user == null) {
 				throw new BizException("用户信息查询失败");
 			}
-			sysUserTsign = register(userId,user.getRealName(),user.getIdCardNo(),user.getPhone());
+			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 
 		// 合成freemarker
@@ -218,10 +217,10 @@ public class ContractServiceImpl implements ContractService {
 
 		if (sysUserTsign == null) {
 			SysUser user = sysUserFeignService.queryUserById(userId);
-			if(user == null){
+			if (user == null) {
 				throw new BizException("用户信息查询失败");
 			}
-			sysUserTsign = register(userId,user.getRealName(),user.getIdCardNo(),user.getPhone());
+			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 
 		// 合成freemarker
@@ -361,10 +360,10 @@ public class ContractServiceImpl implements ContractService {
 
 		if (sysUserTsign == null) {
 			SysUser user = sysUserFeignService.queryUserById(userId);
-			if(user == null){
+			if (user == null) {
 				throw new BizException("用户信息查询失败");
 			}
-			sysUserTsign = register(userId,user.getRealName(),user.getIdCardNo(),user.getPhone());
+			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 
 		// 合成freemarker
@@ -477,15 +476,15 @@ public class ContractServiceImpl implements ContractService {
 	}
 
 	@Override
-	public boolean transferGoodsContract(Integer userId, String musicGroupId, String musicGroupSubjectGoodsGroupIds) {
+	public boolean transferGoodsContract(Integer userId, String musicGroupId, String goodsIds) {
 		SysUserTsign sysUserTsign = sysUserTsignService.get(userId);
 
 		if (sysUserTsign == null) {
 			SysUser user = sysUserFeignService.queryUserById(userId);
-			if(user == null){
+			if (user == null) {
 				throw new BizException("用户信息查询失败");
 			}
-			sysUserTsign = register(userId,user.getRealName(),user.getIdCardNo(),user.getPhone());
+			sysUserTsign = register(userId, user.getRealName(), user.getIdCardNo(), user.getPhone());
 		}
 
 		// 合成freemarker
@@ -512,12 +511,8 @@ public class ContractServiceImpl implements ContractService {
 		studentInfo.setSubject(subject);
 
 		params.put("studentInfo", studentInfo);
-		
-		List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroupList = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(musicGroupSubjectGoodsGroupIds);
-		
-		String goodIdList = musicGroupSubjectGoodsGroupList.stream().map(t -> t.getGoodsIdList()).collect(Collectors.joining(","));
-		
-		List<Goods> goodsList = goodsService.findGoodsByIds(goodIdList);
+
+		List<Goods> goodsList = goodsService.findGoodsByIds(goodsIds);
 		params.put("goodsList", goodsList);
 
 		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId, subjectId);
@@ -558,7 +553,7 @@ public class ContractServiceImpl implements ContractService {
 	}
 
 	@Override
-	public String queryGoodsContract(Integer userId, String musicGroupId, String musicGroupSubjectGoodsGroupIds) {
+	public String queryGoodsContract(Integer userId, String musicGroupId, String goodsIds) {
 
 		// 合成freemarker
 		String srcPdfPath = contractBaseDir + "/goods/" + userId + ".pdf";
@@ -584,12 +579,8 @@ public class ContractServiceImpl implements ContractService {
 		studentInfo.setSubject(subject);
 
 		params.put("studentInfo", studentInfo);
-		
-		List<MusicGroupSubjectGoodsGroup> musicGroupSubjectGoodsGroupList = musicGroupSubjectGoodsGroupService.findGoodsGroupByIds(musicGroupSubjectGoodsGroupIds);
-		
-		String goodIdList = musicGroupSubjectGoodsGroupList.stream().map(t -> t.getGoodsIdList()).collect(Collectors.joining(","));
-		
-		List<Goods> goodsList = goodsService.findGoodsByIds(goodIdList);
+
+		List<Goods> goodsList = goodsService.findGoodsByIds(goodsIds);
 		params.put("goodsList", goodsList);
 
 		MusicGroupSubjectPlan musicGroupSubjectPlan = musicGroupSubjectPlanService.getMusicOneSubjectClassPlan(musicGroupId, subjectId);

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

@@ -604,10 +604,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 					}
 
 					if(Objects.isNull(teacherOnlineSalary)){
-						teacherOnlineSalary=teacherDefaultVipGroupSalary.getOnlineClassesSalary();
-						if(Objects.isNull(teacherOnlineSalary)){
+						if(Objects.isNull(teacherDefaultVipGroupSalary)){
 							throw new BizException("请设置教师课酬");
 						}
+						teacherOnlineSalary=teacherDefaultVipGroupSalary.getOnlineClassesSalary();
 						teacherOnlineSalary=teacherOnlineSalary.multiply(classTimeDuty);
 					}
 					results.put("onlineTeacherSalary",teacherOnlineSalary);
@@ -631,10 +631,10 @@ public class VipGroupServiceImpl extends BaseServiceImpl<Long, VipGroup> impleme
 						teacherOfflineSalary=((VipGroupApplyBaseInfoDto) vipGroup).getOfflineTeacherSalary();
 					}
 					if(Objects.isNull(teacherOfflineSalary)){
-						teacherOfflineSalary=teacherDefaultVipGroupSalary.getOfflineClassesSalary();
-						if(Objects.isNull(teacherOfflineSalary)){
+						if(Objects.isNull(teacherDefaultVipGroupSalary)){
 							throw new BizException("请设置教师课酬");
 						}
+						teacherOfflineSalary=teacherDefaultVipGroupSalary.getOfflineClassesSalary();
 						teacherOfflineSalary=teacherOfflineSalary.multiply(classTimeDuty);
 					}
 					results.put("offlineTeacherSalary",teacherOfflineSalary);

+ 11 - 16
mec-biz/src/main/resources/config/mybatis/StudentRegistrationMapper.xml

@@ -245,9 +245,10 @@
         <result column="payment_status_" property="paymentStatus"/>
         <result column="gender_" property="gender"/>
         <result column="user_id_" property="studentId"/>
+        <result column="id_" property="id"/>
     </resultMap>
     <select id="queryStudentDetailPage" resultMap="studentApplyDetail">
-        SELECT sr.user_id_,sr.name_ username_,sr.parents_name_,sr.current_class_,sr.current_grade_,
+        SELECT sr.id_, sr.user_id_,sr.name_ username_,sr.parents_name_,sr.current_class_,sr.current_grade_,
         su.gender_,sr.is_allow_adjust_, s.name_ subject_name_,ss.name_
         actual_subject_name_,sr.parents_phone_,sr.payment_status_
         FROM student_registration sr
@@ -321,7 +322,7 @@
         student_registration sr on u.id_ = sr.user_id_ where u.id_ = #{userId} order by sr.create_time_ desc limit 0,1
     </select>
 
-    <select id="queryByUserIdAndMusicGroupId" resultMap="StudentRegistration" parameterType="map">
+    <select id="queryByUserIdAndMusicGroupId" resultMap="StudentRegistration">
         select * from student_registration where music_group_id_ = #{musicGroupId} and user_id_ = #{userId}
     </select>
 
@@ -405,21 +406,13 @@
             #{item.remark},now(),now(),#{item.parentsName},#{item.parentsCompany},#{item.paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{item.subjectId},#{item.musicGroupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
         </foreach>
     </insert>
-    <insert id="insertBasic" parameterType="com.ym.mec.biz.dal.entity.StudentRegistration">
-        INSERT INTO student_registration
-        (parents_phone_,user_id_,name_,music_group_id_,current_grade_,current_class_,subject_id_,
-        create_time_,update_time_,parents_name_,payment_status_,actual_subject_id_,music_group_status_)
-        VALUES (#{parentsPhone},#{userId},#{name},#{musicGroupId},#{currentGrade},#{currentClass},#{subjectId},
-            now(),now(),#{parentsName},#{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},#{subjectId},
-            #{musicGroupStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler})
-    </insert>
 
     <!-- 查询乐团userIdList的学生 -->
     <select id="findStudentListByUserIdList" resultMap="StudentRegistration">
-        SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND FIND_IN_SET(user_id_,#{userIdList})
-    </select>
-    <select id="queryStudentByMusicGroupId" resultMap="StudentRegistration">
-
+        SELECT * FROM student_registration WHERE music_group_id_ = #{musicGroupId} AND user_id_ IN
+        <foreach collection="userIdList" item="userId" index="index" open="(" close=")" separator=",">
+            #{userId}
+        </foreach>
     </select>
     <select id="countApplyNum" resultType="java.util.Map">
         SELECT sr.actual_subject_id_ 'key',COUNT(DISTINCT sr.user_id_) 'value' FROM student_registration sr
@@ -429,7 +422,9 @@
 
     <!-- 批量开启缴费 -->
     <update id="batchOpenPay">
-        UPDATE student_registration SET payment_status_ = #{paymentStatus},update_time_ = now()
-        WHERE FIND_IN_SET(id_,#{ids}) AND payment_status_ = 0
+        UPDATE student_registration
+        SET payment_status_ = #{paymentStatus,typeHandler=com.ym.mec.common.dal.CustomEnumTypeHandler},
+        update_time_ = now()
+        WHERE FIND_IN_SET(id_,#{ids}) AND payment_status_ = '0'
     </update>
 </mapper>

+ 2 - 2
mec-student/src/main/java/com/ym/mec/student/controller/ContractsController.java

@@ -36,12 +36,12 @@ public class ContractsController extends BaseController {
 
 	@ApiOperation("查询商品协议")
 	@GetMapping(value = "queryGoodsContract")
-	public Object queryGoodsContract(String musicGroupId, String musicGroupSubjectGoodsGroupIds) {
+	public Object queryGoodsContract(String musicGroupId, String goodsIds) {
 		SysUser sysUser = sysUserFeignService.queryUserInfo();
 		if (sysUser == null) {
 			return failed("获取用户信息失败");
 		}
-		return succeed(contractService.queryGoodsContract(sysUser.getId(), musicGroupId, musicGroupSubjectGoodsGroupIds));
+		return succeed(contractService.queryGoodsContract(sysUser.getId(), musicGroupId, goodsIds));
 	}
 
 	@ApiOperation("查询乐团课程协议")

+ 21 - 0
mec-thirdparty/src/main/java/com/ym/mec/thirdparty/eseal/provider/TsignPlugin.java

@@ -5,6 +5,7 @@ import org.springframework.beans.factory.InitializingBean;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 
+import com.timevale.esign.sdk.tech.bean.AccountProfile;
 import com.timevale.esign.sdk.tech.bean.OrganizeBean;
 import com.timevale.esign.sdk.tech.bean.PersonBean;
 import com.timevale.esign.sdk.tech.bean.PosBean;
@@ -12,10 +13,12 @@ import com.timevale.esign.sdk.tech.bean.SignPDFFileBean;
 import com.timevale.esign.sdk.tech.bean.result.AddAccountResult;
 import com.timevale.esign.sdk.tech.bean.result.AddSealResult;
 import com.timevale.esign.sdk.tech.bean.result.FileDigestSignResult;
+import com.timevale.esign.sdk.tech.bean.result.GetAccountProfileResult;
 import com.timevale.esign.sdk.tech.bean.result.Result;
 import com.timevale.esign.sdk.tech.bean.seal.PersonTemplateType;
 import com.timevale.esign.sdk.tech.bean.seal.SealColor;
 import com.timevale.esign.sdk.tech.impl.constants.LegalAreaType;
+import com.timevale.esign.sdk.tech.impl.constants.LicenseQueryType;
 import com.timevale.esign.sdk.tech.impl.constants.OrganRegType;
 import com.timevale.esign.sdk.tech.impl.constants.SignType;
 import com.timevale.esign.sdk.tech.service.AccountService;
@@ -86,6 +89,8 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
 		AddAccountResult result = service.addAccount(personbean);
 		if (result.getErrCode() == 0) {
 			return result.getAccountId();
+		}else if(result.getErrCode() == 1500012){
+			return queryAccountIdByIdNo(idcard);
 		}
 		throw new ThirdpartyException("创建个人账户接口调用失败code=" + result.getErrCode() + "msg=" + result.getMsg());
 	}
@@ -225,4 +230,20 @@ public class TsignPlugin implements ESealPlugin, InitializingBean, DisposableBea
 		}
 		throw new ThirdpartyException("平台用户PDF摘要签署接口调用失败" + result.getErrCode() + "msg=" + result.getMsg());
 	}
+	
+	private String queryAccountIdByIdNo(String idcardNo){
+		
+		AccountService service = serviceClient.accountService();
+		
+		GetAccountProfileResult result = service.getAccountInfoByIdNo(idcardNo, LicenseQueryType.MAINLAND);
+		
+		if(result != null){
+			AccountProfile accountProfile = result.getAccountInfo();
+			if(accountProfile != null){
+				return accountProfile.getAccountUid();
+			}
+		}
+		
+		return null;
+	}
 }