wjli
2024-04-10 81af4cff627b7ec1e125b90f4fd57392c6d70588
xboot-modules/xboot-your/src/main/java/cn/exrick/xboot/your/entity/OrderTask.java
@@ -1,6 +1,7 @@
package cn.exrick.xboot.your.entity;
import cn.exrick.xboot.core.base.XbootBaseEntity;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
@@ -29,6 +30,7 @@
@ApiModel(value = "订单任务表")
public class OrderTask extends XbootBaseEntity {
    //存放7天内的数据
    private static final long serialVersionUID = 1L;
    @ApiModelProperty(value = "订单号")
@@ -79,7 +81,7 @@
    @ApiModelProperty(value = "是否驶出月台(0:否  1:是)")
    private int isOut;
    @ApiModelProperty(value = "0配送中,1已送达,3异常签收")
    @ApiModelProperty(value = "0配送中,1已送达,2异常签收")
    private int status;
    @ApiModelProperty(value = "无法送达的原因")
@@ -100,10 +102,13 @@
    @ApiModelProperty(value = "耗时 毫秒")
    private int time;
    @Transient
    @TableField(exist = false)
//    @Transient
//    @TableField(exist = false)
    @ApiModelProperty(value = "商户名称")
    private String customerName;
    @ApiModelProperty(value = "商户联系人")
    private String linker;
    @Transient
    @TableField(exist = false)
@@ -129,4 +134,46 @@
    @TableField(exist = false)
    @ApiModelProperty(value = "订单详情")
    private List<OrderDetail> orderDetails;
}
    public String getImg() {
        if (StrUtil.isEmpty(img)) {
            return null;
        }
        String temp = "";
        String[] imgs = img.split(",");
        for (int i = 0; i < imgs.length; i++) {
            String url = imgs[i];
            if (StrUtil.isNotEmpty(url)) {
                if (url.contains("http") && url.contains("/xboot")) {
                    try{
                        if("".equals(temp)){
                            temp += "/xboot" + url.split("/xboot")[1];
                        }else{
                            temp += ",/xboot" + url.split("/xboot")[1];
                        }
                    }catch (Exception e){
                        if("".equals(temp)){
                            temp += url;
                        }else{
                            temp += "," + url;
                        }
                    }
                } else {
                    if("".equals(temp)){
                        temp += url;
                    }else {
                        temp += "," + url;
                    }
                }
            }
        }
        img = temp;
        return img;
    }
    public static void main(String[] args) {
        String img = ",,http://111.63.178.115:9091/xboot/file/view/1712990736426864641,,/xboot/file/view/1712990822305239041,,";
        OrderTask o = new OrderTask();
        o.setImg(img);
        System.out.println(o.getImg());
    }
}