2 Коміти 4ef9cb679a ... 8af75d3bac

Автор SHA1 Опис Дата
  xyy@163.com 8af75d3bac Merge branch '部分国家不计燃油' 3 місяців тому
  xyy@163.com 743da384c7 客户费用恢复 3 місяців тому

+ 19 - 8
sr-smp-admin/sr-smp-dao/src/main/java/com/sr/smp/nosql/dao/tools/SynDataDtoImpl.java

@@ -4,6 +4,7 @@ import com.sr.smp.contract.dto.bill.FinancialBillDetailDto;
 import com.sr.smp.contract.dto.customer.CustomerFeeSetDto;
 import com.sr.smp.contract.dto.customer.CustomerGroupDto;
 import com.sr.smp.contract.dto.dictionary.CustomerDto;
+import com.sr.smp.contract.dto.feecommon.FeeItemResultDto;
 import com.sr.smp.contract.dto.feecommon.WeightRateModel;
 import com.sr.smp.contract.dto.money.UserMoneyDetailDto;
 import com.sr.smp.contract.dto.period.CustomerBillDto;
@@ -398,14 +399,24 @@ public class SynDataDtoImpl implements SynDataDto {
 
     @Override
     public void recoverCustomerFromHistory() {
-//        CustomerFeeSetHistory customerFeeSetHistory =  proMongoTemplate.findById("1814a6089bcd49fe99ce5e2708eee793", CustomerFeeSetHistory.class);
-//
-//        CustomerFeeSet entity = new CustomerFeeSet();
-//        BeanCopyUtil.copyProperties(customerFeeSetHistory, entity);
-//        if (null != entity) {
-//            entity.setId(customerFeeSetHistory.getFeeSetId());
-//            proMongoTemplate.save(entity);
-//        }
+
+//        Criteria criteria = new Criteria();
+////        //设置查询时间范围
+//        criteria.and("productId").is("JSEUB");
+//        Query query = new Query(criteria);
+//        List<CustomerFeeSetHistory> list = proMongoTemplate.find(query, CustomerFeeSetHistory.class);
+//        Map<String, List<CustomerFeeSetHistory>> customerFeeSetHistoryMap = list.stream().filter(item->null != item.getActiveFlag() && item.getActiveFlag() && StringUtils.isNotEmpty( item.getOperateGroup())).collect(Collectors.groupingBy(p -> p.getOperateGroup()));
+//        customerFeeSetHistoryMap.forEach((key, value) -> {
+//            List<CustomerFeeSetHistory> orderCustomerFeeSetHistory = value.stream().sorted(Comparator.comparing(CustomerFeeSetHistory::getOperateDate, Comparator.reverseOrder())).collect(Collectors.toList());
+//            CustomerFeeSet entity = new CustomerFeeSet();
+//            BeanCopyUtil.copyProperties(orderCustomerFeeSetHistory.get(0), entity);
+//            entity.setId(orderCustomerFeeSetHistory.get(0).getFeeSetId());
+//            CustomerFeeSet dbCustomerFeeSet = proMongoTemplate.findById(entity.getId(),CustomerFeeSet.class);
+//            if(null == dbCustomerFeeSet)
+//            {
+//                proMongoTemplate.save(entity);
+//            }
+//        });
     }