Pārlūkot izejas kodu

通讯录数据同步

zouxuan 4 gadi atpakaļ
vecāks
revīzija
462aafb25d

+ 0 - 7
mec-biz/src/main/java/com/ym/mec/biz/dal/dao/ImUserFriendDao.java

@@ -30,12 +30,5 @@ public interface ImUserFriendDao extends BaseDAO<Long, ImUserFriend> {
 	 */
     void deleteByUserId(Integer teacherId);
 
-	/**
-	 * 批量新增
-	 * @param teachers
-	 * @param teacherId
-	 */
-	void batchInsert(@Param("teachers") Set<BasicUserDto> teachers, @Param("teacherId") Integer teacherId);
-
 	void insertByBasicUser(@Param("basicUserDto") BasicUserDto basicUserDto, @Param("teacherId") Integer teacherId);
 }

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

@@ -8,6 +8,7 @@ import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderAuditDto;
 import com.ym.mec.biz.dal.dto.MusicGroupPaymentCalenderDto;
 import com.ym.mec.biz.dal.entity.MusicGroup;
 import com.ym.mec.biz.dal.entity.MusicGroupPaymentCalender;
+import com.ym.mec.biz.dal.entity.MusicGroupStudentClassAdjust;
 import com.ym.mec.biz.dal.entity.MusicGroupStudentFee;
 import com.ym.mec.biz.dal.page.MusicGroupPaymentCalenderQueryInfo;
 import com.ym.mec.common.page.PageInfo;
@@ -116,7 +117,7 @@ public interface MusicGroupPaymentCalenderService extends BaseService<Long, Musi
 	 * @author zouxuan
 	 * @param batchNo
 	 */
