¶Ô±ÈÐÂÎļþ |
| | |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discount:create', 'æ°å»ºéªè¡å¥é¤ä¿¡æ¯è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discount:delete', 'å é¤éªè¡å¥é¤ä¿¡æ¯è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discount:update', 'ä¿®æ¹éªè¡å¥é¤ä¿¡æ¯è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discount:query', 'æ¥è¯¢éªè¡å¥é¤ä¿¡æ¯è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discount:exportExcel', '导åºéªè¡å¥é¤ä¿¡æ¯è¡¨(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountlog:create', 'æ°å»ºç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountlog:delete', 'å é¤ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountlog:update', 'ä¿®æ¹ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountlog:query', 'æ¥è¯¢ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountlog:exportExcel', '导åºç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountmember:create', 'æ°å»ºç¨æ·éªè¡å¥é¤å¡å
³è表', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountmember:delete', 'å é¤ç¨æ·éªè¡å¥é¤å¡å
³è表', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountmember:update', 'ä¿®æ¹ç¨æ·éªè¡å¥é¤å¡å
³è表', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountmember:query', 'æ¥è¯¢ç¨æ·éªè¡å¥é¤å¡å
³è表', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:discountmember:exportExcel', '导åºç¨æ·éªè¡å¥é¤å¡å
³è表(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.model.Discount; |
| | | import com.doumee.service.business.DiscountService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Api(tags = "éªè¡å¥é¤ä¿¡æ¯è¡¨") |
| | | @RestController |
| | | @RequestMapping("/business/discount") |
| | | public class DiscountController extends BaseController { |
| | | |
| | | @Autowired |
| | | private DiscountService discountService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:discount:create") |
| | | public ApiResponse create(@RequestBody Discount discount) { |
| | | return ApiResponse.success(discountService.create(discount)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:discount:delete") |
| | | public ApiResponse deleteById(@PathVariable String id) { |
| | | discountService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:discount:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<String> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(id); |
| | | } |
| | | discountService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:discount:update") |
| | | public ApiResponse updateById(@RequestBody Discount discount) { |
| | | discountService.updateById(discount); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:discount:query") |
| | | public ApiResponse<PageData<Discount>> findPage (@RequestBody PageWrap<Discount> pageWrap) { |
| | | return ApiResponse.success(discountService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:discount:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<Discount> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(Discount.class).export(discountService.findPage(pageWrap).getRecords(), "éªè¡å¥é¤ä¿¡æ¯è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:discount:query") |
| | | public ApiResponse findById(@PathVariable String id) { |
| | | return ApiResponse.success(discountService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.model.DiscountLog; |
| | | import com.doumee.service.business.DiscountLogService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Api(tags = "ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨") |
| | | @RestController |
| | | @RequestMapping("/business/discountLog") |
| | | public class DiscountLogController extends BaseController { |
| | | |
| | | @Autowired |
| | | private DiscountLogService discountLogService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:discountlog:create") |
| | | public ApiResponse create(@RequestBody DiscountLog discountLog) { |
| | | return ApiResponse.success(discountLogService.create(discountLog)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:discountlog:delete") |
| | | public ApiResponse deleteById(@PathVariable String id) { |
| | | discountLogService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:discountlog:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<String> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(id); |
| | | } |
| | | discountLogService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:discountlog:update") |
| | | public ApiResponse updateById(@RequestBody DiscountLog discountLog) { |
| | | discountLogService.updateById(discountLog); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:discountlog:query") |
| | | public ApiResponse<PageData<DiscountLog>> findPage (@RequestBody PageWrap<DiscountLog> pageWrap) { |
| | | return ApiResponse.success(discountLogService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:discountlog:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<DiscountLog> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(DiscountLog.class).export(discountLogService.findPage(pageWrap).getRecords(), "ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:discountlog:query") |
| | | public ApiResponse findById(@PathVariable String id) { |
| | | return ApiResponse.success(discountLogService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.model.DiscountMember; |
| | | import com.doumee.service.business.DiscountMemberService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Api(tags = "ç¨æ·éªè¡å¥é¤å¡å
³è表") |
| | | @RestController |
| | | @RequestMapping("/business/discountMember") |
| | | public class DiscountMemberController extends BaseController { |
| | | |
| | | @Autowired |
| | | private DiscountMemberService discountMemberService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:discountmember:create") |
| | | public ApiResponse create(@RequestBody DiscountMember discountMember) { |
| | | return ApiResponse.success(discountMemberService.create(discountMember)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:discountmember:delete") |
| | | public ApiResponse deleteById(@PathVariable String id) { |
| | | discountMemberService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:discountmember:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<String> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(id); |
| | | } |
| | | discountMemberService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:discountmember:update") |
| | | public ApiResponse updateById(@RequestBody DiscountMember discountMember) { |
| | | discountMemberService.updateById(discountMember); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:discountmember:query") |
| | | public ApiResponse<PageData<DiscountMember>> findPage (@RequestBody PageWrap<DiscountMember> pageWrap) { |
| | | return ApiResponse.success(discountMemberService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:discountmember:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<DiscountMember> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(DiscountMember.class).export(discountMemberService.findPage(pageWrap).getRecords(), "ç¨æ·éªè¡å¥é¤å¡å
³è表", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:discountmember:query") |
| | | public ApiResponse findById(@PathVariable String id) { |
| | | return ApiResponse.success(discountMemberService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.DiscountLog; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | public interface DiscountLogMapper extends BaseMapper<DiscountLog> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.Discount; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | public interface DiscountMapper extends BaseMapper<Discount> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.DiscountMember; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | public interface DiscountMemberMapper extends BaseMapper<DiscountMember> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * éªè¡å¥é¤ä¿¡æ¯è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Data |
| | | @ApiModel("éªè¡å¥é¤ä¿¡æ¯è¡¨") |
| | | @TableName("\"discount\"") |
| | | public class Discount { |
| | | |
| | | @ApiModelProperty(value = "ç¼ç ") |
| | | @ExcelColumn(name="ç¼ç ") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | @ExcelColumn(name="å建人") |
| | | private String creator; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾æ¶é´") |
| | | @ExcelColumn(name="ç¼è¾æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾äºº") |
| | | @ExcelColumn(name="ç¼è¾äºº") |
| | | private String editor; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤", example = "1") |
| | | @ExcelColumn(name="æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @ExcelColumn(name="夿³¨") |
| | | private String info; |
| | | |
| | | @ApiModelProperty(value = "åç§°") |
| | | @ExcelColumn(name="åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0æéå¡ 1次å¡", example = "1") |
| | | @ExcelColumn(name="ç±»å 0æéå¡ 1次å¡") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "æ¯æ¥éªè¡éå¶ç±»å 0ä¸éå¶ 1éå¶", example = "1") |
| | | @ExcelColumn(name="æ¯æ¥éªè¡éå¶ç±»å 0ä¸éå¶ 1éå¶") |
| | | private Integer limitType; |
| | | |
| | | @ApiModelProperty(value = "æ¯æ¥éªè¡éå¶æ¶é´ï¼åéï¼", example = "1") |
| | | @ExcelColumn(name="æ¯æ¥éªè¡éå¶æ¶é´ï¼åéï¼") |
| | | private Integer limitTime; |
| | | |
| | | @ApiModelProperty(value = "éå®ä»·ï¼å
ï¼", example = "1") |
| | | @ExcelColumn(name="éå®ä»·ï¼å
ï¼") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "å线价ï¼å
ï¼", example = "1") |
| | | @ExcelColumn(name="å线价ï¼å
ï¼") |
| | | private BigDecimal linePrice; |
| | | |
| | | @ApiModelProperty(value = "é宿¸ é 0å°ç¨åº", example = "1") |
| | | @ExcelColumn(name="é宿¸ é 0å°ç¨åº") |
| | | private Integer channel; |
| | | |
| | | @ApiModelProperty(value = "å¥é¤å¾ç") |
| | | @ExcelColumn(name="å¥é¤å¾ç") |
| | | private String imgurl; |
| | | |
| | | @ApiModelProperty(value = "ç®ä»") |
| | | @ExcelColumn(name="ç®ä»") |
| | | private String descs; |
| | | |
| | | @ApiModelProperty(value = "æè¿°") |
| | | @ExcelColumn(name="æè¿°") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "éå®å¼å§æ¥æ") |
| | | @ExcelColumn(name="éå®å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "éå®ç»ææ¥æ") |
| | | @ExcelColumn(name="éå®ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "ä½¿ç¨æ¶é´ç±»å 0åºå®æ¶é´æ®µ 1è´ä¹°åçæ 2æå®æ¥æçæ", example = "1") |
| | | @ExcelColumn(name="ä½¿ç¨æ¶é´ç±»å 0åºå®æ¶é´æ®µ 1è´ä¹°åçæ 2æå®æ¥æçæ") |
| | | private Integer useType; |
| | | |
| | | @ApiModelProperty(value = "使ç¨å¼å§æ¥æ") |
| | | @ExcelColumn(name="使ç¨å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date useStartDate; |
| | | |
| | | @ApiModelProperty(value = "使ç¨ç»ææ¥æ") |
| | | @ExcelColumn(name="使ç¨ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date useEndDate; |
| | | |
| | | @ApiModelProperty(value = "ä½¿ç¨ææå¤©æ°", example = "1") |
| | | @ExcelColumn(name="ä½¿ç¨ææå¤©æ°") |
| | | private Integer useDays; |
| | | |
| | | @ApiModelProperty(value = "è忥æ¯å¦å¯ä»¥ 0å¦ 1æ¯", example = "1") |
| | | @ExcelColumn(name="è忥æ¯å¦å¯ä»¥ 0å¦ 1æ¯") |
| | | private Integer useHoliday; |
| | | |
| | | @ApiModelProperty(value = "工使¥æ¯å¦å¯ä»¥ 0å¦ 1æ¯", example = "1") |
| | | @ExcelColumn(name="工使¥æ¯å¦å¯ä»¥ 0å¦ 1æ¯") |
| | | private Integer useWorkday; |
| | | |
| | | @ApiModelProperty(value = "ééæ»éé¢", example = "1") |
| | | @ExcelColumn(name="ééæ»éé¢") |
| | | private Integer saleLimit; |
| | | |
| | | @ApiModelProperty(value = "é鿝天éé¢", example = "1") |
| | | @ExcelColumn(name="é鿝天éé¢") |
| | | private Integer saleDayLimit; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ 0æ£å¸¸ 1åç¨", example = "1") |
| | | @ExcelColumn(name="ç¶æ 0æ£å¸¸ 1åç¨") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦æ¯æèªè¡è½¦è®¢å 0䏿¯æ 1æ¯æ", example = "1") |
| | | @ExcelColumn(name="æ¯å¦æ¯æèªè¡è½¦è®¢å 0䏿¯æ 1æ¯æ") |
| | | private Integer isbike; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦æ¯æçµå¨è½¦ 0䏿¯æ 1æ¯æ", example = "1") |
| | | @ExcelColumn(name="æ¯å¦æ¯æçµå¨è½¦ 0䏿¯æ 1æ¯æ") |
| | | private Integer iselecbike; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨ |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Data |
| | | @ApiModel("ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨") |
| | | @TableName("\"discount_log\"") |
| | | public class DiscountLog { |
| | | |
| | | @ApiModelProperty(value = "ç¼ç ") |
| | | @ExcelColumn(name="ç¼ç ") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | @ExcelColumn(name="å建人") |
| | | private String creator; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾æ¶é´") |
| | | @ExcelColumn(name="ç¼è¾æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾äºº") |
| | | @ExcelColumn(name="ç¼è¾äºº") |
| | | private String editor; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤", example = "1") |
| | | @ExcelColumn(name="æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @ExcelColumn(name="夿³¨") |
| | | private String info; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·å¥é¤å¡ç¼ç ï¼å
³èdiscount_member)") |
| | | @ExcelColumn(name="ç¨æ·å¥é¤å¡ç¼ç ï¼å
³èdiscount_member)") |
| | | private String discountMemberId; |
| | | |
| | | @ApiModelProperty(value = "æä½ç±»å 0ç¨æ·éªè¡ä½¿ç¨ 1å¹³å°ä½åº 2å¹³å°è°æ´", example = "1") |
| | | @ExcelColumn(name="æä½ç±»å 0ç¨æ·éªè¡ä½¿ç¨ 1å¹³å°ä½åº 2å¹³å°è°æ´") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "æµæ£éªè¡æ¶é¿ï¼åéï¼", example = "1") |
| | | @ExcelColumn(name="æµæ£éªè¡æ¶é¿ï¼åéï¼") |
| | | private Integer rideTime; |
| | | |
| | | @ApiModelProperty(value = "æµæ£éé¢ï¼å
ï¼", example = "1") |
| | | @ExcelColumn(name="æµæ£éé¢ï¼å
ï¼") |
| | | private BigDecimal ridePrice; |
| | | |
| | | @ApiModelProperty(value = "è°æ´å¤æ³¨") |
| | | @ExcelColumn(name="è°æ´å¤æ³¨") |
| | | private String editInfo; |
| | | |
| | | @ApiModelProperty(value = "æææå¢å 天æ°", example = "1") |
| | | @ExcelColumn(name="æææå¢å 天æ°") |
| | | private Integer editDays; |
| | | |
| | | @ApiModelProperty(value = "å
³è订åç¼ç (å
³ègoodsorderï¼") |
| | | @ExcelColumn(name="å
³è订åç¼ç (å
³ègoodsorderï¼") |
| | | private String goodsorderId; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * ç¨æ·éªè¡å¥é¤å¡å
³è表 |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Data |
| | | @ApiModel("ç¨æ·éªè¡å¥é¤å¡å
³è表") |
| | | @TableName("\"discount_member\"") |
| | | public class DiscountMember { |
| | | |
| | | @ApiModelProperty(value = "ç¼ç ") |
| | | @ExcelColumn(name="ç¼ç ") |
| | | private String id; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "å建人") |
| | | @ExcelColumn(name="å建人") |
| | | private String creator; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾æ¶é´") |
| | | @ExcelColumn(name="ç¼è¾æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "ç¼è¾äºº") |
| | | @ExcelColumn(name="ç¼è¾äºº") |
| | | private String editor; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤", example = "1") |
| | | @ExcelColumn(name="æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @ExcelColumn(name="夿³¨") |
| | | private String info; |
| | | |
| | | @ApiModelProperty(value = "票å·") |
| | | @ExcelColumn(name="票å·") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "åç§°") |
| | | @ExcelColumn(name="åç§°") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0æéå¡ 1次å¡", example = "1") |
| | | @ExcelColumn(name="ç±»å 0æéå¡ 1次å¡") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "æ¯æ¥éªè¡éå¶ç±»å 0ä¸éå¶ 1éå¶", example = "1") |
| | | @ExcelColumn(name="æ¯æ¥éªè¡éå¶ç±»å 0ä¸éå¶ 1éå¶") |
| | | private Integer limitType; |
| | | |
| | | @ApiModelProperty(value = "æ¯æ¥éªè¡éå¶æ¶é´ï¼åéï¼", example = "1") |
| | | @ExcelColumn(name="æ¯æ¥éªè¡éå¶æ¶é´ï¼åéï¼") |
| | | private Integer limitTime; |
| | | |
| | | @ApiModelProperty(value = "éå®ä»·ï¼å
ï¼", example = "1") |
| | | @ExcelColumn(name="éå®ä»·ï¼å
ï¼") |
| | | private BigDecimal price; |
| | | |
| | | @ApiModelProperty(value = "å线价ï¼å
ï¼", example = "1") |
| | | @ExcelColumn(name="å线价ï¼å
ï¼") |
| | | private BigDecimal linePrice; |
| | | |
| | | @ApiModelProperty(value = "é宿¸ é 0å°ç¨åº", example = "1") |
| | | @ExcelColumn(name="é宿¸ é 0å°ç¨åº") |
| | | private Integer channel; |
| | | |
| | | @ApiModelProperty(value = "å¥é¤å¾ç") |
| | | @ExcelColumn(name="å¥é¤å¾ç") |
| | | private String imgurl; |
| | | |
| | | @ApiModelProperty(value = "ç®ä»") |
| | | @ExcelColumn(name="ç®ä»") |
| | | private String descs; |
| | | |
| | | @ApiModelProperty(value = "æè¿°") |
| | | @ExcelColumn(name="æè¿°") |
| | | private String content; |
| | | |
| | | @ApiModelProperty(value = "éå®å¼å§æ¥æ") |
| | | @ExcelColumn(name="éå®å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "éå®ç»ææ¥æ") |
| | | @ExcelColumn(name="éå®ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "ä½¿ç¨æ¶é´ç±»å 0åºå®æ¶é´æ®µ 1è´ä¹°åçæ 2æå®æ¥æçæ", example = "1") |
| | | @ExcelColumn(name="ä½¿ç¨æ¶é´ç±»å 0åºå®æ¶é´æ®µ 1è´ä¹°åçæ 2æå®æ¥æçæ") |
| | | private Integer useType; |
| | | |
| | | @ApiModelProperty(value = "使ç¨å¼å§æ¥æ") |
| | | @ExcelColumn(name="使ç¨å¼å§æ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date useStartDate; |
| | | |
| | | @ApiModelProperty(value = "使ç¨ç»ææ¥æ") |
| | | @ExcelColumn(name="使ç¨ç»ææ¥æ") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date useEndDate; |
| | | |
| | | @ApiModelProperty(value = "ä½¿ç¨ææå¤©æ°", example = "1") |
| | | @ExcelColumn(name="ä½¿ç¨ææå¤©æ°") |
| | | private Integer useDays; |
| | | |
| | | @ApiModelProperty(value = "è忥æ¯å¦å¯ä»¥ 0å¦ 1æ¯", example = "1") |
| | | @ExcelColumn(name="è忥æ¯å¦å¯ä»¥ 0å¦ 1æ¯") |
| | | private Integer useHoliday; |
| | | |
| | | @ApiModelProperty(value = "工使¥æ¯å¦å¯ä»¥ 0å¦ 1æ¯", example = "1") |
| | | @ExcelColumn(name="工使¥æ¯å¦å¯ä»¥ 0å¦ 1æ¯") |
| | | private Integer useWorkday; |
| | | |
| | | @ApiModelProperty(value = "ééæ»éé¢", example = "1") |
| | | @ExcelColumn(name="ééæ»éé¢") |
| | | private Integer saleLimit; |
| | | |
| | | @ApiModelProperty(value = "é鿝天éé¢", example = "1") |
| | | @ExcelColumn(name="é鿝天éé¢") |
| | | private Integer saleDayLimit; |
| | | |
| | | @ApiModelProperty(value = "ç¶æ 0æ£å¸¸ 1ä½åº 2è¿ææç¨å®", example = "1") |
| | | @ExcelColumn(name="ç¶æ 0æ£å¸¸ 1ä½åº 2è¿ææç¨å®") |
| | | private Integer status; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ç¼ç ï¼å
³èmember)") |
| | | @ExcelColumn(name="ç¨æ·ç¼ç ï¼å
³èmember)") |
| | | private String memberId; |
| | | |
| | | @ApiModelProperty(value = "å
³è订åç¼ç (å
³ègoodsorderï¼") |
| | | @ExcelColumn(name="å
³è订åç¼ç (å
³ègoodsorderï¼") |
| | | private String goodsorderId; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦æ¯æèªè¡è½¦è®¢å 0䏿¯æ 1æ¯æ", example = "1") |
| | | @ExcelColumn(name="æ¯å¦æ¯æèªè¡è½¦è®¢å 0䏿¯æ 1æ¯æ") |
| | | private Integer isbike; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦æ¯æçµå¨è½¦ 0䏿¯æ 1æ¯æ", example = "1") |
| | | @ExcelColumn(name="æ¯å¦æ¯æçµå¨è½¦ 0䏿¯æ 1æ¯æ") |
| | | private Integer iselecbike; |
| | | |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ç¼ç ï¼å
³èmember表ï¼") |
| | | private String memberId; |
| | | @ApiModelProperty(value = "å
³è对象ç¼ç ") |
| | | private String objId; |
| | | @ApiModelProperty(value = "å
³è对象类å 0å¥é¤å¡") |
| | | private Integer objType; |
| | | @ApiModelProperty(value = "交æç±»å 0ç§è½¦æ¼é 1å¥é¤å¡è´ä¹°") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ç¼ç ï¼å
³èmember表ï¼") |
| | | @TableField(exist = false) |
| | |
| | | @ApiModelProperty(value = "æ¯ä»æ¶é´") |
| | | @ExcelColumn(name="交æ¼éæ¶é´",index = 5,width = 10,align = HorizontalAlignment.CENTER,dateFormat = "yyyy-MM-dd HH:mm:ss" ) |
| | | private Date payDate; |
| | | |
| | | @ApiModelProperty(value = "交æç±»å 0ç§è½¦æ¼é") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "ç»ç®éé¢(åï¼") |
| | | @ExcelColumn(name="ç»ç®éé¢(å
)",index = 7,width = 10,align = HorizontalAlignment.CENTER) |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.DiscountLog; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨Serviceå®ä¹ |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | public interface DiscountLogService { |
| | | |
| | | /** |
| | | * å建 |
| | | * |
| | | * @param discountLog å®ä½å¯¹è±¡ |
| | | * @return String |
| | | */ |
| | | String create(DiscountLog discountLog); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(String id); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param discountLog å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(DiscountLog discountLog); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<String> ids); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | | * |
| | | * @param discountLog å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(DiscountLog discountLog); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param discountLogs å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<DiscountLog> discountLogs); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return DiscountLog |
| | | */ |
| | | DiscountLog findById(String id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param discountLog å®ä½å¯¹è±¡ |
| | | * @return DiscountLog |
| | | */ |
| | | DiscountLog findOne(DiscountLog discountLog); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param discountLog å®ä½å¯¹è±¡ |
| | | * @return List<DiscountLog> |
| | | */ |
| | | List<DiscountLog> findList(DiscountLog discountLog); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<DiscountLog> |
| | | */ |
| | | PageData<DiscountLog> findPage(PageWrap<DiscountLog> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | | * |
| | | * @param discountLog å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(DiscountLog discountLog); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.DiscountMember; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·éªè¡å¥é¤å¡å
³è表Serviceå®ä¹ |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | public interface DiscountMemberService { |
| | | |
| | | /** |
| | | * å建 |
| | | * |
| | | * @param discountMember å®ä½å¯¹è±¡ |
| | | * @return String |
| | | */ |
| | | String create(DiscountMember discountMember); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(String id); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param discountMember å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(DiscountMember discountMember); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<String> ids); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | | * |
| | | * @param discountMember å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(DiscountMember discountMember); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param discountMembers å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<DiscountMember> discountMembers); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return DiscountMember |
| | | */ |
| | | DiscountMember findById(String id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param discountMember å®ä½å¯¹è±¡ |
| | | * @return DiscountMember |
| | | */ |
| | | DiscountMember findOne(DiscountMember discountMember); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param discountMember å®ä½å¯¹è±¡ |
| | | * @return List<DiscountMember> |
| | | */ |
| | | List<DiscountMember> findList(DiscountMember discountMember); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<DiscountMember> |
| | | */ |
| | | PageData<DiscountMember> findPage(PageWrap<DiscountMember> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | | * |
| | | * @param discountMember å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(DiscountMember discountMember); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.Discount; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * éªè¡å¥é¤ä¿¡æ¯è¡¨Serviceå®ä¹ |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | public interface DiscountService { |
| | | |
| | | /** |
| | | * å建 |
| | | * |
| | | * @param discount å®ä½å¯¹è±¡ |
| | | * @return String |
| | | */ |
| | | String create(Discount discount); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(String id); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param discount å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(Discount discount); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<String> ids); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | | * |
| | | * @param discount å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(Discount discount); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param discounts å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<Discount> discounts); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return Discount |
| | | */ |
| | | Discount findById(String id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param discount å®ä½å¯¹è±¡ |
| | | * @return Discount |
| | | */ |
| | | Discount findOne(Discount discount); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param discount å®ä½å¯¹è±¡ |
| | | * @return List<Discount> |
| | | */ |
| | | List<Discount> findList(Discount discount); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<Discount> |
| | | */ |
| | | PageData<Discount> findPage(PageWrap<Discount> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | | * |
| | | * @param discount å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(Discount discount); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.DiscountLogMapper; |
| | | import com.doumee.dao.business.model.DiscountLog; |
| | | import com.doumee.service.business.DiscountLogService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·å¥é¤å¡ä½¿ç¨è°æ´æ¥å¿è¡¨Serviceå®ç° |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Service |
| | | public class DiscountLogServiceImpl implements DiscountLogService { |
| | | |
| | | @Autowired |
| | | private DiscountLogMapper discountLogMapper; |
| | | |
| | | @Override |
| | | public String create(DiscountLog discountLog) { |
| | | discountLogMapper.insert(discountLog); |
| | | return discountLog.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(String id) { |
| | | discountLogMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(DiscountLog discountLog) { |
| | | UpdateWrapper<DiscountLog> deleteWrapper = new UpdateWrapper<>(discountLog); |
| | | discountLogMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<String> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | discountLogMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(DiscountLog discountLog) { |
| | | discountLogMapper.updateById(discountLog); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<DiscountLog> discountLogs) { |
| | | if (CollectionUtils.isEmpty(discountLogs)) { |
| | | return; |
| | | } |
| | | for (DiscountLog discountLog: discountLogs) { |
| | | this.updateById(discountLog); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public DiscountLog findById(String id) { |
| | | return discountLogMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public DiscountLog findOne(DiscountLog discountLog) { |
| | | QueryWrapper<DiscountLog> wrapper = new QueryWrapper<>(discountLog); |
| | | return discountLogMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<DiscountLog> findList(DiscountLog discountLog) { |
| | | QueryWrapper<DiscountLog> wrapper = new QueryWrapper<>(discountLog); |
| | | return discountLogMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<DiscountLog> findPage(PageWrap<DiscountLog> pageWrap) { |
| | | IPage<DiscountLog> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<DiscountLog> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountLog::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(DiscountLog::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountLog::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(DiscountLog::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getInfo() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getInfo, pageWrap.getModel().getInfo()); |
| | | } |
| | | if (pageWrap.getModel().getDiscountMemberId() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getDiscountMemberId, pageWrap.getModel().getDiscountMemberId()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getRideTime() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getRideTime, pageWrap.getModel().getRideTime()); |
| | | } |
| | | if (pageWrap.getModel().getRidePrice() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getRidePrice, pageWrap.getModel().getRidePrice()); |
| | | } |
| | | if (pageWrap.getModel().getEditInfo() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getEditInfo, pageWrap.getModel().getEditInfo()); |
| | | } |
| | | if (pageWrap.getModel().getEditDays() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getEditDays, pageWrap.getModel().getEditDays()); |
| | | } |
| | | if (pageWrap.getModel().getGoodsorderId() != null) { |
| | | queryWrapper.lambda().eq(DiscountLog::getGoodsorderId, pageWrap.getModel().getGoodsorderId()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(discountLogMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public long count(DiscountLog discountLog) { |
| | | QueryWrapper<DiscountLog> wrapper = new QueryWrapper<>(discountLog); |
| | | return discountLogMapper.selectCount(wrapper); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.DiscountMemberMapper; |
| | | import com.doumee.dao.business.model.DiscountMember; |
| | | import com.doumee.service.business.DiscountMemberService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * ç¨æ·éªè¡å¥é¤å¡å
³è表Serviceå®ç° |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Service |
| | | public class DiscountMemberServiceImpl implements DiscountMemberService { |
| | | |
| | | @Autowired |
| | | private DiscountMemberMapper discountMemberMapper; |
| | | |
| | | @Override |
| | | public String create(DiscountMember discountMember) { |
| | | discountMemberMapper.insert(discountMember); |
| | | return discountMember.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(String id) { |
| | | discountMemberMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(DiscountMember discountMember) { |
| | | UpdateWrapper<DiscountMember> deleteWrapper = new UpdateWrapper<>(discountMember); |
| | | discountMemberMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<String> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | discountMemberMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(DiscountMember discountMember) { |
| | | discountMemberMapper.updateById(discountMember); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<DiscountMember> discountMembers) { |
| | | if (CollectionUtils.isEmpty(discountMembers)) { |
| | | return; |
| | | } |
| | | for (DiscountMember discountMember: discountMembers) { |
| | | this.updateById(discountMember); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public DiscountMember findById(String id) { |
| | | return discountMemberMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public DiscountMember findOne(DiscountMember discountMember) { |
| | | QueryWrapper<DiscountMember> wrapper = new QueryWrapper<>(discountMember); |
| | | return discountMemberMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<DiscountMember> findList(DiscountMember discountMember) { |
| | | QueryWrapper<DiscountMember> wrapper = new QueryWrapper<>(discountMember); |
| | | return discountMemberMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<DiscountMember> findPage(PageWrap<DiscountMember> pageWrap) { |
| | | IPage<DiscountMember> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<DiscountMember> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountMember::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(DiscountMember::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountMember::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(DiscountMember::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getInfo() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getInfo, pageWrap.getModel().getInfo()); |
| | | } |
| | | if (pageWrap.getModel().getCode() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getCode, pageWrap.getModel().getCode()); |
| | | } |
| | | if (pageWrap.getModel().getName() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getName, pageWrap.getModel().getName()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getLimitType() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getLimitType, pageWrap.getModel().getLimitType()); |
| | | } |
| | | if (pageWrap.getModel().getLimitTime() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getLimitTime, pageWrap.getModel().getLimitTime()); |
| | | } |
| | | if (pageWrap.getModel().getPrice() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getPrice, pageWrap.getModel().getPrice()); |
| | | } |
| | | if (pageWrap.getModel().getLinePrice() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getLinePrice, pageWrap.getModel().getLinePrice()); |
| | | } |
| | | if (pageWrap.getModel().getChannel() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getChannel, pageWrap.getModel().getChannel()); |
| | | } |
| | | if (pageWrap.getModel().getImgurl() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getImgurl, pageWrap.getModel().getImgurl()); |
| | | } |
| | | if (pageWrap.getModel().getDescs() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getDescs, pageWrap.getModel().getDescs()); |
| | | } |
| | | if (pageWrap.getModel().getContent() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getContent, pageWrap.getModel().getContent()); |
| | | } |
| | | if (pageWrap.getModel().getStartDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountMember::getStartDate, Utils.Date.getStart(pageWrap.getModel().getStartDate())); |
| | | queryWrapper.lambda().le(DiscountMember::getStartDate, Utils.Date.getEnd(pageWrap.getModel().getStartDate())); |
| | | } |
| | | if (pageWrap.getModel().getEndDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountMember::getEndDate, Utils.Date.getStart(pageWrap.getModel().getEndDate())); |
| | | queryWrapper.lambda().le(DiscountMember::getEndDate, Utils.Date.getEnd(pageWrap.getModel().getEndDate())); |
| | | } |
| | | if (pageWrap.getModel().getUseType() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getUseType, pageWrap.getModel().getUseType()); |
| | | } |
| | | if (pageWrap.getModel().getUseStartDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountMember::getUseStartDate, Utils.Date.getStart(pageWrap.getModel().getUseStartDate())); |
| | | queryWrapper.lambda().le(DiscountMember::getUseStartDate, Utils.Date.getEnd(pageWrap.getModel().getUseStartDate())); |
| | | } |
| | | if (pageWrap.getModel().getUseEndDate() != null) { |
| | | queryWrapper.lambda().ge(DiscountMember::getUseEndDate, Utils.Date.getStart(pageWrap.getModel().getUseEndDate())); |
| | | queryWrapper.lambda().le(DiscountMember::getUseEndDate, Utils.Date.getEnd(pageWrap.getModel().getUseEndDate())); |
| | | } |
| | | if (pageWrap.getModel().getUseDays() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getUseDays, pageWrap.getModel().getUseDays()); |
| | | } |
| | | if (pageWrap.getModel().getUseHoliday() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getUseHoliday, pageWrap.getModel().getUseHoliday()); |
| | | } |
| | | if (pageWrap.getModel().getUseWorkday() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getUseWorkday, pageWrap.getModel().getUseWorkday()); |
| | | } |
| | | if (pageWrap.getModel().getSaleLimit() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getSaleLimit, pageWrap.getModel().getSaleLimit()); |
| | | } |
| | | if (pageWrap.getModel().getSaleDayLimit() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getSaleDayLimit, pageWrap.getModel().getSaleDayLimit()); |
| | | } |
| | | if (pageWrap.getModel().getStatus() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getStatus, pageWrap.getModel().getStatus()); |
| | | } |
| | | if (pageWrap.getModel().getMemberId() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getMemberId, pageWrap.getModel().getMemberId()); |
| | | } |
| | | if (pageWrap.getModel().getGoodsorderId() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getGoodsorderId, pageWrap.getModel().getGoodsorderId()); |
| | | } |
| | | if (pageWrap.getModel().getIsbike() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getIsbike, pageWrap.getModel().getIsbike()); |
| | | } |
| | | if (pageWrap.getModel().getIselecbike() != null) { |
| | | queryWrapper.lambda().eq(DiscountMember::getIselecbike, pageWrap.getModel().getIselecbike()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(discountMemberMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public long count(DiscountMember discountMember) { |
| | | QueryWrapper<DiscountMember> wrapper = new QueryWrapper<>(discountMember); |
| | | return discountMemberMapper.selectCount(wrapper); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.DiscountMapper; |
| | | import com.doumee.dao.business.model.Discount; |
| | | import com.doumee.service.business.DiscountService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * éªè¡å¥é¤ä¿¡æ¯è¡¨Serviceå®ç° |
| | | * @author æ±è¹è¹ |
| | | * @date 2025/02/17 09:43 |
| | | */ |
| | | @Service |
| | | public class DiscountServiceImpl implements DiscountService { |
| | | |
| | | @Autowired |
| | | private DiscountMapper discountMapper; |
| | | |
| | | @Override |
| | | public String create(Discount discount) { |
| | | discountMapper.insert(discount); |
| | | return discount.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(String id) { |
| | | discountMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(Discount discount) { |
| | | UpdateWrapper<Discount> deleteWrapper = new UpdateWrapper<>(discount); |
| | | discountMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<String> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | discountMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(Discount discount) { |
| | | discountMapper.updateById(discount); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<Discount> discounts) { |
| | | if (CollectionUtils.isEmpty(discounts)) { |
| | | return; |
| | | } |
| | | for (Discount discount: discounts) { |
| | | this.updateById(discount); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public Discount findById(String id) { |
| | | return discountMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public Discount findOne(Discount discount) { |
| | | QueryWrapper<Discount> wrapper = new QueryWrapper<>(discount); |
| | | return discountMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<Discount> findList(Discount discount) { |
| | | QueryWrapper<Discount> wrapper = new QueryWrapper<>(discount); |
| | | return discountMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<Discount> findPage(PageWrap<Discount> pageWrap) { |
| | | IPage<Discount> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<Discount> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(Discount::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(Discount::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(Discount::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(Discount::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(Discount::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(Discount::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(Discount::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(Discount::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getInfo() != null) { |
| | | queryWrapper.lambda().eq(Discount::getInfo, pageWrap.getModel().getInfo()); |
| | | } |
| | | if (pageWrap.getModel().getName() != null) { |
| | | queryWrapper.lambda().eq(Discount::getName, pageWrap.getModel().getName()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(Discount::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getLimitType() != null) { |
| | | queryWrapper.lambda().eq(Discount::getLimitType, pageWrap.getModel().getLimitType()); |
| | | } |
| | | if (pageWrap.getModel().getLimitTime() != null) { |
| | | queryWrapper.lambda().eq(Discount::getLimitTime, pageWrap.getModel().getLimitTime()); |
| | | } |
| | | if (pageWrap.getModel().getPrice() != null) { |
| | | queryWrapper.lambda().eq(Discount::getPrice, pageWrap.getModel().getPrice()); |
| | | } |
| | | if (pageWrap.getModel().getLinePrice() != null) { |
| | | queryWrapper.lambda().eq(Discount::getLinePrice, pageWrap.getModel().getLinePrice()); |
| | | } |
| | | if (pageWrap.getModel().getChannel() != null) { |
| | | queryWrapper.lambda().eq(Discount::getChannel, pageWrap.getModel().getChannel()); |
| | | } |
| | | if (pageWrap.getModel().getImgurl() != null) { |
| | | queryWrapper.lambda().eq(Discount::getImgurl, pageWrap.getModel().getImgurl()); |
| | | } |
| | | if (pageWrap.getModel().getDescs() != null) { |
| | | queryWrapper.lambda().eq(Discount::getDescs, pageWrap.getModel().getDescs()); |
| | | } |
| | | if (pageWrap.getModel().getContent() != null) { |
| | | queryWrapper.lambda().eq(Discount::getContent, pageWrap.getModel().getContent()); |
| | | } |
| | | if (pageWrap.getModel().getStartDate() != null) { |
| | | queryWrapper.lambda().ge(Discount::getStartDate, Utils.Date.getStart(pageWrap.getModel().getStartDate())); |
| | | queryWrapper.lambda().le(Discount::getStartDate, Utils.Date.getEnd(pageWrap.getModel().getStartDate())); |
| | | } |
| | | if (pageWrap.getModel().getEndDate() != null) { |
| | | queryWrapper.lambda().ge(Discount::getEndDate, Utils.Date.getStart(pageWrap.getModel().getEndDate())); |
| | | queryWrapper.lambda().le(Discount::getEndDate, Utils.Date.getEnd(pageWrap.getModel().getEndDate())); |
| | | } |
| | | if (pageWrap.getModel().getUseType() != null) { |
| | | queryWrapper.lambda().eq(Discount::getUseType, pageWrap.getModel().getUseType()); |
| | | } |
| | | if (pageWrap.getModel().getUseStartDate() != null) { |
| | | queryWrapper.lambda().ge(Discount::getUseStartDate, Utils.Date.getStart(pageWrap.getModel().getUseStartDate())); |
| | | queryWrapper.lambda().le(Discount::getUseStartDate, Utils.Date.getEnd(pageWrap.getModel().getUseStartDate())); |
| | | } |
| | | if (pageWrap.getModel().getUseEndDate() != null) { |
| | | queryWrapper.lambda().ge(Discount::getUseEndDate, Utils.Date.getStart(pageWrap.getModel().getUseEndDate())); |
| | | queryWrapper.lambda().le(Discount::getUseEndDate, Utils.Date.getEnd(pageWrap.getModel().getUseEndDate())); |
| | | } |
| | | if (pageWrap.getModel().getUseDays() != null) { |
| | | queryWrapper.lambda().eq(Discount::getUseDays, pageWrap.getModel().getUseDays()); |
| | | } |
| | | if (pageWrap.getModel().getUseHoliday() != null) { |
| | | queryWrapper.lambda().eq(Discount::getUseHoliday, pageWrap.getModel().getUseHoliday()); |
| | | } |
| | | if (pageWrap.getModel().getUseWorkday() != null) { |
| | | queryWrapper.lambda().eq(Discount::getUseWorkday, pageWrap.getModel().getUseWorkday()); |
| | | } |
| | | if (pageWrap.getModel().getSaleLimit() != null) { |
| | | queryWrapper.lambda().eq(Discount::getSaleLimit, pageWrap.getModel().getSaleLimit()); |
| | | } |
| | | if (pageWrap.getModel().getSaleDayLimit() != null) { |
| | | queryWrapper.lambda().eq(Discount::getSaleDayLimit, pageWrap.getModel().getSaleDayLimit()); |
| | | } |
| | | if (pageWrap.getModel().getStatus() != null) { |
| | | queryWrapper.lambda().eq(Discount::getStatus, pageWrap.getModel().getStatus()); |
| | | } |
| | | if (pageWrap.getModel().getIsbike() != null) { |
| | | queryWrapper.lambda().eq(Discount::getIsbike, pageWrap.getModel().getIsbike()); |
| | | } |
| | | if (pageWrap.getModel().getIselecbike() != null) { |
| | | queryWrapper.lambda().eq(Discount::getIselecbike, pageWrap.getModel().getIselecbike()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(discountMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public long count(Discount discount) { |
| | | QueryWrapper<Discount> wrapper = new QueryWrapper<>(discount); |
| | | return discountMapper.selectCount(wrapper); |
| | | } |
| | | } |