anderx преди 1 година
родител
ревизия
2c8694c0de
променени са 1 файла, в които са добавени 4 реда и са изтрити 4 реда
  1. 4 4
      src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

+ 4 - 4
src/main/java/com/goafanti/order/service/impl/OrderNewServiceImpl.java

@@ -52,7 +52,7 @@ import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
-import java.time.LocalDateTime;
+import java.time.LocalDate;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.stream.Collectors;
@@ -663,12 +663,12 @@ public class OrderNewServiceImpl extends BaseMybatisDao<TOrderNewMapper> impleme
 		int count=0;
 		int yearSum=1;
 		List<String> peopleList = new ArrayList<>();
-		LocalDateTime startDate = LocalDateTime.now().withDayOfMonth(1).withMonth(1);
+		LocalDate startDate = LocalDate.now().withMonth(1).withDayOfMonth(1);
+		LocalDate endDate = startDate.withYear(startDate.getYear()+1);
 		//分成会员统计和非会员统计
 		if (!tTaskMembers.isEmpty()){
-			LocalDateTime endDate = LocalDateTime.now().withDayOfMonth(31).withMonth(12);
 			for (PublicRelease e : list) {
-				LocalDateTime date = LocalDateTime.parse(e.getReleaseStart().toString(), DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss"));
+				LocalDate date = LocalDate.parse(e.getReleaseStart().toString(), DateTimeFormatter.ofPattern("yyyy-MM-dd"));
 				if (date.isAfter(startDate)&&date.isBefore(endDate)){
 					durationCount=durationCount.add(BigDecimal.valueOf(e.getDuration()));
 					if (!peopleList.contains(e.getAid())){