Commit 019f40c5 by wuwenlong

order list roomImage\roomType\roomTypeName missing value bugfix;

parent df3cc432
package share.common.enums;
import share.common.utils.StringUtils;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
public enum RoomType {
......@@ -25,6 +28,22 @@ public enum RoomType {
return String.join(",", list);
}
public static RoomType getEnumByCode(String code){
for (RoomType type : RoomType.values()) {
if (StringUtils.equals(type.code,code)) {
return type;
}
}
return null;
}
public static String getNameByCode(String code){
RoomType type = getEnumByCode(code);
if(Objects.nonNull(type)){
return type.name;
}
return "";
}
public String getCode() {
return code;
......
......@@ -165,6 +165,14 @@ public class SOrderVo
@ApiModelProperty(value = "房间图片")
private String roomImages;
//房间图片
@ApiModelProperty(value = "房间类型")
private String roomType;
//房间图片
@ApiModelProperty(value = "房间类型名称")
private String roomTypeName;
/** 门店地址 */
@ApiModelProperty(value = "门店地址")
private String address;
......
......@@ -700,6 +700,9 @@ public class SOrderServiceImpl extends ServiceImpl<SOrderMapper, SOrder> impleme
roomList.stream().forEach(room -> {
if (room.getId().equals(vo.getRoomId())) {
vo.setRoomName(room.getName());
vo.setRoomImages(room.getImages());
vo.setRoomType(room.getRoomType());
vo.setRoomTypeName(RoomType.getNameByCode(room.getRoomType()));
}
});
if(Objects.nonNull(vo.getCouponId())) {
......
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