61e3917c5b0d667d23430890f45396a9bb7731ac..ebc62375d25878033dcc109640cebc2f68e36cbe
16 小时以前 peng
店铺优惠卷调整
ebc623 对比 | 目录
18 小时以前 zxl
店铺绑优惠劵
9e134e 对比 | 目录
8个文件已修改
88 ■■■■■ 已修改文件
framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreCouponSingleQuery.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/mapper/StoreCouponSingleMapper.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/StoreCouponService.java 14 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/StoreCouponSingleService.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponServiceImpl.java 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponSingleServiceImpl.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/resources/mapper/lmk/StoreCouponSingleMapper.xml 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
manager-api/src/main/java/cn/lili/controller/lmk/StoreCouponController.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
framework/src/main/java/cn/lili/modules/lmk/domain/query/StoreCouponSingleQuery.java
@@ -18,5 +18,6 @@
@Data
@ApiModel(value = "StoreCouponSingle查询参数", description = "店铺优惠卷单品查询参数")
public class StoreCouponSingleQuery extends AbsQuery {
    private String refId;
}
framework/src/main/java/cn/lili/modules/lmk/mapper/StoreCouponSingleMapper.java
@@ -31,4 +31,9 @@
    */
    IPage getPage(IPage page, @Param("query") StoreCouponSingleQuery query);
    /**
     *  分页
     */
    IPage getPageByRefId(IPage page, @Param("query") StoreCouponSingleQuery query);
}
framework/src/main/java/cn/lili/modules/lmk/service/StoreCouponService.java
@@ -1,6 +1,7 @@
package cn.lili.modules.lmk.service;
import cn.lili.modules.lmk.domain.entity.StoreCoupon;
import cn.lili.modules.lmk.domain.query.StoreCouponSingleQuery;
import com.baomidou.mybatisplus.extension.service.IService;
import cn.lili.base.Result;
import cn.lili.modules.lmk.domain.form.StoreCouponForm;
@@ -20,6 +21,7 @@
    /**
     * 添加
     *
     * @param form
     * @return
     */
@@ -27,6 +29,7 @@
    /**
     * 修改
     *
     * @param form
     * @return
     */
@@ -34,6 +37,7 @@
    /**
     * 批量删除
     *
     * @param ids
     * @return
     */
@@ -41,6 +45,7 @@
    /**
     * id删除
     *
     * @param id
     * @return
     */
@@ -48,6 +53,7 @@
    /**
     * 分页查询
     *
     * @param query
     * @return
     */
@@ -55,6 +61,7 @@
    /**
     * 根据id查找
     *
     * @param id
     * @return
     */
@@ -62,6 +69,7 @@
    /**
     * 列表
     *
     * @return
     */
    Result all();
