120 changed files with 1002 additions and 870 deletions
@ -0,0 +1,68 @@ |
|||
package cc.hiver.core.base; |
|||
|
|||
import cc.hiver.core.common.constant.CommonConstant; |
|||
import cc.hiver.core.common.utils.SnowFlakeUtil; |
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
import com.baomidou.mybatisplus.annotation.TableField; |
|||
import com.baomidou.mybatisplus.annotation.TableId; |
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.springframework.data.annotation.CreatedBy; |
|||
import org.springframework.data.annotation.CreatedDate; |
|||
import org.springframework.data.annotation.LastModifiedBy; |
|||
import org.springframework.data.annotation.LastModifiedDate; |
|||
import org.springframework.data.jpa.domain.support.AuditingEntityListener; |
|||
import org.springframework.format.annotation.DateTimeFormat; |
|||
|
|||
import javax.persistence.EntityListeners; |
|||
import javax.persistence.Id; |
|||
import javax.persistence.MappedSuperclass; |
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
@MappedSuperclass |
|||
@EntityListeners(AuditingEntityListener.class) |
|||
@JsonIgnoreProperties(value = {"hibernateLazyInitializer", "handler", "fieldHandler"}) |
|||
public abstract class HiverBaseMallEntity implements Serializable { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@Id |
|||
@TableId |
|||
@ApiModelProperty(value = "唯一标识") |
|||
private String id = SnowFlakeUtil.nextId().toString(); |
|||
|
|||
@ApiModelProperty("店铺id") |
|||
private String mallId; |
|||
|
|||
@ApiModelProperty("办公区域") |
|||
private String region; |
|||
|
|||
@ApiModelProperty(value = "创建者") |
|||
@CreatedBy |
|||
@TableField(fill = FieldFill.INSERT) |
|||
private String createBy; |
|||
|
|||
@CreatedDate |
|||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value = "创建时间") |
|||
private Date createTime; |
|||
|
|||
@ApiModelProperty(value = "更新者") |
|||
@LastModifiedBy |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private String updateBy; |
|||
|
|||
@LastModifiedDate |
|||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty(value = "更新时间") |
|||
@TableField(fill = FieldFill.UPDATE) |
|||
private Date updateTime; |
|||
|
|||
@ApiModelProperty(value = "删除标志 默认0") |
|||
private Integer delFlag = CommonConstant.STATUS_NORMAL; |
|||
} |
|||
@ -1,12 +1,12 @@ |
|||
package cc.hiver.shop.controller; |
|||
package cc.hiver.mall.controller; |
|||
|
|||
import cc.hiver.core.common.utils.PageUtil; |
|||
import cc.hiver.core.common.utils.ResultUtil; |
|||
import cc.hiver.core.common.vo.PageVo; |
|||
import cc.hiver.core.common.vo.Result; |
|||
import cc.hiver.shop.entity.CustomAddress; |
|||
import cc.hiver.shop.service.CustomAddressService; |
|||
import cc.hiver.shop.dto.CustomAddressQueryCriteria; |
|||
import cc.hiver.mall.entity.CustomAddress; |
|||
import cc.hiver.mall.service.CustomAddressService; |
|||
import cc.hiver.mall.pojo.query.CustomAddressQueryCriteria; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
@ -0,0 +1,20 @@ |
|||
package cc.hiver.mall.controller; |
|||
|
|||
import io.swagger.annotations.Api; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* 商品品牌控制器 |
|||
* |
|||
* @author Yazhi Li |
|||
*/ |
|||
@Slf4j |
|||
@RestController |
|||
@Api(tags = "商品品牌接口") |
|||
@RequestMapping(value = "/hiver/app/brand/") |
|||
@Transactional |
|||
public class GoodsBrandController { |
|||
} |
|||
@ -1,6 +1,6 @@ |
|||
package cc.hiver.shop.controller; |
|||
package cc.hiver.mall.controller; |
|||
|
|||
import cc.hiver.shop.service.GoodsService; |
|||
import cc.hiver.mall.service.GoodsService; |
|||
import io.swagger.annotations.Api; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
@ -1,11 +1,11 @@ |
|||
package cc.hiver.shop.controller; |
|||
package cc.hiver.mall.controller; |
|||
|
|||
import cc.hiver.core.common.utils.ResultUtil; |
|||
import cc.hiver.core.common.vo.Result; |
|||
import cc.hiver.shop.entity.GoodsInStock; |
|||
import cc.hiver.shop.entity.GoodsStock; |
|||
import cc.hiver.shop.service.GoodsInStockService; |
|||
import cc.hiver.shop.service.GoodsStockService; |
|||
import cc.hiver.mall.entity.GoodsInStock; |
|||
import cc.hiver.mall.entity.GoodsStock; |
|||
import cc.hiver.mall.service.GoodsInStockService; |
|||
import cc.hiver.mall.service.GoodsStockService; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
@ -1,12 +1,12 @@ |
|||
package cc.hiver.shop.controller; |
|||
package cc.hiver.mall.controller; |
|||
|
|||
import cc.hiver.core.common.utils.ResultUtil; |
|||
import cc.hiver.core.common.vo.Result; |
|||
import cc.hiver.shop.entity.Mall; |
|||
import cc.hiver.shop.entity.UserMall; |
|||
import cc.hiver.shop.service.MallService; |
|||
import cc.hiver.shop.service.UserMallService; |
|||
import cc.hiver.shop.service.mybatis.IMallService; |
|||
import cc.hiver.mall.entity.Mall; |
|||
import cc.hiver.mall.entity.UserMall; |
|||
import cc.hiver.mall.service.MallService; |
|||
import cc.hiver.mall.service.UserMallService; |
|||
import cc.hiver.mall.service.mybatis.IMallService; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
@ -1,6 +1,6 @@ |
|||
package cc.hiver.shop.controller; |
|||
package cc.hiver.mall.controller; |
|||
|
|||
import cc.hiver.shop.service.RoleSettingService; |
|||
import cc.hiver.mall.service.RoleSettingService; |
|||
import io.swagger.annotations.Api; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.controller; |
|||
package cc.hiver.mall.controller; |
|||
|
|||
import cc.hiver.core.common.utils.ResultUtil; |
|||
import cc.hiver.core.common.vo.Result; |
|||
import cc.hiver.shop.entity.UserClockIn; |
|||
import cc.hiver.shop.service.UserClockInService; |
|||
import cc.hiver.mall.entity.UserClockIn; |
|||
import cc.hiver.mall.service.UserClockInService; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.CustomAddress; |
|||
import cc.hiver.mall.entity.CustomAddress; |
|||
|
|||
public interface CustomAddressDao extends HiverBaseDao<CustomAddress, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.entity.GoodsAttribute; |
|||
|
|||
public interface GoodsAttributeDao extends HiverBaseDao<GoodsAttribute, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.entity.GoodsBrand; |
|||
|
|||
public interface GoodsBrandDao extends HiverBaseDao<GoodsBrand, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.entity.GoodsCategoryAttribute; |
|||
|
|||
public interface GoodsCategoryAttributeDao extends HiverBaseDao<GoodsCategoryAttribute, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.entity.GoodsCategoryBrand; |
|||
|
|||
public interface GoodsCategoryBrandDao extends HiverBaseDao<GoodsCategoryBrand, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.GoodsCategory; |
|||
import cc.hiver.mall.entity.GoodsCategory; |
|||
|
|||
import java.util.List; |
|||
|
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.Goods; |
|||
import cc.hiver.mall.entity.Goods; |
|||
|
|||
public interface GoodsDao extends HiverBaseDao<Goods, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.GoodsInStock; |
|||
import cc.hiver.mall.entity.GoodsInStock; |
|||
|
|||
public interface GoodsInStockDao extends HiverBaseDao<GoodsInStock, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.GoodsStock; |
|||
import cc.hiver.mall.entity.GoodsStock; |
|||
|
|||
public interface GoodsStockDao extends HiverBaseDao<GoodsStock, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.Mall; |
|||
import cc.hiver.mall.entity.Mall; |
|||
|
|||
public interface MallDao extends HiverBaseDao<Mall, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.PopularUrl; |
|||
import cc.hiver.mall.entity.PopularUrl; |
|||
|
|||
public interface PopularUrlDao extends HiverBaseDao<PopularUrl, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.PopularUrlGoods; |
|||
import cc.hiver.mall.entity.PopularUrlGoods; |
|||
|
|||
import java.util.List; |
|||
|
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.RoleSetting; |
|||
import cc.hiver.mall.entity.RoleSetting; |
|||
|
|||
public interface RoleSettingDao extends HiverBaseDao<RoleSetting, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.entity.SalesOrder; |
|||
|
|||
public interface SalesOrderDao extends HiverBaseDao<SalesOrder, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.entity.SalesOrderItem; |
|||
|
|||
public interface SalesOrderItemDao extends HiverBaseDao<SalesOrderItem, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.UserClockIn; |
|||
import cc.hiver.mall.entity.UserClockIn; |
|||
|
|||
public interface UserClockInDao extends HiverBaseDao<UserClockIn, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.dao; |
|||
package cc.hiver.mall.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.UserMall; |
|||
import cc.hiver.mall.entity.UserMall; |
|||
|
|||
public interface UserMallDao extends HiverBaseDao<UserMall, String> { |
|||
void deleteAllByMallId(String mallId); |
|||
@ -0,0 +1,16 @@ |
|||
package cc.hiver.mall.dao.mapper; |
|||
|
|||
import cc.hiver.mall.entity.Address; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Mapper |
|||
public interface AddressMapper extends BaseMapper<Address> { |
|||
@Select("<script>" + |
|||
" SELECT m.* from t_address m where m.member_id =#{memberId} " + |
|||
"</script>") |
|||
List<Address> listByMemberId(String memberId); |
|||
} |
|||
@ -1,6 +1,6 @@ |
|||
package cc.hiver.shop.dao.mapper; |
|||
package cc.hiver.mall.dao.mapper; |
|||
|
|||
import cc.hiver.shop.entity.Mall; |
|||
import cc.hiver.mall.entity.Mall; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
@ -0,0 +1,41 @@ |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseMallEntity; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.annotations.DynamicInsert; |
|||
import org.hibernate.annotations.DynamicUpdate; |
|||
|
|||
import javax.persistence.Entity; |
|||
import javax.persistence.Table; |
|||
|
|||
@Data |
|||
@Entity |
|||
@DynamicInsert |
|||
@DynamicUpdate |
|||
@Table(name = "t_goods_attribute") |
|||
@TableName("t_goods_attribute") |
|||
@ApiModel(value = "商品属性/规格表") |
|||
public class GoodsAttribute extends HiverBaseMallEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty(value = "商品ID") |
|||
private String goodsId; |
|||
|
|||
@ApiModelProperty(value = "属性ID") |
|||
private String attributeId; |
|||
|
|||
@ApiModelProperty(value = "属性名称") |
|||
private String name; |
|||
|
|||
@ApiModelProperty(value = "属性值") |
|||
private String value; |
|||
|
|||
@ApiModelProperty(value = "类型(1:规格;2:属性;)") |
|||
private Integer type; |
|||
|
|||
@ApiModelProperty(value = "规格图片") |
|||
private String picUrl; |
|||
} |
|||
@ -0,0 +1,32 @@ |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseMallEntity; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.annotations.DynamicInsert; |
|||
import org.hibernate.annotations.DynamicUpdate; |
|||
|
|||
import javax.persistence.Entity; |
|||
import javax.persistence.Table; |
|||
|
|||
@Data |
|||
@Entity |
|||
@DynamicInsert |
|||
@DynamicUpdate |
|||
@Table(name = "t_goods_category_attribute") |
|||
@TableName("t_goods_category_attribute") |
|||
@ApiModel(value = "商品属性表") |
|||
public class GoodsCategoryAttribute extends HiverBaseMallEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty(value = "分类ID") |
|||
private String categoryId; |
|||
|
|||
@ApiModelProperty(value = "属性名称") |
|||
private String name; |
|||
|
|||
@ApiModelProperty(value = "类型(1:规格;2:属性;)") |
|||
private Integer type; |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseMallEntity; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.annotations.DynamicInsert; |
|||
import org.hibernate.annotations.DynamicUpdate; |
|||
|
|||
import javax.persistence.Entity; |
|||
import javax.persistence.Table; |
|||
|
|||
@Data |
|||
@Entity |
|||
@DynamicInsert |
|||
@DynamicUpdate |
|||
@Table(name = "t_goods_category_brand") |
|||
@TableName("t_goods_category_brand") |
|||
@ApiModel(value = "商品品牌表") |
|||
public class GoodsCategoryBrand extends HiverBaseMallEntity { |
|||
@ApiModelProperty(value = "分类ID") |
|||
private String categoryId; |
|||
|
|||
@ApiModelProperty(value = "品牌ID") |
|||
private String brandId; |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
package cc.hiver.shop.entity; |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
@ -1,4 +1,4 @@ |
|||
package cc.hiver.shop.entity; |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
@ -0,0 +1,56 @@ |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseEntity; |
|||
import cc.hiver.core.common.constant.MallConstant; |
|||
import cc.hiver.core.common.utils.SnowFlakeUtil; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.annotations.DynamicInsert; |
|||
import org.hibernate.annotations.DynamicUpdate; |
|||
|
|||
import javax.persistence.Entity; |
|||
import javax.persistence.Table; |
|||
import java.math.BigDecimal; |
|||
|
|||
@Data |
|||
@Entity |
|||
@DynamicInsert |
|||
@DynamicUpdate |
|||
@Table(name = "t_sales_order") |
|||
@TableName("t_sales_order") |
|||
@ApiModel(value = "销售单主表") |
|||
public class SalesOrder extends HiverBaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty(value = "销售单号") |
|||
private String sn = "SN" + SnowFlakeUtil.nextId().toString(); |
|||
|
|||
@ApiModelProperty(value = "用户ID") |
|||
private String userId; |
|||
|
|||
@ApiModelProperty(value = "收货人姓名") |
|||
private String consigneeName; |
|||
|
|||
@ApiModelProperty(value = "收货人联系方式") |
|||
private String consigneeMobile; |
|||
|
|||
@ApiModelProperty(value = "收货人公司") |
|||
private String consigneeCompany; |
|||
|
|||
@ApiModelProperty(value = "收货人所属区域") |
|||
private String consigneeArea; |
|||
|
|||
@ApiModelProperty(value = "详细地址") |
|||
private String address; |
|||
|
|||
@ApiModelProperty(value = "邮编") |
|||
private String zipCode; |
|||
|
|||
@ApiModelProperty(value = "是否启用 0处理中 1已保存") |
|||
private Integer status = MallConstant.SALES_ORDER_PROCESS; |
|||
|
|||
@ApiModelProperty(value = "订单总额") |
|||
private BigDecimal totalAmount = new BigDecimal(0); |
|||
} |
|||
@ -0,0 +1,51 @@ |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import org.hibernate.annotations.DynamicInsert; |
|||
import org.hibernate.annotations.DynamicUpdate; |
|||
|
|||
import javax.persistence.Entity; |
|||
import javax.persistence.Table; |
|||
import java.math.BigDecimal; |
|||
|
|||
@Data |
|||
@Entity |
|||
@DynamicInsert |
|||
@DynamicUpdate |
|||
@Table(name = "t_sales_order_item") |
|||
@TableName("t_sales_order_item") |
|||
@ApiModel(value = "销售单详细表") |
|||
public class SalesOrderItem extends HiverBaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
@ApiModelProperty(value = "销售单主表id") |
|||
private String salesOrderId; |
|||
|
|||
@ApiModelProperty(value = "商品编号") |
|||
private String sn; |
|||
|
|||
@ApiModelProperty(value = "商品名称") |
|||
private String name; |
|||
|
|||
@ApiModelProperty(value = "商品ID") |
|||
private String goodsId; |
|||
|
|||
@ApiModelProperty(value = "商品规格值,以英文逗号(,)分割") |
|||
private String specIds; |
|||
|
|||
@ApiModelProperty(value = "商品图片") |
|||
private String picUrl; |
|||
|
|||
@ApiModelProperty(value = "商品单价") |
|||
private BigDecimal price = new BigDecimal(0); |
|||
|
|||
@ApiModelProperty(value = "商品数量") |
|||
private Integer count = 0; |
|||
|
|||
@ApiModelProperty(value = "商品总价") |
|||
private BigDecimal totalAmount = new BigDecimal(0); |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
package cc.hiver.shop.entity; |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.common.utils.SnowFlakeUtil; |
|||
import com.baomidou.mybatisplus.annotation.FieldFill; |
|||
@ -1,4 +1,4 @@ |
|||
package cc.hiver.shop.entity; |
|||
package cc.hiver.mall.entity; |
|||
|
|||
import cc.hiver.core.base.HiverBaseEntity; |
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
@ -0,0 +1,38 @@ |
|||
package cc.hiver.mall.pojo.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.NotEmpty; |
|||
import javax.validation.constraints.NotNull; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@ApiModel("属性表单") |
|||
public class CategoryAttributeDto { |
|||
@ApiModelProperty("分类ID") |
|||
@NotNull |
|||
private Long categoryId; |
|||
|
|||
|
|||
@ApiModelProperty("属性类型(1:规格;2:属性)") |
|||
@NotNull |
|||
private Integer type; |
|||
|
|||
@ApiModelProperty("属性集合") |
|||
@NotEmpty |
|||
private List<Attribute> attributes; |
|||
|
|||
@Data |
|||
public static class Attribute { |
|||
|
|||
@ApiModelProperty("属性ID") |
|||
private Long id; |
|||
|
|||
@ApiModelProperty("属性名称") |
|||
@NotBlank |
|||
private String name; |
|||
} |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package cc.hiver.mall.pojo.dto; |
|||
|
|||
import cc.hiver.mall.entity.PopularUrl; |
|||
import cc.hiver.mall.entity.PopularUrlGoods; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@Accessors(chain = true) |
|||
public class PopularUrlDto { |
|||
@ApiModelProperty(value = "热销链接主表") |
|||
private PopularUrl url; |
|||
|
|||
@ApiModelProperty(value = "热销商品列表") |
|||
private List<PopularUrlGoods> goodsList; |
|||
} |
|||
@ -0,0 +1,19 @@ |
|||
package cc.hiver.mall.pojo.dto; |
|||
|
|||
import cc.hiver.mall.entity.SalesOrder; |
|||
import cc.hiver.mall.entity.SalesOrderItem; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
import lombok.experimental.Accessors; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@Accessors(chain = true) |
|||
public class SalesOrderDto { |
|||
@ApiModelProperty("销售单主表") |
|||
private SalesOrder order; |
|||
|
|||
@ApiModelProperty(value = "销售单列表") |
|||
private List<SalesOrderItem> orderItems; |
|||
} |
|||
@ -1,4 +1,4 @@ |
|||
package cc.hiver.shop.dto; |
|||
package cc.hiver.mall.pojo.query; |
|||
|
|||
import cc.hiver.core.common.annotation.Query; |
|||
import lombok.Data; |
|||
@ -1,8 +1,8 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.CustomAddress; |
|||
import cc.hiver.shop.dto.CustomAddressQueryCriteria; |
|||
import cc.hiver.mall.entity.CustomAddress; |
|||
import cc.hiver.mall.pojo.query.CustomAddressQueryCriteria; |
|||
import org.springframework.data.domain.Page; |
|||
import org.springframework.data.domain.Pageable; |
|||
|
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.mall.entity.GoodsAttribute; |
|||
|
|||
public interface GoodsAttributeService extends HiverBaseService<GoodsAttribute, String> { |
|||
} |
|||
@ -0,0 +1,12 @@ |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.mall.entity.GoodsBrand; |
|||
|
|||
/** |
|||
* 商品品牌服务接口 |
|||
* |
|||
* @author Yazhi Li |
|||
*/ |
|||
public interface GoodsBrandService extends HiverBaseService<GoodsBrand, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.mall.entity.GoodsCategoryAttribute; |
|||
|
|||
public interface GoodsCategoryAttributeService extends HiverBaseService<GoodsCategoryAttribute, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.mall.entity.GoodsCategoryBrand; |
|||
|
|||
public interface GoodsCategoryBrandService extends HiverBaseService<GoodsCategoryBrand, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.GoodsCategory; |
|||
import cc.hiver.mall.entity.GoodsCategory; |
|||
|
|||
import java.util.List; |
|||
|
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.GoodsInStock; |
|||
import cc.hiver.mall.entity.GoodsInStock; |
|||
|
|||
public interface GoodsInStockService extends HiverBaseService<GoodsInStock, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.Goods; |
|||
import cc.hiver.mall.entity.Goods; |
|||
|
|||
public interface GoodsService extends HiverBaseService<Goods, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.GoodsStock; |
|||
import cc.hiver.mall.entity.GoodsStock; |
|||
|
|||
public interface GoodsStockService extends HiverBaseService<GoodsStock, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.Mall; |
|||
import cc.hiver.mall.entity.Mall; |
|||
|
|||
public interface MallService extends HiverBaseService<Mall, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.PopularUrlGoods; |
|||
import cc.hiver.mall.entity.PopularUrlGoods; |
|||
|
|||
import java.util.List; |
|||
|
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.PopularUrl; |
|||
import cc.hiver.mall.entity.PopularUrl; |
|||
|
|||
public interface PopularUrlService extends HiverBaseService<PopularUrl, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.RoleSetting; |
|||
import cc.hiver.mall.entity.RoleSetting; |
|||
|
|||
public interface RoleSettingService extends HiverBaseService<RoleSetting, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.mall.entity.SalesOrderItem; |
|||
|
|||
public interface SalesOrderItemService extends HiverBaseService<SalesOrderItem, String> { |
|||
} |
|||
@ -0,0 +1,7 @@ |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.mall.entity.SalesOrder; |
|||
|
|||
public interface SalesOrderService extends HiverBaseService<SalesOrder, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.UserClockIn; |
|||
import cc.hiver.mall.entity.UserClockIn; |
|||
|
|||
public interface UserClockInService extends HiverBaseService<UserClockIn, String> { |
|||
} |
|||
@ -1,7 +1,7 @@ |
|||
package cc.hiver.shop.service; |
|||
package cc.hiver.mall.service; |
|||
|
|||
import cc.hiver.core.base.HiverBaseService; |
|||
import cc.hiver.shop.entity.UserMall; |
|||
import cc.hiver.mall.entity.UserMall; |
|||
|
|||
public interface UserMallService extends HiverBaseService<UserMall, String> { |
|||
void deleteAllByMallId(String mallId); |
|||
@ -0,0 +1,31 @@ |
|||
package cc.hiver.mall.service.mybatis; |
|||
|
|||
import cc.hiver.mall.entity.Address; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface IAddressService extends IService<Address> { |
|||
/** |
|||
* 新增地址 |
|||
* |
|||
* @param entity |
|||
* @return |
|||
*/ |
|||
boolean addAddress(Address entity); |
|||
|
|||
/** |
|||
* 修改地址 |
|||
* |
|||
* @param entity |
|||
* @return |
|||
*/ |
|||
boolean updateAddress(Address entity); |
|||
|
|||
/** |
|||
* 获取当前登录会员的地址列表 |
|||
* |
|||
* @return |
|||
*/ |
|||
List<Address> listCurrentMemberAddresses(String memberId); |
|||
} |
|||
@ -1,6 +1,6 @@ |
|||
package cc.hiver.shop.service.mybatis; |
|||
package cc.hiver.mall.service.mybatis; |
|||
|
|||
import cc.hiver.shop.entity.Mall; |
|||
import cc.hiver.mall.entity.Mall; |
|||
import com.baomidou.mybatisplus.extension.service.IService; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
@ -1,11 +1,11 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.core.common.utils.QueryHelp; |
|||
import cc.hiver.shop.dao.CustomAddressDao; |
|||
import cc.hiver.shop.entity.CustomAddress; |
|||
import cc.hiver.shop.service.CustomAddressService; |
|||
import cc.hiver.shop.dto.CustomAddressQueryCriteria; |
|||
import cc.hiver.mall.dao.CustomAddressDao; |
|||
import cc.hiver.mall.entity.CustomAddress; |
|||
import cc.hiver.mall.service.CustomAddressService; |
|||
import cc.hiver.mall.pojo.query.CustomAddressQueryCriteria; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.data.domain.Page; |
|||
@ -0,0 +1,23 @@ |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.dao.GoodsAttributeDao; |
|||
import cc.hiver.mall.entity.GoodsAttribute; |
|||
import cc.hiver.mall.service.GoodsAttributeService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@Transactional |
|||
public class GoodsAttributeServiceImpl implements GoodsAttributeService { |
|||
@Autowired |
|||
private GoodsAttributeDao goodsAttributeDao; |
|||
|
|||
@Override |
|||
public HiverBaseDao<GoodsAttribute, String> getRepository() { |
|||
return goodsAttributeDao; |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.dao.GoodsBrandDao; |
|||
import cc.hiver.mall.entity.GoodsBrand; |
|||
import cc.hiver.mall.service.GoodsBrandService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@Transactional |
|||
public class GoodsBrandServiceImpl implements GoodsBrandService { |
|||
@Autowired |
|||
private GoodsBrandDao goodsBrandDao; |
|||
|
|||
@Override |
|||
public HiverBaseDao<GoodsBrand, String> getRepository() { |
|||
return goodsBrandDao; |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.dao.GoodsCategoryAttributeDao; |
|||
import cc.hiver.mall.entity.GoodsCategoryAttribute; |
|||
import cc.hiver.mall.service.GoodsCategoryAttributeService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@Transactional |
|||
public class GoodsCategoryAttributeServiceImpl implements GoodsCategoryAttributeService { |
|||
@Autowired |
|||
private GoodsCategoryAttributeDao goodsCategoryAttributeDao; |
|||
|
|||
@Override |
|||
public HiverBaseDao<GoodsCategoryAttribute, String> getRepository() { |
|||
return goodsCategoryAttributeDao; |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.dao.GoodsCategoryBrandDao; |
|||
import cc.hiver.mall.entity.GoodsCategoryBrand; |
|||
import cc.hiver.mall.service.GoodsCategoryBrandService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@Transactional |
|||
public class GoodsCategoryBrandServiceImpl implements GoodsCategoryBrandService { |
|||
@Autowired |
|||
private GoodsCategoryBrandDao goodsCategoryBrandDao; |
|||
|
|||
@Override |
|||
public HiverBaseDao<GoodsCategoryBrand, String> getRepository() { |
|||
return goodsCategoryBrandDao; |
|||
} |
|||
} |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.GoodsCategoryDao; |
|||
import cc.hiver.shop.entity.GoodsCategory; |
|||
import cc.hiver.shop.service.GoodsCategoryService; |
|||
import cc.hiver.mall.dao.GoodsCategoryDao; |
|||
import cc.hiver.mall.entity.GoodsCategory; |
|||
import cc.hiver.mall.service.GoodsCategoryService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.GoodsInStockDao; |
|||
import cc.hiver.shop.entity.GoodsInStock; |
|||
import cc.hiver.shop.service.GoodsInStockService; |
|||
import cc.hiver.mall.dao.GoodsInStockDao; |
|||
import cc.hiver.mall.entity.GoodsInStock; |
|||
import cc.hiver.mall.service.GoodsInStockService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.GoodsDao; |
|||
import cc.hiver.shop.entity.Goods; |
|||
import cc.hiver.shop.service.GoodsService; |
|||
import cc.hiver.mall.dao.GoodsDao; |
|||
import cc.hiver.mall.entity.Goods; |
|||
import cc.hiver.mall.service.GoodsService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.GoodsStockDao; |
|||
import cc.hiver.shop.entity.GoodsStock; |
|||
import cc.hiver.shop.service.GoodsStockService; |
|||
import cc.hiver.mall.dao.GoodsStockDao; |
|||
import cc.hiver.mall.entity.GoodsStock; |
|||
import cc.hiver.mall.service.GoodsStockService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.MallDao; |
|||
import cc.hiver.shop.entity.Mall; |
|||
import cc.hiver.shop.service.MallService; |
|||
import cc.hiver.mall.dao.MallDao; |
|||
import cc.hiver.mall.entity.Mall; |
|||
import cc.hiver.mall.service.MallService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.PopularUrlGoodsDao; |
|||
import cc.hiver.shop.entity.PopularUrlGoods; |
|||
import cc.hiver.shop.service.PopularUrlGoodsService; |
|||
import cc.hiver.mall.dao.PopularUrlGoodsDao; |
|||
import cc.hiver.mall.entity.PopularUrlGoods; |
|||
import cc.hiver.mall.service.PopularUrlGoodsService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.PopularUrlDao; |
|||
import cc.hiver.shop.entity.PopularUrl; |
|||
import cc.hiver.shop.service.PopularUrlService; |
|||
import cc.hiver.mall.dao.PopularUrlDao; |
|||
import cc.hiver.mall.entity.PopularUrl; |
|||
import cc.hiver.mall.service.PopularUrlService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.RoleSettingDao; |
|||
import cc.hiver.shop.entity.RoleSetting; |
|||
import cc.hiver.shop.service.RoleSettingService; |
|||
import cc.hiver.mall.dao.RoleSettingDao; |
|||
import cc.hiver.mall.entity.RoleSetting; |
|||
import cc.hiver.mall.service.RoleSettingService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -0,0 +1,23 @@ |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.dao.SalesOrderItemDao; |
|||
import cc.hiver.mall.entity.SalesOrderItem; |
|||
import cc.hiver.mall.service.SalesOrderItemService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@Transactional |
|||
public class SalesOrderItemServiceImpl implements SalesOrderItemService { |
|||
@Autowired |
|||
private SalesOrderItemDao salesOrderItemDao; |
|||
|
|||
@Override |
|||
public HiverBaseDao<SalesOrderItem, String> getRepository() { |
|||
return salesOrderItemDao; |
|||
} |
|||
} |
|||
@ -0,0 +1,23 @@ |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.mall.dao.SalesOrderDao; |
|||
import cc.hiver.mall.entity.SalesOrder; |
|||
import cc.hiver.mall.service.SalesOrderService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
@Slf4j |
|||
@Service |
|||
@Transactional |
|||
public class SalesOrderServiceImpl implements SalesOrderService { |
|||
@Autowired |
|||
private SalesOrderDao salesOrderDao; |
|||
|
|||
@Override |
|||
public HiverBaseDao<SalesOrder, String> getRepository() { |
|||
return salesOrderDao; |
|||
} |
|||
} |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.UserClockInDao; |
|||
import cc.hiver.shop.entity.UserClockIn; |
|||
import cc.hiver.shop.service.UserClockInService; |
|||
import cc.hiver.mall.dao.UserClockInDao; |
|||
import cc.hiver.mall.entity.UserClockIn; |
|||
import cc.hiver.mall.service.UserClockInService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,9 +1,9 @@ |
|||
package cc.hiver.shop.serviceimpl; |
|||
package cc.hiver.mall.serviceimpl; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.dao.UserMallDao; |
|||
import cc.hiver.shop.entity.UserMall; |
|||
import cc.hiver.shop.service.UserMallService; |
|||
import cc.hiver.mall.dao.UserMallDao; |
|||
import cc.hiver.mall.entity.UserMall; |
|||
import cc.hiver.mall.service.UserMallService; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -0,0 +1,63 @@ |
|||
package cc.hiver.mall.serviceimpl.mybatis; |
|||
|
|||
import cc.hiver.core.common.constant.CommonConstant; |
|||
import cc.hiver.mall.dao.mapper.AddressMapper; |
|||
import cc.hiver.mall.entity.Address; |
|||
import cc.hiver.mall.service.mybatis.IAddressService; |
|||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|||
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.ArrayList; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import java.util.stream.Collectors; |
|||
|
|||
@Service |
|||
public class IAddressServiceImpl extends ServiceImpl<AddressMapper, Address> implements IAddressService { |
|||
@Override |
|||
@Transactional |
|||
public boolean addAddress(Address entity) { |
|||
boolean result = this.save(entity); |
|||
if (result) { |
|||
if (CommonConstant.STATUS_YES.equals(entity.getDefaulted())) { |
|||
this.update(new LambdaUpdateWrapper<Address>() |
|||
.eq(Address::getMemberId, entity.getMemberId()) |
|||
.eq(Address::getDefaulted, 1) |
|||
.ne(Address::getId, entity.getId()) |
|||
.set(Address::getDefaulted, 0)); |
|||
} |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public boolean updateAddress(Address entity) { |
|||
boolean result = this.updateById(entity); |
|||
if (result) { |
|||
// 修改其他默认地址为非默认
|
|||
if (CommonConstant.STATUS_YES.equals(entity.getDefaulted())) { |
|||
this.update(new LambdaUpdateWrapper<Address>() |
|||
.eq(Address::getMemberId, entity.getMemberId()) |
|||
.eq(Address::getDefaulted, 1) |
|||
.ne(Address::getId, entity.getId()) |
|||
.set(Address::getDefaulted, 0) |
|||
); |
|||
} |
|||
} |
|||
return result; |
|||
} |
|||
|
|||
@Override |
|||
public List<Address> listCurrentMemberAddresses(String memberId) { |
|||
List<Address> umsAddressList = this.list(new LambdaQueryWrapper<Address>() |
|||
.eq(Address::getMemberId, memberId) |
|||
.orderByDesc(Address::getDefaulted) // 默认地址排在首位
|
|||
); |
|||
List<Address> memberAddressList = Optional.ofNullable(umsAddressList).orElse(new ArrayList<>()).stream() |
|||
.collect(Collectors.toList()); |
|||
return memberAddressList; |
|||
} |
|||
} |
|||
@ -1,8 +1,8 @@ |
|||
package cc.hiver.shop.serviceimpl.mybatis; |
|||
package cc.hiver.mall.serviceimpl.mybatis; |
|||
|
|||
import cc.hiver.shop.dao.mapper.MallMapper; |
|||
import cc.hiver.shop.entity.Mall; |
|||
import cc.hiver.shop.service.mybatis.IMallService; |
|||
import cc.hiver.mall.dao.mapper.MallMapper; |
|||
import cc.hiver.mall.entity.Mall; |
|||
import cc.hiver.mall.service.mybatis.IMallService; |
|||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
@ -1,7 +1,7 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="cc.hiver.shop.dao.mapper.MallMapper"> |
|||
<select id="findByUserId" resultType="cc.hiver.shop.entity.Mall"> |
|||
<mapper namespace="cc.hiver.mall.dao.mapper.MallMapper"> |
|||
<select id="findByUserId" resultType="cc.hiver.mall.entity.Mall"> |
|||
SELECT DISTINCT m.* |
|||
FROM t_mall m |
|||
LEFT JOIN t_user_mall um ON m.id = um.mall_id |
|||
@ -1,89 +0,0 @@ |
|||
package cc.hiver.shop.controller; |
|||
|
|||
import cc.hiver.core.common.utils.ResultUtil; |
|||
import cc.hiver.core.common.vo.Result; |
|||
import cc.hiver.shop.entity.GoodsAttributeKey; |
|||
import cc.hiver.shop.entity.GoodsAttributeValue; |
|||
import cc.hiver.shop.entity.Mall; |
|||
import cc.hiver.shop.service.GoodsAttributeKeyService; |
|||
import cc.hiver.shop.service.GoodsAttributeValueService; |
|||
import cc.hiver.shop.service.MallService; |
|||
import cc.hiver.shop.dto.GoodsAttributeDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RequestParam; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Slf4j |
|||
@RestController |
|||
@Api(tags = "商品规格接口") |
|||
@RequestMapping(value = "/hiver/app/goodsAttribute/") |
|||
@Transactional |
|||
public class GoodsAttributeController { |
|||
@Autowired |
|||
private GoodsAttributeKeyService goodsAttributeKeyService; |
|||
|
|||
@Autowired |
|||
private GoodsAttributeValueService goodsAttributeValueService; |
|||
|
|||
@Autowired |
|||
private MallService mallService; |
|||
|
|||
@RequestMapping(value = "/save", method = RequestMethod.POST) |
|||
@ApiOperation(value = "保存数据") |
|||
public Result save(GoodsAttributeDto entity) { |
|||
GoodsAttributeKey attributeKey = new GoodsAttributeKey(); |
|||
attributeKey.setMallId(entity.getMallId()); |
|||
attributeKey.setCategoryId(entity.getCategoryId()); |
|||
attributeKey.setAttributeKey(entity.getAttributeKey()); |
|||
Mall mall = mallService.findById(entity.getMallId()); |
|||
if(mall == null) { |
|||
return ResultUtil.error("商铺不存在"); |
|||
} |
|||
attributeKey.setRegion(mall.getRegion()); |
|||
GoodsAttributeKey goodsAttributeKey = goodsAttributeKeyService.save(attributeKey); |
|||
for(String value : entity.getAttributeValues()) { |
|||
GoodsAttributeValue goodsAttributeValue = new GoodsAttributeValue(); |
|||
goodsAttributeValue.setAttributeId(goodsAttributeKey.getId()); |
|||
goodsAttributeValue.setAttributeValue(value); |
|||
goodsAttributeValueService.save(goodsAttributeValue); |
|||
} |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
@RequestMapping(value = "/edit", method = RequestMethod.POST) |
|||
@ApiOperation(value = "更新数据") |
|||
public Result edit(GoodsAttributeDto entity) { |
|||
GoodsAttributeKey goodsAttributeKey = goodsAttributeKeyService.findById(entity.getId()); |
|||
goodsAttributeKey.setAttributeKey(entity.getAttributeKey()); |
|||
List<GoodsAttributeValue> values = goodsAttributeValueService.findAllByAttributeId(entity.getId()); |
|||
goodsAttributeValueService.delete(values); |
|||
for(String v : entity.getAttributeValues()) { |
|||
GoodsAttributeValue goodsAttributeValue = new GoodsAttributeValue(); |
|||
goodsAttributeValue.setAttributeId(entity.getId()); |
|||
goodsAttributeValue.setAttributeValue(v); |
|||
goodsAttributeValueService.save(goodsAttributeValue); |
|||
} |
|||
return ResultUtil.success(); |
|||
} |
|||
|
|||
@RequestMapping(value = "/delByIds", method = RequestMethod.POST) |
|||
@ApiOperation(value = "批量通过ids删除") |
|||
public Result delByIds(@RequestParam String[] ids) { |
|||
for (String id : ids) { |
|||
List<GoodsAttributeValue> values = goodsAttributeValueService.getAll(); |
|||
for(GoodsAttributeValue value : values) { |
|||
goodsAttributeValueService.delete(value); |
|||
} |
|||
goodsAttributeKeyService.delete(id); |
|||
} |
|||
return ResultUtil.success("批量通过id删除数据成功"); |
|||
} |
|||
} |
|||
@ -1,38 +0,0 @@ |
|||
package cc.hiver.shop.controller; |
|||
|
|||
import cc.hiver.core.common.utils.ResultUtil; |
|||
import cc.hiver.core.common.vo.Result; |
|||
import cc.hiver.shop.entity.ShoppingCart; |
|||
import cc.hiver.shop.service.ShoppingCartGoodsService; |
|||
import cc.hiver.shop.service.ShoppingCartService; |
|||
import cc.hiver.shop.dto.SalesSlipDto; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RequestMethod; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
@Slf4j |
|||
@RestController |
|||
@Api(tags = "购物车接口") |
|||
@RequestMapping(value = "/hiver/app/shoppingCart/") |
|||
@Transactional |
|||
public class ShoppingCartController { |
|||
@Autowired |
|||
private ShoppingCartService shoppingCartService; |
|||
|
|||
@Autowired |
|||
private ShoppingCartGoodsService shoppingCartGoodsService; |
|||
|
|||
@RequestMapping(value = "/create", method = RequestMethod.POST) |
|||
@ApiOperation(value = "创建销售单") |
|||
public Result<SalesSlipDto> create(ShoppingCart entity) { |
|||
ShoppingCart shoppingCart = shoppingCartService.save(entity); |
|||
SalesSlipDto salesSlip = new SalesSlipDto(); |
|||
salesSlip.setShoppingCart(shoppingCart); |
|||
return new ResultUtil<SalesSlipDto>().setData(salesSlip); |
|||
} |
|||
} |
|||
@ -1,10 +0,0 @@ |
|||
package cc.hiver.shop.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.Address; |
|||
|
|||
import java.util.List; |
|||
|
|||
public interface AddressDao extends HiverBaseDao<Address, String> { |
|||
List<Address> findAllByMemberId(String memberId); |
|||
} |
|||
@ -1,7 +0,0 @@ |
|||
package cc.hiver.shop.dao; |
|||
|
|||
import cc.hiver.core.base.HiverBaseDao; |
|||
import cc.hiver.shop.entity.GoodsAttributeKey; |
|||
|
|||
public interface GoodsAttributeKeyDao extends HiverBaseDao<GoodsAttributeKey, String> { |
|||
} |
|||
Some files were not shown because too many files changed in this diff
Loading…
Reference in new issue