|
@@ -119,7 +119,7 @@ public class LibBorrowHisServiceImpl extends BaseServiceImpl<TbLibBorrowHis,Stri
|
|
params.put("libId",join.getId());
|
|
params.put("libId",join.getId());
|
|
List<Map<String,Object>> list = queryDao.findLibRankToPush(params);
|
|
List<Map<String,Object>> list = queryDao.findLibRankToPush(params);
|
|
//总借阅量
|
|
//总借阅量
|
|
- int totolNum = 0;
|
|
|
|
|
|
+ int totalNum = 0;
|
|
//总借阅次数
|
|
//总借阅次数
|
|
int totalTimes = 0;
|
|
int totalTimes = 0;
|
|
if(!list.isEmpty()){
|
|
if(!list.isEmpty()){
|
|
@@ -130,18 +130,18 @@ public class LibBorrowHisServiceImpl extends BaseServiceImpl<TbLibBorrowHis,Stri
|
|
data.put("keyword2", "借书总量"+map.get("borrow_num")+"本");
|
|
data.put("keyword2", "借书总量"+map.get("borrow_num")+"本");
|
|
data.put("keyword3","第"+map.get("ranking").toString().split("\\.")[0]+"名");
|
|
data.put("keyword3","第"+map.get("ranking").toString().split("\\.")[0]+"名");
|
|
sendWxNotice(data,map.get("wx_account").toString(),"parents/pages/ranking/ranking?type=1&vipId="+map.get("vip_id")+"&libId="+join.getId());
|
|
sendWxNotice(data,map.get("wx_account").toString(),"parents/pages/ranking/ranking?type=1&vipId="+map.get("vip_id")+"&libId="+join.getId());
|
|
- totolNum+=Integer.parseInt(map.get("borrow_num").toString().split("\\.")[0]);
|
|
|
|
|
|
+ totalNum+=Integer.parseInt(map.get("borrow_num").toString().split("\\.")[0]);
|
|
totalTimes+=Integer.parseInt(map.get("borrow_times").toString().split("\\.")[0]);
|
|
totalTimes+=Integer.parseInt(map.get("borrow_times").toString().split("\\.")[0]);
|
|
- addHis(map,hisList,join.getId(),2,params.get("searchDate").toString());
|
|
|
|
|
|
+ addHis(map,hisList,join,2,params.get("searchDate").toString());
|
|
}
|
|
}
|
|
this.save(hisList);
|
|
this.save(hisList);
|
|
}
|
|
}
|
|
//推送到馆长
|
|
//推送到馆长
|
|
- if(totolNum>0){
|
|
|
|
|
|
+ if(totalNum>0){
|
|
List<Map<String,Object>> managerList = bookDetailService.libManageList(join.getId());
|
|
List<Map<String,Object>> managerList = bookDetailService.libManageList(join.getId());
|
|
if(Collections3.isNotEmpty(managerList)){
|
|
if(Collections3.isNotEmpty(managerList)){
|
|
data.put("keyword1", DateHelper.format(DateHelper.getLastMonthFirstDay(new Date()),"yyyy年MM月")+"馆内借阅量排名结果");
|
|
data.put("keyword1", DateHelper.format(DateHelper.getLastMonthFirstDay(new Date()),"yyyy年MM月")+"馆内借阅量排名结果");
|
|
- data.put("keyword2", "馆内借书总数量"+totolNum+"本");
|
|
|
|
|
|
+ data.put("keyword2", "馆内借书总数量"+totalNum+"本");
|
|
data.put("keyword3","馆内借阅总次数"+totalTimes+"次");
|
|
data.put("keyword3","馆内借阅总次数"+totalTimes+"次");
|
|
for(Map<String,Object> map:managerList){
|
|
for(Map<String,Object> map:managerList){
|
|
data.put("first", "亲爱的"+map.get("name")+"馆长,"+join.getLeagueName()+"月度排名结果已经出来了!");
|
|
data.put("first", "亲爱的"+map.get("name")+"馆长,"+join.getLeagueName()+"月度排名结果已经出来了!");
|
|
@@ -175,7 +175,7 @@ public class LibBorrowHisServiceImpl extends BaseServiceImpl<TbLibBorrowHis,Stri
|
|
data.put("keyword2", "借书总量"+map.get("borrow_num")+"本");
|
|
data.put("keyword2", "借书总量"+map.get("borrow_num")+"本");
|
|
data.put("keyword3","第"+map.get("ranking").toString().split("\\.")[0]+"名");
|
|
data.put("keyword3","第"+map.get("ranking").toString().split("\\.")[0]+"名");
|
|
sendWxNotice(data,map.get("wx_account").toString(),"parents/pages/ranking/ranking?type=1&vipId="+map.get("vip_id")+"&libId="+join.getId());
|
|
sendWxNotice(data,map.get("wx_account").toString(),"parents/pages/ranking/ranking?type=1&vipId="+map.get("vip_id")+"&libId="+join.getId());
|
|
- addHis(map,hisList,join.getId(),1,params.get("searchDate").toString());
|
|
|
|
|
|
+ addHis(map,hisList,join,1,params.get("searchDate").toString());
|
|
|
|
|
|
totolNum+=Integer.parseInt(map.get("borrow_num").toString().split("\\.")[0]);
|
|
totolNum+=Integer.parseInt(map.get("borrow_num").toString().split("\\.")[0]);
|
|
totalTimes+=Integer.parseInt(map.get("borrow_times").toString().split("\\.")[0]);
|
|
totalTimes+=Integer.parseInt(map.get("borrow_times").toString().split("\\.")[0]);
|
|
@@ -200,7 +200,7 @@ public class LibBorrowHisServiceImpl extends BaseServiceImpl<TbLibBorrowHis,Stri
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
- public void addHis(Map<String,Object> map,List<TbLibBorrowHis> hisList,String id,int type,String searchDate){
|
|
|
|
|
|
+ public void addHis(Map<String,Object> map,List<TbLibBorrowHis> hisList,TbLibJoin join,int type,String searchDate){
|
|
//插入月记录
|
|
//插入月记录
|
|
TbLibBorrowHis his = new TbLibBorrowHis();
|
|
TbLibBorrowHis his = new TbLibBorrowHis();
|
|
his.setBorrowNum(Integer.parseInt(map.get("borrow_num")+""));
|
|
his.setBorrowNum(Integer.parseInt(map.get("borrow_num")+""));
|
|
@@ -208,20 +208,22 @@ public class LibBorrowHisServiceImpl extends BaseServiceImpl<TbLibBorrowHis,Stri
|
|
his.setChildImg(map.get("child_img")+"");
|
|
his.setChildImg(map.get("child_img")+"");
|
|
his.setChildName(map.get("child_name")+"");
|
|
his.setChildName(map.get("child_name")+"");
|
|
his.setHisYear(searchDate.substring(0,4));
|
|
his.setHisYear(searchDate.substring(0,4));
|
|
- his.setLibId(id);
|
|
|
|
|
|
+ his.setLibId(join.getId());
|
|
his.setVipId(map.get("vip_id")+"");
|
|
his.setVipId(map.get("vip_id")+"");
|
|
his.setRanking(Integer.parseInt(map.get("ranking").toString().split("\\.")[0]));
|
|
his.setRanking(Integer.parseInt(map.get("ranking").toString().split("\\.")[0]));
|
|
if(type==2){
|
|
if(type==2){
|
|
his.setHisMonth(searchDate.substring(5));
|
|
his.setHisMonth(searchDate.substring(5));
|
|
if(his.getRanking()<4){
|
|
if(his.getRanking()<4){
|
|
his.setHeadRanking(1);
|
|
his.setHeadRanking(1);
|
|
- //改变借阅书籍量
|
|
|
|
- LibVipService vipService = libVipServiceService.getById(map.get("id").toString());
|
|
|
|
- vipService.setBorrowNum(his.getRanking()==1?5:his.getRanking()==2?4:3);
|
|
|
|
- libVipServiceService.save(vipService);
|
|
|
|
}else{
|
|
}else{
|
|
his.setHeadRanking(2);
|
|
his.setHeadRanking(2);
|
|
}
|
|
}
|
|
|
|
+ //改变借阅书籍量
|
|
|
|
+ if(join.getType()<9){
|
|
|
|
+ LibVipService vipService = libVipServiceService.getById(map.get("id").toString());
|
|
|
|
+ vipService.setBorrowNum(his.getRanking()==1?5:his.getRanking()==2?4:his.getRanking()==3?3:2);
|
|
|
|
+ libVipServiceService.save(vipService);
|
|
|
|
+ }
|
|
}
|
|
}
|
|
hisList.add(his);
|
|
hisList.add(his);
|
|
}
|
|
}
|