-	public void autoClassGroupAdjust(String batchNo);
+	public void autoClassGroupAdjust(MusicGroupStudentClassAdjust musicGroupStudentClassAdjust);
 
 	/**
 	 * @describe 审核拒绝

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

@@ -2179,7 +2179,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
             Integer musicGroupStudentClassAdjustId = classGroup4MixDto.getMusicGroupStudentClassAdjustId();
             //学生结算表
             courseScheduleStudentPaymentService.createForMusicGroup(courseScheduleList, studentIdList, musicGroupStudentClassAdjustId);
-            imUserFriendService.refreshClassImUserFriend(classGroup.getId());
             return classGroup;
         }
         return null;
@@ -3341,9 +3340,6 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 settingsDetail.setCourseTotalNum(subNum.intValue());
                 settingsDetail.setCourseType(CourseScheduleType.valueOf(courseType));
                 settingsDetail.setUnitPrice(unitPrice);
-//                settingsDetail.setCourseTotalMinuties(Integer.parseInt(jsonObject.get(courseType).toString()) * subNum.intValue());
-//                settingsDetail.setCourseCurrentPrice(unitPrice.multiply(new BigDecimal(settingsDetail.getCourseTotalMinuties())));
-//                settingsDetail.setCourseOriginalPrice(settingsDetail.getCourseCurrentPrice());
                 courseMap.put(courseType, settingsDetail);
             }
             resultMap.put(classGroupId, courseMap);
@@ -3473,6 +3469,7 @@ public class ClassGroupServiceImpl extends BaseServiceImpl<Integer, ClassGroup>
                 //删除教师课酬
                 courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(delCourseIds);
             }
+            imUserFriendService.refreshGroupImUserFriend(musicGroup.getId(),MUSIC);
             return "学员班级调整完成";
         } else {
             //冻结班级

+ 21 - 12
mec-biz/src/main/java/com/ym/mec/biz/service/impl/MusicGroupPaymentCalenderServiceImpl.java

@@ -24,6 +24,7 @@ import java.util.Map.Entry;
 import java.util.Set;
 import java.util.stream.Collectors;
 
+import com.ym.mec.biz.dal.enums.GroupType;
 import com.ym.mec.biz.service.*;
 import org.apache.commons.beanutils.BeanUtils;
 import org.apache.commons.lang3.StringUtils;
@@ -150,6 +151,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	@Autowired
 	private ImGroupMemberService imGroupMemberService;
 	@Autowired
+	private ImUserFriendService imUserFriendService;
+	@Autowired
 	private ClassGroupStudentMapperDao classGroupStudentMapperDao;
 	@Autowired
 	private MusicGroupStudentClassAdjustDao musicGroupStudentClassAdjustDao;
@@ -479,6 +482,8 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			Organization organization = organizationDao.get(musicGroup.getOrganId());
 			sysMessageService.batchSeoMessage(musicGroupDao.queryUserIdByRoleId(roleIds, musicGroup.getOrganId()),
 					MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(), musicGroup.getName());
+		}else {
+			imUserFriendService.refreshGroupImUserFriend(musicGroupId, GroupType.MUSIC);
 		}
 		return batchNo;
 	}
@@ -800,8 +805,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 					MessageTypeEnum.BACKSTAGE_PAYMENT_CALENDER_AUDIT, "", organization.getName(), musicGroup.getName());
 		}else {
 			if(paymentType == ADD_STUDENT){
-				//如果是合班缴费
-				autoClassGroupAdjust(batchNo);
+				MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+				if(musicGroupStudentClassAdjust != null){
+					//如果是合班缴费
+					autoClassGroupAdjust(musicGroupStudentClassAdjust);
+				}else {
+					imUserFriendService.refreshGroupImUserFriend(musicGroupId,GroupType.MUSIC);
+				}
 			}else if(paymentType == SPAN_GROUP_CLASS_ADJUST){
 				//删除和解冻班级,课程信息
 				MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
@@ -985,9 +995,6 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 		calenderAuditDetailDto.setAuditDto(auditDto);
 		//获取收费标准
 		calenderAuditDetailDto.setMusicGroupPaymentCalenderCourseSettings(musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
-		//获取学员列表
-//		calenderAuditDetailDto.setBasicUserDtos(musicGroupPaymentCalenderDetailDao.querySimpleUserDto(batchNo,auditDto.getMusicGroupId()));
-//		calenderAuditDetailDto.setStudentNum(calenderAuditDetailDto.getSimpleUserDto().size());
 		//获取缴费周期
 		List<MusicGroupPaymentCalender> groupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(batchNo);
 		calenderAuditDetailDto.setMusicGroupPaymentCalenders(groupPaymentCalenders);
@@ -999,11 +1006,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 	//审核通过后自动排课
 	@Override
 	@Transactional(rollbackFor = Exception.class)
-	public void autoClassGroupAdjust(String batchNo){
-		MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
-		if(musicGroupStudentClassAdjust == null){
-			return;
-		}
+	public void autoClassGroupAdjust(MusicGroupStudentClassAdjust musicGroupStudentClassAdjust){
 		List<MusicGroupPaymentCalender> musicGroupPaymentCalenders = musicGroupPaymentCalenderDao.findByBatchNo(musicGroupStudentClassAdjust.getBatchNo());
 		for (MusicGroupPaymentCalender musicGroupPaymentCalender : musicGroupPaymentCalenders) {
 			if(musicGroupPaymentCalender.getStatus() == AUDITING || musicGroupPaymentCalender.getStatus() == REJECT){
@@ -1061,6 +1064,7 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 			//删除教师课酬
 			courseScheduleTeacherSalaryDao.batchDeleteByCourseScheduleIds(delCourseIds);
 		}
+		imUserFriendService.refreshGroupImUserFriend(musicGroupPaymentCalenders.get(0).getMusicGroupId(),GroupType.MUSIC);
 	}
 
 	@Override
@@ -1115,8 +1119,13 @@ public class MusicGroupPaymentCalenderServiceImpl extends BaseServiceImpl<Long,
 				classGroupService.addStudentToClassGroupAndCourseArranging(Integer.parseInt(calender.getStudentIds()), classGroupIdStr, batchNo,
 						musicGroupPaymentCalenderCourseSettingsDao.queryCalenderCourseSettingsByBatchNo(batchNo));
 			}
-			//如果是合班缴费
-			autoClassGroupAdjust(batchNo);
+			MusicGroupStudentClassAdjust musicGroupStudentClassAdjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);
+			if(musicGroupStudentClassAdjust != null){
+				//如果是合班缴费
+				autoClassGroupAdjust(musicGroupStudentClassAdjust);
+			}else {
+				imUserFriendService.refreshGroupImUserFriend(calender.getMusicGroupId(),GroupType.MUSIC);
+			}
 		}else if(calender.getPaymentType() == SPAN_GROUP_CLASS_ADJUST){
 			//删除和解冻班级,课程信息
 			MusicGroupStudentClassAdjust adjust = musicGroupStudentClassAdjustDao.findByBatchNo(batchNo);

+ 3 - 29
mec-biz/src/main/java/com/ym/mec/biz/service/impl/StudentRegistrationServiceImpl.java

@@ -20,6 +20,7 @@ import java.util.stream.Collectors;
 
 import javax.annotation.Resource;
 
+import com.ym.mec.biz.service.*;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -98,23 +99,6 @@ import com.ym.mec.biz.dal.enums.PaymentStatusEnum;
 import com.ym.mec.biz.dal.enums.PlatformCashAccountDetailTypeEnum;
 import com.ym.mec.biz.dal.enums.StudentMusicGroupStatusEnum;
 import com.ym.mec.biz.dal.page.StudentRegistrationQueryInfo;
-import com.ym.mec.biz.service.ClassGroupService;
-import com.ym.mec.biz.service.ClassGroupStudentMapperService;
-import com.ym.mec.biz.service.ContractService;
-import com.ym.mec.biz.service.CourseScheduleService;
-import com.ym.mec.biz.service.CourseScheduleStudentPaymentService;
-import com.ym.mec.biz.service.ImGroupMemberService;
-import com.ym.mec.biz.service.MusicGroupPaymentCalenderService;
-import com.ym.mec.biz.service.MusicGroupSubjectPlanService;
-import com.ym.mec.biz.service.SellOrderService;
-import com.ym.mec.biz.service.StudentPaymentOrderDetailService;
-import com.ym.mec.biz.service.StudentPaymentOrderService;
-import com.ym.mec.biz.service.StudentRegistrationService;
-import com.ym.mec.biz.service.SubjectService;
-import com.ym.mec.biz.service.SysConfigService;
-import com.ym.mec.biz.service.SysMessageService;
-import com.ym.mec.biz.service.SysUserCashAccountDetailService;
-import com.ym.mec.biz.service.SysUserCashAccountService;
 import com.ym.mec.common.dal.BaseDAO;
 import com.ym.mec.common.entity.ImResult;
 import com.ym.mec.common.entity.ImUserModel;
@@ -202,6 +186,8 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
     private StudentCourseFeeDetailDao studentCourseFeeDetailDao;
     @Autowired
     private CourseScheduleDao courseScheduleDao;
+    @Autowired
+    private ImUserFriendService imUserFriendService;
 
     @Override
     public BaseDAO<Long, StudentRegistration> getDAO() {
@@ -662,9 +648,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
         if (studentRegistration == null) {
             throw new BizException("参数校验失败");
         }
-        /*if(studentAddDto.getSignClassId() == null && studentAddDto.getMixClassId() == null){
-            throw new BizException("参数校验失败: 单技班或合奏班必填一项");
-        }*/
         Date date = new Date();
         String musicGroupId = studentRegistration.getMusicGroupId();
         
