|
@@ -1,8 +1,11 @@
|
|
|
package com.ssj.service.weixin.library.service.impl;
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
|
import com.google.common.primitives.Ints;
|
|
|
+import com.ssj.bean.common.framework.core.domain.Response;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibManager;
|
|
|
+import com.ssj.bean.weixin.libmy.domain.TbLibManagerAudit;
|
|
|
import com.ssj.bean.weixin.push.domain.SendTemplateShort;
|
|
|
import com.ssj.bean.weixin.user.domain.User;
|
|
|
import com.ssj.dao.kmt.kmt.dao.KmtQueryDao;
|
|
@@ -13,6 +16,7 @@ import com.ssj.dao.weixin.library.dao.IOneBookQueryDao;
|
|
|
import com.ssj.framework.basic.utils.DateHelper;
|
|
|
import com.ssj.framework.core.common.service.BaseServiceImpl;
|
|
|
import com.ssj.framework.core.util.*;
|
|
|
+import com.ssj.framework.idworker.IdWorker;
|
|
|
import com.ssj.service.conch.curator.request.CreateTeacherRequest;
|
|
|
import com.ssj.service.conch.teacher.app.request.VcodeSubmitReq;
|
|
|
import com.ssj.service.mapper.LibManagerMapper;
|
|
@@ -22,6 +26,7 @@ import com.ssj.service.sys.teacher.dto.CorrectionCountDTO;
|
|
|
import com.ssj.service.sys.teacher.dto.OnlineCorrectTeacherDTO;
|
|
|
import com.ssj.service.weixin.library.dto.*;
|
|
|
import com.ssj.service.weixin.library.service.IBookManagerService;
|
|
|
+import com.ssj.service.weixin.library.service.LibManagerAuditService;
|
|
|
import com.ssj.service.weixin.push.service.PushTemplateService;
|
|
|
import com.ssj.service.weixin.user.service.UserService;
|
|
|
import org.apache.commons.collections.CollectionUtils;
|
|
@@ -71,6 +76,9 @@ public class BookManagerServiceImpl extends BaseServiceImpl<TbLibManager, String
|
|
|
@Autowired
|
|
|
private LibVipMapper libVipMapper;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private LibManagerAuditService auditService;
|
|
|
+
|
|
|
@Override
|
|
|
public PagingAndSortingRepository<TbLibManager, String> getDao() {
|
|
|
|
|
@@ -969,6 +977,47 @@ public class BookManagerServiceImpl extends BaseServiceImpl<TbLibManager, String
|
|
|
public TbLibManager findOneManagerBySubject (String subject){
|
|
|
return libManagerMapper.findRandManagerByTypeAndSubject(subject);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Response managerAddSave(String libId, String name, String mobile) {
|
|
|
+ Response response = new Response();
|
|
|
+ Date now = new Date();
|
|
|
+ TbLibManager tb = dao.findManagerByPhoneAndType(mobile,4);
|
|
|
+ if(Objects.nonNull(tb)){
|
|
|
+ response.failure("此电话号码已拥有校长身份!");
|
|
|
+ return response;
|
|
|
+ }
|
|
|
+ User user = userService.findByMobile(mobile);
|
|
|
+ if(user==null){
|
|
|
+ user = new User();
|
|
|
+ user.setId(IdWorker.generateId());
|
|
|
+ user.setMobile(mobile);
|
|
|
+ user.setUserName(name);
|
|
|
+ user = userService.save(user);
|
|
|
+ }
|
|
|
+ tb = new TbLibManager();
|
|
|
+ tb.setUserId(user.getId());
|
|
|
+ tb.setName(name);
|
|
|
+ tb.setTelephone(mobile);
|
|
|
+ tb.setType(4);
|
|
|
+ tb.setState(1);
|
|
|
+ tb.setLibId(libId);
|
|
|
+ tb.setCreateTime(now);
|
|
|
+ tb = this.save(tb);
|
|
|
+
|
|
|
+ TbLibManagerAudit audit = new TbLibManagerAudit();
|
|
|
+ audit.setStatus(1);
|
|
|
+ audit.setTelephone(tb.getTelephone());
|
|
|
+ audit.setLibManagerId(tb.getId());
|
|
|
+ audit.setLibId(tb.getLibId());
|
|
|
+ audit.setType(tb.getType());
|
|
|
+ audit.setCreateTime(now);
|
|
|
+ audit.setLastUpdateTime(now);
|
|
|
+ audit.setUserId(tb.getUserId());
|
|
|
+ audit.setName(tb.getName());
|
|
|
+ auditService.save(audit);
|
|
|
+ return response.success();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
|