Commit 0e085cc8 authored by libin's avatar libin

租车会员统计

parent 009eff2f
package com.github.wxiaoqi.security.common.util; package com.github.wxiaoqi.security.common.util;
import java.math.BigDecimal; import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/11/20 20:25
*/
@FunctionalInterface @FunctionalInterface
public interface ToBigDecimalFunction<T> { public interface ToBigDecimalFunction<T> {
BigDecimal applyAsBigDecimal(T value); BigDecimal applyAsBigDecimal(T value);
......
...@@ -6,9 +6,13 @@ import com.xxfc.platform.order.entity.OrderReceivedStatisticsBase; ...@@ -6,9 +6,13 @@ import com.xxfc.platform.order.entity.OrderReceivedStatisticsBase;
import org.apache.commons.collections4.CollectionUtils; import org.apache.commons.collections4.CollectionUtils;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.temporal.WeekFields;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Locale;
/** /**
* @author libin * @author libin
...@@ -76,10 +80,10 @@ public enum StatisticsStatusEnum { ...@@ -76,10 +80,10 @@ public enum StatisticsStatusEnum {
} }
public static<T extends OrderReceivedStatisticsBase> T wrapStatisticsObject(Date date,String stateGroup,T targetObj){ public static<T extends OrderReceivedStatisticsBase> T wrapStatisticsObject(Date date,String stateGroup,T targetObj){
DateTime yesterday = DateTime.of(date); LocalDate localDate = LocalDate.from(new Date().toInstant().atZone(ZoneId.systemDefault()));
String year = String.valueOf(yesterday.getField(DateField.YEAR)); String year = String.valueOf(localDate.getYear());
String month = String.format("%s%d", year, yesterday.getField(DateField.MONTH)); String month = String.format("%s%d", year, localDate.getMonthValue());
String weekOfYear = String.format("%s%d", year, yesterday.getField(DateField.WEEK_OF_YEAR)); String weekOfYear = String.format("%s%d", year,localDate.get(WeekFields.of(Locale.CHINESE).weekOfYear()));
String[] status = stateGroup.split("-"); String[] status = stateGroup.split("-");
targetObj.setCrtTime(new Date()); targetObj.setCrtTime(new Date());
targetObj.setCompanyId(Integer.valueOf(status[0])); targetObj.setCompanyId(Integer.valueOf(status[0]));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment