Commit a13d9f1e by weijiguang

下单时校验订单中sku数量

parent fa61a757
......@@ -6,6 +6,7 @@ import com.soss.common.core.domain.AjaxResult;
import com.soss.common.core.page.TableDataInfo;
import com.soss.common.exception.ServiceException;
import com.soss.system.domain.SysBanner;
import com.soss.system.domain.po.BannerListPo;
import com.soss.system.domain.po.BannerPo;
import com.soss.system.domain.vo.BannerVo;
import com.soss.system.service.ISysBannerService;
......@@ -27,7 +28,7 @@ public class BannerController extends BaseController {
private ISysBannerService bannerService;
@PostMapping("/list")
public TableDataInfo list(@RequestBody SysBanner banner) {
public TableDataInfo list(@RequestBody BannerListPo banner) {
startPage();
List<SysBanner> list = bannerService.selectBanner(banner);
List<BannerVo> bannerVos = bannerService.copyBanner(list);
......
package com.soss.system.domain.po;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("轮播图查询参数类")
public class BannerListPo {
/**
* 类型:1-小程序,2-KDS,3-点单屏
*/
private Integer type;
/**
* 目标:1-小程序首页,2-小程序我的,0-其它
*/
private Integer target;
/**
* 状态
*/
private Integer state;
@ApiModelProperty("省份")
private String province;
@ApiModelProperty("城市")
private String city;
@ApiModelProperty("区域")
private String area;
@ApiModelProperty("店铺ID")
private Long shopId;
}
package com.soss.system.mapper;
import com.soss.system.domain.SysBanner;
import com.soss.system.domain.po.BannerListPo;
import org.apache.ibatis.annotations.Param;
import java.util.List;
......@@ -12,7 +13,7 @@ import java.util.List;
* @date 2022-04-28
*/
public interface SysBannerMapper {
List<SysBanner> selectBanner(SysBanner banner);
List<SysBanner> selectBanner(BannerListPo banner);
Long createBanner(SysBanner banner);
......
package com.soss.system.service;
import com.soss.system.domain.SysBanner;
import com.soss.system.domain.po.BannerListPo;
import com.soss.system.domain.po.BannerPo;
import com.soss.system.domain.vo.BannerVo;
......@@ -13,7 +14,7 @@ import java.util.List;
* @date 2022-04-28
*/
public interface ISysBannerService {
List<SysBanner> selectBanner(SysBanner banner);
List<SysBanner> selectBanner(BannerListPo banner);
Long createBanner(BannerPo banner);
......
......@@ -4,6 +4,7 @@ import com.soss.common.exception.ServiceException;
import com.soss.common.utils.StringUtils;
import com.soss.system.domain.Shop;
import com.soss.system.domain.SysBanner;
import com.soss.system.domain.po.BannerListPo;
import com.soss.system.domain.po.BannerPo;
import com.soss.system.domain.vo.BannerVo;
import com.soss.system.mapper.ShopMapper;
......@@ -39,7 +40,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
private AreaUtil areaUtil;
@Override
public List<SysBanner> selectBanner(SysBanner banner) {
public List<SysBanner> selectBanner(BannerListPo banner) {
return sysBannerMapper.selectBanner(banner);
}
......@@ -144,6 +145,7 @@ public class SysBannerServiceImpl implements ISysBannerService {
bannerVo.setType(banner.getType());
bannerVo.setTarget(banner.getTarget());
bannerVo.setSort(banner.getSort());
bannerVo.setState(banner.getState());
bannerVo.setProvinceStr(banner.getProvince());
bannerVo.setCityStr(banner.getCity());
bannerVo.setAreaStr(banner.getArea());
......
......@@ -19,7 +19,7 @@
<result property="updatedAt" column="updated_at"/>
</resultMap>
<select id="selectBanner" resultMap="BannerResult" parameterType="SysBanner">
<select id="selectBanner" resultMap="BannerResult" parameterType="BannerListPo">
select * from sys_banner
<where>
<if test="type != null ">type = #{type}</if>
......@@ -27,7 +27,7 @@
<if test="province != null and province != ''">and province like concat('%', #{province}, '%')</if>
<if test="city != null and city != ''">and city like concat('%', #{city}, '%')</if>
<if test="area != null and area != ''">and area like concat('%', #{area}, '%')</if>
<if test="shopIds != null and shopIds != ''">and shop_ids like concat('%', #{shopIds}, '%')</if>
<if test="shopId != null and shopId != ''">and shopId like concat('%', #{shopId}, '%')</if>
<if test="state != null ">and state = #{state}</if>
</where>
order by created_at desc
......
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