|
@@ -6,6 +6,7 @@ import com.ssj.bean.sys.imlibuser.TbClass;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibJoin;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibManager;
|
|
|
import com.ssj.bean.weixin.libmy.domain.TbLibManagerAudit;
|
|
|
+import com.ssj.bean.weixin.libmy.domain.TbLibReadManager;
|
|
|
import com.ssj.dao.weixin.library.dao.ILibJoinDao;
|
|
|
import com.ssj.dao.weixin.library.dao.ILibJoinQueryDao;
|
|
|
import com.ssj.framework.basic.utils.DateHelper;
|
|
@@ -18,6 +19,7 @@ import com.ssj.framework.core.util.StringUtil;
|
|
|
import com.ssj.framework.core.util.SystemResourceLocator;
|
|
|
import com.ssj.framework.weixin.util.BarcodeFactory;
|
|
|
import com.ssj.service.sys.imlibuser.service.TbClassService;
|
|
|
+import com.ssj.service.sys.manager.service.IReadManagerService;
|
|
|
import com.ssj.service.weixin.library.service.IBookManagerService;
|
|
|
import com.ssj.service.weixin.library.service.ILibJoinService;
|
|
|
import com.ssj.service.weixin.library.service.LibManagerAuditService;
|
|
@@ -66,7 +68,10 @@ public class LibJoinServiceImpl extends BaseServiceImpl<TbLibJoin, String> imple
|
|
|
|
|
|
@Autowired
|
|
|
private LibManagerAuditService auditService;
|
|
|
-
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IReadManagerService readManagerService;
|
|
|
+
|
|
|
|
|
|
@Override
|
|
|
public PagingAndSortingRepository<TbLibJoin, String> getDao() {
|
|
@@ -101,21 +106,54 @@ public class LibJoinServiceImpl extends BaseServiceImpl<TbLibJoin, String> imple
|
|
|
Date now = new Date();
|
|
|
TbLibJoin join = this.getById(libId);
|
|
|
for (int i = 0; i < ids.length; i++) {
|
|
|
+
|
|
|
String userId = ids[i];
|
|
|
- libJoinDao.libManagerDeleteIn(libId, userId,type);
|
|
|
- TbLibManager tb = new TbLibManager();
|
|
|
- tb.setLibId(libId);
|
|
|
- tb.setUserId(userId);
|
|
|
- tb.setType(type);
|
|
|
- tb.setName(names[i]==null?userService.getById(userId).getName():names[i]);
|
|
|
- if(StringUtil.isNotEmpty(mobiles[i])){
|
|
|
- tb.setTelephone(mobiles[i]);
|
|
|
+ if(type==0 || type ==1){
|
|
|
+ TbLibReadManager manager = new TbLibReadManager();
|
|
|
+ manager.setLibId(libId);
|
|
|
+ manager.setUserId(userId);
|
|
|
+ manager.setType(type);
|
|
|
+ manager.setName(names[i]==null?userService.getById(userId).getName():names[i]);
|
|
|
+ if(StringUtil.isNotEmpty(mobiles[i])){
|
|
|
+ manager.setTelephone(mobiles[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ manager.setCreateTime(now);
|
|
|
+ manager.setState(1);
|
|
|
+ readManagerService.save(manager);
|
|
|
+ }else{
|
|
|
+ libJoinDao.libManagerDeleteIn(libId, userId,type);
|
|
|
+ TbLibManager tb = new TbLibManager();
|
|
|
+ tb.setLibId(libId);
|
|
|
+ tb.setUserId(userId);
|
|
|
+ tb.setType(type);
|
|
|
+ tb.setName(names[i]==null?userService.getById(userId).getName():names[i]);
|
|
|
+ if(StringUtil.isNotEmpty(mobiles[i])){
|
|
|
+ tb.setTelephone(mobiles[i]);
|
|
|
+ }
|
|
|
+
|
|
|
+ tb.setCreateTime(now);
|
|
|
+ tb.setLibtype(join.getLibtype()>1?2:1);
|
|
|
+ tb.setState(1);
|
|
|
+ tb = managerService.save(tb);
|
|
|
+
|
|
|
+ if(type==4){
|
|
|
+ //校长,插入audit记录
|
|
|
+ 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());
|
|
|
+ //BeanUtils.copyProperties(tb,audit);
|
|
|
+ auditService.save(audit);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
- tb.setCreateTime(now);
|
|
|
- tb.setLibtype(join.getLibtype()>1?2:1);
|
|
|
- tb.setState(1);
|
|
|
- tb = managerService.save(tb);
|
|
|
if(type==1){
|
|
|
userId="JIEYUE"+userId;//图书借阅
|
|
|
}else if(type==2){
|
|
@@ -125,21 +163,7 @@ public class LibJoinServiceImpl extends BaseServiceImpl<TbLibJoin, String> imple
|
|
|
}else{
|
|
|
userId ="CD"+userId;
|
|
|
}
|
|
|
- if(type==4){
|
|
|
- //校长,插入audit记录
|
|
|
- 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());
|
|
|
- //BeanUtils.copyProperties(tb,audit);
|
|
|
- auditService.save(audit);
|
|
|
- }
|
|
|
+
|
|
|
tokenManager.createManageType(userId,libId);
|
|
|
tokenManager.delToken(userId);
|
|
|
}
|