|
@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
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.dao.weixin.library.dao.ILibJoinDao;
|
|
|
import com.ssj.dao.weixin.library.dao.ILibJoinQueryDao;
|
|
|
import com.ssj.framework.basic.utils.DateHelper;
|
|
@@ -17,11 +18,14 @@ 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.weixin.library.service.IBookManagerService;
|
|
|
import com.ssj.service.weixin.library.service.ILibJoinService;
|
|
|
+import com.ssj.service.weixin.library.service.LibManagerAuditService;
|
|
|
import com.ssj.service.weixin.sales.service.LibBorrowedServiceService;
|
|
|
import com.ssj.service.weixin.sales.service.LibCommissionService;
|
|
|
import com.ssj.service.weixin.sales.service.LibSalesPriceService;
|
|
|
import com.ssj.service.weixin.user.service.UserService;
|
|
|
+import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
|
import org.springframework.data.domain.Pageable;
|
|
@@ -56,6 +60,12 @@ public class LibJoinServiceImpl extends BaseServiceImpl<TbLibJoin, String> imple
|
|
|
|
|
|
@Autowired
|
|
|
private TbClassService tbClassService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private IBookManagerService managerService;
|
|
|
+
|
|
|
+ @Autowired
|
|
|
+ private LibManagerAuditService auditService;
|
|
|
|
|
|
|
|
|
@Override
|
|
@@ -77,15 +87,18 @@ public class LibJoinServiceImpl extends BaseServiceImpl<TbLibJoin, String> imple
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void libManagerDelete(String id) {
|
|
|
+ public void libManagerDelete(String id,int type) {
|
|
|
libJoinDao.libManagerDelete(id);
|
|
|
-
|
|
|
+ if(type == 4){
|
|
|
+ //删除audit 记录
|
|
|
+ libJoinDao.libAuditDelete(id);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void addAdmin(String[] ids, String libId ,Integer type,String mobiles[],String names[]) {
|
|
|
if(ids.length>0){
|
|
|
- List<TbLibManager> list = new ArrayList<TbLibManager>();
|
|
|
+ Date now = new Date();
|
|
|
TbLibJoin join = this.getById(libId);
|
|
|
for (int i = 0; i < ids.length; i++) {
|
|
|
String userId = ids[i];
|
|
@@ -99,11 +112,10 @@ public class LibJoinServiceImpl extends BaseServiceImpl<TbLibJoin, String> imple
|
|
|
tb.setTelephone(mobiles[i]);
|
|
|
}
|
|
|
|
|
|
- tb.setCreateTime(new Date());
|
|
|
+ tb.setCreateTime(now);
|
|
|
tb.setLibtype(join.getLibtype()>1?2:1);
|
|
|
tb.setState(1);
|
|
|
- list.add(tb);
|
|
|
-
|
|
|
+ tb = managerService.save(tb);
|
|
|
if(type==1){
|
|
|
userId="JIEYUE"+userId;//图书借阅
|
|
|
}else if(type==2){
|
|
@@ -113,10 +125,25 @@ 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);
|
|
|
}
|
|
|
- libJoinQueryDao.insertTbLibManager(list);
|
|
|
+ //libJoinQueryDao.insertTbLibManager(list);
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -163,7 +190,8 @@ public class LibJoinServiceImpl extends BaseServiceImpl<TbLibJoin, String> imple
|
|
|
public List<Map<String, Object>> getNoLocationJoin(Integer type) {
|
|
|
return libJoinQueryDao.getNoLocationJoin(type);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
+ @Override
|
|
|
public List<TbLibJoin> getLibJoinByCode(List<String> orgCode){
|
|
|
if(orgCode!=null&&orgCode.size()>0){
|
|
|
return libJoinDao.getLibJoinByCode(orgCode);
|