@@ -70,5 +78,9 @@
    Result addStoreCoupon(StoreCouponForm storeCoupon);
    Result generateStoreCoupon( String id);
    Result changeStatus(String id);
    Result generateStoreCoupon(String id);
    Result getPageByStoreCoupon(StoreCouponSingleQuery query);
}
framework/src/main/java/cn/lili/modules/lmk/service/StoreCouponSingleService.java
@@ -50,6 +50,8 @@
     */
    Result page(StoreCouponSingleQuery query);
    Result pageByRefId(StoreCouponSingleQuery query);
    /**
     * 根据id查找
     * @param id
framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponServiceImpl.java
@@ -3,6 +3,7 @@
import cn.lili.common.exception.ServiceException;
import cn.lili.modules.lmk.domain.entity.CouponVirtual;
import cn.lili.modules.lmk.domain.entity.StoreCouponSingle;
import cn.lili.modules.lmk.domain.query.StoreCouponSingleQuery;
import cn.lili.modules.lmk.enums.general.GenerateCouponStausEnum;
import cn.lili.modules.lmk.enums.general.StoreCouponStausEnum;
import cn.lili.modules.lmk.service.StoreCouponSingleService;
@@ -229,6 +230,11 @@
        }
    }
    @Override
    public Result getPageByStoreCoupon(StoreCouponSingleQuery query){
        return storeCouponSingleService.pageByRefId(query);
    }
    private static StoreCouponSingle getStoreCouponSingle(StoreCoupon storeCoupon, int i) {
        StoreCouponSingle storeCouponSingle = new StoreCouponSingle();
        storeCouponSingle.setStoreCoupRef(storeCoupon.getId());
@@ -240,4 +246,22 @@
        storeCouponSingle.setCouponNo(String.format("%08d", i));
        return storeCouponSingle;
    }
    @Override
    public Result changeStatus(String id) {
        StoreCoupon storeCoupon = this.getById(id);
        if (storeCoupon == null) {
            throw new ServiceException("当前店铺优惠卷不存在");
        }
        String status = storeCoupon.getStatus();
        if (StoreCouponStausEnum.ENABLE.name().equals(status)) {
            storeCoupon.setStatus(StoreCouponStausEnum.DISABLE.name());
        }else if (StoreCouponStausEnum.DISABLE.name().equals(status)) {
            storeCoupon.setStatus(StoreCouponStausEnum.ENABLE.name());
        }else {
            throw new ServiceException("当前店铺优惠卷状态异常无法修改");
        }
        this.updateById(storeCoupon);
        return Result.ok();
    }
}
framework/src/main/java/cn/lili/modules/lmk/service/impl/StoreCouponSingleServiceImpl.java
@@ -93,6 +93,18 @@
    }
    /**
     * 分页查询
     * @param query
     * @return
     */
    @Override
    public Result pageByRefId(StoreCouponSingleQuery query) {
        IPage<StoreCouponSingleVO> page = PageUtil.getPage(query, StoreCouponSingleVO.class);
        baseMapper.getPageByRefId(page, query);
        return Result.ok().data(page.getRecords()).total(page.getTotal());
    }
    /**
     * 根据id查找
     * @param id
     * @return
framework/src/main/resources/mapper/lmk/StoreCouponSingleMapper.xml
@@ -50,4 +50,19 @@
            LSCS.delete_flag = 0
    </select>
    <select id="getPageByRefId" resultMap="BaseResultMap">
        SELECT
            LSCS.store_coup_ref,
            LSCS.store_id,
            LSCS.coupon_id,
            LSCS.coupon_name,
            LSCS.coupon_no,
            LSCS.claim_status,
            LSCS.id
        FROM
            lmk_store_coupon_single LSCS
        WHERE
            LSCS.delete_flag = 0
        AND LSCS.store_coup_ref = #{query.refId}
    </select>
</mapper>
manager-api/src/main/java/cn/lili/controller/lmk/StoreCouponController.java
@@ -3,6 +3,7 @@
import cn.lili.base.Result;
import cn.lili.modules.lmk.domain.form.StoreCouponForm;
import cn.lili.modules.lmk.domain.query.StoreCouponQuery;
import cn.lili.modules.lmk.domain.query.StoreCouponSingleQuery;
import cn.lili.modules.lmk.service.StoreCouponService;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.AllArgsConstructor;
@@ -30,6 +31,15 @@
    public Result addStoreCoupon(@RequestBody StoreCouponForm storeCoupon){
      return  storeCouponService.addStoreCoupon(storeCoupon);
    }
    /**
     * 修改订单店铺优惠卷状态
     * @param id
     * @return
     */
    @PostMapping("/changeStatus/{id}")
    public Result changeStatus(@PathVariable String id){
      return  storeCouponService.changeStatus(id);
    }
    /**
     * 根据店铺关联关系生成单品
@@ -50,4 +60,9 @@
    public Result getPage(StoreCouponQuery query){
        return  storeCouponService.page(query);
    }
    @GetMapping("/getPageByStoreCoupon")
    public Result getPageByStoreCoupon(StoreCouponSingleQuery query){
        return storeCouponService.getPageByStoreCoupon(query);
    }
}