package com.ruoyi.ss.store.domain;

import com.ruoyi.ss.store.domain.enums.StoreStatus;
import lombok.Data;

/**
 * @author wjh
 * 2024/4/29
 */
@Data
public class StoreBO extends Store {

    /**
     * 过滤前台更新字段
     */
    public StoreBO filterUpdateByApp() {
        StoreBO bo = new StoreBO();
        bo.setStoreId(getStoreId());
        bo.setName(getName());
        bo.setPicture(getPicture());
        bo.setAddress(getAddress());
        bo.setLng(getLng());
        bo.setLat(getLat());
        bo.setProvince(getProvince());
        bo.setCity(getCity());
        bo.setCounty(getCounty());
        bo.setType(getType());
        bo.setContactName(getContactName());
        bo.setContactMobile(getContactMobile());
        return bo;
    }

    /**
     * 过滤前台创建字段
     */
    public StoreBO filterCreateByApp() {
        StoreBO bo = new StoreBO();
        bo.setName(getName());
        bo.setPicture(getPicture());
        bo.setAddress(getAddress());
        bo.setLng(getLng());
        bo.setLat(getLat());
        bo.setBusinessTimeStart(getBusinessTimeStart());
        bo.setBusinessTimeEnd(getBusinessTimeEnd());
        bo.setProvince(getProvince());
        bo.setCity(getCity());
        bo.setCounty(getCounty());
        bo.setType(getType());
        bo.setContactName(getContactName());
        bo.setContactMobile(getContactMobile());
        bo.setShow(getShow());
        bo.setUseOutTime(getUseOutTime());
        return bo;
    }

    /**
     * 过滤后台更新字段
     */
    public StoreBO filterUpdate() {
        StoreBO bo = new StoreBO();
        bo.setStoreId(getStoreId());
        bo.setName(getName());
        bo.setUserId(getUserId());
        bo.setPicture(getPicture());
        bo.setAddress(getAddress());
        bo.setLng(getLng());
        bo.setLat(getLat());
        bo.setBusinessTimeStart(getBusinessTimeStart());
        bo.setBusinessTimeEnd(getBusinessTimeEnd());
        bo.setProvince(getProvince());
        bo.setCity(getCity());
        bo.setCounty(getCounty());
        bo.setType(getType());
        bo.setContactName(getContactName());
        bo.setContactMobile(getContactMobile());
        bo.setShow(getShow());
        bo.setUseOutTime(getUseOutTime());
        return bo;
    }

    /**
     * 过滤后台创建字段
     * @return
     */
    public StoreBO filterCreate() {
        StoreBO bo = new StoreBO();
        bo.setName(getName());
        bo.setUserId(getUserId());
        bo.setPicture(getPicture());
        bo.setAddress(getAddress());
        bo.setLng(getLng());
        bo.setLat(getLat());
        bo.setBusinessTimeStart(getBusinessTimeStart());
        bo.setBusinessTimeEnd(getBusinessTimeEnd());
        bo.setProvince(getProvince());
        bo.setCity(getCity());
        bo.setCounty(getCounty());
        bo.setType(getType());
        bo.setContactName(getContactName());
        bo.setContactMobile(getContactMobile());
        bo.setShow(getShow());
        bo.setStatus(StoreStatus.NORMAL.getStatus());
        bo.setEnabled(true);
        bo.setUseOutTime(getUseOutTime());
        return bo;
    }

    /**
     * 用户配置店铺
     * @return
     */
    public StoreBO filterConfigByApp() {
        StoreBO bo = new StoreBO();
        bo.setStoreId(getStoreId());
        bo.setBusinessTimeStart(getBusinessTimeStart());
        bo.setBusinessTimeEnd(getBusinessTimeEnd());
        bo.setShow(getShow());
        bo.setUseOutTime(getUseOutTime());
        return bo;
    }

    /**
     * 店铺员工修改店铺
     */
    public StoreBO filterUpdateByAppStaff() {
        return this.filterUpdateByApp();
    }
}
