修改查询积分语句
This commit is contained in:
parent
cfdc726d19
commit
63b58ac6b7
|
@ -15,6 +15,7 @@ import com.sqx.modules.app.entity.UserEntity;
|
|||
import com.sqx.modules.artificer.dao.ArtificerDao;
|
||||
import com.sqx.modules.artificer.dao.OrdersDao;
|
||||
import com.sqx.modules.artificer.entity.Artificer;
|
||||
import com.sqx.modules.artificer.entity.Orders;
|
||||
import com.sqx.modules.artificer.entity.Period;
|
||||
import com.sqx.modules.artificer.service.AppArtificerIntegralService;
|
||||
import com.sqx.modules.artificer.vo.HomeVO;
|
||||
|
@ -89,14 +90,24 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
Period period = obtainCycle(new Date());
|
||||
orders.setCurrentEndDate(DateUtil.formatDateTime(period.getEndFundData()));
|
||||
|
||||
//当前周期储值积分数
|
||||
String storedValueIntegral = ordersDao.selectOrdersStoredValueIntegral(artificerId, endDate, startDate);
|
||||
// //当前周期储值积分数
|
||||
// String storedValueIntegral = ordersDao.selectOrdersStoredValueIntegral(artificerId, endDate, startDate);
|
||||
// //当前周在线积分数
|
||||
// String onlineCredits = ordersDao.selectOnlineCredits(artificerId, endDate, startDate);
|
||||
// BigDecimal a = new BigDecimal(storedValueIntegral);
|
||||
// BigDecimal b = new BigDecimal(onlineCredits);
|
||||
// //储存积分数 加上在线积分数 等于当期积分
|
||||
// BigDecimal add = a.add(b);
|
||||
|
||||
//获取所有积分方法
|
||||
Map<String,Object> jfMap = getJifenList(artificerId, startDate, endDate);
|
||||
String zxjf = jfMap.get("zxscjf").toString();
|
||||
//当前周在线积分数
|
||||
String onlineCredits = ordersDao.selectOnlineCredits(artificerId, endDate, startDate);
|
||||
BigDecimal a = new BigDecimal(storedValueIntegral);
|
||||
BigDecimal b = new BigDecimal(onlineCredits);
|
||||
//储存积分数 加上在线积分数 等于当期积分
|
||||
BigDecimal add = a.add(b);
|
||||
BigDecimal b = new BigDecimal(zxjf);
|
||||
|
||||
//总积分
|
||||
String sumJf = jfMap.get("sumJf").toString();
|
||||
BigDecimal add = new BigDecimal(sumJf);
|
||||
orders.setIntegral(add);
|
||||
|
||||
//当期订单数:计算订单发生了按摩行为的订单数,订单状态经历了开始服务到订单结束。
|
||||
|
@ -558,4 +569,43 @@ public class AppArtificerIntegralServiceImpl implements AppArtificerIntegralServ
|
|||
return Result.success(map);
|
||||
}
|
||||
|
||||
public Result getJifenList(Long userId, String startTime, String endTime) {
|
||||
//1.获取业绩积分
|
||||
List<Orders> yjjfList = ordersDao.getYjjfList(userId,startTime,endTime);
|
||||
int yjjf = 0;
|
||||
for (Orders par:yjjfList) {
|
||||
yjjf += (int) Double.parseDouble(par.getJifen());
|
||||
}
|
||||
//2.获取储值积分(为他充值的)
|
||||
List<Orders> czjfList = ordersDao.getCzjfList(userId,startTime,endTime);
|
||||
int czjf = 0;
|
||||
for (Orders par:czjfList) {
|
||||
czjf += (int) Double.parseDouble(par.getJifen());
|
||||
}
|
||||
//3.获取订单充值积分
|
||||
List<Orders> ddczList = ordersDao.getDdczList(userId,startTime,endTime);
|
||||
int ddczjf = 0;
|
||||
for (Orders par:ddczList) {
|
||||
ddczjf += (int) Double.parseDouble(par.getJifen());
|
||||
}
|
||||
//4.获取在线时长积分
|
||||
List<Orders> zxscList = ordersDao.getZxscList(userId,startTime,endTime);
|
||||
int zxscjf = 0;
|
||||
for (Orders par:zxscList) {
|
||||
zxscjf += (int) Double.parseDouble(par.getJifen());
|
||||
}
|
||||
int sumJf = 0;
|
||||
sumJf = yjjf + czjf + ddczjf + zxscjf;
|
||||
Map<String,Object> map = new HashMap<String,Object>();
|
||||
map.put("yjjfList",yjjfList);
|
||||
map.put("yjjf",yjjf);
|
||||
map.put("czjfList",czjfList);
|
||||
map.put("czjf",czjf);
|
||||
map.put("ddczList",ddczList);
|
||||
map.put("ddczjf",ddczjf);
|
||||
map.put("zxscList",zxscList);
|
||||
map.put("zxscjf",zxscjf);
|
||||
map.put("sumJf",sumJf);
|
||||
return Result.success(map);
|
||||
}
|
||||
}
|
|
@ -90,7 +90,7 @@ public class AllTaskServiceImpl implements AllTaskSercice {
|
|||
String lastMonth = format.format(calendar4.getTime());
|
||||
startTime = lastMonth+"-01 00:00:00";
|
||||
endTime = lastMonth+"-10 23:59:59";
|
||||
}else if(dayOfMonth == 26){
|
||||
}else if(dayOfMonth == 21){
|
||||
Calendar calendar4 = Calendar.getInstance();
|
||||
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM");
|
||||
String lastMonth = format.format(calendar4.getTime());
|
||||
|
|
Loading…
Reference in New Issue