parent
94b4954c37
commit
824985a6ad
|
|
@ -4,5 +4,6 @@
|
|||
*/target/*
|
||||
*/*.iml
|
||||
/.gradle/
|
||||
/application.pid
|
||||
*.log
|
||||
logs/*
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.pojo.BotButtonConfig;
|
||||
import cn.ysk.cashier.service.BotButtonConfigService;
|
||||
import cn.ysk.cashier.dto.BotButtonConfigQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "buttonConfig管理")
|
||||
@RequestMapping("/api/botButtonConfig")
|
||||
public class BotButtonConfigController {
|
||||
|
||||
private final BotButtonConfigService botButtonConfigService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('botButtonConfig:list')")
|
||||
public void exportBotButtonConfig(HttpServletResponse response, BotButtonConfigQueryCriteria criteria) throws IOException {
|
||||
botButtonConfigService.download(botButtonConfigService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询buttonConfig")
|
||||
@PreAuthorize("@el.check('botButtonConfig:list')")
|
||||
public ResponseEntity<Object> queryBotButtonConfig(BotButtonConfigQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botButtonConfigService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增buttonConfig")
|
||||
@PreAuthorize("@el.check('botButtonConfig:add')")
|
||||
public ResponseEntity<Object> createBotButtonConfig(@Validated @RequestBody BotButtonConfig resources){
|
||||
return new ResponseEntity<>(botButtonConfigService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改buttonConfig")
|
||||
@PreAuthorize("@el.check('botButtonConfig:edit')")
|
||||
public ResponseEntity<Object> updateBotButtonConfig(@Validated @RequestBody BotButtonConfig resources){
|
||||
botButtonConfigService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除buttonConfig")
|
||||
@PreAuthorize("@el.check('botButtonConfig:del')")
|
||||
public ResponseEntity<Object> deleteBotButtonConfig(@RequestBody Integer[] ids) {
|
||||
botButtonConfigService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.pojo.BotConfig;
|
||||
import cn.ysk.cashier.service.BotConfigService;
|
||||
import cn.ysk.cashier.dto.BotConfigQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "botConfig管理")
|
||||
@RequestMapping("/api/botConfig")
|
||||
public class BotConfigController {
|
||||
|
||||
private final BotConfigService botConfigService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('botConfig:list')")
|
||||
public void exportBotConfig(HttpServletResponse response, BotConfigQueryCriteria criteria) throws IOException {
|
||||
botConfigService.download(botConfigService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询botConfig")
|
||||
@PreAuthorize("@el.check('botConfig:list')")
|
||||
public ResponseEntity<Object> queryBotConfig(BotConfigQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botConfigService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增botConfig")
|
||||
@PreAuthorize("@el.check('botConfig:add')")
|
||||
public ResponseEntity<Object> createBotConfig(@Validated @RequestBody BotConfig resources){
|
||||
return new ResponseEntity<>(botConfigService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改botConfig")
|
||||
@PreAuthorize("@el.check('botConfig:edit')")
|
||||
public ResponseEntity<Object> updateBotConfig(@Validated @RequestBody BotConfig resources){
|
||||
botConfigService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除botConfig")
|
||||
@PreAuthorize("@el.check('botConfig:del')")
|
||||
public ResponseEntity<Object> deleteBotConfig(@RequestBody Integer[] ids) {
|
||||
botConfigService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.pojo.BotUser;
|
||||
import cn.ysk.cashier.service.BotUserService;
|
||||
import cn.ysk.cashier.dto.BotUserQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "BotUserController管理")
|
||||
@RequestMapping("/api/botUser")
|
||||
public class BotUserController {
|
||||
|
||||
private final BotUserService botUserService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('botUser:list')")
|
||||
public void exportBotUser(HttpServletResponse response, BotUserQueryCriteria criteria) throws IOException {
|
||||
botUserService.download(botUserService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询BotUserController")
|
||||
@PreAuthorize("@el.check('botUser:list')")
|
||||
public ResponseEntity<Object> queryBotUser(BotUserQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botUserService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增BotUserController")
|
||||
@PreAuthorize("@el.check('botUser:add')")
|
||||
public ResponseEntity<Object> createBotUser(@Validated @RequestBody BotUser resources){
|
||||
return new ResponseEntity<>(botUserService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改BotUserController")
|
||||
@PreAuthorize("@el.check('botUser:edit')")
|
||||
public ResponseEntity<Object> updateBotUser(@Validated @RequestBody BotUser resources){
|
||||
botUserService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除BotUserController")
|
||||
@PreAuthorize("@el.check('botUser:del')")
|
||||
public ResponseEntity<Object> deleteBotUser(@RequestBody Integer[] ids) {
|
||||
botUserService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.pojo.BotUserFlow;
|
||||
import cn.ysk.cashier.service.BotUserFlowService;
|
||||
import cn.ysk.cashier.dto.BotUserFlowQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "accountFlow管理")
|
||||
@RequestMapping("/api/botUserFlow")
|
||||
public class BotUserFlowController {
|
||||
|
||||
private final BotUserFlowService botUserFlowService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('botUserFlow:list')")
|
||||
public void exportBotUserFlow(HttpServletResponse response, BotUserFlowQueryCriteria criteria) throws IOException {
|
||||
botUserFlowService.download(botUserFlowService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询accountFlow")
|
||||
@PreAuthorize("@el.check('botUserFlow:list')")
|
||||
public ResponseEntity<Object> queryBotUserFlow(BotUserFlowQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botUserFlowService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增accountFlow")
|
||||
@PreAuthorize("@el.check('botUserFlow:add')")
|
||||
public ResponseEntity<Object> createBotUserFlow(@Validated @RequestBody BotUserFlow resources){
|
||||
return new ResponseEntity<>(botUserFlowService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改accountFlow")
|
||||
@PreAuthorize("@el.check('botUserFlow:edit')")
|
||||
public ResponseEntity<Object> updateBotUserFlow(@Validated @RequestBody BotUserFlow resources){
|
||||
botUserFlowService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除accountFlow")
|
||||
@PreAuthorize("@el.check('botUserFlow:del')")
|
||||
public ResponseEntity<Object> deleteBotUserFlow(@RequestBody Integer[] ids) {
|
||||
botUserFlowService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,82 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.pojo.TbRenewalsPayLog;
|
||||
import cn.ysk.cashier.service.TbRenewalsPayLogService;
|
||||
import cn.ysk.cashier.dto.TbRenewalsPayLogQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2023-11-07
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/shop/renewals管理")
|
||||
@RequestMapping("/api/tbRenewalsPayLog")
|
||||
public class TbRenewalsPayLogController {
|
||||
|
||||
private final TbRenewalsPayLogService tbRenewalsPayLogService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('tbRenewalsPayLog:list')")
|
||||
public void exportTbRenewalsPayLog(HttpServletResponse response, TbRenewalsPayLogQueryCriteria criteria) throws IOException {
|
||||
tbRenewalsPayLogService.download(tbRenewalsPayLogService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询/shop/renewals")
|
||||
@PreAuthorize("@el.check('tbRenewalsPayLog:list')")
|
||||
public ResponseEntity<Object> queryTbRenewalsPayLog(TbRenewalsPayLogQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbRenewalsPayLogService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增/shop/renewals")
|
||||
@PreAuthorize("@el.check('tbRenewalsPayLog:add')")
|
||||
public ResponseEntity<Object> createTbRenewalsPayLog(@Validated @RequestBody TbRenewalsPayLog resources){
|
||||
return new ResponseEntity<>(tbRenewalsPayLogService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/shop/renewals")
|
||||
@PreAuthorize("@el.check('tbRenewalsPayLog:edit')")
|
||||
public ResponseEntity<Object> updateTbRenewalsPayLog(@Validated @RequestBody TbRenewalsPayLog resources){
|
||||
tbRenewalsPayLogService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除/shop/renewals")
|
||||
@PreAuthorize("@el.check('tbRenewalsPayLog:del')")
|
||||
public ResponseEntity<Object> deleteTbRenewalsPayLog(@RequestBody Integer[] ids) {
|
||||
tbRenewalsPayLogService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,78 @@
|
|||
package cn.ysk.cashier.controller;
|
||||
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopCoupon;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopCouponService;
|
||||
import cn.ysk.cashier.mybatis.vo.TbShopCouponVo;
|
||||
import cn.ysk.cashier.utils.SecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import cn.ysk.cashier.dto.TbShopCouponQueryCriteria;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 优惠券(TbShopCoupon)表控制层
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-10-22 15:43:24
|
||||
*/
|
||||
@Api(tags = "优惠券管理")
|
||||
@RestController
|
||||
@RequestMapping("/api/tbShopCoupon")
|
||||
public class TbShopCouponController {
|
||||
/**
|
||||
* 服务对象
|
||||
*/
|
||||
@Resource
|
||||
private TbShopCouponService tbShopCouponService;
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("分页查询")
|
||||
public ResponseEntity<Object> selectAll(TbShopCouponQueryCriteria criteria) {
|
||||
return new ResponseEntity<>(tbShopCouponService.queryAll(criteria), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("{id}")
|
||||
@ApiOperation("通过Id查询详情")
|
||||
public TbShopCoupon selectOne(@PathVariable Integer id) {
|
||||
return tbShopCouponService.findById(id);
|
||||
}
|
||||
|
||||
@GetMapping("/product/{couponId}")
|
||||
@ApiOperation("查询赠送的商品")
|
||||
public ResponseEntity<Object> queryActivatePros(@PathVariable("couponId") Integer couponId){
|
||||
return new ResponseEntity<>(tbShopCouponService.findActivatePros(couponId),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增")
|
||||
public ResponseEntity<Object> insert(@RequestBody TbShopCouponVo tbShopCoupon) {
|
||||
if (tbShopCoupon.getType().equals(2) && CollectionUtils.isEmpty(tbShopCoupon.getProducts())) {
|
||||
throw new BadRequestException("赠送商品不可为空");
|
||||
}
|
||||
tbShopCoupon.setEditor(SecurityUtils.getCurrentUserNickName());
|
||||
return new ResponseEntity<>(tbShopCouponService.update(tbShopCoupon), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("通过id修改")
|
||||
public ResponseEntity<Object> update(@RequestBody TbShopCouponVo tbShopCoupon) {
|
||||
if (tbShopCoupon.getType().equals(2) && CollectionUtils.isEmpty(tbShopCoupon.getProducts()))
|
||||
throw new BadRequestException("赠送商品不可为空");
|
||||
tbShopCouponService.update(tbShopCoupon);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除")
|
||||
public ResponseEntity<Object> delete(@RequestParam("id") Integer id) {
|
||||
tbShopCouponService.delete(id);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -38,10 +38,6 @@ public class ShopPayApiController {
|
|||
|
||||
@GetMapping("getOrderPayUrl")
|
||||
@ApiOperation("获取店铺订单支付URL")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "orderId", value = "订单id", paramType = "query", required = true, dataType = "String"),
|
||||
@ApiImplicitParam(name = "shopId", value = "店铺id", paramType = "query", required = true, dataType = "String"),
|
||||
})
|
||||
public ResponseEntity url(@RequestParam Map<String, Object> params) {
|
||||
MapProxy mapProxy = MapProxy.create(params);
|
||||
String shopId = mapProxy.getStr("shopId");
|
||||
|
|
|
|||
|
|
@ -1,91 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.pojo.shop.TbReceiptSales;
|
||||
import cn.ysk.cashier.dto.shop.TbReceiptSalesQueryCriteria;
|
||||
import cn.ysk.cashier.service.shop.TbReceiptSalesService;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-08
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/shop/receiptSales管理")
|
||||
@RequestMapping("/api/tbReceiptSales")
|
||||
public class TbReceiptSalesController {
|
||||
|
||||
private final TbReceiptSalesService tbReceiptSalesService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('tbReceiptSales:list')")
|
||||
public void exportTbReceiptSales(HttpServletResponse response, TbReceiptSalesQueryCriteria criteria) throws IOException {
|
||||
tbReceiptSalesService.download(tbReceiptSalesService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询/shop/receiptSales")
|
||||
@PreAuthorize("@el.check('tbReceiptSales:list')")
|
||||
public ResponseEntity<Object> queryTbReceiptSales(TbReceiptSalesQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbReceiptSalesService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/{shopId}")
|
||||
@ApiOperation("查询/shop/receiptSales")
|
||||
@PreAuthorize("@el.check('tbReceiptSales:info')")
|
||||
public Object queryTbReceiptSalesInfo(@PathVariable("shopId")Integer shopId){
|
||||
|
||||
return tbReceiptSalesService.findById(shopId);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增/shop/receiptSales")
|
||||
@PreAuthorize("@el.check('tbReceiptSales:add')")
|
||||
public ResponseEntity<Object> createTbReceiptSales(@Validated @RequestBody TbReceiptSales resources){
|
||||
return new ResponseEntity<>(tbReceiptSalesService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/shop/receiptSales")
|
||||
@PreAuthorize("@el.check('tbReceiptSales:edit')")
|
||||
public ResponseEntity<Object> updateTbReceiptSales(@Validated @RequestBody TbReceiptSales resources){
|
||||
tbReceiptSalesService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除/shop/receiptSales")
|
||||
@PreAuthorize("@el.check('tbReceiptSales:del')")
|
||||
public ResponseEntity<Object> deleteTbReceiptSales(@RequestBody Integer[] ids) {
|
||||
tbReceiptSalesService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,95 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCashSpread;
|
||||
import cn.ysk.cashier.service.shop.TbShopCashSpreadService;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCashSpreadQueryCriteria;
|
||||
import cn.ysk.cashier.utils.StringUtils;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/shop/spread管理")
|
||||
@RequestMapping("/api/tbShopCashSpread")
|
||||
public class TbShopCashSpreadController {
|
||||
|
||||
private final TbShopCashSpreadService tbShopCashSpreadService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('tbShopCashSpread:list')")
|
||||
public void exportTbShopCashSpread(HttpServletResponse response, TbShopCashSpreadQueryCriteria criteria) throws IOException {
|
||||
tbShopCashSpreadService.download(tbShopCashSpreadService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询/shop/spread")
|
||||
@PreAuthorize("@el.check('tbShopCashSpread:list')")
|
||||
public ResponseEntity<Object> queryTbShopCashSpread(TbShopCashSpreadQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbShopCashSpreadService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
@GetMapping("/{shopId}")
|
||||
@ApiOperation("查询/shop/spread/info")
|
||||
@PreAuthorize("@el.check('tbShopCashSpread:info')")
|
||||
public Object queryTbShopCashSpreadInfo(@PathVariable("shopId") Integer shopId){
|
||||
TbShopCashSpread byShopId = tbShopCashSpreadService.findByShopId(shopId);
|
||||
String screenConfig = byShopId.getScreenConfig();
|
||||
return StringUtils.stringChangeMap(screenConfig);
|
||||
}
|
||||
@PostMapping
|
||||
@ApiOperation("新增/shop/spread")
|
||||
@PreAuthorize("@el.check('tbShopCashSpread:add')")
|
||||
public ResponseEntity<Object> createTbShopCashSpread(@Validated @RequestBody TbShopCashSpread resources){
|
||||
return new ResponseEntity<>(tbShopCashSpreadService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/shop/spread")
|
||||
@PreAuthorize("@el.check('tbShopCashSpread:edit')")
|
||||
public ResponseEntity<Object> updateTbShopCashSpread(@Validated @RequestBody TbShopCashSpread resources){
|
||||
Integer update = tbShopCashSpreadService.update(resources);
|
||||
if (update>0){
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
|
||||
}
|
||||
return new ResponseEntity<>(HttpStatus.BAD_REQUEST);
|
||||
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除/shop/spread")
|
||||
@PreAuthorize("@el.check('tbShopCashSpread:del')")
|
||||
public ResponseEntity<Object> deleteTbShopCashSpread(@RequestBody String[] ids) {
|
||||
tbShopCashSpreadService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.controller.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCurrency;
|
||||
import cn.ysk.cashier.service.shop.TbShopCurrencyService;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCurrencyQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import io.swagger.annotations.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/shop/currency管理")
|
||||
@RequestMapping("/api/tbShopCurrency")
|
||||
public class TbShopCurrencyController {
|
||||
|
||||
private final TbShopCurrencyService tbShopCurrencyService;
|
||||
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('tbShopCurrency:list')")
|
||||
public void exportTbShopCurrency(HttpServletResponse response, TbShopCurrencyQueryCriteria criteria) throws IOException {
|
||||
tbShopCurrencyService.download(tbShopCurrencyService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@ApiOperation("查询/shop/currency")
|
||||
public ResponseEntity<Object> queryTbShopCurrency(TbShopCurrencyQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbShopCurrencyService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/{shopId}")
|
||||
@ApiOperation("查询/shop/currency/info")
|
||||
public Object queryTbShopCurrencyInfo(@PathVariable("shopId") String shopId){
|
||||
return tbShopCurrencyService.findByShopId(shopId);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@ApiOperation("新增/shop/currency")
|
||||
public ResponseEntity<Object> createTbShopCurrency(@Validated @RequestBody TbShopCurrency resources){
|
||||
return new ResponseEntity<>(tbShopCurrencyService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@ApiOperation("修改/shop/currency")
|
||||
public ResponseEntity<Object> updateTbShopCurrency(@Validated @RequestBody TbShopCurrency resources){
|
||||
tbShopCurrencyService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@ApiOperation("删除/shop/currency")
|
||||
public ResponseEntity<Object> deleteTbShopCurrency(@RequestBody Integer[] ids) {
|
||||
tbShopCurrencyService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -5,7 +5,7 @@ import java.util.Date;
|
|||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表(TbActivateProduct)表查询类
|
||||
* 活动赠送商品表(TbCouponProduct)表查询类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
|
|
|
|||
|
|
@ -0,0 +1,17 @@
|
|||
package cn.ysk.cashier.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* 优惠券(TbShopCoupon)表查询类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-10-22 15:43:25
|
||||
*/
|
||||
@Data
|
||||
public class TbShopCouponQueryCriteria {
|
||||
private Integer shopId;
|
||||
private long page;
|
||||
private long size;
|
||||
}
|
||||
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.BotButtonConfig;
|
||||
import cn.ysk.cashier.dto.BotButtonConfigDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface BotButtonConfigMapper extends BaseMapper<BotButtonConfigDto, BotButtonConfig> {
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.BotConfig;
|
||||
import cn.ysk.cashier.dto.BotConfigDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface BotConfigMapper extends BaseMapper<BotConfigDto, BotConfig> {
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.BotUserFlow;
|
||||
import cn.ysk.cashier.dto.BotUserFlowDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface BotUserFlowMapper extends BaseMapper<BotUserFlowDto, BotUserFlow> {
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.BotUser;
|
||||
import cn.ysk.cashier.dto.BotUserDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface BotUserMapper extends BaseMapper<BotUserDto, BotUser> {
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.TbRenewalsPayLog;
|
||||
import cn.ysk.cashier.dto.TbRenewalsPayLogDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2023-11-07
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbRenewalsPayLogMapper extends BaseMapper<TbRenewalsPayLogDto, TbRenewalsPayLog> {
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper.shop;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.shop.TbMerchantCoupon;
|
||||
import cn.ysk.cashier.dto.shop.TbMerchantCouponDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-20
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbMerchantCouponMapper extends BaseMapper<TbMerchantCouponDto, TbMerchantCoupon> {
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper.shop;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.shop.TbReceiptSales;
|
||||
import cn.ysk.cashier.dto.shop.TbReceiptSalesDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-08
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbReceiptSalesMapper extends BaseMapper<TbReceiptSalesDto, TbReceiptSales> {
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper.shop;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCashSpread;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCashSpreadDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbShopCashSpreadMapper extends BaseMapper<TbShopCashSpreadDto, TbShopCashSpread> {
|
||||
|
||||
}
|
||||
|
|
@ -1,32 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.mapper.shop;
|
||||
|
||||
import cn.ysk.cashier.base.BaseMapper;
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCurrency;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCurrencyDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbShopCurrencyMapper extends BaseMapper<TbShopCurrencyDto, TbShopCurrency> {
|
||||
|
||||
}
|
||||
|
|
@ -1,31 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("tb_activate")
|
||||
public class Activate extends Model<Activate> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Integer id;
|
||||
private Integer shopId;
|
||||
private Integer minNum;
|
||||
private Integer maxNum;
|
||||
private BigDecimal handselNum;
|
||||
private String handselType;
|
||||
private String isDel;
|
||||
//是否赠送商品 0否 1是
|
||||
private Integer isGiftPro;
|
||||
@TableField(exist = false)
|
||||
private List<TbActivateProduct> products;
|
||||
}
|
||||
|
|
@ -1,44 +1,103 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.math.BigDecimal;
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivate extends Model<TbActivate> {
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@Entity
|
||||
@Table(name = "tb_activate")
|
||||
public class TbActivate {
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "id", nullable = false)
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "shop_id")
|
||||
private Integer shopId;
|
||||
//充值金额
|
||||
private Integer amount;
|
||||
//赠送金额
|
||||
private Integer giftAmount;
|
||||
//是否使用优惠卷 0否 1是
|
||||
private Integer isUseCoupon;
|
||||
//优惠卷id
|
||||
private Integer couponId;
|
||||
//优惠卷数量
|
||||
private Integer num;
|
||||
|
||||
@Column(name = "min_num")
|
||||
private Integer minNum;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
@Column(name = "max_num")
|
||||
private Integer maxNum;
|
||||
|
||||
@Column(name = "handsel_num", precision = 10, scale = 2)
|
||||
private BigDecimal handselNum;
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "handsel_type", length = 20)
|
||||
private String handselType;
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
@Size(max = 20)
|
||||
@Column(name = "is_del", length = 20)
|
||||
private String isDel;
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
@Size(max = 255)
|
||||
@Column(name = "is_user")
|
||||
private String isUser;
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public Integer getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(Integer amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public Integer getGiftAmount() {
|
||||
return giftAmount;
|
||||
}
|
||||
|
||||
public void setGiftAmount(Integer giftAmount) {
|
||||
this.giftAmount = giftAmount;
|
||||
}
|
||||
|
||||
public Integer getIsUseCoupon() {
|
||||
return isUseCoupon;
|
||||
}
|
||||
|
||||
public void setIsUseCoupon(Integer isUseCoupon) {
|
||||
this.isUseCoupon = isUseCoupon;
|
||||
}
|
||||
|
||||
public Integer getCouponId() {
|
||||
return couponId;
|
||||
}
|
||||
|
||||
public void setCouponId(Integer couponId) {
|
||||
this.couponId = couponId;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,17 @@ package cn.ysk.cashier.mybatis.entity;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 活动商品赠送表(TbActivateInRecord)表实体类
|
||||
* 活动商品赠送记录表(TbActivateInRecord)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-22 14:50:16
|
||||
* @since 2024-10-23 09:49:59
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
||||
|
|
@ -18,8 +20,18 @@ public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
|||
private Integer id;
|
||||
//会员id
|
||||
private Integer vipUserId;
|
||||
//卷Id (校验是否可用)
|
||||
private Integer couponId;
|
||||
//卷描述 满10减2/商品卷
|
||||
private String name;
|
||||
//1-满减 2-商品
|
||||
private Integer type;
|
||||
//商品id
|
||||
private Integer proId;
|
||||
//满多少金额
|
||||
private Integer fullAmount;
|
||||
//减多少金额
|
||||
private Integer discountAmount;
|
||||
//赠送数量
|
||||
private Integer num;
|
||||
//未使用数量
|
||||
|
|
@ -32,9 +44,11 @@ public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
|||
private Integer sourceFlowId;
|
||||
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
private String couponJson;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
|
|
@ -52,6 +66,30 @@ public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
|||
this.vipUserId = vipUserId;
|
||||
}
|
||||
|
||||
public Integer getCouponId() {
|
||||
return couponId;
|
||||
}
|
||||
|
||||
public void setCouponId(Integer couponId) {
|
||||
this.couponId = couponId;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getProId() {
|
||||
return proId;
|
||||
}
|
||||
|
|
@ -60,6 +98,22 @@ public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
|||
this.proId = proId;
|
||||
}
|
||||
|
||||
public Integer getFullAmount() {
|
||||
return fullAmount;
|
||||
}
|
||||
|
||||
public void setFullAmount(Integer fullAmount) {
|
||||
this.fullAmount = fullAmount;
|
||||
}
|
||||
|
||||
public Integer getDiscountAmount() {
|
||||
return discountAmount;
|
||||
}
|
||||
|
||||
public void setDiscountAmount(Integer discountAmount) {
|
||||
this.discountAmount = discountAmount;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
|
@ -115,5 +169,13 @@ public class TbActivateInRecord extends Model<TbActivateInRecord> {
|
|||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
|
||||
public String getCouponJson() {
|
||||
return couponJson;
|
||||
}
|
||||
|
||||
public void setCouponJson(String couponJson) {
|
||||
this.couponJson = couponJson;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,8 @@ package cn.ysk.cashier.mybatis.entity;
|
|||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
|
@ -10,27 +12,32 @@ import java.io.Serializable;
|
|||
* 活动赠送商品使用记录表(TbActivateOutRecord)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-22 14:53:52
|
||||
* @since 2024-10-23 09:50:40
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivateOutRecord extends Model<TbActivateOutRecord> {
|
||||
|
||||
private Integer id;
|
||||
//商品赠送Id
|
||||
|
||||
private Integer shopId;
|
||||
//订单id
|
||||
private String orderId;
|
||||
//商品赠送Id tb_activate_in_record的id
|
||||
private Integer giveId;
|
||||
//商品id
|
||||
private Integer proId;
|
||||
//未使用数量
|
||||
//会员id
|
||||
private Integer vipUserId;
|
||||
//1-满减 2-商品
|
||||
private Integer type;
|
||||
//使用数量
|
||||
private Integer useNum;
|
||||
//退单量
|
||||
private Integer refNum;
|
||||
//订单id
|
||||
private String orderId;
|
||||
//新建: create, 完成: closed, 取消:cancel,
|
||||
private String status;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
|
|
@ -42,6 +49,22 @@ public class TbActivateOutRecord extends Model<TbActivateOutRecord> {
|
|||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(Integer shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public Integer getGiveId() {
|
||||
return giveId;
|
||||
}
|
||||
|
|
@ -50,12 +73,20 @@ public class TbActivateOutRecord extends Model<TbActivateOutRecord> {
|
|||
this.giveId = giveId;
|
||||
}
|
||||
|
||||
public Integer getProId() {
|
||||
return proId;
|
||||
public Integer getVipUserId() {
|
||||
return vipUserId;
|
||||
}
|
||||
|
||||
public void setProId(Integer proId) {
|
||||
this.proId = proId;
|
||||
public void setVipUserId(Integer vipUserId) {
|
||||
this.vipUserId = vipUserId;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getUseNum() {
|
||||
|
|
@ -74,14 +105,6 @@ public class TbActivateOutRecord extends Model<TbActivateOutRecord> {
|
|||
this.refNum = refNum;
|
||||
}
|
||||
|
||||
public String getOrderId() {
|
||||
return orderId;
|
||||
}
|
||||
|
||||
public void setOrderId(String orderId) {
|
||||
this.orderId = orderId;
|
||||
}
|
||||
|
||||
public String getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,83 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表(TbActivateProduct)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TbActivateProduct extends Model<TbActivateProduct> {
|
||||
|
||||
private Integer id;
|
||||
//活动Id
|
||||
private Integer activateId;
|
||||
//商品id
|
||||
private Integer productId;
|
||||
//数量
|
||||
private Integer num;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getActivateId() {
|
||||
return activateId;
|
||||
}
|
||||
|
||||
public void setActivateId(Integer activateId) {
|
||||
this.activateId = activateId;
|
||||
}
|
||||
|
||||
public Integer getProductId() {
|
||||
return productId;
|
||||
}
|
||||
|
||||
public void setProductId(Integer productId) {
|
||||
this.productId = productId;
|
||||
}
|
||||
|
||||
public Integer getNum() {
|
||||
return num;
|
||||
}
|
||||
|
||||
public void setNum(Integer num) {
|
||||
this.num = num;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表(TbActivateProduct)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
*/
|
||||
@Data
|
||||
@SuppressWarnings("serial")
|
||||
public class TbCouponProduct extends Model<TbCouponProduct> {
|
||||
private Integer id;
|
||||
//活动Id
|
||||
private Integer couponId;
|
||||
//商品id
|
||||
private Integer productId;
|
||||
//数量
|
||||
private Integer num;
|
||||
@TableField(exist = false)
|
||||
private String name;
|
||||
@TableField(exist = false)
|
||||
private String coverImg;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,253 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import java.time.LocalTime;
|
||||
import java.util.Date;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.FieldFill;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* 优惠券(TbShopCoupon)表实体类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-10-24 13:54:34
|
||||
*/
|
||||
@SuppressWarnings("serial")
|
||||
public class TbShopCoupon extends Model<TbShopCoupon> {
|
||||
//自增
|
||||
private Integer id;
|
||||
|
||||
private String shopId;
|
||||
//名称(无意义)
|
||||
private String title;
|
||||
//1-满减 2-商品
|
||||
private Integer type;
|
||||
//满多少金额
|
||||
private Integer fullAmount;
|
||||
//减多少金额
|
||||
private Integer discountAmount;
|
||||
//描述
|
||||
private String description;
|
||||
//发放数量
|
||||
private Integer number;
|
||||
//剩余数量
|
||||
private Integer leftNumber;
|
||||
//有效期类型,可选值为 fixed(固定时间)/custom(自定义时间)
|
||||
private String validityType;
|
||||
//有效天数
|
||||
private Integer validDays;
|
||||
//隔多少天生效
|
||||
private Integer daysToTakeEffect;
|
||||
//有效开始时间
|
||||
private Date validStartTime;
|
||||
//有效结束时间
|
||||
private Date validEndTime;
|
||||
//周 数组["周一","周二"]
|
||||
private String userDays;
|
||||
//all-全时段 custom-指定时段
|
||||
private String useTimeType;
|
||||
//可用开始时间
|
||||
private LocalTime useStartTime;
|
||||
//可用结束时间
|
||||
private LocalTime useEndTime;
|
||||
//已使用数量
|
||||
private Integer useNumber;
|
||||
//发放人
|
||||
private String editor;
|
||||
//状态0-关闭 1 正常
|
||||
private Integer status;
|
||||
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
@TableField(fill = FieldFill.UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(String shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Integer getFullAmount() {
|
||||
return fullAmount;
|
||||
}
|
||||
|
||||
public void setFullAmount(Integer fullAmount) {
|
||||
this.fullAmount = fullAmount;
|
||||
}
|
||||
|
||||
public Integer getDiscountAmount() {
|
||||
return discountAmount;
|
||||
}
|
||||
|
||||
public void setDiscountAmount(Integer discountAmount) {
|
||||
this.discountAmount = discountAmount;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Integer getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(Integer number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public Integer getLeftNumber() {
|
||||
return leftNumber;
|
||||
}
|
||||
|
||||
public void setLeftNumber(Integer leftNumber) {
|
||||
this.leftNumber = leftNumber;
|
||||
}
|
||||
|
||||
public String getValidityType() {
|
||||
return validityType;
|
||||
}
|
||||
|
||||
public void setValidityType(String validityType) {
|
||||
this.validityType = validityType;
|
||||
}
|
||||
|
||||
public Integer getValidDays() {
|
||||
return validDays;
|
||||
}
|
||||
|
||||
public void setValidDays(Integer validDays) {
|
||||
this.validDays = validDays;
|
||||
}
|
||||
|
||||
public Integer getDaysToTakeEffect() {
|
||||
return daysToTakeEffect;
|
||||
}
|
||||
|
||||
public void setDaysToTakeEffect(Integer daysToTakeEffect) {
|
||||
this.daysToTakeEffect = daysToTakeEffect;
|
||||
}
|
||||
|
||||
public Date getValidStartTime() {
|
||||
return validStartTime;
|
||||
}
|
||||
|
||||
public void setValidStartTime(Date validStartTime) {
|
||||
this.validStartTime = validStartTime;
|
||||
}
|
||||
|
||||
public Date getValidEndTime() {
|
||||
return validEndTime;
|
||||
}
|
||||
|
||||
public void setValidEndTime(Date validEndTime) {
|
||||
this.validEndTime = validEndTime;
|
||||
}
|
||||
|
||||
public String getUserDays() {
|
||||
return userDays;
|
||||
}
|
||||
|
||||
public void setUserDays(String userDays) {
|
||||
this.userDays = userDays;
|
||||
}
|
||||
|
||||
public String getUseTimeType() {
|
||||
return useTimeType;
|
||||
}
|
||||
|
||||
public void setUseTimeType(String useTimeType) {
|
||||
this.useTimeType = useTimeType;
|
||||
}
|
||||
|
||||
public LocalTime getUseStartTime() {
|
||||
return useStartTime;
|
||||
}
|
||||
|
||||
public void setUseStartTime(LocalTime useStartTime) {
|
||||
this.useStartTime = useStartTime;
|
||||
}
|
||||
|
||||
public LocalTime getUseEndTime() {
|
||||
return useEndTime;
|
||||
}
|
||||
|
||||
public void setUseEndTime(LocalTime useEndTime) {
|
||||
this.useEndTime = useEndTime;
|
||||
}
|
||||
|
||||
public Integer getUseNumber() {
|
||||
return useNumber;
|
||||
}
|
||||
|
||||
public void setUseNumber(Integer useNumber) {
|
||||
this.useNumber = useNumber;
|
||||
}
|
||||
|
||||
public String getEditor() {
|
||||
return editor;
|
||||
}
|
||||
|
||||
public void setEditor(String editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public Date getCreateTime() {
|
||||
return createTime;
|
||||
}
|
||||
|
||||
public void setCreateTime(Date createTime) {
|
||||
this.createTime = createTime;
|
||||
}
|
||||
|
||||
public Date getUpdateTime() {
|
||||
return updateTime;
|
||||
}
|
||||
|
||||
public void setUpdateTime(Date updateTime) {
|
||||
this.updateTime = updateTime;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("tb_user_storage")
|
||||
public class TbUserStorage extends Model<TbUserStorage> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
private String id; // 记录ID
|
||||
private Integer userId; // 用户ID
|
||||
private String shopId; // 用户ID
|
||||
private Integer productId;
|
||||
private Integer num;
|
||||
private Integer outNum;
|
||||
private Integer inNum;
|
||||
private Date createTime;
|
||||
private String account;
|
||||
private String unit;
|
||||
private String productName;
|
||||
private Integer skuId;
|
||||
private String skuName;
|
||||
private String imgUrl;
|
||||
}
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.Activate;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
public interface ActivateMapper extends BaseMapper<Activate> {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,6 +1,6 @@
|
|||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbActivateProduct;
|
||||
import cn.ysk.cashier.mybatis.entity.TbCouponProduct;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
|
|
@ -9,7 +9,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
*/
|
||||
public interface TbActivateProductMapper extends BaseMapper<TbActivateProduct> {
|
||||
public interface TbCouponProductMapper extends BaseMapper<TbCouponProduct> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopCoupon;
|
||||
|
||||
/**
|
||||
* 优惠券(TbShopCoupon)表数据库访问层
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-10-22 15:43:25
|
||||
*/
|
||||
public interface TbShopCouponMapper extends BaseMapper<TbShopCoupon> {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,9 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import cn.ysk.cashier.mybatis.entity.TbUserStorage;
|
||||
|
||||
public interface TbUserStorageMapper extends BaseMapper<TbUserStorage> {
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -2,14 +2,12 @@ package cn.ysk.cashier.mybatis.rest;
|
|||
|
||||
import cn.ysk.cashier.annotation.Log;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.mybatis.entity.Activate;
|
||||
import cn.ysk.cashier.mybatis.service.ShopService;
|
||||
import cn.ysk.cashier.mybatis.entity.TbActivate;
|
||||
import cn.ysk.cashier.mybatis.service.TbActivateService;
|
||||
import cn.ysk.cashier.service.WxService;
|
||||
import cn.ysk.cashier.utils.CacheKey;
|
||||
import cn.ysk.cashier.utils.RedisUtils;
|
||||
import cn.ysk.cashier.utils.SecurityUtils;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.http.HttpStatus;
|
||||
|
|
@ -25,31 +23,23 @@ import java.util.Map;
|
|||
@Api(tags = "/shop/storage")
|
||||
@RequestMapping("/shop/storage")
|
||||
public class StorageController {
|
||||
private final ShopService shopService;
|
||||
|
||||
private final TbActivateService tbActivateService;
|
||||
private final RedisUtils redisUtils;
|
||||
private final WxService wxService;
|
||||
|
||||
@GetMapping("/findActivate")
|
||||
public ResponseEntity<Object> findActivate(@RequestParam String shopId){
|
||||
String userName = SecurityUtils.getCurrentUsername();
|
||||
return new ResponseEntity<>(shopService.findActivate(shopId), HttpStatus.OK);
|
||||
return new ResponseEntity<>(tbActivateService.findActivate(shopId), HttpStatus.OK);
|
||||
}
|
||||
|
||||
@Log("修改活动数据")
|
||||
@PostMapping("/modityActivate")
|
||||
public ResponseEntity<Object> modityActivate(@RequestBody Activate activate){
|
||||
if (activate.getIsGiftPro() != null && activate.getIsGiftPro() == 1 && CollectionUtils.isEmpty(activate.getProducts()))
|
||||
throw new BadRequestException("赠送商品不可为空");
|
||||
String userName = SecurityUtils.getCurrentUsername();
|
||||
shopService.modityActivate(activate);
|
||||
@PostMapping("/upActivate")
|
||||
public ResponseEntity<Object> upActivate(@RequestBody TbActivate activate){
|
||||
tbActivateService.modifyActivate(activate);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
|
||||
@GetMapping("/activate/{activateId}")
|
||||
@ApiOperation("查询活动赠送商品")
|
||||
public ResponseEntity<Object> queryActivatePros(@PathVariable("activateId") Integer activateId){
|
||||
return new ResponseEntity<>(shopService.findActivatePros(activateId),HttpStatus.OK);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param params
|
||||
|
|
|
|||
|
|
@ -1,30 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.service;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.Activate;
|
||||
import cn.ysk.cashier.mybatis.entity.StorageVo;
|
||||
import cn.ysk.cashier.mybatis.vo.ActivateProsVo;
|
||||
import cn.ysk.cashier.pojo.product.TbProduct;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
public interface ShopService {
|
||||
Object findStorage(Integer shopId, String account, Pageable pageable);
|
||||
|
||||
void outStorage(Integer id, String userName, Integer num);
|
||||
|
||||
|
||||
void inStorage(StorageVo storageVo, String userName);
|
||||
|
||||
Object findActivate(String shopId);
|
||||
|
||||
void modityActivate(Activate activate);
|
||||
|
||||
List<ActivateProsVo> findActivatePros(Integer activate);
|
||||
}
|
||||
|
|
@ -10,4 +10,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
*/
|
||||
public interface TbActivateService extends IService<TbActivate> {
|
||||
|
||||
|
||||
Object findActivate(String shopId);
|
||||
|
||||
void modifyActivate(TbActivate activate);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
package cn.ysk.cashier.mybatis.service;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbActivateProduct;
|
||||
import cn.ysk.cashier.mybatis.entity.TbCouponProduct;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
|
||||
|
|
@ -10,7 +10,8 @@ import com.baomidou.mybatisplus.extension.service.IService;
|
|||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
*/
|
||||
public interface TbActivateProductService extends IService<TbActivateProduct> {
|
||||
public interface TbCouponProductService extends IService<TbCouponProduct> {
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
package cn.ysk.cashier.mybatis.service;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbCouponProduct;
|
||||
import cn.ysk.cashier.mybatis.vo.TbShopCouponVo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopCoupon;
|
||||
import cn.ysk.cashier.dto.TbShopCouponQueryCriteria;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 优惠券(TbShopCoupon)表服务接口
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-10-22 15:43:25
|
||||
*/
|
||||
public interface TbShopCouponService extends IService<TbShopCoupon> {
|
||||
|
||||
Map<String, Object> queryAll(TbShopCouponQueryCriteria criteria);
|
||||
|
||||
|
||||
TbShopCoupon findById (Integer id);
|
||||
|
||||
|
||||
boolean update(TbShopCouponVo param);
|
||||
boolean delete(Integer id);
|
||||
|
||||
List<TbCouponProduct> findActivatePros(Integer couponId);
|
||||
}
|
||||
|
||||
|
|
@ -1,186 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.service.impl;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.Activate;
|
||||
import cn.ysk.cashier.mybatis.entity.TbActivateProduct;
|
||||
import cn.ysk.cashier.mybatis.mapper.*;
|
||||
import cn.ysk.cashier.mybatis.service.TbActivateProductService;
|
||||
import cn.ysk.cashier.mybatis.vo.ActivateProsVo;
|
||||
import cn.ysk.cashier.pojo.product.TbProduct;
|
||||
import cn.ysk.cashier.pojo.product.TbProductSku;
|
||||
import cn.ysk.cashier.pojo.shop.TbMerchantAccount;
|
||||
import cn.ysk.cashier.repository.product.TbProductRepository;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import cn.ysk.cashier.exception.NewBadRequestException;
|
||||
import cn.ysk.cashier.mybatis.entity.StorageVo;
|
||||
import cn.ysk.cashier.mybatis.entity.TbUserStorage;
|
||||
import cn.ysk.cashier.mybatis.service.ShopService;
|
||||
import cn.ysk.cashier.utils.*;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author admin
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Service
|
||||
public class ShopServiceImpl implements ShopService {
|
||||
|
||||
@Autowired
|
||||
private TbUserStorageMapper userStorageMapper;
|
||||
@Autowired
|
||||
private TbMerchantAccountMapper tbMerchantAccountMapper;
|
||||
@Autowired
|
||||
private TbProducSkutMapper producSkutMapper;
|
||||
@Autowired
|
||||
private ActivateMapper activateMapper;
|
||||
@Autowired
|
||||
private TbProductRepository tbProductRepository;
|
||||
@Resource
|
||||
private TbActivateProductService actProductService;
|
||||
@Override
|
||||
public Object findStorage(Integer shopId, String account, Pageable pageable) {
|
||||
QueryWrapper<TbUserStorage> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("shop_id", shopId);
|
||||
if (StringUtils.isNotEmpty(account)) {
|
||||
queryWrapper.eq("account", account);
|
||||
}
|
||||
IPage<TbUserStorage> iPage = userStorageMapper.selectPage(new Page<>(pageable.getPageNumber(), pageable.getPageSize()), queryWrapper);
|
||||
return PageUtil.toPage(iPage.getRecords(), iPage.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void outStorage(Integer id, String userName, Integer num) {
|
||||
if (Objects.isNull(num) || num < 0) {
|
||||
throw new NewBadRequestException("请输入出库数量");
|
||||
}
|
||||
QueryWrapper<TbMerchantAccount> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("account", userName);
|
||||
TbMerchantAccount merchantAccount = tbMerchantAccountMapper.selectOne(wrapper);
|
||||
|
||||
QueryWrapper<TbUserStorage> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("id", id);
|
||||
queryWrapper.eq("shop_id", merchantAccount.getShopId());
|
||||
TbUserStorage userStorage = userStorageMapper.selectOne(queryWrapper);
|
||||
if (Objects.isNull(userStorage)) {
|
||||
throw new NewBadRequestException("存储商品在该店铺不存在");
|
||||
}
|
||||
if (userStorage.getNum() < num) {
|
||||
throw new NewBadRequestException("库存不足");
|
||||
}
|
||||
userStorage.setNum(userStorage.getNum() - num);
|
||||
userStorage.setOutNum(userStorage.getOutNum() + num);
|
||||
userStorageMapper.updateById(userStorage);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void inStorage(StorageVo storageVo, String userName) {
|
||||
if (Objects.isNull(storageVo.getNum()) || storageVo.getNum() < 0) {
|
||||
throw new NewBadRequestException("请输入出库数量");
|
||||
}
|
||||
QueryWrapper<TbMerchantAccount> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("account", userName);
|
||||
TbMerchantAccount merchantAccount = tbMerchantAccountMapper.selectOne(wrapper);
|
||||
|
||||
QueryWrapper<TbUserStorage> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("product_name", storageVo.getProductName());
|
||||
queryWrapper.eq("account", storageVo.getAccount());
|
||||
queryWrapper.eq("shop_id", merchantAccount.getShopId());
|
||||
TbUserStorage userStorage = userStorageMapper.selectOne(queryWrapper);
|
||||
if (Objects.nonNull(userStorage)) {
|
||||
userStorage.setNum(userStorage.getNum() + storageVo.getNum());
|
||||
userStorage.setInNum(userStorage.getInNum() + storageVo.getNum());
|
||||
userStorageMapper.updateById(userStorage);
|
||||
}else {
|
||||
userStorage = new TbUserStorage();
|
||||
userStorage.setAccount(storageVo.getAccount());
|
||||
userStorage.setCreateTime(new Date());
|
||||
userStorage.setShopId(merchantAccount.getShopId());
|
||||
userStorage.setNum(storageVo.getNum());
|
||||
userStorage.setOutNum(0);
|
||||
userStorage.setInNum(storageVo.getNum());
|
||||
userStorage.setImgUrl(storageVo.getImg());
|
||||
userStorage.setProductName(storageVo.getImg());
|
||||
userStorage.setUnit(storageVo.getUnit());
|
||||
userStorageMapper.insert(userStorage);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object findActivate(String shopId) {
|
||||
QueryWrapper<Activate> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("shop_id",shopId);
|
||||
queryWrapper.orderByDesc("id");
|
||||
List<Activate> list = activateMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modityActivate(Activate activate) {
|
||||
if (Objects.nonNull(activate.getId()) && activate.getId() > 0){
|
||||
activate.setHandselType("GD");
|
||||
activate.setMaxNum(activate.getMinNum());
|
||||
activateMapper.updateById(activate);
|
||||
}else {
|
||||
activate.setHandselType("GD");
|
||||
activate.setMaxNum(activate.getMinNum());
|
||||
activateMapper.insert(activate);
|
||||
}
|
||||
if(!CollectionUtils.isEmpty(activate.getProducts())){
|
||||
List<Integer> collect = new ArrayList<>();
|
||||
for (TbActivateProduct product : activate.getProducts()) {
|
||||
product.setActivateId(activate.getId());
|
||||
if (product.getId() != null) collect.add(product.getId());
|
||||
}
|
||||
QueryWrapper<TbActivateProduct> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("activate_id",activate.getId());
|
||||
List<TbActivateProduct> actProducts = actProductService.list(queryWrapper);
|
||||
for (TbActivateProduct actProduct : actProducts) {
|
||||
if (!collect.contains(actProduct.getId())) {
|
||||
actProductService.removeById(actProduct.getId());
|
||||
}
|
||||
}
|
||||
actProductService.saveOrUpdateBatch(activate.getProducts());
|
||||
}else {
|
||||
LambdaQueryWrapper<TbActivateProduct> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TbActivateProduct::getActivateId, activate.getId()); // 条件:年龄等于30
|
||||
actProductService.remove(queryWrapper);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ActivateProsVo> findActivatePros(Integer activateId) {
|
||||
QueryWrapper<TbActivateProduct> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("activate_id", activateId);
|
||||
List<TbActivateProduct> actProducts = actProductService.list(queryWrapper);
|
||||
if (!CollectionUtils.isEmpty(actProducts)) {
|
||||
Map<Integer, Integer> map = actProducts.stream().collect(
|
||||
Collectors.toMap(
|
||||
TbActivateProduct::getProductId,
|
||||
TbActivateProduct::getNum,
|
||||
(existing, replacement) -> existing));
|
||||
if (!CollectionUtils.isEmpty(map)) {
|
||||
List<TbProduct> products = tbProductRepository.findByIds(new ArrayList<>(map.keySet()));
|
||||
List<ActivateProsVo> results= new ArrayList<>();
|
||||
for (TbProduct product : products) {
|
||||
ActivateProsVo pro =new ActivateProsVo(product.getId(),product.getName(),product.getCoverImg());
|
||||
pro.setNum(map.get(pro.getId()));
|
||||
results.add(pro);
|
||||
}
|
||||
return results;
|
||||
}
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,27 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.ysk.cashier.mybatis.mapper.TbActivateProductMapper;
|
||||
import cn.ysk.cashier.mybatis.entity.TbActivateProduct;
|
||||
import cn.ysk.cashier.mybatis.service.TbActivateProductService;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import cn.ysk.cashier.dto.TbActivateProductQueryCriteria;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表(TbActivateProduct)表服务实现类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
*/
|
||||
@Service("tbActivateProductService")
|
||||
public class TbActivateProductServiceImpl extends ServiceImpl<TbActivateProductMapper, TbActivateProduct> implements TbActivateProductService {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -1,10 +1,18 @@
|
|||
package cn.ysk.cashier.mybatis.service.impl;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbActivate;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import cn.ysk.cashier.mybatis.service.TbActivateService;
|
||||
import cn.ysk.cashier.mybatis.mapper.TbActivateMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* @author Administrator
|
||||
|
|
@ -12,9 +20,28 @@ import org.springframework.stereotype.Service;
|
|||
* @createDate 2024-09-03 14:08:30
|
||||
*/
|
||||
@Service
|
||||
public class TbActivateServiceImpl extends ServiceImpl<TbActivateMapper, TbActivate>
|
||||
implements TbActivateService{
|
||||
public class TbActivateServiceImpl extends ServiceImpl<TbActivateMapper, TbActivate> implements TbActivateService{
|
||||
|
||||
@Autowired
|
||||
private TbActivateMapper activateMapper;
|
||||
|
||||
@Override
|
||||
public Object findActivate(String shopId) {
|
||||
QueryWrapper<TbActivate> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("shop_id",shopId);
|
||||
queryWrapper.orderByDesc("id");
|
||||
List<TbActivate> list = activateMapper.selectList(queryWrapper);
|
||||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyActivate(TbActivate activate) {
|
||||
if (Objects.nonNull(activate.getId()) && activate.getId() > 0){
|
||||
activateMapper.updateById(activate);
|
||||
}else {
|
||||
activateMapper.insert(activate);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,19 @@
|
|||
package cn.ysk.cashier.mybatis.service.impl;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbCouponProduct;
|
||||
import cn.ysk.cashier.mybatis.mapper.TbCouponProductMapper;
|
||||
import cn.ysk.cashier.mybatis.service.TbCouponProductService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* 活动赠送商品表(TbActivateProduct)表服务实现类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-08-20 11:27:40
|
||||
*/
|
||||
@Service("tbCouponProductService")
|
||||
public class TbCouponProductServiceImpl extends ServiceImpl<TbCouponProductMapper, TbCouponProduct> implements TbCouponProductService {
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,130 @@
|
|||
package cn.ysk.cashier.mybatis.service.impl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.ysk.cashier.dto.TbShopCouponQueryCriteria;
|
||||
import cn.ysk.cashier.mybatis.entity.TbCouponProduct;
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopCoupon;
|
||||
import cn.ysk.cashier.mybatis.mapper.TbShopCouponMapper;
|
||||
import cn.ysk.cashier.mybatis.service.TbCouponProductService;
|
||||
import cn.ysk.cashier.mybatis.service.TbShopCouponService;
|
||||
import cn.ysk.cashier.mybatis.vo.TbShopCouponVo;
|
||||
import cn.ysk.cashier.pojo.product.TbProduct;
|
||||
import cn.ysk.cashier.repository.product.TbProductRepository;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 优惠券(TbShopCoupon)表服务实现类
|
||||
*
|
||||
* @author ww
|
||||
* @since 2024-10-22 15:43:25
|
||||
*/
|
||||
@Service("tbShopCouponService")
|
||||
public class TbShopCouponServiceImpl extends ServiceImpl<TbShopCouponMapper, TbShopCoupon> implements TbShopCouponService {
|
||||
|
||||
@Autowired
|
||||
private TbShopCouponMapper tbShopCouponmapper;
|
||||
@Autowired
|
||||
private TbCouponProductService couProductService;
|
||||
@Autowired
|
||||
private TbProductRepository tbProductRepository;
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryAll(TbShopCouponQueryCriteria criteria) {
|
||||
Page<TbShopCoupon> page = new Page<>(criteria.getPage(), criteria.getSize());
|
||||
QueryWrapper<TbShopCoupon> wrapper = new QueryWrapper<>();
|
||||
wrapper.eq("shop_id", criteria.getShopId());
|
||||
// if (StringUtils.isNotBlank(criteria.getName())) {
|
||||
// wrapper.and(w -> w.like("name", criteria.getName())
|
||||
// .or()
|
||||
// .like("singer", criteria.getName())
|
||||
// .or()
|
||||
// .like("origin_singer", criteria.getName()));
|
||||
// }
|
||||
wrapper.orderByDesc("create_time");
|
||||
Page<TbShopCoupon> ipage = tbShopCouponmapper.selectPage(page, wrapper);
|
||||
return PageUtil.toPage(ipage.getRecords(), ipage.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbShopCouponVo findById(Integer id) {
|
||||
TbShopCouponVo tbShopCouponVo = new TbShopCouponVo();
|
||||
TbShopCoupon tbShopCoupon = tbShopCouponmapper.selectById(id);
|
||||
BeanUtil.copyProperties(tbShopCoupon,tbShopCouponVo, CopyOptions.create().setIgnoreNullValue(true));
|
||||
if(tbShopCoupon.getType()==2){
|
||||
List<TbCouponProduct> activatePros = findActivatePros(id);
|
||||
tbShopCouponVo.setProducts(activatePros);
|
||||
}
|
||||
return tbShopCouponVo;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean update(TbShopCouponVo param) {
|
||||
if (param.getId() == null) {
|
||||
tbShopCouponmapper.insert(param);
|
||||
} else {
|
||||
tbShopCouponmapper.updateById(param);
|
||||
}
|
||||
if (CollectionUtil.isNotEmpty(param.getProducts())) {
|
||||
List<Integer> collect = new ArrayList<>();
|
||||
for (TbCouponProduct product : param.getProducts()) {
|
||||
product.setCouponId(param.getId());
|
||||
if (product.getId() != null) collect.add(product.getId());
|
||||
}
|
||||
QueryWrapper<TbCouponProduct> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("coupon_id", param.getId());
|
||||
List<TbCouponProduct> actProducts = couProductService.list(queryWrapper);
|
||||
for (TbCouponProduct actProduct : actProducts) {
|
||||
if (!collect.contains(actProduct.getId())) {
|
||||
couProductService.removeById(actProduct.getId());
|
||||
}
|
||||
}
|
||||
couProductService.saveOrUpdateBatch(param.getProducts());
|
||||
} else {
|
||||
LambdaQueryWrapper<TbCouponProduct> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(TbCouponProduct::getCouponId, param.getId());
|
||||
couProductService.remove(queryWrapper);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean delete(Integer id) {
|
||||
tbShopCouponmapper.deleteById(id);
|
||||
couProductService.remove(new LambdaQueryWrapper<TbCouponProduct>().eq(TbCouponProduct::getCouponId, id));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
public List<TbCouponProduct> findActivatePros(Integer couponId) {
|
||||
QueryWrapper<TbCouponProduct> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("coupon_id", couponId);
|
||||
List<TbCouponProduct> actProducts = couProductService.list(queryWrapper);
|
||||
if (!CollectionUtils.isEmpty(actProducts)) {
|
||||
for (TbCouponProduct actProduct : actProducts) {
|
||||
TbProduct product = tbProductRepository.findById(actProduct.getProductId()).orElse(null);
|
||||
if (product != null) {
|
||||
actProduct.setName(product.getName());
|
||||
actProduct.setCoverImg(product.getCoverImg());
|
||||
}
|
||||
}
|
||||
return actProducts;
|
||||
}
|
||||
return new ArrayList<>();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1,17 +0,0 @@
|
|||
package cn.ysk.cashier.mybatis.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ActivateProsVo {
|
||||
private Integer id;
|
||||
private String name;
|
||||
private String coverImg;
|
||||
private Integer num;
|
||||
|
||||
public ActivateProsVo(Integer id, String name, String coverImg) {
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.coverImg = coverImg;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
package cn.ysk.cashier.mybatis.vo;
|
||||
|
||||
import cn.ysk.cashier.mybatis.entity.TbCouponProduct;
|
||||
import cn.ysk.cashier.mybatis.entity.TbShopCoupon;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class TbShopCouponVo extends TbShopCoupon {
|
||||
|
||||
private List<TbCouponProduct> products = new ArrayList<>();
|
||||
}
|
||||
|
|
@ -1,53 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="bot_button_config")
|
||||
public class BotButtonConfig implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`button_name`")
|
||||
@ApiModelProperty(value = "按钮名称")
|
||||
private String buttonName;
|
||||
|
||||
@Column(name = "`button_value`")
|
||||
@ApiModelProperty(value = "按钮值")
|
||||
private String buttonValue;
|
||||
|
||||
public void copy(BotButtonConfig source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,57 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="bot_config")
|
||||
public class BotConfig implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`config_key`")
|
||||
@ApiModelProperty(value = "元素键值")
|
||||
private String configKey;
|
||||
|
||||
@Column(name = "`config_value`")
|
||||
@ApiModelProperty(value = "元素值")
|
||||
private String configValue;
|
||||
|
||||
@Column(name = "`remark`")
|
||||
@ApiModelProperty(value = "描述")
|
||||
private String remark;
|
||||
|
||||
public void copy(BotConfig source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,123 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="bot_user")
|
||||
public class BotUser implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`father_id`")
|
||||
@ApiModelProperty(value = "fatherId")
|
||||
private Integer fatherId;
|
||||
|
||||
@Column(name = "`father_telegram_id`")
|
||||
@ApiModelProperty(value = "父级电报号")
|
||||
private String fatherTelegramId;
|
||||
|
||||
@Column(name = "`user_telegram_id`")
|
||||
@ApiModelProperty(value = "电报号")
|
||||
private String userTelegramId;
|
||||
|
||||
@Column(name = "`user_name`")
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@Column(name = "`group_telegram_id`")
|
||||
@ApiModelProperty(value = "组电报号")
|
||||
private String groupTelegramId;
|
||||
|
||||
@Column(name = "`user_code`")
|
||||
@ApiModelProperty(value = "用户代码")
|
||||
private String userCode;
|
||||
|
||||
@Column(name = "`user_pay_pass`")
|
||||
@ApiModelProperty(value = "userPayPass")
|
||||
private String userPayPass;
|
||||
|
||||
@Column(name = "`bomb_status`")
|
||||
@ApiModelProperty(value = "bombStatus")
|
||||
private String bombStatus;
|
||||
|
||||
@Column(name = "`bot_status`")
|
||||
@ApiModelProperty(value = "用户状态")
|
||||
private String botStatus;
|
||||
|
||||
@Column(name = "`usdt_recharge_total`")
|
||||
@ApiModelProperty(value = "总充值")
|
||||
private BigDecimal usdtRechargeTotal;
|
||||
|
||||
@Column(name = "`usdt_withdraw_total`")
|
||||
@ApiModelProperty(value = "总提现")
|
||||
private BigDecimal usdtWithdrawTotal;
|
||||
|
||||
@Column(name = "`balance`")
|
||||
@ApiModelProperty(value = "总资金")
|
||||
private BigDecimal balance;
|
||||
|
||||
@Column(name = "`freeze_balance`")
|
||||
@ApiModelProperty(value = "冻结资金")
|
||||
private BigDecimal freezeBalance;
|
||||
|
||||
@Column(name = "`version`")
|
||||
@ApiModelProperty(value = "版本号")
|
||||
private Integer version;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "`update_time`")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "`user_language`")
|
||||
@ApiModelProperty(value = "语言")
|
||||
private String userLanguage;
|
||||
|
||||
@Column(name = "`chip_balance`")
|
||||
@ApiModelProperty(value = "质押资金")
|
||||
private BigDecimal chipBalance;
|
||||
|
||||
@Column(name = "`father_bind_time`")
|
||||
@ApiModelProperty(value = "绑定时间")
|
||||
private Timestamp fatherBindTime;
|
||||
|
||||
public void copy(BotUser source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,75 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="bot_user_flow")
|
||||
public class BotUserFlow implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`user_telegram_id`")
|
||||
@ApiModelProperty(value = "电报号")
|
||||
private String userTelegramId;
|
||||
|
||||
@Column(name = "`user_name`")
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@Column(name = "`biz_code`")
|
||||
@ApiModelProperty(value = "业务代码")
|
||||
private String bizCode;
|
||||
|
||||
@Column(name = "`amount`")
|
||||
@ApiModelProperty(value = "变动金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Column(name = "`old_balance`")
|
||||
@ApiModelProperty(value = "变动前金额")
|
||||
private BigDecimal oldBalance;
|
||||
|
||||
@Column(name = "`new_balance`")
|
||||
@ApiModelProperty(value = "变动后金额")
|
||||
private BigDecimal newBalance;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
||||
public void copy(BotUserFlow source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,100 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2023-11-07
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_renewals_pay_log")
|
||||
public class TbRenewalsPayLog implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`pay_type`")
|
||||
@ApiModelProperty(value = "支付方式")
|
||||
private String payType;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "店铺Id")
|
||||
private String shopId;
|
||||
|
||||
@Column(name = "`order_id`")
|
||||
@ApiModelProperty(value = "订单Id")
|
||||
private String orderId;
|
||||
|
||||
@Column(name = "`open_id`")
|
||||
@ApiModelProperty(value = "openId")
|
||||
private String openId;
|
||||
|
||||
@Column(name = "`user_id`")
|
||||
@ApiModelProperty(value = "用户Id")
|
||||
private String userId;
|
||||
|
||||
@Column(name = "`transaction_id`")
|
||||
@ApiModelProperty(value = "交易单号(第三方交易单号)")
|
||||
private String transactionId;
|
||||
|
||||
@Column(name = "`amount`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "状态 ")
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "`remark`")
|
||||
@ApiModelProperty(value = "备注")
|
||||
private String remark;
|
||||
|
||||
@Column(name = "`attach`")
|
||||
@ApiModelProperty(value = "用户自定义参数")
|
||||
private String attach;
|
||||
|
||||
@Column(name = "`expired_at`")
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private Long expiredAt;
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Long updatedAt;
|
||||
|
||||
public void copy(TbRenewalsPayLog source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,467 +0,0 @@
|
|||
|
||||
package cn.ysk.cashier.pojo.shop;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
import java.sql.Timestamp;
|
||||
|
||||
/**
|
||||
* @author lyf
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @date 2024-03-20
|
||||
**/
|
||||
@Entity
|
||||
@Table(name = "tb_merchant_coupon")
|
||||
public class TbMerchantCoupon implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "自增")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "状态0-关闭 1 正常")
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "`title`")
|
||||
@ApiModelProperty(value = " 优惠券名称")
|
||||
private String title;
|
||||
|
||||
@Column(name = "`template_id`", nullable = false)
|
||||
@NotBlank
|
||||
@ApiModelProperty(value = "templateId")
|
||||
private String templateId = "0";
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "shopId")
|
||||
private String shopId;
|
||||
|
||||
@Column(name = "`shop_snap`")
|
||||
@ApiModelProperty(value = "shopSnap")
|
||||
private String shopSnap;
|
||||
|
||||
@Column(name = "`from_time`")
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private Timestamp fromTime;
|
||||
|
||||
@Column(name = "`to_time`")
|
||||
@ApiModelProperty(value = "到期时间")
|
||||
private Timestamp toTime;
|
||||
|
||||
@Column(name = "`limit_number`")
|
||||
@ApiModelProperty(value = "限领数量")
|
||||
private Integer limitNumber;
|
||||
|
||||
@Column(name = "`number`")
|
||||
@ApiModelProperty(value = "发放数量")
|
||||
private Integer number;
|
||||
|
||||
@Column(name = "`use_number`")
|
||||
@ApiModelProperty(value = "已核销数量")
|
||||
private Integer useNumber;
|
||||
|
||||
@Column(name = "`left_number`", nullable = false)
|
||||
@ApiModelProperty(value = "剩余数量")
|
||||
private Integer leftNumber;
|
||||
|
||||
@Column(name = "`amount`")
|
||||
@ApiModelProperty(value = "优惠金额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Column(name = "`limit_amount`")
|
||||
@ApiModelProperty(value = "订单满赠金额")
|
||||
private BigDecimal limitAmount;
|
||||
|
||||
@Column(name = "`is_show`")
|
||||
@ApiModelProperty(value = "是否显示0-不显示 1显示")
|
||||
private Integer isShow;
|
||||
|
||||
@Column(name = "`pic`")
|
||||
@ApiModelProperty(value = "图标")
|
||||
private String pic;
|
||||
|
||||
@Column(name = "`type`")
|
||||
@ApiModelProperty(value = "0-满减 1-折扣")
|
||||
private Integer type;
|
||||
|
||||
@Column(name = "`ratio`")
|
||||
@ApiModelProperty(value = "折扣 ,一位小数")
|
||||
private Float ratio;
|
||||
|
||||
@Column(name = "`max_ratio_amount`")
|
||||
@ApiModelProperty(value = "最大折扣金额")
|
||||
private BigDecimal maxRatioAmount;
|
||||
|
||||
@Column(name = "`track`")
|
||||
@ApiModelProperty(value = "优惠券途径,首充|分销")
|
||||
private String track;
|
||||
|
||||
@Column(name = "`class_type`")
|
||||
@ApiModelProperty(value = "品类product 商品券 ---cateogry 品类券common -通用券")
|
||||
@NotNull
|
||||
private String classType;
|
||||
|
||||
@Column(name = "`effect_type`")
|
||||
@ApiModelProperty(value = "有效期类型:0-toTime有效 1-effectDays有效")
|
||||
@NotNull
|
||||
private Integer effectType;
|
||||
|
||||
@Column(name = "`effect_days`")
|
||||
@ApiModelProperty(value = "领取之日有效天数")
|
||||
private Integer effectDays;
|
||||
|
||||
@Column(name = "`relation_ids`")
|
||||
@ApiModelProperty(value = "关联商品Id")
|
||||
private String relationIds;
|
||||
|
||||
@Column(name = "`relation_list`")
|
||||
@ApiModelProperty(value = "relationList")
|
||||
private String relationList;
|
||||
|
||||
@Column(name = "`editor`")
|
||||
@ApiModelProperty(value = "发放人")
|
||||
private String editor;
|
||||
|
||||
@Column(name = "`note`")
|
||||
@ApiModelProperty(value = "说明")
|
||||
private String note;
|
||||
|
||||
@Column(name = "`created_at`", nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`", nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Long updatedAt;
|
||||
|
||||
@Column(name = "`furnish_meal`")
|
||||
@ApiModelProperty(value = "支持堂食")
|
||||
private Integer furnishMeal;
|
||||
|
||||
@Column(name = "`furnish_express`")
|
||||
@ApiModelProperty(value = "支持配送")
|
||||
private Integer furnishExpress;
|
||||
|
||||
@Column(name = "`furnish_draw`")
|
||||
@ApiModelProperty(value = "支持自提")
|
||||
private Integer furnishDraw;
|
||||
|
||||
@Column(name = "`furnish_vir`")
|
||||
@ApiModelProperty(value = "支持虚拟")
|
||||
private Integer furnishVir;
|
||||
|
||||
@Column(name = "`disable_distribute`")
|
||||
@ApiModelProperty(value = "disableDistribute")
|
||||
private Integer disableDistribute;
|
||||
|
||||
@Column(name = "`merchant_id`")
|
||||
@ApiModelProperty(value = "商户Id")
|
||||
private String merchantId;
|
||||
|
||||
@Column(name = "`category_id`")
|
||||
@ApiModelProperty(value = "分类id")
|
||||
private String categoryId;
|
||||
|
||||
public void copy(TbMerchantCoupon source) {
|
||||
BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Integer getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Integer status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
public String getTemplateId() {
|
||||
return templateId;
|
||||
}
|
||||
|
||||
public void setTemplateId(String templateId) {
|
||||
this.templateId = templateId;
|
||||
}
|
||||
|
||||
public String getShopId() {
|
||||
return shopId;
|
||||
}
|
||||
|
||||
public void setShopId(String shopId) {
|
||||
this.shopId = shopId;
|
||||
}
|
||||
|
||||
public String getShopSnap() {
|
||||
return shopSnap;
|
||||
}
|
||||
|
||||
public void setShopSnap(String shopSnap) {
|
||||
this.shopSnap = shopSnap;
|
||||
}
|
||||
|
||||
public Timestamp getFromTime() {
|
||||
return fromTime;
|
||||
}
|
||||
|
||||
public void setFromTime(Timestamp fromTime) {
|
||||
this.fromTime = fromTime;
|
||||
}
|
||||
|
||||
public Timestamp getToTime() {
|
||||
return toTime;
|
||||
}
|
||||
|
||||
public void setToTime(Timestamp toTime) {
|
||||
this.toTime = toTime;
|
||||
}
|
||||
|
||||
public Integer getLimitNumber() {
|
||||
return limitNumber;
|
||||
}
|
||||
|
||||
public void setLimitNumber(Integer limitNumber) {
|
||||
this.limitNumber = limitNumber;
|
||||
}
|
||||
|
||||
public Integer getNumber() {
|
||||
return number;
|
||||
}
|
||||
|
||||
public void setNumber(Integer number) {
|
||||
this.number = number;
|
||||
}
|
||||
|
||||
public Integer getUseNumber() {
|
||||
return useNumber;
|
||||
}
|
||||
|
||||
public void setUseNumber(Integer useNumber) {
|
||||
this.useNumber = useNumber;
|
||||
}
|
||||
|
||||
public Integer getLeftNumber() {
|
||||
return leftNumber;
|
||||
}
|
||||
|
||||
public void setLeftNumber(Integer leftNumber) {
|
||||
this.leftNumber = leftNumber;
|
||||
}
|
||||
|
||||
public BigDecimal getAmount() {
|
||||
return amount;
|
||||
}
|
||||
|
||||
public void setAmount(BigDecimal amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public BigDecimal getLimitAmount() {
|
||||
return limitAmount;
|
||||
}
|
||||
|
||||
public void setLimitAmount(BigDecimal limitAmount) {
|
||||
this.limitAmount = limitAmount;
|
||||
}
|
||||
|
||||
public Integer getIsShow() {
|
||||
return isShow;
|
||||
}
|
||||
|
||||
public void setIsShow(Integer isShow) {
|
||||
this.isShow = isShow;
|
||||
}
|
||||
|
||||
public String getPic() {
|
||||
return pic;
|
||||
}
|
||||
|
||||
public void setPic(String pic) {
|
||||
this.pic = pic;
|
||||
}
|
||||
|
||||
public Integer getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public void setType(Integer type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public Float getRatio() {
|
||||
return ratio;
|
||||
}
|
||||
|
||||
public void setRatio(Float ratio) {
|
||||
this.ratio = ratio;
|
||||
}
|
||||
|
||||
public BigDecimal getMaxRatioAmount() {
|
||||
return maxRatioAmount;
|
||||
}
|
||||
|
||||
public void setMaxRatioAmount(BigDecimal maxRatioAmount) {
|
||||
this.maxRatioAmount = maxRatioAmount;
|
||||
}
|
||||
|
||||
public String getTrack() {
|
||||
return track;
|
||||
}
|
||||
|
||||
public void setTrack(String track) {
|
||||
this.track = track;
|
||||
}
|
||||
|
||||
public String getClassType() {
|
||||
return classType;
|
||||
}
|
||||
|
||||
public void setClassType(String classType) {
|
||||
this.classType = classType;
|
||||
}
|
||||
|
||||
public Integer getEffectType() {
|
||||
return effectType;
|
||||
}
|
||||
|
||||
public void setEffectType(Integer effectType) {
|
||||
this.effectType = effectType;
|
||||
}
|
||||
|
||||
public Integer getEffectDays() {
|
||||
return effectDays;
|
||||
}
|
||||
|
||||
public void setEffectDays(Integer effectDays) {
|
||||
this.effectDays = effectDays;
|
||||
}
|
||||
|
||||
public String getRelationIds() {
|
||||
return relationIds;
|
||||
}
|
||||
|
||||
public void setRelationIds(String relationIds) {
|
||||
this.relationIds = relationIds;
|
||||
}
|
||||
|
||||
public String getRelationList() {
|
||||
return relationList;
|
||||
}
|
||||
|
||||
public void setRelationList(String relationList) {
|
||||
this.relationList = relationList;
|
||||
}
|
||||
|
||||
public String getEditor() {
|
||||
return editor;
|
||||
}
|
||||
|
||||
public void setEditor(String editor) {
|
||||
this.editor = editor;
|
||||
}
|
||||
|
||||
public String getNote() {
|
||||
return note;
|
||||
}
|
||||
|
||||
public void setNote(String note) {
|
||||
this.note = note;
|
||||
}
|
||||
|
||||
public Long getCreatedAt() {
|
||||
return createdAt;
|
||||
}
|
||||
|
||||
public void setCreatedAt(Long createdAt) {
|
||||
this.createdAt = createdAt;
|
||||
}
|
||||
|
||||
public Long getUpdatedAt() {
|
||||
return updatedAt;
|
||||
}
|
||||
|
||||
public void setUpdatedAt(Long updatedAt) {
|
||||
this.updatedAt = updatedAt;
|
||||
}
|
||||
|
||||
public Integer getFurnishMeal() {
|
||||
return furnishMeal;
|
||||
}
|
||||
|
||||
public void setFurnishMeal(Integer furnishMeal) {
|
||||
this.furnishMeal = furnishMeal;
|
||||
}
|
||||
|
||||
public Integer getFurnishExpress() {
|
||||
return furnishExpress;
|
||||
}
|
||||
|
||||
public void setFurnishExpress(Integer furnishExpress) {
|
||||
this.furnishExpress = furnishExpress;
|
||||
}
|
||||
|
||||
public Integer getFurnishDraw() {
|
||||
return furnishDraw;
|
||||
}
|
||||
|
||||
public void setFurnishDraw(Integer furnishDraw) {
|
||||
this.furnishDraw = furnishDraw;
|
||||
}
|
||||
|
||||
public Integer getFurnishVir() {
|
||||
return furnishVir;
|
||||
}
|
||||
|
||||
public void setFurnishVir(Integer furnishVir) {
|
||||
this.furnishVir = furnishVir;
|
||||
}
|
||||
|
||||
public Integer getDisableDistribute() {
|
||||
return disableDistribute;
|
||||
}
|
||||
|
||||
public void setDisableDistribute(Integer disableDistribute) {
|
||||
this.disableDistribute = disableDistribute;
|
||||
}
|
||||
|
||||
public String getMerchantId() {
|
||||
return merchantId;
|
||||
}
|
||||
|
||||
public void setMerchantId(String merchantId) {
|
||||
this.merchantId = merchantId;
|
||||
}
|
||||
|
||||
public String getCategoryId() {
|
||||
return categoryId;
|
||||
}
|
||||
|
||||
public void setCategoryId(String categoryId) {
|
||||
this.categoryId = categoryId;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,120 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo.shop;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-01-08
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_receipt_sales")
|
||||
public class TbReceiptSales implements Serializable {
|
||||
|
||||
@Id
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "shopId")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`title`")
|
||||
@ApiModelProperty(value = "标题")
|
||||
private String title="";
|
||||
|
||||
@Column(name = "`logo`")
|
||||
@ApiModelProperty(value = "是否显示公司Logo")
|
||||
private String logo="";
|
||||
|
||||
@Column(name = "`show_contact_info`")
|
||||
@ApiModelProperty(value = "打印联系电话等信息")
|
||||
private Integer showContactInfo=0;
|
||||
|
||||
@Column(name = "`show_member`")
|
||||
@ApiModelProperty(value = "打印会员开关 0?1")
|
||||
private Integer showMember=0;
|
||||
|
||||
@Column(name = "`show_member_code`")
|
||||
@ApiModelProperty(value = "打印会员编号开关")
|
||||
private Integer showMemberCode=0;
|
||||
|
||||
@Column(name = "`show_member_score`")
|
||||
@ApiModelProperty(value = "打印会员积分")
|
||||
private Integer showMemberScore=0;
|
||||
|
||||
@Column(name = "`show_member_wallet`")
|
||||
@ApiModelProperty(value = "打印会员余额开关 0?1")
|
||||
private Integer showMemberWallet=0;
|
||||
|
||||
@Column(name = "`footer_remark`")
|
||||
@ApiModelProperty(value = "店铺Id")
|
||||
private String footerRemark="";
|
||||
|
||||
@Column(name = "`show_cash_charge`")
|
||||
@ApiModelProperty(value = "打印找零")
|
||||
private Integer showCashCharge=0;
|
||||
|
||||
@Column(name = "`show_serial_no`")
|
||||
@ApiModelProperty(value = "流水号")
|
||||
private Integer showSerialNo=0;
|
||||
|
||||
@Column(name = "`big_serial_no`")
|
||||
@ApiModelProperty(value = "用大号字打印流水号 在showSerialNo可用前提下")
|
||||
private Integer bigSerialNo;
|
||||
|
||||
@Column(name = "`header_text`")
|
||||
@ApiModelProperty(value = "头部文字")
|
||||
private String headerText;
|
||||
|
||||
@Column(name = "`header_text_align`")
|
||||
@ApiModelProperty(value = "文字 对齐方式")
|
||||
private String headerTextAlign;
|
||||
|
||||
@Column(name = "`footer_text`")
|
||||
@ApiModelProperty(value = "尾部文字")
|
||||
private String footerText="";
|
||||
|
||||
@Column(name = "`footer_text_align`")
|
||||
@ApiModelProperty(value = "文字 对齐方式")
|
||||
private String footerTextAlign;
|
||||
|
||||
@Column(name = "`footer_image`")
|
||||
@ApiModelProperty(value = "尾部图像")
|
||||
private String footerImage="";
|
||||
|
||||
@Column(name = "`pre_print`")
|
||||
@ApiModelProperty(value = "预打印,YES开启 NO不开启")
|
||||
private String prePrint;
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Long updatedAt;
|
||||
|
||||
public void copy(TbReceiptSales source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,72 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo.shop;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_shop_cash_spread")
|
||||
public class TbShopCashSpread implements Serializable {
|
||||
|
||||
@Id
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "shopId")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`sale_receipt`")
|
||||
@ApiModelProperty(value = "登陆密码")
|
||||
private String saleReceipt;
|
||||
|
||||
@Column(name = "`triplicate_receipt`")
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String triplicateReceipt;
|
||||
|
||||
@Column(name = "`screen_config`")
|
||||
@ApiModelProperty(value = "到期提醒时间")
|
||||
private String screenConfig;
|
||||
|
||||
@Column(name = "`tag_config`")
|
||||
@ApiModelProperty(value = "tagConfig")
|
||||
private String tagConfig;
|
||||
|
||||
@Column(name = "`scale_config`")
|
||||
@ApiModelProperty(value = "scaleConfig")
|
||||
private String scaleConfig;
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Long updatedAt;
|
||||
|
||||
public void copy(TbShopCashSpread source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.pojo.shop;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_shop_currency")
|
||||
public class TbShopCurrency implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "自增id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "店铺Id")
|
||||
private String shopId;
|
||||
|
||||
@Column(name = "`prepare_amount`")
|
||||
@ApiModelProperty(value = "备用金")
|
||||
private BigDecimal prepareAmount;
|
||||
|
||||
@Column(name = "`currency`")
|
||||
@ApiModelProperty(value = "货币单位 ¥,$")
|
||||
private String currency;
|
||||
|
||||
@Column(name = "`decimals_digits`")
|
||||
@ApiModelProperty(value = "小数位,0,1,2,无,元,角,分")
|
||||
private Integer decimalsDigits;
|
||||
|
||||
@Column(name = "`discount_round`")
|
||||
@ApiModelProperty(value = "无,四舍五入,五舍六入none,round4up5,round5up6,round12up34")
|
||||
private String discountRound;
|
||||
|
||||
@Column(name = "`merchant_id`")
|
||||
@ApiModelProperty(value = "商户Id")
|
||||
private String merchantId;
|
||||
|
||||
@Column(name = "`small_change`")
|
||||
@ApiModelProperty(value = "订单抹零 -1无,0元 1角2分 0.5=0.5元")
|
||||
private Integer smallChange;
|
||||
|
||||
@Column(name = "`enable_custom_discount`")
|
||||
@ApiModelProperty(value = "使折扣生效")
|
||||
private Integer enableCustomDiscount;
|
||||
|
||||
@Column(name = "`max_discount`")
|
||||
@ApiModelProperty(value = "最大抹零金额(100)")
|
||||
private BigDecimal maxDiscount;
|
||||
|
||||
@Column(name = "`max_percent`")
|
||||
@ApiModelProperty(value = "最大折扣百分比,,优先级高于max_discount")
|
||||
private Double maxPercent;
|
||||
|
||||
@Column(name = "`discount_configs`")
|
||||
@ApiModelProperty(value = "折扣显示详情")
|
||||
private String discountConfigs;
|
||||
|
||||
@Column(name = "`biz_duration`")
|
||||
@ApiModelProperty(value = "营业时间(弃用)")
|
||||
private String bizDuration;
|
||||
|
||||
@Column(name = "`allow_web_pay`")
|
||||
@ApiModelProperty(value = "允许网络支付")
|
||||
private Integer allowWebPay;
|
||||
|
||||
@Column(name = "`is_auto_to_zero`")
|
||||
@ApiModelProperty(value = "自动抹零,开启时,系统自动抹零")
|
||||
private Integer isAutoToZero;
|
||||
|
||||
@Column(name = "`is_include_tax_price`")
|
||||
@ApiModelProperty(value = "商品含税")
|
||||
private Integer isIncludeTaxPrice;
|
||||
|
||||
@Column(name = "`service_charge`")
|
||||
@ApiModelProperty(value = "服务费配置(小费)")
|
||||
private String serviceCharge;
|
||||
|
||||
@Column(name = "`tax_number`")
|
||||
@ApiModelProperty(value = "税号")
|
||||
private String taxNumber;
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Long updatedAt;
|
||||
|
||||
@Column(name = "`auto_lock_screen`")
|
||||
@ApiModelProperty(value = "自动锁屏")
|
||||
private Integer autoLockScreen;
|
||||
|
||||
@Column(name = "`voice_notification`")
|
||||
@ApiModelProperty(value = "语音通知")
|
||||
private Integer voiceNotification;
|
||||
|
||||
public void copy(TbShopCurrency source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotButtonConfig;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
public interface BotButtonConfigRepository extends JpaRepository<BotButtonConfig, Integer>, JpaSpecificationExecutor<BotButtonConfig> {
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotConfig;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
public interface BotConfigRepository extends JpaRepository<BotConfig, Integer>, JpaSpecificationExecutor<BotConfig> {
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotUserFlow;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
public interface BotUserFlowRepository extends JpaRepository<BotUserFlow, Integer>, JpaSpecificationExecutor<BotUserFlow> {
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotUser;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
public interface BotUserRepository extends JpaRepository<BotUser, Integer>, JpaSpecificationExecutor<BotUser> {
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository;
|
||||
|
||||
import cn.ysk.cashier.pojo.TbRenewalsPayLog;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2023-11-07
|
||||
**/
|
||||
public interface TbRenewalsPayLogRepository extends JpaRepository<TbRenewalsPayLog, Integer>, JpaSpecificationExecutor<TbRenewalsPayLog> {
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbMerchantCoupon;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-20
|
||||
**/
|
||||
public interface TbMerchantCouponRepository extends JpaRepository<TbMerchantCoupon, Integer>, JpaSpecificationExecutor<TbMerchantCoupon> {
|
||||
}
|
||||
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbReceiptSales;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-08
|
||||
**/
|
||||
public interface TbReceiptSalesRepository extends JpaRepository<TbReceiptSales, Integer>, JpaSpecificationExecutor<TbReceiptSales> {
|
||||
}
|
||||
|
|
@ -1,43 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCashSpread;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
import javax.transaction.Transactional;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
public interface TbShopCashSpreadRepository extends JpaRepository<TbShopCashSpread, String>, JpaSpecificationExecutor<TbShopCashSpread> {
|
||||
@Query("select spread from TbShopCashSpread spread where spread.id = :shopId")
|
||||
TbShopCashSpread findByShopId(@Param("shopId")Integer shopId);
|
||||
|
||||
@Modifying
|
||||
@Transactional
|
||||
@Query("update TbShopCashSpread spread set spread.screenConfig = :screenConfig, spread.updatedAt = :updatedTime where spread.id = :shopId")
|
||||
Integer updateConfig(@Param("shopId")Integer shopId, @Param("screenConfig")String screenConfig,
|
||||
@Param("updatedTime")Long updatedTime);
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,33 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.repository.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCurrency;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
public interface TbShopCurrencyRepository extends JpaRepository<TbShopCurrency, Integer>, JpaSpecificationExecutor<TbShopCurrency> {
|
||||
|
||||
@Query("SELECT currency from TbShopCurrency currency where currency.shopId = :shopId")
|
||||
TbShopCurrency findByShopId(@Param("shopId")String shopId);
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotButtonConfig;
|
||||
import cn.ysk.cashier.dto.BotButtonConfigDto;
|
||||
import cn.ysk.cashier.dto.BotButtonConfigQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
public interface BotButtonConfigService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(BotButtonConfigQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<BotButtonConfigDto>
|
||||
*/
|
||||
List<BotButtonConfigDto> queryAll(BotButtonConfigQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return BotButtonConfigDto
|
||||
*/
|
||||
BotButtonConfigDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return BotButtonConfigDto
|
||||
*/
|
||||
BotButtonConfigDto create(BotButtonConfig resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(BotButtonConfig resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<BotButtonConfigDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -1,68 +0,0 @@
|
|||
package cn.ysk.cashier.service;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotConfig;
|
||||
import cn.ysk.cashier.dto.BotConfigDto;
|
||||
import cn.ysk.cashier.dto.BotConfigQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
public interface BotConfigService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(BotConfigQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<BotConfigDto>
|
||||
*/
|
||||
List<BotConfigDto> queryAll(BotConfigQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return BotConfigDto
|
||||
*/
|
||||
BotConfigDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return BotConfigDto
|
||||
*/
|
||||
BotConfigDto create(BotConfig resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(BotConfig resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<BotConfigDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotUserFlow;
|
||||
import cn.ysk.cashier.dto.BotUserFlowDto;
|
||||
import cn.ysk.cashier.dto.BotUserFlowQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
public interface BotUserFlowService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(BotUserFlowQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<BotUserFlowDto>
|
||||
*/
|
||||
List<BotUserFlowDto> queryAll(BotUserFlowQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return BotUserFlowDto
|
||||
*/
|
||||
BotUserFlowDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return BotUserFlowDto
|
||||
*/
|
||||
BotUserFlowDto create(BotUserFlow resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(BotUserFlow resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<BotUserFlowDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotUser;
|
||||
import cn.ysk.cashier.dto.BotUserDto;
|
||||
import cn.ysk.cashier.dto.BotUserQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
public interface BotUserService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(BotUserQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<BotUserDto>
|
||||
*/
|
||||
List<BotUserDto> queryAll(BotUserQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return BotUserDto
|
||||
*/
|
||||
BotUserDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return BotUserDto
|
||||
*/
|
||||
BotUserDto create(BotUser resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(BotUser resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<BotUserDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service;
|
||||
|
||||
import cn.ysk.cashier.pojo.TbRenewalsPayLog;
|
||||
import cn.ysk.cashier.dto.TbRenewalsPayLogDto;
|
||||
import cn.ysk.cashier.dto.TbRenewalsPayLogQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author lyf
|
||||
* @date 2023-11-07
|
||||
**/
|
||||
public interface TbRenewalsPayLogService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbRenewalsPayLogQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbRenewalsPayLogDto>
|
||||
*/
|
||||
List<TbRenewalsPayLogDto> queryAll(TbRenewalsPayLogQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbRenewalsPayLogDto
|
||||
*/
|
||||
TbRenewalsPayLogDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbRenewalsPayLogDto
|
||||
*/
|
||||
TbRenewalsPayLogDto create(TbRenewalsPayLog resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbRenewalsPayLog resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbRenewalsPayLogDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -1,105 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotButtonConfig;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.repository.BotButtonConfigRepository;
|
||||
import cn.ysk.cashier.service.BotButtonConfigService;
|
||||
import cn.ysk.cashier.dto.BotButtonConfigDto;
|
||||
import cn.ysk.cashier.dto.BotButtonConfigQueryCriteria;
|
||||
import cn.ysk.cashier.mapper.BotButtonConfigMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BotButtonConfigServiceImpl implements BotButtonConfigService {
|
||||
|
||||
private final BotButtonConfigRepository botButtonConfigRepository;
|
||||
private final BotButtonConfigMapper botButtonConfigMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(BotButtonConfigQueryCriteria criteria, Pageable pageable){
|
||||
Page<BotButtonConfig> page = botButtonConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(botButtonConfigMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BotButtonConfigDto> queryAll(BotButtonConfigQueryCriteria criteria){
|
||||
return botButtonConfigMapper.toDto(botButtonConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public BotButtonConfigDto findById(Integer id) {
|
||||
BotButtonConfig botButtonConfig = botButtonConfigRepository.findById(id).orElseGet(BotButtonConfig::new);
|
||||
ValidationUtil.isNull(botButtonConfig.getId(),"BotButtonConfig","id",id);
|
||||
return botButtonConfigMapper.toDto(botButtonConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BotButtonConfigDto create(BotButtonConfig resources) {
|
||||
return botButtonConfigMapper.toDto(botButtonConfigRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(BotButtonConfig resources) {
|
||||
BotButtonConfig botButtonConfig = botButtonConfigRepository.findById(resources.getId()).orElseGet(BotButtonConfig::new);
|
||||
ValidationUtil.isNull( botButtonConfig.getId(),"BotButtonConfig","id",resources.getId());
|
||||
botButtonConfig.copy(resources);
|
||||
botButtonConfigRepository.save(botButtonConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
botButtonConfigRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<BotButtonConfigDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (BotButtonConfigDto botButtonConfig : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("按钮名称", botButtonConfig.getButtonName());
|
||||
map.put("按钮值", botButtonConfig.getButtonValue());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,106 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotConfig;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.repository.BotConfigRepository;
|
||||
import cn.ysk.cashier.service.BotConfigService;
|
||||
import cn.ysk.cashier.dto.BotConfigDto;
|
||||
import cn.ysk.cashier.dto.BotConfigQueryCriteria;
|
||||
import cn.ysk.cashier.mapper.BotConfigMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BotConfigServiceImpl implements BotConfigService {
|
||||
|
||||
private final BotConfigRepository botConfigRepository;
|
||||
private final BotConfigMapper botConfigMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(BotConfigQueryCriteria criteria, Pageable pageable){
|
||||
Page<BotConfig> page = botConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(botConfigMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BotConfigDto> queryAll(BotConfigQueryCriteria criteria){
|
||||
return botConfigMapper.toDto(botConfigRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public BotConfigDto findById(Integer id) {
|
||||
BotConfig botConfig = botConfigRepository.findById(id).orElseGet(BotConfig::new);
|
||||
ValidationUtil.isNull(botConfig.getId(),"BotConfig","id",id);
|
||||
return botConfigMapper.toDto(botConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BotConfigDto create(BotConfig resources) {
|
||||
return botConfigMapper.toDto(botConfigRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(BotConfig resources) {
|
||||
BotConfig botConfig = botConfigRepository.findById(resources.getId()).orElseGet(BotConfig::new);
|
||||
ValidationUtil.isNull( botConfig.getId(),"BotConfig","id",resources.getId());
|
||||
botConfig.copy(resources);
|
||||
botConfigRepository.save(botConfig);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
botConfigRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<BotConfigDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (BotConfigDto botConfig : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("元素键值", botConfig.getConfigKey());
|
||||
map.put("元素值", botConfig.getConfigValue());
|
||||
map.put("描述", botConfig.getRemark());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotUserFlow;
|
||||
import cn.ysk.cashier.repository.BotUserFlowRepository;
|
||||
import cn.ysk.cashier.service.BotUserFlowService;
|
||||
import cn.ysk.cashier.dto.BotUserFlowDto;
|
||||
import cn.ysk.cashier.dto.BotUserFlowQueryCriteria;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.mapper.BotUserFlowMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BotUserFlowServiceImpl implements BotUserFlowService {
|
||||
|
||||
private final BotUserFlowRepository botUserFlowRepository;
|
||||
private final BotUserFlowMapper botUserFlowMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(BotUserFlowQueryCriteria criteria, Pageable pageable){
|
||||
Page<BotUserFlow> page = botUserFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(botUserFlowMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BotUserFlowDto> queryAll(BotUserFlowQueryCriteria criteria){
|
||||
return botUserFlowMapper.toDto(botUserFlowRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public BotUserFlowDto findById(Integer id) {
|
||||
BotUserFlow botUserFlow = botUserFlowRepository.findById(id).orElseGet(BotUserFlow::new);
|
||||
ValidationUtil.isNull(botUserFlow.getId(),"BotUserFlow","id",id);
|
||||
return botUserFlowMapper.toDto(botUserFlow);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BotUserFlowDto create(BotUserFlow resources) {
|
||||
return botUserFlowMapper.toDto(botUserFlowRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(BotUserFlow resources) {
|
||||
BotUserFlow botUserFlow = botUserFlowRepository.findById(resources.getId()).orElseGet(BotUserFlow::new);
|
||||
ValidationUtil.isNull( botUserFlow.getId(),"BotUserFlow","id",resources.getId());
|
||||
botUserFlow.copy(resources);
|
||||
botUserFlowRepository.save(botUserFlow);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
botUserFlowRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<BotUserFlowDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (BotUserFlowDto botUserFlow : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("电报号", botUserFlow.getUserTelegramId());
|
||||
map.put("用户名称", botUserFlow.getUserName());
|
||||
map.put("业务代码", botUserFlow.getBizCode());
|
||||
map.put("变动金额", botUserFlow.getAmount());
|
||||
map.put("变动前金额", botUserFlow.getOldBalance());
|
||||
map.put("变动后金额", botUserFlow.getNewBalance());
|
||||
map.put("创建时间", botUserFlow.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl;
|
||||
|
||||
import cn.ysk.cashier.pojo.BotUser;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.repository.BotUserRepository;
|
||||
import cn.ysk.cashier.service.BotUserService;
|
||||
import cn.ysk.cashier.dto.BotUserDto;
|
||||
import cn.ysk.cashier.dto.BotUserQueryCriteria;
|
||||
import cn.ysk.cashier.mapper.BotUserMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BotUserServiceImpl implements BotUserService {
|
||||
|
||||
private final BotUserRepository botUserRepository;
|
||||
private final BotUserMapper botUserMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(BotUserQueryCriteria criteria, Pageable pageable){
|
||||
Page<BotUser> page = botUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(botUserMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BotUserDto> queryAll(BotUserQueryCriteria criteria){
|
||||
return botUserMapper.toDto(botUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public BotUserDto findById(Integer id) {
|
||||
BotUser botUser = botUserRepository.findById(id).orElseGet(BotUser::new);
|
||||
ValidationUtil.isNull(botUser.getId(),"BotUser","id",id);
|
||||
return botUserMapper.toDto(botUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BotUserDto create(BotUser resources) {
|
||||
return botUserMapper.toDto(botUserRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(BotUser resources) {
|
||||
BotUser botUser = botUserRepository.findById(resources.getId()).orElseGet(BotUser::new);
|
||||
ValidationUtil.isNull( botUser.getId(),"BotUser","id",resources.getId());
|
||||
botUser.copy(resources);
|
||||
botUserRepository.save(botUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
botUserRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<BotUserDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (BotUserDto botUser : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put(" fatherId", botUser.getFatherId());
|
||||
map.put("父级电报号", botUser.getFatherTelegramId());
|
||||
map.put("电报号", botUser.getUserTelegramId());
|
||||
map.put("用户名称", botUser.getUserName());
|
||||
map.put("组电报号", botUser.getGroupTelegramId());
|
||||
map.put("用户代码", botUser.getUserCode());
|
||||
map.put(" userPayPass", botUser.getUserPayPass());
|
||||
map.put(" bombStatus", botUser.getBombStatus());
|
||||
map.put("用户状态", botUser.getBotStatus());
|
||||
map.put("总充值", botUser.getUsdtRechargeTotal());
|
||||
map.put("总提现", botUser.getUsdtWithdrawTotal());
|
||||
map.put("总资金", botUser.getBalance());
|
||||
map.put("冻结资金", botUser.getFreezeBalance());
|
||||
map.put("版本号", botUser.getVersion());
|
||||
map.put("创建时间", botUser.getCreateTime());
|
||||
map.put("更新时间", botUser.getUpdateTime());
|
||||
map.put("语言", botUser.getUserLanguage());
|
||||
map.put("质押资金", botUser.getChipBalance());
|
||||
map.put("绑定时间", botUser.getFatherBindTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,116 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl;
|
||||
|
||||
import cn.ysk.cashier.pojo.TbRenewalsPayLog;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.repository.TbRenewalsPayLogRepository;
|
||||
import cn.ysk.cashier.service.TbRenewalsPayLogService;
|
||||
import cn.ysk.cashier.dto.TbRenewalsPayLogDto;
|
||||
import cn.ysk.cashier.dto.TbRenewalsPayLogQueryCriteria;
|
||||
import cn.ysk.cashier.mapper.TbRenewalsPayLogMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2023-11-07
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbRenewalsPayLogServiceImpl implements TbRenewalsPayLogService {
|
||||
|
||||
private final TbRenewalsPayLogRepository tbRenewalsPayLogRepository;
|
||||
private final TbRenewalsPayLogMapper tbRenewalsPayLogMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbRenewalsPayLogQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbRenewalsPayLog> page = tbRenewalsPayLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbRenewalsPayLogMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbRenewalsPayLogDto> queryAll(TbRenewalsPayLogQueryCriteria criteria){
|
||||
return tbRenewalsPayLogMapper.toDto(tbRenewalsPayLogRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbRenewalsPayLogDto findById(Integer id) {
|
||||
TbRenewalsPayLog tbRenewalsPayLog = tbRenewalsPayLogRepository.findById(id).orElseGet(TbRenewalsPayLog::new);
|
||||
ValidationUtil.isNull(tbRenewalsPayLog.getId(),"TbRenewalsPayLog","id",id);
|
||||
return tbRenewalsPayLogMapper.toDto(tbRenewalsPayLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbRenewalsPayLogDto create(TbRenewalsPayLog resources) {
|
||||
return tbRenewalsPayLogMapper.toDto(tbRenewalsPayLogRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbRenewalsPayLog resources) {
|
||||
TbRenewalsPayLog tbRenewalsPayLog = tbRenewalsPayLogRepository.findById(resources.getId()).orElseGet(TbRenewalsPayLog::new);
|
||||
ValidationUtil.isNull( tbRenewalsPayLog.getId(),"TbRenewalsPayLog","id",resources.getId());
|
||||
tbRenewalsPayLog.copy(resources);
|
||||
tbRenewalsPayLogRepository.save(tbRenewalsPayLog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbRenewalsPayLogRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbRenewalsPayLogDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbRenewalsPayLogDto tbRenewalsPayLog : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("支付方式", tbRenewalsPayLog.getPayType());
|
||||
map.put("店铺Id", tbRenewalsPayLog.getShopId());
|
||||
map.put("订单Id", tbRenewalsPayLog.getOrderId());
|
||||
map.put(" openId", tbRenewalsPayLog.getOpenId());
|
||||
map.put("用户Id", tbRenewalsPayLog.getUserId());
|
||||
map.put("交易单号(第三方交易单号)", tbRenewalsPayLog.getTransactionId());
|
||||
map.put("金额", tbRenewalsPayLog.getAmount());
|
||||
map.put("状态 ", tbRenewalsPayLog.getStatus());
|
||||
map.put("备注", tbRenewalsPayLog.getRemark());
|
||||
map.put("用户自定义参数", tbRenewalsPayLog.getAttach());
|
||||
map.put("到期时间", tbRenewalsPayLog.getExpiredAt());
|
||||
map.put("创建时间", tbRenewalsPayLog.getCreatedAt());
|
||||
map.put(" updatedAt", tbRenewalsPayLog.getUpdatedAt());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -417,16 +417,12 @@ public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
|||
outRecordService.update(lambdaUpdateWrapper);
|
||||
|
||||
List<TbOrderDetail> details = tbOrderDetailRepository.searchDetailByOrderId(tbOrderInfo.getId());
|
||||
Set<String> keys = new HashSet<>();
|
||||
for (TbOrderDetail detail : details) {
|
||||
detail.setStatus("cancelled");
|
||||
// 返还库存
|
||||
productService.returnStockByPro(detail.getProductId(), detail.getProductSkuId(), detail.getNum());
|
||||
tbOrderDetailRepository.save(detail);
|
||||
keys.add(CacheKey.PRODUCT_SKU + detail.getShopId() + ":" + detail.getId());
|
||||
}
|
||||
String[] keysArray = keys.toArray(new String[keys.size()]);
|
||||
redisUtils.del(keysArray);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -251,7 +251,11 @@ public class TbProductServiceImpl implements TbProductService {
|
|||
if ("sku".equals(product.getTypeEnum())){
|
||||
if(tbProductSkus.size() > 1){
|
||||
BigDecimal maxPrice = tbProductSkus.stream().map(TbProductSku::getSalePrice).max(BigDecimal::compareTo).get();
|
||||
productNewVo.setLowPrice("¥" +productNewVo.getLowPrice() + "~¥" + maxPrice);
|
||||
if (maxPrice.compareTo(new BigDecimal(productNewVo.getLowPrice())) == 0) {
|
||||
productNewVo.setLowPrice("¥" +productNewVo.getLowPrice());
|
||||
}else {
|
||||
productNewVo.setLowPrice("¥" +productNewVo.getLowPrice() + "~¥" + maxPrice);
|
||||
}
|
||||
}else {
|
||||
productNewVo.setLowPrice("¥" +productNewVo.getLowPrice());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,180 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl.shopimpl;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import cn.ysk.cashier.exception.BadRequestException;
|
||||
import cn.ysk.cashier.pojo.product.TbProduct;
|
||||
import cn.ysk.cashier.pojo.shop.TbMerchantCoupon;
|
||||
import cn.ysk.cashier.repository.product.TbProductRepository;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import cn.ysk.cashier.vo.CouponVO;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.repository.shop.TbMerchantCouponRepository;
|
||||
import cn.ysk.cashier.service.shop.TbMerchantCouponService;
|
||||
import cn.ysk.cashier.dto.shop.TbMerchantCouponDto;
|
||||
import cn.ysk.cashier.dto.shop.TbMerchantCouponQueryCriteria;
|
||||
import cn.ysk.cashier.mapper.shop.TbMerchantCouponMapper;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-03-20
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbMerchantCouponServiceImpl implements TbMerchantCouponService {
|
||||
|
||||
private final TbMerchantCouponRepository tbMerchantCouponRepository;
|
||||
private final TbMerchantCouponMapper tbMerchantCouponMapper;
|
||||
private final TbProductRepository tbProductRepository;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbMerchantCouponQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbMerchantCoupon> page = tbMerchantCouponRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
List<CouponVO> objects = new ArrayList<>();
|
||||
for (TbMerchantCoupon o :page.getContent()) {
|
||||
CouponVO couponVO = new CouponVO();
|
||||
BeanUtils.copyProperties(o,couponVO);
|
||||
if (!o.getRelationIds().isEmpty()) {
|
||||
List<Integer> integers = new ArrayList<>();
|
||||
integers.add(Integer.valueOf(o.getRelationIds()));
|
||||
List<TbProduct> byIds = tbProductRepository.findByIds(integers);
|
||||
couponVO.setName(byIds.get(0).getName());
|
||||
couponVO.setCoverImg(byIds.get(0).getCoverImg());
|
||||
}
|
||||
objects.add(couponVO);
|
||||
}
|
||||
HashMap<String, Object> couponvoMap = new HashMap<>();
|
||||
couponvoMap.put("content", objects);
|
||||
couponvoMap.put("totalElements", page.getTotalElements());
|
||||
return couponvoMap;
|
||||
// return PageUtil.toPage(page.map(tbMerchantCouponMapper::toDto));
|
||||
}
|
||||
@Override
|
||||
public List<TbMerchantCouponDto> queryAll(TbMerchantCouponQueryCriteria criteria){
|
||||
return tbMerchantCouponMapper.toDto(tbMerchantCouponRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbMerchantCouponDto findById(Integer id) {
|
||||
TbMerchantCoupon tbMerchantCoupon = tbMerchantCouponRepository.findById(id).orElseGet(TbMerchantCoupon::new);
|
||||
ValidationUtil.isNull(tbMerchantCoupon.getId(),"TbMerchantCoupon","id",id);
|
||||
return tbMerchantCouponMapper.toDto(tbMerchantCoupon);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbMerchantCoupon create(TbMerchantCoupon resources) {
|
||||
resources.setCreatedAt(Instant.now().toEpochMilli());
|
||||
resources.setUpdatedAt(Instant.now().toEpochMilli());
|
||||
if (resources.getEffectType() == 1){
|
||||
if (resources.getToTime() == null && resources.getFromTime() == null){
|
||||
throw new BadRequestException("开始时间结束时间为空");
|
||||
}
|
||||
}else {
|
||||
resources.setToTime(null);
|
||||
resources.setFromTime(null);
|
||||
}
|
||||
|
||||
if ("product".equals(resources.getClassType())){
|
||||
if (resources.getRelationIds() == null){
|
||||
throw new BadRequestException("商品不能为空");
|
||||
}
|
||||
}
|
||||
if (resources.getNumber() == 0){
|
||||
resources.setLeftNumber(0);
|
||||
}else {
|
||||
resources.setLeftNumber(resources.getNumber());
|
||||
}
|
||||
return tbMerchantCouponRepository.save(resources);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbMerchantCoupon resources) {
|
||||
TbMerchantCoupon tbMerchantCoupon = tbMerchantCouponRepository.findById(resources.getId()).orElseGet(TbMerchantCoupon::new);
|
||||
ValidationUtil.isNull( tbMerchantCoupon.getId(),"TbMerchantCoupon","id",resources.getId());
|
||||
tbMerchantCoupon.copy(resources);
|
||||
tbMerchantCouponRepository.save(tbMerchantCoupon);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbMerchantCouponRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbMerchantCouponDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbMerchantCouponDto tbMerchantCoupon : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("状态0-关闭 1 正常", tbMerchantCoupon.getStatus());
|
||||
map.put(" 优惠券名称", tbMerchantCoupon.getTitle());
|
||||
map.put(" templateId", tbMerchantCoupon.getTemplateId());
|
||||
map.put(" shopId", tbMerchantCoupon.getShopId());
|
||||
map.put(" shopSnap", tbMerchantCoupon.getShopSnap());
|
||||
map.put("开始时间", tbMerchantCoupon.getFromTime());
|
||||
map.put("到期时间", tbMerchantCoupon.getToTime());
|
||||
map.put("限领数量", tbMerchantCoupon.getLimitNumber());
|
||||
map.put("发放数量", tbMerchantCoupon.getNumber());
|
||||
map.put("剩余数量", tbMerchantCoupon.getLeftNumber());
|
||||
map.put("优惠金额", tbMerchantCoupon.getAmount());
|
||||
map.put("订单满赠金额", tbMerchantCoupon.getLimitAmount());
|
||||
map.put("是否显示0-不显示 1显示", tbMerchantCoupon.getIsShow());
|
||||
map.put("图标", tbMerchantCoupon.getPic());
|
||||
map.put("0-满减 1-折扣", tbMerchantCoupon.getType());
|
||||
map.put("折扣 ,一位小数", tbMerchantCoupon.getRatio());
|
||||
map.put("最大折扣金额", tbMerchantCoupon.getMaxRatioAmount());
|
||||
map.put("优惠券途径,首充|分销", tbMerchantCoupon.getTrack());
|
||||
map.put("品类product 商品券 ---cateogry 品类券common -通 用券", tbMerchantCoupon.getClassType());
|
||||
map.put("有效期类型:0-toTime有效 1-effectDays有效", tbMerchantCoupon.getEffectType());
|
||||
map.put("领取之日有效天数", tbMerchantCoupon.getEffectDays());
|
||||
map.put("关联商品Id", tbMerchantCoupon.getRelationIds());
|
||||
map.put(" relationList", tbMerchantCoupon.getRelationList());
|
||||
map.put("发放人", tbMerchantCoupon.getEditor());
|
||||
map.put("说明", tbMerchantCoupon.getNote());
|
||||
map.put(" createdAt", tbMerchantCoupon.getCreatedAt());
|
||||
map.put(" updatedAt", tbMerchantCoupon.getUpdatedAt());
|
||||
map.put("支持堂食", tbMerchantCoupon.getFurnishMeal());
|
||||
map.put("支持配送", tbMerchantCoupon.getFurnishExpress());
|
||||
map.put("支持自提", tbMerchantCoupon.getFurnishDraw());
|
||||
map.put("支持虚拟", tbMerchantCoupon.getFurnishVir());
|
||||
map.put(" disableDistribute", tbMerchantCoupon.getDisableDistribute());
|
||||
map.put("商户Id", tbMerchantCoupon.getMerchantId());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,122 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl.shopimpl;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbReceiptSales;
|
||||
import cn.ysk.cashier.mapper.shop.TbReceiptSalesMapper;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.repository.shop.TbReceiptSalesRepository;
|
||||
import cn.ysk.cashier.service.shop.TbReceiptSalesService;
|
||||
import cn.ysk.cashier.dto.shop.TbReceiptSalesDto;
|
||||
import cn.ysk.cashier.dto.shop.TbReceiptSalesQueryCriteria;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-01-08
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbReceiptSalesServiceImpl implements TbReceiptSalesService {
|
||||
|
||||
private final TbReceiptSalesRepository tbReceiptSalesRepository;
|
||||
private final TbReceiptSalesMapper tbReceiptSalesMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbReceiptSalesQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbReceiptSales> page = tbReceiptSalesRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbReceiptSalesMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbReceiptSalesDto> queryAll(TbReceiptSalesQueryCriteria criteria){
|
||||
return tbReceiptSalesMapper.toDto(tbReceiptSalesRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbReceiptSalesDto findById(Integer id) {
|
||||
TbReceiptSales tbReceiptSales = tbReceiptSalesRepository.findById(id).orElseGet(TbReceiptSales::new);
|
||||
|
||||
return tbReceiptSalesMapper.toDto(tbReceiptSales);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbReceiptSalesDto create(TbReceiptSales resources) {
|
||||
return tbReceiptSalesMapper.toDto(tbReceiptSalesRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbReceiptSales resources) {
|
||||
TbReceiptSales tbReceiptSales = tbReceiptSalesRepository.findById(resources.getId()).orElseGet(TbReceiptSales::new);
|
||||
ValidationUtil.isNull( tbReceiptSales.getId(),"TbReceiptSales","id",resources.getId());
|
||||
tbReceiptSales.copy(resources);
|
||||
tbReceiptSalesRepository.save(tbReceiptSales);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbReceiptSalesRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbReceiptSalesDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbReceiptSalesDto tbReceiptSales : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("标题", tbReceiptSales.getTitle());
|
||||
map.put("是否显示公司Logo", tbReceiptSales.getLogo());
|
||||
map.put("打印联系电话等信息", tbReceiptSales.getShowContactInfo());
|
||||
map.put("打印会员开关 0?1", tbReceiptSales.getShowMember());
|
||||
map.put("打印会员编号开关", tbReceiptSales.getShowMemberCode());
|
||||
map.put("打印会员积分", tbReceiptSales.getShowMemberScore());
|
||||
map.put("打印会员余额开关 0?1", tbReceiptSales.getShowMemberWallet());
|
||||
map.put("店铺Id", tbReceiptSales.getFooterRemark());
|
||||
map.put("打印找零", tbReceiptSales.getShowCashCharge());
|
||||
map.put("流水号", tbReceiptSales.getShowSerialNo());
|
||||
map.put("用大号字打印流水号 在showSerialNo可用前提下", tbReceiptSales.getBigSerialNo());
|
||||
map.put("头部文字", tbReceiptSales.getHeaderText());
|
||||
map.put("文字 对齐方式", tbReceiptSales.getHeaderTextAlign());
|
||||
map.put("尾部文字", tbReceiptSales.getFooterText());
|
||||
map.put("文字 对齐方式", tbReceiptSales.getFooterTextAlign());
|
||||
map.put("尾部图像", tbReceiptSales.getFooterImage());
|
||||
map.put("预打印,YES开启 NO不开启", tbReceiptSales.getPrePrint());
|
||||
map.put(" createdAt", tbReceiptSales.getCreatedAt());
|
||||
map.put(" updatedAt", tbReceiptSales.getUpdatedAt());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,115 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl.shopimpl;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCashSpread;
|
||||
import cn.ysk.cashier.service.shop.TbShopCashSpreadService;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCashSpreadDto;
|
||||
import cn.ysk.cashier.mapper.shop.TbShopCashSpreadMapper;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.repository.shop.TbShopCashSpreadRepository;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCashSpreadQueryCriteria;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbShopCashSpreadServiceImpl implements TbShopCashSpreadService {
|
||||
|
||||
private final TbShopCashSpreadRepository tbShopCashSpreadRepository;
|
||||
private final TbShopCashSpreadMapper tbShopCashSpreadMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbShopCashSpreadQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbShopCashSpread> page = tbShopCashSpreadRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbShopCashSpreadMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbShopCashSpreadDto> queryAll(TbShopCashSpreadQueryCriteria criteria){
|
||||
return tbShopCashSpreadMapper.toDto(tbShopCashSpreadRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbShopCashSpreadDto findById(String id) {
|
||||
TbShopCashSpread tbShopCashSpread = tbShopCashSpreadRepository.findById(id).orElseGet(TbShopCashSpread::new);
|
||||
ValidationUtil.isNull(tbShopCashSpread.getId(),"TbShopCashSpread","id",id);
|
||||
return tbShopCashSpreadMapper.toDto(tbShopCashSpread);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbShopCashSpread findByShopId(Integer id) {
|
||||
TbShopCashSpread byShopId = tbShopCashSpreadRepository.findByShopId(id);
|
||||
return byShopId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbShopCashSpreadDto create(TbShopCashSpread resources) {
|
||||
return tbShopCashSpreadMapper.toDto(tbShopCashSpreadRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Integer update(TbShopCashSpread resources) {
|
||||
return tbShopCashSpreadRepository.updateConfig(resources.getId(), resources.getScreenConfig().trim(), Instant.now().toEpochMilli());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(String[] ids) {
|
||||
for (String id : ids) {
|
||||
tbShopCashSpreadRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbShopCashSpreadDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbShopCashSpreadDto tbShopCashSpread : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("登陆密码", tbShopCashSpread.getSaleReceipt());
|
||||
map.put("状态", tbShopCashSpread.getTriplicateReceipt());
|
||||
map.put("到期提醒时间", tbShopCashSpread.getScreenConfig());
|
||||
map.put(" tagConfig", tbShopCashSpread.getTagConfig());
|
||||
map.put(" scaleConfig", tbShopCashSpread.getScaleConfig());
|
||||
map.put(" createdAt", tbShopCashSpread.getCreatedAt());
|
||||
map.put(" updatedAt", tbShopCashSpread.getUpdatedAt());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,130 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.impl.shopimpl;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCurrency;
|
||||
import cn.ysk.cashier.utils.ValidationUtil;
|
||||
import cn.ysk.cashier.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import cn.ysk.cashier.repository.shop.TbShopCurrencyRepository;
|
||||
import cn.ysk.cashier.service.shop.TbShopCurrencyService;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCurrencyDto;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCurrencyQueryCriteria;
|
||||
import cn.ysk.cashier.mapper.shop.TbShopCurrencyMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import cn.ysk.cashier.utils.PageUtil;
|
||||
import cn.ysk.cashier.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbShopCurrencyServiceImpl implements TbShopCurrencyService {
|
||||
|
||||
private final TbShopCurrencyRepository tbShopCurrencyRepository;
|
||||
private final TbShopCurrencyMapper tbShopCurrencyMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbShopCurrencyQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbShopCurrency> page = tbShopCurrencyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbShopCurrencyMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbShopCurrencyDto> queryAll(TbShopCurrencyQueryCriteria criteria){
|
||||
return tbShopCurrencyMapper.toDto(tbShopCurrencyRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbShopCurrencyDto findById(Integer id) {
|
||||
TbShopCurrency tbShopCurrency = tbShopCurrencyRepository.findById(id).orElseGet(TbShopCurrency::new);
|
||||
ValidationUtil.isNull(tbShopCurrency.getId(),"TbShopCurrency","id",id);
|
||||
return tbShopCurrencyMapper.toDto(tbShopCurrency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TbShopCurrency findByShopId(String id) {
|
||||
TbShopCurrency byShopId = tbShopCurrencyRepository.findByShopId(id);
|
||||
return byShopId;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbShopCurrencyDto create(TbShopCurrency resources) {
|
||||
return tbShopCurrencyMapper.toDto(tbShopCurrencyRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbShopCurrency resources) {
|
||||
TbShopCurrency tbShopCurrency = tbShopCurrencyRepository.findById(resources.getId()).orElseGet(TbShopCurrency::new);
|
||||
ValidationUtil.isNull( tbShopCurrency.getId(),"TbShopCurrency","id",resources.getId());
|
||||
tbShopCurrency.copy(resources);
|
||||
tbShopCurrencyRepository.save(tbShopCurrency);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbShopCurrencyRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbShopCurrencyDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbShopCurrencyDto tbShopCurrency : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("店铺Id", tbShopCurrency.getShopId());
|
||||
map.put("备用金", tbShopCurrency.getPrepareAmount());
|
||||
map.put("货币单位 ¥,$", tbShopCurrency.getCurrency());
|
||||
map.put("小数位,0,1,2,无,元,角,分", tbShopCurrency.getDecimalsDigits());
|
||||
map.put("无,四舍五入,五舍六入none,round4up5,round5up6,round12up34", tbShopCurrency.getDiscountRound());
|
||||
map.put("商户Id", tbShopCurrency.getMerchantId());
|
||||
map.put("订单抹零 -1无,0元 1角2分 0.5=0.5元", tbShopCurrency.getSmallChange());
|
||||
map.put("使折扣生效", tbShopCurrency.getEnableCustomDiscount());
|
||||
map.put("最大抹零金额(100)", tbShopCurrency.getMaxDiscount());
|
||||
map.put("最大折扣百分比,,优先级高于max_discount", tbShopCurrency.getMaxPercent());
|
||||
map.put("折扣显示详情", tbShopCurrency.getDiscountConfigs());
|
||||
map.put("营业时间(弃用)", tbShopCurrency.getBizDuration());
|
||||
map.put("允许网络支付", tbShopCurrency.getAllowWebPay());
|
||||
map.put("自动抹零,开启时,系统自动抹零", tbShopCurrency.getIsAutoToZero());
|
||||
map.put("商品含税", tbShopCurrency.getIsIncludeTaxPrice());
|
||||
map.put("服务费配置(小费)", tbShopCurrency.getServiceCharge());
|
||||
map.put("税号", tbShopCurrency.getTaxNumber());
|
||||
map.put(" createdAt", tbShopCurrency.getCreatedAt());
|
||||
map.put(" updatedAt", tbShopCurrency.getUpdatedAt());
|
||||
map.put("自动锁屏", tbShopCurrency.getAutoLockScreen());
|
||||
map.put("语音通知", tbShopCurrency.getVoiceNotification());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbMerchantCoupon;
|
||||
import cn.ysk.cashier.dto.shop.TbMerchantCouponDto;
|
||||
import cn.ysk.cashier.dto.shop.TbMerchantCouponQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author lyf
|
||||
* @date 2024-03-20
|
||||
**/
|
||||
public interface TbMerchantCouponService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbMerchantCouponQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbMerchantCouponDto>
|
||||
*/
|
||||
List<TbMerchantCouponDto> queryAll(TbMerchantCouponQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbMerchantCouponDto
|
||||
*/
|
||||
TbMerchantCouponDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbMerchantCouponDto
|
||||
*/
|
||||
TbMerchantCoupon create(TbMerchantCoupon resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbMerchantCoupon resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbMerchantCouponDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -1,83 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbReceiptSales;
|
||||
import cn.ysk.cashier.dto.shop.TbReceiptSalesDto;
|
||||
import cn.ysk.cashier.dto.shop.TbReceiptSalesQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author lyf
|
||||
* @date 2024-01-08
|
||||
**/
|
||||
public interface TbReceiptSalesService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbReceiptSalesQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbReceiptSalesDto>
|
||||
*/
|
||||
List<TbReceiptSalesDto> queryAll(TbReceiptSalesQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbReceiptSalesDto
|
||||
*/
|
||||
TbReceiptSalesDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbReceiptSalesDto
|
||||
*/
|
||||
TbReceiptSalesDto create(TbReceiptSales resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbReceiptSales resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbReceiptSalesDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCashSpread;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCashSpreadDto;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCashSpreadQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
public interface TbShopCashSpreadService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbShopCashSpreadQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbShopCashSpreadDto>
|
||||
*/
|
||||
List<TbShopCashSpreadDto> queryAll(TbShopCashSpreadQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbShopCashSpreadDto
|
||||
*/
|
||||
TbShopCashSpreadDto findById(String id);
|
||||
TbShopCashSpread findByShopId(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbShopCashSpreadDto
|
||||
*/
|
||||
TbShopCashSpreadDto create(TbShopCashSpread resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
Integer update(TbShopCashSpread resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(String[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbShopCashSpreadDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -1,90 +0,0 @@
|
|||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package cn.ysk.cashier.service.shop;
|
||||
|
||||
import cn.ysk.cashier.pojo.shop.TbShopCurrency;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCurrencyDto;
|
||||
import cn.ysk.cashier.dto.shop.TbShopCurrencyQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author lyf
|
||||
* @date 2024-01-05
|
||||
**/
|
||||
public interface TbShopCurrencyService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbShopCurrencyQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbShopCurrencyDto>
|
||||
*/
|
||||
List<TbShopCurrencyDto> queryAll(TbShopCurrencyQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbShopCurrencyDto
|
||||
*/
|
||||
TbShopCurrencyDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbShopCurrencyDto
|
||||
*/
|
||||
TbShopCurrency findByShopId(String id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbShopCurrencyDto
|
||||
*/
|
||||
TbShopCurrencyDto create(TbShopCurrency resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbShopCurrency resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbShopCurrencyDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -36,11 +36,6 @@ public class ParamsController {
|
|||
|
||||
@GetMapping("page")
|
||||
@ApiOperation("分页")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "page", value = "当前页码,从1开始", paramType = "query", required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = "size", value = "每页显示记录数", paramType = "query",required = true, dataType="int") ,
|
||||
@ApiImplicitParam(name = "paramCode", value = "参数编码", paramType = "query", dataType="String")
|
||||
})
|
||||
public ResponseEntity page(@ApiIgnore @RequestParam Map<String, Object> params){
|
||||
Map<String, Object> page = paramsService.page(params);
|
||||
return ResponseEntity.ok().body(page);
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<?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="cn.ysk.cashier.mybatis.mapper.TbActivateMapper">
|
||||
|
||||
<resultMap id="BaseResultMap" type="cn.ysk.cashier.mybatis.pojo.TbActivatetb">
|
||||
<id property="id" column="id" jdbcType="INTEGER"/>
|
||||
<result property="shop_id" column="shop_id" jdbcType="INTEGER"/>
|
||||
<result property="min_num" column="min_num" jdbcType="INTEGER"/>
|
||||
<result property="max_num" column="max_num" jdbcType="INTEGER"/>
|
||||
<result property="handsel_num" column="handsel_num" jdbcType="DECIMAL"/>
|
||||
<result property="handsel_type" column="handsel_type" jdbcType="VARCHAR"/>
|
||||
<result property="is_del" column="is_del" jdbcType="VARCHAR"/>
|
||||
<result property="is_user" column="is_user" jdbcType="VARCHAR"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="Base_Column_List">
|
||||
id,shop_id,min_num,
|
||||
max_num,handsel_num,handsel_type,
|
||||
is_del,is_user
|
||||
</sql>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue