Commit f70fb10b by 周晓航

修改对接api 属性

Signed-off-by: 周晓航 <xiaohang.zhou@freemud.com>
parent 9bbd1877
......@@ -81,7 +81,7 @@ public class DeliveryInfoDTO {
* 额外拓展属性 json
* @see cn.freemud.entities.dto.console.DeliveryInfoExpandFieldDTO
*/
private String expandFields;
private DeliveryInfoExpandFieldDTO expandFields;
}
......@@ -19,9 +19,7 @@ import cn.freemud.entities.dto.console.DeliveryInfoExpandFieldDTO;
import cn.freemud.entities.dto.console.NightDeliveryuInfo;
import cn.freemud.entities.vo.ShoppingCartGoodsResponseVo;
import cn.freemud.utils.DateTimeUtil;
import com.alibaba.fastjson.JSON;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang.StringUtils;
import java.text.ParseException;
import java.text.SimpleDateFormat;
......@@ -51,16 +49,14 @@ public interface DeliveryService {
* @param amount 原始配送费价格
* @param expandFields 门店反馈的额外配送费配置
*/
default List<ExtraDeliveryDto> nightDeliveryAmountHandle(long amount, String expandFields) {
default List<ExtraDeliveryDto> nightDeliveryAmountHandle(long amount, DeliveryInfoExpandFieldDTO expandFields) {
List<ExtraDeliveryDto> list = new ArrayList<>();
if (amount > 0) {
ExtraDeliveryDto defaultAmount = new ExtraDeliveryDto(ExtraDeliveryDto.TYPE_DEFAULT, amount);
list.add(defaultAmount);
}
if (StringUtils.isNotBlank(expandFields)) {
DeliveryInfoExpandFieldDTO expandField = JSON.parseObject(expandFields, DeliveryInfoExpandFieldDTO.class);
if (Objects.nonNull(expandField) && CollectionUtils.isNotEmpty(expandField.getNightDeliveryInfo())) {
for (NightDeliveryuInfo info : expandField.getNightDeliveryInfo()) {
if (Objects.nonNull(expandFields) && CollectionUtils.isNotEmpty(expandFields.getNightDeliveryInfo())) {
for (NightDeliveryuInfo info : expandFields.getNightDeliveryInfo()) {
if (info.getStatus() == NightDeliveryuInfo.COMMON_STATUS_OPEN) {
// 当前时间在区间内
try {
......@@ -81,7 +77,6 @@ public interface DeliveryService {
}
}
}
}
return list;
}
......
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