| | |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import lombok.Data; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalDateTime; |
| | |
| | | |
| | | private LocalDateTime createTime; |
| | | |
| | | private Integer score; |
| | | private Integer score; // 订单评分 |
| | | |
| | | private String evaluation; |
| | | private String evaluation; // 订单评价 |
| | | |
| | | public static List<PushEvaluationRequestDTO> convert(List<Map<String, Object>> mapList) { |
| | | List<PushEvaluationRequestDTO> requstList = new ArrayList<>(); |
| | |
| | | if(Objects.nonNull(requestDTO)) { |
| | | PushEvaluationDriverDTO driverDTO = JSON.parseObject(jsonData, PushEvaluationDriverDTO.class); |
| | | Optional.ofNullable(driverDTO).ifPresent(d -> requestDTO.setDriverInfo(d.convert())); |
| | | if(Objects.isNull(requestDTO.getScore())) { |
| | | requestDTO.setScore(5); // 默认5分 |
| | | } |
| | | if(StringUtils.isEmpty(requestDTO.getEvaluation())) { // 默认评价 |
| | | requestDTO.setEvaluation("车内整洁,地图认路准,驾驶平稳,态度好服务棒"); |
| | | } |
| | | requstList.add(requestDTO); |
| | | } |
| | | }); |