@@ -694,8 +677,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentDao.insert(new Student(userId, studentRegistration.getSubjectId().toString()));
                 //添加用户现金账户
                 sysUserCashAccountDao.insert(new SysUserCashAccount(userId, "CNY"));
-                //添加用户电子签章账户
-//                contractService.register(userId, sysUser.getRealName(), sysUser.getIdCardNo(), sysUser.getPhone());
                 ImResult register = imFeignService.register(new ImUserModel(userId.toString(), sysUser.getUsername(), null));
                 sysUser.setImToken(register.getToken());
                 teacherDao.updateUser(sysUser);
@@ -756,13 +737,7 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                     userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
                     null, studentAddDto.getTemporaryCourseFee(), null);
 
-            /*if (musicGroup.getFeeType() != null && musicGroup.getFeeType() != MusicGroupPaymentCalender.FeeType.OFFLINE && musicGroupStudentFee.getTemporaryCourseFee().doubleValue() * 100 == 0) {
-                musicGroupStudentFee.setRemainNetworkClassTimes(musicGroupStudentFee.getRemainNetworkClassTimes() + 1);
-            }*/
             musicGroupStudentFeeDao.insert(musicGroupStudentFee);
-//            musicGroupStudentFeeDao.insert(new MusicGroupStudentFee(musicGroupId,
-//                    userId, studentRegistration.getSubjectId(), studentAddDto.getCourseFee(),
-//                    nextPaymentDate, studentAddDto.getTemporaryCourseFee(), paymentStatus));
             //当前学员是否以前存在过当前乐团
             if (phoneAndMusicGroupId != null) {
                 studentRegistration.setId(phoneAndMusicGroupId.getId());
@@ -771,7 +746,6 @@ public class StudentRegistrationServiceImpl extends BaseServiceImpl<Long, Studen
                 studentRegistrationDao.insertBasic(studentRegistration);
             }
             studentRegistrationDao.updateCurrentClass(studentRegistration);
-
             return userId;
         }
     }

+ 0 - 10
mec-biz/src/main/resources/config/mybatis/ImUserFriendMapper.xml

@@ -40,13 +40,6 @@
 		VALUES(#{id},#{userId},#{friendId},#{friendNickname},#{memo},#{tags},NOW(),NOW())
 	</insert>
 
-	<insert id="batchInsert">
-		INSERT INTO im_user_friend (user_id_,friend_id_,friend_nickname_,tags_,memo_,create_time_,update_time_)
-		VALUES
-		<foreach collection="teachers" item="item" separator=",">
-			(#{teacherId},#{item.userId},#{item.name},#{item.subjectName},#{item.musicGroupName},NOW(),NOW())
-		</foreach>
-	</insert>
 	<insert id="insertByBasicUser">
 		INSERT INTO im_user_friend (user_id_,friend_id_,friend_nickname_,tags_,memo_,create_time_,update_time_)
 		VALUES (#{teacherId},#{basicUserDto.userId},#{basicUserDto.name},#{basicUserDto.subjectName},#{basicUserDto.musicGroupName},NOW(),NOW())
@@ -61,9 +54,6 @@
 		<if test="friendId != null">
 		friend_id_ = #{friendId},
 		</if>
-		<if test="id != null">
-		id_ = #{id},
-		</if>
 		<if test="friendNickname != null">
 		friend_nickname_ = #{friendNickname},
 		</if>