feat: 1、增加店铺包装费用 2、修复营业时间显示问题和修改异常问题
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.oying.base.BaseEntity; |
| | | import com.oying.modules.pc.product.domain.Product; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty(value = "店铺标签,逗号分隔") |
| | | private String tags; |
| | | |
| | | @ApiModelProperty(value = "配送费用") |
| | | private BigDecimal deliveryFee; |
| | | |
| | | @ApiModelProperty(value = "起送金额") |
| | | private BigDecimal deliveryMinimum; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String contactPhone; |
| | | |
| | | @ApiModelProperty(value = "营业开始时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime openTime; |
| | | |
| | | @ApiModelProperty(value = "营业结束时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime closeTime; |
| | | |
| | | @ApiModelProperty(value = "营业状态") |
| | |
| | | @ApiModelProperty(value = "评分") |
| | | private Double score = 0d; |
| | | |
| | | @ApiModelProperty(value = "包装费用") |
| | | private BigDecimal packagingFee; |
| | | |
| | | @ApiModelProperty(value = "配送费用") |
| | | private BigDecimal deliveryFee; |
| | | |
| | | @ApiModelProperty(value = "起送金额") |
| | | private BigDecimal deliveryMinimum; |
| | | |
| | | @TableField(exist = false) |
| | | @ApiModelProperty(value = "配送距离") |
| | | private Integer deliveryDuration = 0; |
| | |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | import javax.validation.constraints.NotNull; |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalTime; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | @ApiModelProperty(value = "是否支持自提") |
| | | private Integer selfPickup; |
| | | |
| | | @ApiModelProperty(value = "包装费用") |
| | | private BigDecimal packagingFee; |
| | | |
| | | @ApiModelProperty(value = "店铺资质", example = "[]") |
| | | private List<StoreQualificationCreateRequest> qualificationList = new ArrayList<>(); |
| | | |
| | |
| | | package com.oying.modules.pc.store.domain.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String contactPhone; |
| | | |
| | | @ApiModelProperty(value = "营业开始时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime openTime; |
| | | |
| | | @ApiModelProperty(value = "营业结束时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime closeTime; |
| | | |
| | | private String businessHours; |
| | |
| | | package com.oying.modules.pc.store.domain.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | public interface UpdateStoreBusinessHoursGroup{} |
| | | |
| | | @NotNull(groups = UpdateStoreBusinessHoursGroup.class) |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime openTime; |
| | | |
| | | @NotNull(groups = UpdateStoreBusinessHoursGroup.class) |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime closeTime; |
| | | |
| | | public interface UpdateStoreAddressGroup{} |
| | |
| | | package com.oying.modules.pc.store.domain.dto; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.oying.modules.pc.product.domain.Product; |
| | | import com.oying.modules.pc.store.domain.StoreQualification; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | |
| | | @ApiModelProperty(value = "起送金额") |
| | | private BigDecimal deliveryMinimum; |
| | | |
| | | @ApiModelProperty(value = "包装费用") |
| | | private BigDecimal packagingFee; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String contactPhone; |
| | | |
| | | @ApiModelProperty(value = "营业开始时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime openTime; |
| | | |
| | | @ApiModelProperty(value = "营业结束时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime closeTime; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | |
| | | package com.oying.modules.pc.store.rest; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.bean.copier.CopyOptions; |
| | | import cn.hutool.core.util.ObjUtil; |
| | | import com.oying.modules.pc.product.domain.Product; |
| | | import com.oying.modules.pc.product.domain.dto.ProductQueryCriteria; |
| | |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | public ResponseEntity<?> getStoreById(@PathVariable("storeId") Long storeId) { |
| | | Store store = storeService.getById(storeId); |
| | | CustomerStoreView view = new CustomerStoreView(); |
| | | BeanUtils.copyProperties(store, view); |
| | | BeanUtil.copyProperties(store, view, CopyOptions.create().setIgnoreNullValue(true)); |
| | | view.setBusinessHours(BusinessHoursUtils.formatBusinessHours(store.getOpenTime(), store.getCloseTime())); |
| | | return ResponseEntity.ok(R.success(view)); |
| | | } |
| | |
| | | @ApiOperation("查询店铺") |
| | | public ResponseEntity<?> getStoreDetailsById(@PathVariable("storeId") Long storeId) { |
| | | Store store = storeService.getById(storeId); |
| | | CustomerStoreView view = new CustomerStoreView(); |
| | | BeanUtil.copyProperties(store, view, CopyOptions.create().setIgnoreNullValue(true)); |
| | | view.setBusinessHours(BusinessHoursUtils.formatBusinessHours(store.getOpenTime(), store.getCloseTime())); |
| | | if (ObjUtil.isNotEmpty(store)) { |
| | | store.setQualifications(storeQualificationService.getByStoreId(storeId)); |
| | | view.setQualifications(storeQualificationService.getByStoreId(storeId)); |
| | | } |
| | | return ResponseEntity.ok(R.success(store)); |
| | | return ResponseEntity.ok(R.success(view)); |
| | | } |
| | | |
| | | private List<Product> getProductsByStoreId(Long storeId) { |
| | |
| | | //@PreAuthorize("@el.check('merchant:store:getById')") |
| | | public ResponseEntity<?> getStoreById(@PathVariable Long storeId) { |
| | | Store store = storeService.getById(storeId); |
| | | StoreMerchantView view = new StoreMerchantView(); |
| | | BeanUtils.copyProperties(store, view); |
| | | return ResponseEntity.ok(R.success(view)); |
| | | /*StoreMerchantView view = new StoreMerchantView(); |
| | | BeanUtils.copyProperties(store, view);*/ |
| | | return ResponseEntity.ok(R.success(store)); |
| | | } |
| | | |
| | | @GetMapping(value = "/{storeId}/details") |
| | |
| | | package com.oying.modules.pc.store.view; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.oying.modules.pc.store.domain.StoreQualification; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class CustomerStoreView { |
| | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String contactPhone; |
| | | |
| | | @ApiModelProperty(value = "营业时间") |
| | | private String businessHours; |
| | | |
| | | @ApiModelProperty(value = "营业开始时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime openTime; |
| | | |
| | | @ApiModelProperty(value = "营业结束时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime closeTime; |
| | | |
| | | private String businessHours; |
| | | @ApiModelProperty(value = "营业状态") |
| | | private Integer businessStatus; |
| | | |
| | | @ApiModelProperty(value = "市级代码") |
| | | private String cityCode; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | | private String address; |
| | |
| | | @ApiModelProperty(value = "评分") |
| | | private Double score = 0d; |
| | | |
| | | @ApiModelProperty(value = "包装费用") |
| | | private BigDecimal packagingFee; |
| | | |
| | | @ApiModelProperty(value = "配送费用") |
| | | private BigDecimal deliveryFee; |
| | | |
| | | @ApiModelProperty(value = "起送金额") |
| | | private BigDecimal deliveryMinimum; |
| | | |
| | | @ApiModelProperty(value = "配送距离") |
| | | private Integer deliveryDuration = 0; |
| | | |
| | |
| | | @ApiModelProperty(value = "月销售量") |
| | | private Integer monthlyUnitsSold = 0; |
| | | |
| | | @ApiModelProperty(value = "资质") |
| | | private List<StoreQualification> qualifications; |
| | | |
| | | } |
| | |
| | | package com.oying.modules.pc.store.view; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import com.oying.modules.pc.store.domain.StoreQualification; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.time.LocalTime; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | public class StoreMerchantView { |
| | |
| | | @ApiModelProperty(value = "店铺描述") |
| | | private String description; |
| | | |
| | | @ApiModelProperty(value = "包装费用") |
| | | private BigDecimal packagingFee; |
| | | |
| | | @ApiModelProperty(value = "联系电话") |
| | | private String contactPhone; |
| | | |
| | | @ApiModelProperty(value = "营业开始时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime openTime; |
| | | |
| | | @ApiModelProperty(value = "营业结束时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime closeTime; |
| | | |
| | | @ApiModelProperty(value = "详细地址") |
| | |
| | | @ApiModelProperty(value = "版本号") |
| | | private Long version; |
| | | |
| | | @ApiModelProperty(value = "资质") |
| | | private List<StoreQualification> qualifications; |
| | | |
| | | } |
| | |
| | | package com.oying.modules.pc.store.view; |
| | | |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | private String contactPhone; |
| | | |
| | | @ApiModelProperty(value = "营业开始时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime openTime; |
| | | |
| | | @ApiModelProperty(value = "营业结束时间") |
| | | @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "HH:mm") |
| | | private LocalTime closeTime; |
| | | |
| | | @ApiModelProperty(value = "市级代码") |
| | |
| | | <result property="tags" column="tags"/> |
| | | <result property="deliveryFee" column="delivery_fee"/> |
| | | <result property="deliveryMinimum" column="delivery_minimum"/> |
| | | <result property="packagingFee" column="packaging_fee"/> |
| | | <result property="contactPhone" column="contact_phone"/> |
| | | <result property="openTime" column="open_time"/> |
| | | <result property="closeTime" column="close_time"/> |
| | |
| | | |
| | | <sql id="store_column_list"> |
| | | store_id, merchant_id, platform_category_id, store_type, store_code, store_name, business_scope, status, business_status, audit_status, logo_image_id, logo_image_url, |
| | | cover_image_id, cover_image_url, description, tags, delivery_fee, delivery_minimum, contact_phone, open_time, close_time, |
| | | cover_image_id, cover_image_url, description, tags, delivery_fee, delivery_minimum, packaging_fee, contact_phone, open_time, close_time, |
| | | address, longitude, latitude, geo_hash, geo_point, coordinate_system, radius, returns, self_pickup, create_by, create_time, update_by, update_time, version |
| | | </sql> |
| | | |
| | | <sql id="selectStoreVo"> |
| | | select |
| | | store_id, merchant_id, platform_category_id, store_type, store_code, store_name, business_scope, status, business_status, audit_status, logo_image_id, logo_image_url, |
| | | cover_image_id, cover_image_url, description, tags, delivery_fee, delivery_minimum, contact_phone, open_time, close_time, |
| | | cover_image_id, cover_image_url, description, tags, delivery_fee, delivery_minimum, packaging_fee, contact_phone, open_time, close_time, |
| | | address, longitude, latitude, geo_hash, geo_point, coordinate_system, radius, returns, self_pickup, create_by, create_time, update_by, update_time, version from pc_store |
| | | </sql> |
| | | |