|
@@ -10,11 +10,11 @@ import cn.com.ty.lift.batch.applet.dao.model.response.RegionPaymentResponse;
|
|
|
import cn.com.ty.lift.batch.applet.util.DataStatisticsUtil;
|
|
|
import cn.com.ty.lift.common.constants.ApiConstants;
|
|
|
import cn.com.xwy.boot.web.dto.RestResponse;
|
|
|
+import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.data.redis.core.RedisTemplate;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
-import java.time.Duration;
|
|
|
import java.time.LocalDate;
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.Comparator;
|
|
@@ -140,7 +140,12 @@ public class PaymentDataService {
|
|
|
final List<RegionPaymentResponse> finalRegionPaymentResponseList = new ArrayList<>();
|
|
|
//区域名称对应付款数据
|
|
|
Map<String, List<PaymentDataModel>> regionNameToPaymentData = paymentDataModelList.stream()
|
|
|
- .collect(Collectors.groupingBy(PaymentDataModel::getRegionName));
|
|
|
+ .collect(Collectors.groupingBy(a -> {
|
|
|
+ if (StringUtils.isNotBlank(a.getRegionName())) {
|
|
|
+ return a.getRegionName();
|
|
|
+ }
|
|
|
+ return "暂无名称";
|
|
|
+ }));
|
|
|
regionNameToPaymentData.forEach((key, value) -> {
|
|
|
RegionPaymentResponse regionPaymentResponse = new RegionPaymentResponse();
|
|
|
//计划收款总和
|
|
@@ -181,7 +186,12 @@ public class PaymentDataService {
|
|
|
final List<ProjectPaymentResponse> finalProjectPaymentResponseList = new ArrayList<>();
|
|
|
//将数据转化为项目名->付款数据
|
|
|
Map<String, List<PaymentDataModel>> projectNameToPaymentData = paymentDataModelList.stream()
|
|
|
- .collect(Collectors.groupingBy(PaymentDataModel::getProjectName));
|
|
|
+ .collect(Collectors.groupingBy(a -> {
|
|
|
+ if (StringUtils.isNotBlank(a.getProjectName())) {
|
|
|
+ return a.getProjectName();
|
|
|
+ }
|
|
|
+ return "暂无名称";
|
|
|
+ }));
|
|
|
projectNameToPaymentData.forEach((key, value) -> {
|
|
|
if (value != null && value.size() > 0) {
|
|
|
PaymentDataModel paymentDataModel = value.get(0);
|
|
@@ -201,8 +211,10 @@ public class PaymentDataService {
|
|
|
if (paymentDataModel.getWorkDate() != null) {
|
|
|
afterDate = paymentDataModel.getWorkDate();
|
|
|
}
|
|
|
- Duration duration = Duration.between(afterDate, paymentDataModel.getPlanDate());
|
|
|
- projectPaymentResponse.setDueToDays(duration.toDays());
|
|
|
+ if (afterDate != null && paymentDataModel.getPlanDate() != null) {
|
|
|
+ projectPaymentResponse.setDueToDays(Long.valueOf(afterDate.until(
|
|
|
+ paymentDataModel.getPlanDate()).getDays()));
|
|
|
+ }
|
|
|
//合同金额
|
|
|
double contractMoney = paymentDataModel.getContractMoney() != null
|
|
|
? paymentDataModel.getContractMoney().doubleValue() : 0d;
|