111
This commit is contained in:
parent
3b3f4e1eb8
commit
70b44c1387
|
@ -0,0 +1,38 @@
|
|||
package com.ruoyi.web.controller;
|
||||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.net.url.UrlBuilder;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
|
||||
public class Tst {
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
/**
|
||||
author:157239486 优惠券 核销 writeOff 团购
|
||||
* 输码校验 encrypted_data
|
||||
*/
|
||||
|
||||
String uri = "https://open.douyin.com/goodlife/v1/fulfilment/certificate/prepare/";
|
||||
|
||||
//二维码扫描出来的短链
|
||||
String tempUri = "https://v.douyin.com/i5WxdEgD/";
|
||||
|
||||
String res = HttpUtil.get(tempUri);
|
||||
//获取objectId
|
||||
String encryptedDataUri = ReUtil.getGroup0(Validator.URL, res);
|
||||
String objectId = UrlBuilder.of(encryptedDataUri).getQuery().get("object_id").toString();
|
||||
System.out.println(objectId);
|
||||
|
||||
// String result = HttpRequest.get(uri)
|
||||
// .contentType("application/json")
|
||||
// .header("access-token", "clt.2515da8e47993967e30d85fbe8265abaFlf7gCwUaEIsjwtfJtopESDVXLH5_lf")
|
||||
// .form("encrypted_data", objectId).execute().body();
|
||||
|
||||
// System.out.println(result);
|
||||
|
||||
|
||||
}
|
||||
}
|
|
@ -3,6 +3,8 @@ package com.ruoyi.web.controller.system;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.ruoyi.ss.card.domain.GroupBuyingDTO;
|
||||
import com.ruoyi.ss.card.service.ISsCardAssembler;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
@ -36,10 +38,10 @@ import com.ruoyi.common.core.page.TableDataInfo;
|
|||
public class CardController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ISsCardService ssCardService;
|
||||
private ISsCardService cardService;
|
||||
|
||||
@Autowired
|
||||
private ISsCardAssembler ssCardAssembler;
|
||||
private ISsCardAssembler cardAssembler;
|
||||
|
||||
|
||||
/**
|
||||
|
@ -51,8 +53,8 @@ public class CardController extends BaseController
|
|||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<SsCardVO> list = ssCardService.selectSsCardList(query);
|
||||
ssCardAssembler.assembleInfo(list);
|
||||
List<SsCardVO> list = cardService.selectSsCardList(query);
|
||||
cardAssembler.assembleInfo(list);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
@ -64,7 +66,7 @@ public class CardController extends BaseController
|
|||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, SsCardQuery query)
|
||||
{
|
||||
List<SsCardVO> list = ssCardService.selectSsCardList(query);
|
||||
List<SsCardVO> list = cardService.selectSsCardList(query);
|
||||
ExcelUtil<SsCardVO> util = new ExcelUtil<SsCardVO>(SsCardVO.class);
|
||||
util.exportExcel(response, list, "卡券数据");
|
||||
}
|
||||
|
@ -76,7 +78,7 @@ public class CardController extends BaseController
|
|||
@GetMapping(value = "/{couponId}")
|
||||
public AjaxResult getInfo(@PathVariable("couponId") Long couponId)
|
||||
{
|
||||
return success(ssCardService.selectSsCardByCouponId(couponId));
|
||||
return success(cardService.selectSsCardByCouponId(couponId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -87,7 +89,7 @@ public class CardController extends BaseController
|
|||
@PostMapping
|
||||
public AjaxResult add(@RequestBody SsCard ssCard)
|
||||
{
|
||||
return toAjax(ssCardService.insertSsCard(ssCard));
|
||||
return toAjax(cardService.insertSsCard(ssCard));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -98,7 +100,7 @@ public class CardController extends BaseController
|
|||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody SsCard ssCard)
|
||||
{
|
||||
return toAjax(ssCardService.updateSsCard(ssCard));
|
||||
return toAjax(cardService.updateSsCard(ssCard));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -109,6 +111,18 @@ public class CardController extends BaseController
|
|||
@DeleteMapping("/{couponIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] couponIds)
|
||||
{
|
||||
return toAjax(ssCardService.deleteSsCardByCouponIds(couponIds));
|
||||
return toAjax(cardService.deleteSsCardByCouponIds(couponIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 验券
|
||||
*/
|
||||
@Log(title = "验券", businessType = BusinessType.PREPARE)
|
||||
@GetMapping("/prepare")
|
||||
public AjaxResult prepare(GroupBuyingDTO dto)
|
||||
{
|
||||
logger.info("验券:{}", JSON.toJSON(dto));
|
||||
return toAjax(cardService.prepare(dto));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,107 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecords;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecordsVO;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecordsQuery;
|
||||
import com.ruoyi.ss.cardGetRecords.service.ICardGetRecordsService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 卡券领取(购买)记录Controller
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/getRecords")
|
||||
public class CardGetRecordsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICardGetRecordsService cardGetRecordsService;
|
||||
|
||||
/**
|
||||
* 查询卡券领取(购买)记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:getRecords:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CardGetRecordsQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<CardGetRecordsVO> list = cardGetRecordsService.selectCardGetRecordsList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出卡券领取(购买)记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:getRecords:export')")
|
||||
@Log(title = "卡券领取(购买)记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CardGetRecordsQuery query)
|
||||
{
|
||||
List<CardGetRecordsVO> list = cardGetRecordsService.selectCardGetRecordsList(query);
|
||||
ExcelUtil<CardGetRecordsVO> util = new ExcelUtil<CardGetRecordsVO>(CardGetRecordsVO.class);
|
||||
util.exportExcel(response, list, "卡券领取(购买)记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取卡券领取(购买)记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:getRecords:query')")
|
||||
@GetMapping(value = "/{recordId}")
|
||||
public AjaxResult getInfo(@PathVariable("recordId") Long recordId)
|
||||
{
|
||||
return success(cardGetRecordsService.selectCardGetRecordsByRecordId(recordId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增卡券领取(购买)记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:getRecords:add')")
|
||||
@Log(title = "卡券领取(购买)记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CardGetRecords cardGetRecords)
|
||||
{
|
||||
return toAjax(cardGetRecordsService.insertCardGetRecords(cardGetRecords));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改卡券领取(购买)记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:getRecords:edit')")
|
||||
@Log(title = "卡券领取(购买)记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CardGetRecords cardGetRecords)
|
||||
{
|
||||
return toAjax(cardGetRecordsService.updateCardGetRecords(cardGetRecords));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除卡券领取(购买)记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:getRecords:remove')")
|
||||
@Log(title = "卡券领取(购买)记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{recordIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] recordIds)
|
||||
{
|
||||
return toAjax(cardGetRecordsService.deleteCardGetRecordsByRecordIds(recordIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecords;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsVO;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsQuery;
|
||||
import com.ruoyi.ss.checkoff.service.ICheckoffRecordsService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 核销记录Controller
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/records")
|
||||
public class CheckoffRecordsController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private ICheckoffRecordsService checkoffRecordsService;
|
||||
|
||||
/**
|
||||
* 查询核销记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:records:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(CheckoffRecordsQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<CheckoffRecordsVO> list = checkoffRecordsService.selectCheckoffRecordsList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出核销记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:records:export')")
|
||||
@Log(title = "核销记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, CheckoffRecordsQuery query)
|
||||
{
|
||||
List<CheckoffRecordsVO> list = checkoffRecordsService.selectCheckoffRecordsList(query);
|
||||
ExcelUtil<CheckoffRecordsVO> util = new ExcelUtil<CheckoffRecordsVO>(CheckoffRecordsVO.class);
|
||||
util.exportExcel(response, list, "核销记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取核销记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:records:query')")
|
||||
@GetMapping(value = "/{checkoffId}")
|
||||
public AjaxResult getInfo(@PathVariable("checkoffId") Long checkoffId)
|
||||
{
|
||||
return success(checkoffRecordsService.selectCheckoffRecordsByCheckoffId(checkoffId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增核销记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:records:add')")
|
||||
@Log(title = "核销记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody CheckoffRecords checkoffRecords)
|
||||
{
|
||||
return toAjax(checkoffRecordsService.insertCheckoffRecords(checkoffRecords));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改核销记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:records:edit')")
|
||||
@Log(title = "核销记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody CheckoffRecords checkoffRecords)
|
||||
{
|
||||
return toAjax(checkoffRecordsService.updateCheckoffRecords(checkoffRecords));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除核销记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:records:remove')")
|
||||
@Log(title = "核销记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{checkoffIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] checkoffIds)
|
||||
{
|
||||
return toAjax(checkoffRecordsService.deleteCheckoffRecordsByCheckoffIds(checkoffIds));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,107 @@
|
|||
package com.ruoyi.web.controller.system;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.ruoyi.common.annotation.Log;
|
||||
import com.ruoyi.common.core.controller.BaseController;
|
||||
import com.ruoyi.common.core.domain.AjaxResult;
|
||||
import com.ruoyi.common.enums.BusinessType;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMapping;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingVO;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingQuery;
|
||||
import com.ruoyi.ss.mapping.service.IStoreMappingService;
|
||||
import com.ruoyi.common.utils.poi.ExcelUtil;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 系统与第三方店铺映射关系Controller
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/system/mapping")
|
||||
public class StoreMappingController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IStoreMappingService storeMappingService;
|
||||
|
||||
/**
|
||||
* 查询系统与第三方店铺映射关系列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:mapping:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(StoreMappingQuery query)
|
||||
{
|
||||
startPage();
|
||||
startOrderBy();
|
||||
List<StoreMappingVO> list = storeMappingService.selectStoreMappingList(query);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出系统与第三方店铺映射关系列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:mapping:export')")
|
||||
@Log(title = "系统与第三方店铺映射关系", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, StoreMappingQuery query)
|
||||
{
|
||||
List<StoreMappingVO> list = storeMappingService.selectStoreMappingList(query);
|
||||
ExcelUtil<StoreMappingVO> util = new ExcelUtil<StoreMappingVO>(StoreMappingVO.class);
|
||||
util.exportExcel(response, list, "系统与第三方店铺映射关系数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取系统与第三方店铺映射关系详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:mapping:query')")
|
||||
@GetMapping(value = "/{storeId}")
|
||||
public AjaxResult getInfo(@PathVariable("storeId") Long storeId)
|
||||
{
|
||||
return success(storeMappingService.selectStoreMappingByStoreId(storeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统与第三方店铺映射关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:mapping:add')")
|
||||
@Log(title = "系统与第三方店铺映射关系", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody StoreMapping storeMapping)
|
||||
{
|
||||
return toAjax(storeMappingService.insertStoreMapping(storeMapping));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统与第三方店铺映射关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:mapping:edit')")
|
||||
@Log(title = "系统与第三方店铺映射关系", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody StoreMapping storeMapping)
|
||||
{
|
||||
return toAjax(storeMappingService.updateStoreMapping(storeMapping));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统与第三方店铺映射关系
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('system:mapping:remove')")
|
||||
@Log(title = "系统与第三方店铺映射关系", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{storeIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] storeIds)
|
||||
{
|
||||
return toAjax(storeMappingService.deleteStoreMappingByStoreIds(storeIds));
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
|
|||
import com.ruoyi.common.core.domain.dto.ModifyBalanceDTO;
|
||||
import com.ruoyi.common.core.domain.entity.User;
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.ss.cardGetRecords.service.ICardGetRecordsService;
|
||||
import com.ruoyi.ss.changeBalance.service.IChangeBalanceService;
|
||||
import com.ruoyi.ss.user.domain.UserVO;
|
||||
import com.ruoyi.common.core.page.TableDataInfo;
|
||||
|
@ -44,6 +45,9 @@ public class UserController extends BaseController
|
|||
@Autowired
|
||||
private IChangeBalanceService changeBalanceService;
|
||||
|
||||
@Autowired
|
||||
private ICardGetRecordsService cardGetRecordsService;
|
||||
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
|
@ -194,5 +198,16 @@ public class UserController extends BaseController
|
|||
return toAjax(i);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户可用卡券
|
||||
*/
|
||||
@Log(title = "获取可用卡券", businessType = BusinessType.PREPARE)
|
||||
@GetMapping("/getAvailableCard")
|
||||
public AjaxResult getAvailableCard()
|
||||
{
|
||||
logger.info("获取可用卡券");
|
||||
return success(cardGetRecordsService.getAvailableCard(getUserId()));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -241,3 +241,6 @@ e:
|
|||
password: admin12311111
|
||||
yp:
|
||||
apikey: 69d42dc4f806b9cbd5de48459353602f
|
||||
douyin:
|
||||
appKey: awitlgmafy1n6hmp
|
||||
secret: f8b69e946746b8e82d0ade3a31123055
|
||||
|
|
|
@ -1207,6 +1207,51 @@ public class ServiceConstants {
|
|||
|
||||
/**----------------------------充值渠道类型end----------------------------*/
|
||||
|
||||
/**----------------------------状态类型 start----------------------------*/
|
||||
|
||||
/**
|
||||
* 状态: 1-未使用
|
||||
*/
|
||||
public static final String CARD_STATUS_UNUSED = "1";
|
||||
|
||||
/**
|
||||
* 状态: 2-已使用
|
||||
*/
|
||||
public static final String CARD_STATUS_USED = "2";
|
||||
|
||||
/**
|
||||
* 状态: 3-已过期
|
||||
*/
|
||||
public static final String CARD_STATUS_EXPIRED = "3";
|
||||
|
||||
/**----------------------------状态类型 end----------------------------*/
|
||||
|
||||
/**----------------------------卡券获取方式 start----------------------------*/
|
||||
|
||||
/**
|
||||
* 卡券获取方式: 1-手动领取
|
||||
*/
|
||||
public static final String COUPON_GET_MANUAL = "1";
|
||||
|
||||
/**
|
||||
* 卡券获取方式: 2-后台发放
|
||||
*/
|
||||
public static final String COUPON_GET_ADMIN = "2";
|
||||
|
||||
/**
|
||||
* 卡券获取方式: 3-平台购买
|
||||
*/
|
||||
public static final String COUPON_GET_PLATFORM_PURCHASE = "3";
|
||||
|
||||
/**
|
||||
* 卡券获取方式: 4-第三方购买
|
||||
*/
|
||||
public static final String COUPON_GET_THIRD_PARTY_PURCHASE = "4";
|
||||
|
||||
/**----------------------------卡券获取方式 end----------------------------*/
|
||||
|
||||
|
||||
|
||||
// /**----------------------------对账类型start----------------------------*/
|
||||
//
|
||||
// /**
|
||||
|
|
|
@ -212,6 +212,13 @@ public enum BusinessType
|
|||
/**
|
||||
* 修改余额
|
||||
*/
|
||||
MODIFYBALANCE
|
||||
|
||||
MODIFYBALANCE,
|
||||
/**
|
||||
* 验签准备
|
||||
*/
|
||||
PREPARE,
|
||||
/**
|
||||
* 验签
|
||||
*/
|
||||
VERIFY
|
||||
}
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package com.ruoyi.common.utils.dy;
|
||||
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import lombok.SneakyThrows;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.concurrent.ConcurrentHashMap;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
|
||||
@Slf4j
|
||||
public class DouYinAccessTokenUtil {
|
||||
|
||||
// 存储每个租户的token和过期时间
|
||||
private static final ConcurrentHashMap<String, String> cachedTokens = new ConcurrentHashMap<>();
|
||||
private static final ConcurrentHashMap<String, Long> tokenExpirationTimes = new ConcurrentHashMap<>();
|
||||
|
||||
@SneakyThrows
|
||||
public static String getToken(String appId, String appsecret) {
|
||||
String cacheKey = appId+ ":" + appsecret;
|
||||
if (isTokenExpired(cacheKey)) {
|
||||
log.info("token已过期,重新获取");
|
||||
String uri = "https://open.douyin.com/oauth/client_token/";
|
||||
|
||||
HashMap<String, Object> paramMap = new HashMap<>();
|
||||
paramMap.put("client_key", appId);
|
||||
paramMap.put("client_secret", appsecret);
|
||||
paramMap.put("grant_type", "client_credential");
|
||||
|
||||
String result= HttpUtil.post(uri, paramMap);
|
||||
JSONObject jsonObject = JSON.parseObject(result);
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
String accessToken = data.getString("access_token");
|
||||
// 更新缓存
|
||||
cachedTokens.put(cacheKey, accessToken);
|
||||
tokenExpirationTimes.put(cacheKey, System.currentTimeMillis() + TimeUnit.SECONDS.toMillis(3600L));
|
||||
return accessToken;
|
||||
}
|
||||
log.info("token未过期,直接使用");
|
||||
return cachedTokens.get(cacheKey);
|
||||
}
|
||||
|
||||
/**判断token是否过期*/
|
||||
private static boolean isTokenExpired(String cacheKey) {
|
||||
Long expirationTime = tokenExpirationTimes.get(cacheKey);
|
||||
return expirationTime == null || System.currentTimeMillis() > expirationTime;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package com.ruoyi.ss.card.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
@Data
|
||||
public class GroupBuyingDTO {
|
||||
|
||||
@NotNull(message = "店铺ID不能为空")
|
||||
@ApiModelProperty("店铺id")
|
||||
private Long storeId;
|
||||
|
||||
@ApiModelProperty("加密数据")
|
||||
// @NotBlank(message = "加密数据不能为空")
|
||||
private String encryptedData;
|
||||
|
||||
@ApiModelProperty("卡券码")
|
||||
private String code;
|
||||
|
||||
}
|
|
@ -101,5 +101,9 @@ public class SsCard extends BaseEntity{
|
|||
@ApiModelProperty("可用时间开始")
|
||||
private LocalTime availableTimeStart;
|
||||
|
||||
@Excel(name = "skuId")
|
||||
@ApiModelProperty("skuId")
|
||||
private String skuId;
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -61,4 +61,10 @@ public interface SsCardMapper
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSsCardByCouponIds(Long[] couponIds);
|
||||
|
||||
|
||||
/**
|
||||
* 根据skuId查询卡券
|
||||
*/
|
||||
SsCardVO selectSsCardBySkuId(String skuId);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
c.available_week,
|
||||
c.available_time_end,
|
||||
c.available_time_start,
|
||||
c.merchant_id
|
||||
c.merchant_id,
|
||||
c.sku_id
|
||||
from ss_card c
|
||||
left join ss_store s on c.store_id = s.store_id
|
||||
</sql>
|
||||
|
@ -54,6 +55,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="query.originalPrice != null "> and c.original_price = #{query.originalPrice}</if>
|
||||
<if test="query.availableRooms != null and query.availableRooms != ''"> and c.available_rooms = #{query.availableRooms}</if>
|
||||
<if test="query.availableWeek != null and query.availableWeek != ''"> and c.available_week = #{query.availableWeek}</if>
|
||||
<if test="query.skuId != null "> and c.sku_id = #{query.skuId}</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectSsCardList" parameterType="SsCardQuery" resultMap="SsCardResult">
|
||||
|
@ -68,6 +70,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where c.coupon_id = #{couponId}
|
||||
</select>
|
||||
|
||||
<select id="selectSsCardBySkuId" parameterType="string" resultMap="SsCardResult">
|
||||
<include refid="selectSsCardVo"/>
|
||||
where c.sku_id = #{skuId}
|
||||
</select>
|
||||
|
||||
<insert id="insertSsCard" parameterType="SsCard" useGeneratedKeys="true" keyProperty="couponId">
|
||||
insert into ss_card
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
|
@ -91,6 +98,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="availableWeek != null">available_week,</if>
|
||||
<if test="availableTimeEnd != null">available_time_end,</if>
|
||||
<if test="availableTimeStart != null">available_time_start,</if>
|
||||
<if test="skuId != null">sku_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="name != null">#{name},</if>
|
||||
|
@ -113,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="availableWeek != null">#{availableWeek,typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
|
||||
<if test="availableTimeEnd != null">#{availableTimeEnd},</if>
|
||||
<if test="availableTimeStart != null">#{availableTimeStart},</if>
|
||||
<if test="skuId != null">#{skuId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
|
@ -145,6 +154,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="data.availableWeek != null">available_week = #{data.availableWeek,typeHandler=com.ruoyi.system.mapper.typehandler.StringSplitListTypeHandler},</if>
|
||||
<if test="data.availableTimeEnd != null">available_time_end = #{data.availableTimeEnd},</if>
|
||||
<if test="data.availableTimeStart != null">available_time_start = #{data.availableTimeStart},</if>
|
||||
<if test="data.skuId != null">sku_id = #{data.skuId},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteSsCardByCouponId" parameterType="Long">
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package com.ruoyi.ss.card.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.ss.card.domain.GroupBuyingDTO;
|
||||
import com.ruoyi.ss.card.domain.SsCard;
|
||||
import com.ruoyi.ss.card.domain.SsCardVO;
|
||||
import com.ruoyi.ss.card.domain.SsCardQuery;
|
||||
|
@ -21,6 +23,14 @@ public interface ISsCardService
|
|||
*/
|
||||
public SsCardVO selectSsCardByCouponId(Long couponId);
|
||||
|
||||
/**
|
||||
* 根据skuId查询卡券
|
||||
*
|
||||
* @param skuId skuId
|
||||
* @return 卡券
|
||||
*/
|
||||
public SsCardVO selectSsCardBySkuId(String skuId);
|
||||
|
||||
/**
|
||||
* 查询卡券列表
|
||||
*
|
||||
|
@ -60,4 +70,10 @@ public interface ISsCardService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSsCardByCouponId(Long couponId);
|
||||
|
||||
/**
|
||||
* 验券
|
||||
*/
|
||||
int prepare(GroupBuyingDTO dto);
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1,31 @@
|
|||
package com.ruoyi.ss.card.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import cn.hutool.core.lang.Validator;
|
||||
import cn.hutool.core.net.url.UrlBuilder;
|
||||
import cn.hutool.core.util.ReUtil;
|
||||
import cn.hutool.http.HttpRequest;
|
||||
import cn.hutool.http.HttpUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import com.ruoyi.common.utils.SecurityUtils;
|
||||
import com.ruoyi.common.utils.ServiceUtil;
|
||||
import com.ruoyi.common.utils.dy.DouYinAccessTokenUtil;
|
||||
import com.ruoyi.ss.card.domain.GroupBuyingDTO;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecords;
|
||||
import com.ruoyi.ss.cardGetRecords.service.ICardGetRecordsService;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecords;
|
||||
import com.ruoyi.ss.checkoff.service.ICheckoffRecordsService;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingVO;
|
||||
import com.ruoyi.ss.mapping.service.IStoreMappingService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ss.card.mapper.SsCardMapper;
|
||||
import com.ruoyi.ss.card.domain.SsCard;
|
||||
|
@ -10,6 +33,9 @@ import com.ruoyi.ss.card.domain.SsCardVO;
|
|||
import com.ruoyi.ss.card.domain.SsCardQuery;
|
||||
import com.ruoyi.ss.card.service.ISsCardService;
|
||||
|
||||
import static com.ruoyi.common.constant.ServiceConstants.CARD_STATUS_UNUSED;
|
||||
import static com.ruoyi.common.constant.ServiceConstants.COUPON_GET_THIRD_PARTY_PURCHASE;
|
||||
|
||||
/**
|
||||
* 卡券Service业务层处理
|
||||
*
|
||||
|
@ -19,8 +45,25 @@ import com.ruoyi.ss.card.service.ISsCardService;
|
|||
@Service
|
||||
public class SsCardServiceImpl implements ISsCardService
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(SsCardServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private SsCardMapper ssCardMapper;
|
||||
private SsCardMapper cardMapper;
|
||||
|
||||
@Autowired
|
||||
private IStoreMappingService storeMappingService;
|
||||
|
||||
@Value("${douyin.appKey}")
|
||||
private String appKey;
|
||||
|
||||
@Value("${douyin.secret}")
|
||||
private String appSecret;
|
||||
|
||||
@Autowired
|
||||
private ICheckoffRecordsService checkoffRecordsService;
|
||||
|
||||
@Autowired
|
||||
private ICardGetRecordsService cardGetRecordsService;
|
||||
|
||||
/**
|
||||
* 查询卡券
|
||||
|
@ -31,7 +74,18 @@ public class SsCardServiceImpl implements ISsCardService
|
|||
@Override
|
||||
public SsCardVO selectSsCardByCouponId(Long couponId)
|
||||
{
|
||||
return ssCardMapper.selectSsCardByCouponId(couponId);
|
||||
return cardMapper.selectSsCardByCouponId(couponId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据skuId查询卡券
|
||||
*
|
||||
* @param skuId skuId
|
||||
* @return 卡券
|
||||
*/
|
||||
@Override
|
||||
public SsCardVO selectSsCardBySkuId(String skuId) {
|
||||
return cardMapper.selectSsCardBySkuId(skuId);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -43,7 +97,7 @@ public class SsCardServiceImpl implements ISsCardService
|
|||
@Override
|
||||
public List<SsCardVO> selectSsCardList(SsCardQuery ssCard)
|
||||
{
|
||||
return ssCardMapper.selectSsCardList(ssCard);
|
||||
return cardMapper.selectSsCardList(ssCard);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -56,7 +110,7 @@ public class SsCardServiceImpl implements ISsCardService
|
|||
public int insertSsCard(SsCard ssCard)
|
||||
{
|
||||
ssCard.setCreateTime(DateUtils.getNowDate());
|
||||
return ssCardMapper.insertSsCard(ssCard);
|
||||
return cardMapper.insertSsCard(ssCard);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,7 +122,7 @@ public class SsCardServiceImpl implements ISsCardService
|
|||
@Override
|
||||
public int updateSsCard(SsCard ssCard)
|
||||
{
|
||||
return ssCardMapper.updateSsCard(ssCard);
|
||||
return cardMapper.updateSsCard(ssCard);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -80,7 +134,7 @@ public class SsCardServiceImpl implements ISsCardService
|
|||
@Override
|
||||
public int deleteSsCardByCouponIds(Long[] couponIds)
|
||||
{
|
||||
return ssCardMapper.deleteSsCardByCouponIds(couponIds);
|
||||
return cardMapper.deleteSsCardByCouponIds(couponIds);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -92,6 +146,144 @@ public class SsCardServiceImpl implements ISsCardService
|
|||
@Override
|
||||
public int deleteSsCardByCouponId(Long couponId)
|
||||
{
|
||||
return ssCardMapper.deleteSsCardByCouponId(couponId);
|
||||
return cardMapper.deleteSsCardByCouponId(couponId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 验券准备
|
||||
*/
|
||||
@Override
|
||||
public int prepare(GroupBuyingDTO dto) {
|
||||
StoreMappingVO storeMappingVO = storeMappingService.selectStoreMappingByStoreId(dto.getStoreId());
|
||||
String tpStoreId = storeMappingVO.getTpStoreId();
|
||||
String token = DouYinAccessTokenUtil.getToken(appKey, appSecret);
|
||||
|
||||
String uri = "https://open.douyin.com/goodlife/v1/fulfilment/certificate/prepare/";
|
||||
|
||||
// 获取二维码的短链数据
|
||||
String res = HttpUtil.get(dto.getEncryptedData());
|
||||
String encryptedDataUri = ReUtil.getGroup0(Validator.URL, res);
|
||||
|
||||
// 解析 object_id
|
||||
String objectId = Optional.ofNullable(UrlBuilder.of(encryptedDataUri).getQuery().get("object_id"))
|
||||
.map(Object::toString)
|
||||
.orElseThrow(() -> new RuntimeException("二维码数据中未找到 object_id"));
|
||||
|
||||
// 发起请求
|
||||
String result = HttpRequest.get(uri)
|
||||
.contentType("application/json")
|
||||
.header("access-token", token)
|
||||
.form("encrypted_data", objectId)
|
||||
.execute()
|
||||
.body();
|
||||
|
||||
// 解析结果
|
||||
saveCheckoffRecords(result, tpStoreId, token);
|
||||
return 1;
|
||||
}
|
||||
|
||||
private void saveCheckoffRecords(String result, String tpStoreId, String token) {
|
||||
JSONObject jsonObject = JSON.parseObject(result);
|
||||
JSONObject data = jsonObject.getJSONObject("data");
|
||||
|
||||
// 确保 data 存在
|
||||
ServiceUtil.assertion(data == null || !"0".equals(data.getString("error_code")),
|
||||
"【验券准备】调用失败: " + (data != null ? data.getString("description") : "无错误描述"));
|
||||
|
||||
JSONArray certificates = Optional.ofNullable(data.getJSONArray("certificates"))
|
||||
.orElseGet(() -> {
|
||||
log.error("未找到有效的 certificate 信息");
|
||||
return new JSONArray();
|
||||
});
|
||||
|
||||
if (certificates.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
JSONObject firstCertificate = certificates.getJSONObject(0);
|
||||
JSONObject amount = firstCertificate.getJSONObject("amount");
|
||||
|
||||
// 避免空指针异常
|
||||
Integer originalAmount = amount != null ? amount.getInteger("original_amount") : 0;
|
||||
Integer listMarketAmount = amount != null ? amount.getInteger("list_market_amount") : 0;
|
||||
Integer payAmount = amount != null ? amount.getInteger("pay_amount") : 0;
|
||||
|
||||
String verifyToken = data.getString("verify_token");
|
||||
String encryptedCode = firstCertificate.getString("encrypted_code");
|
||||
|
||||
JSONObject sku = firstCertificate.getJSONObject("sku");
|
||||
String skuId = sku != null ? sku.getString("sku_id") : null;
|
||||
|
||||
// 获取卡券信息
|
||||
SsCardVO ssCardVO = cardMapper.selectSsCardBySkuId(skuId);
|
||||
ServiceUtil.assertion(ssCardVO == null, "【验券准备】根据 sku_id 未查询到卡券");
|
||||
|
||||
CheckoffRecords checkoffRecords = new CheckoffRecords();
|
||||
checkoffRecords.setCheckoffTime(DateUtils.getNowDate());
|
||||
checkoffRecords.setStatus("1");
|
||||
checkoffRecords.setEncryptedCode(encryptedCode);
|
||||
checkoffRecords.setPoiId(tpStoreId);
|
||||
checkoffRecords.setUserId(SecurityUtils.getUserId());
|
||||
checkoffRecords.setVerifyToken(verifyToken);
|
||||
checkoffRecords.setResult(result);
|
||||
checkoffRecords.setOriginalAmount(originalAmount);
|
||||
checkoffRecords.setListMarketAmount(listMarketAmount);
|
||||
checkoffRecords.setPayAmount(payAmount);
|
||||
checkoffRecords.setCardId(ssCardVO.getCouponId());
|
||||
checkoffRecords.setSkuId(skuId);
|
||||
|
||||
int insertResult = checkoffRecordsService.insertCheckoffRecords(checkoffRecords);
|
||||
log.info("新建核销记录:{}", insertResult > 0 ? "成功" : "失败");
|
||||
ServiceUtil.assertion(insertResult == 0, "新建核销记录失败");
|
||||
|
||||
// 核销接口
|
||||
verifyCertificate(checkoffRecords, token);
|
||||
|
||||
// 创建卡券领取记录
|
||||
CardGetRecords cardGetRecords = new CardGetRecords();
|
||||
cardGetRecords.setStatus(CARD_STATUS_UNUSED);
|
||||
cardGetRecords.setUserId(SecurityUtils.getUserId());
|
||||
cardGetRecords.setCouponId(ssCardVO.getCouponId());
|
||||
cardGetRecords.setGetMethod(COUPON_GET_THIRD_PARTY_PURCHASE);
|
||||
cardGetRecords.setReceiveTime(DateUtils.getNowDate());
|
||||
cardGetRecords.setStartTime(DateUtils.getNowDate());
|
||||
cardGetRecords.setEndTime(DateUtils.addYears(DateUtils.getNowDate(), 1));
|
||||
|
||||
int cardInsertResult = cardGetRecordsService.insertCardGetRecords(cardGetRecords);
|
||||
log.info("新建卡券领取记录:{}", cardInsertResult > 0 ? "成功" : "失败");
|
||||
ServiceUtil.assertion(cardInsertResult == 0, "新建卡券领取记录失败");
|
||||
}
|
||||
|
||||
private void verifyCertificate(CheckoffRecords checkoffRecords, String token) {
|
||||
String uri = "https://open.douyin.com/goodlife/v1/fulfilment/certificate/verify/";
|
||||
|
||||
JSONObject verifyJson = new JSONObject();
|
||||
verifyJson.put("verify_token", checkoffRecords.getVerifyToken());
|
||||
verifyJson.put("poi_id", checkoffRecords.getPoiId());
|
||||
JSONArray encryptedCodeArray = new JSONArray();
|
||||
encryptedCodeArray.add(checkoffRecords.getEncryptedCode());
|
||||
|
||||
verifyJson.put("encrypted_codes", encryptedCodeArray);
|
||||
log.info("verifyJson={}", JSON.toJSONString(verifyJson));
|
||||
|
||||
String verifyResult = HttpRequest.post(uri)
|
||||
.contentType("application/json")
|
||||
.header("access-token", token)
|
||||
.body(verifyJson.toJSONString())
|
||||
.execute()
|
||||
.body();
|
||||
|
||||
// 解析 JSON
|
||||
JSONObject resultJson = JSONObject.parseObject(verifyResult);
|
||||
JSONObject data1 = resultJson.getJSONObject("data");
|
||||
|
||||
// 确保 data1 存在
|
||||
int errorCode = (data1 != null) ? data1.getIntValue("error_code") : -1;
|
||||
String errorMsg = (data1 != null) ? data1.getString("description") : "未知错误";
|
||||
|
||||
ServiceUtil.assertion(errorCode != 0, "调验券接口失败: " + errorMsg);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,54 @@
|
|||
package com.ruoyi.ss.cardGetRecords.domain;
|
||||
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 卡券领取(购买)记录对象 ss_card_records
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
@Data
|
||||
public class CardGetRecords extends BaseEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long recordId;
|
||||
|
||||
@Excel(name = "领取人")
|
||||
@ApiModelProperty("领取人")
|
||||
private Long userId;
|
||||
|
||||
@Excel(name = "卡券")
|
||||
@ApiModelProperty("卡券")
|
||||
private Long couponId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "领取时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("领取时间")
|
||||
private Date receiveTime;
|
||||
|
||||
@Excel(name = "获取方式")
|
||||
@ApiModelProperty("获取方式")
|
||||
private String getMethod;
|
||||
|
||||
@Excel(name = "状态")
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "开始使用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("开始使用时间")
|
||||
private Date startTime;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "结束使用时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("结束使用时间")
|
||||
private Date endTime;
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.ruoyi.ss.cardGetRecords.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CardGetRecordsQuery extends CardGetRecords{
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
package com.ruoyi.ss.cardGetRecords.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CardGetRecordsVO extends CardGetRecords{
|
||||
|
||||
@ApiModelProperty(value = "领取人姓名")
|
||||
private String userName;
|
||||
|
||||
@ApiModelProperty(value = "卡券名称")
|
||||
private String cardName;
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.ss.cardGetRecords.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecords;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecordsVO;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecordsQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 卡券领取(购买)记录Mapper接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
public interface CardGetRecordsMapper
|
||||
{
|
||||
/**
|
||||
* 查询卡券领取(购买)记录
|
||||
*
|
||||
* @param recordId 卡券领取(购买)记录主键
|
||||
* @return 卡券领取(购买)记录
|
||||
*/
|
||||
public CardGetRecordsVO selectCardGetRecordsByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询卡券领取(购买)记录列表
|
||||
*
|
||||
* @param query 卡券领取(购买)记录
|
||||
* @return 卡券领取(购买)记录集合
|
||||
*/
|
||||
public List<CardGetRecordsVO> selectCardGetRecordsList(@Param("query")CardGetRecordsQuery query);
|
||||
|
||||
/**
|
||||
* 新增卡券领取(购买)记录
|
||||
*
|
||||
* @param cardGetRecords 卡券领取(购买)记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCardGetRecords(CardGetRecords cardGetRecords);
|
||||
|
||||
/**
|
||||
* 修改卡券领取(购买)记录
|
||||
*
|
||||
* @param cardGetRecords 卡券领取(购买)记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCardGetRecords(@Param("data") CardGetRecords cardGetRecords);
|
||||
|
||||
/**
|
||||
* 删除卡券领取(购买)记录
|
||||
*
|
||||
* @param recordId 卡券领取(购买)记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCardGetRecordsByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 批量删除卡券领取(购买)记录
|
||||
*
|
||||
* @param recordIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCardGetRecordsByRecordIds(Long[] recordIds);
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
<?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="com.ruoyi.ss.cardGetRecords.mapper.CardGetRecordsMapper">
|
||||
|
||||
<resultMap type="CardGetRecordsVO" id="CardGetRecordsResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectCardGetRecordsVo">
|
||||
select
|
||||
cr.record_id,
|
||||
cr.user_id,
|
||||
u.user_name as userName,
|
||||
cr.coupon_id,
|
||||
c.name as cardName,
|
||||
cr.receive_time,
|
||||
cr.get_method,
|
||||
cr.status,
|
||||
cr.start_time,
|
||||
cr.end_time
|
||||
from ss_card_records cr
|
||||
left join ss_user u on cr.user_id = u.user_id
|
||||
left join ss_card c on cr.coupon_id = c.coupon_id
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.userId != null "> and cr.user_id = #{query.userId}</if>
|
||||
<if test="query.couponId != null "> and cr.coupon_id = #{query.couponId}</if>
|
||||
<if test="query.receiveTime != null "> and cr.receive_time = #{query.receiveTime}</if>
|
||||
<if test="query.getMethod != null and query.getMethod != ''"> and cr.get_method = #{query.getMethod}</if>
|
||||
<if test="query.status != null and query.status != ''"> and cr.status = #{query.status}</if>
|
||||
<if test="query.startTime != null "> and cr.start_time = #{query.startTime}</if>
|
||||
<if test="query.endTime != null "> and cr.end_time = #{query.endTime}</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectCardGetRecordsList" parameterType="CardGetRecordsQuery" resultMap="CardGetRecordsResult">
|
||||
<include refid="selectCardGetRecordsVo"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCardGetRecordsByRecordId" parameterType="Long" resultMap="CardGetRecordsResult">
|
||||
<include refid="selectCardGetRecordsVo"/>
|
||||
where cr.record_id = #{recordId}
|
||||
</select>
|
||||
|
||||
<insert id="insertCardGetRecords" parameterType="CardGetRecords" useGeneratedKeys="true" keyProperty="recordId">
|
||||
insert into ss_card_records
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="couponId != null">coupon_id,</if>
|
||||
<if test="receiveTime != null">receive_time,</if>
|
||||
<if test="getMethod != null and getMethod != ''">get_method,</if>
|
||||
<if test="status != null and status != ''">status,</if>
|
||||
<if test="startTime != null">start_time,</if>
|
||||
<if test="endTime != null">end_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="couponId != null">#{couponId},</if>
|
||||
<if test="receiveTime != null">#{receiveTime},</if>
|
||||
<if test="getMethod != null and getMethod != ''">#{getMethod},</if>
|
||||
<if test="status != null and status != ''">#{status},</if>
|
||||
<if test="startTime != null">#{startTime},</if>
|
||||
<if test="endTime != null">#{endTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCardGetRecords" parameterType="CardGetRecords">
|
||||
update ss_card_records
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where record_id = #{data.recordId}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.userId != null">user_id = #{data.userId},</if>
|
||||
<if test="data.couponId != null">coupon_id = #{data.couponId},</if>
|
||||
<if test="data.receiveTime != null">receive_time = #{data.receiveTime},</if>
|
||||
<if test="data.getMethod != null and data.getMethod != ''">get_method = #{data.getMethod},</if>
|
||||
<if test="data.status != null and data.status != ''">status = #{data.status},</if>
|
||||
<if test="data.startTime != null">start_time = #{data.startTime},</if>
|
||||
<if test="data.endTime != null">end_time = #{data.endTime},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteCardGetRecordsByRecordId" parameterType="Long">
|
||||
delete from ss_card_records where record_id = #{recordId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCardGetRecordsByRecordIds" parameterType="String">
|
||||
delete from ss_card_records where record_id in
|
||||
<foreach item="recordId" collection="array" open="(" separator="," close=")">
|
||||
#{recordId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,68 @@
|
|||
package com.ruoyi.ss.cardGetRecords.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecords;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecordsVO;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecordsQuery;
|
||||
|
||||
/**
|
||||
* 卡券领取(购买)记录Service接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
public interface ICardGetRecordsService
|
||||
{
|
||||
/**
|
||||
* 查询卡券领取(购买)记录
|
||||
*
|
||||
* @param recordId 卡券领取(购买)记录主键
|
||||
* @return 卡券领取(购买)记录
|
||||
*/
|
||||
public CardGetRecordsVO selectCardGetRecordsByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 查询卡券领取(购买)记录列表
|
||||
*
|
||||
* @param cardGetRecords 卡券领取(购买)记录
|
||||
* @return 卡券领取(购买)记录集合
|
||||
*/
|
||||
public List<CardGetRecordsVO> selectCardGetRecordsList(CardGetRecordsQuery cardGetRecords);
|
||||
|
||||
/**
|
||||
* 新增卡券领取(购买)记录
|
||||
*
|
||||
* @param cardGetRecords 卡券领取(购买)记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCardGetRecords(CardGetRecords cardGetRecords);
|
||||
|
||||
/**
|
||||
* 修改卡券领取(购买)记录
|
||||
*
|
||||
* @param cardGetRecords 卡券领取(购买)记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCardGetRecords(CardGetRecords cardGetRecords);
|
||||
|
||||
/**
|
||||
* 批量删除卡券领取(购买)记录
|
||||
*
|
||||
* @param recordIds 需要删除的卡券领取(购买)记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCardGetRecordsByRecordIds(Long[] recordIds);
|
||||
|
||||
/**
|
||||
* 删除卡券领取(购买)记录信息
|
||||
*
|
||||
* @param recordId 卡券领取(购买)记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCardGetRecordsByRecordId(Long recordId);
|
||||
|
||||
/**
|
||||
* 获取用户可用卡券
|
||||
*/
|
||||
List<CardGetRecordsVO> getAvailableCard(Long userId);
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
package com.ruoyi.ss.cardGetRecords.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ss.cardGetRecords.mapper.CardGetRecordsMapper;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecords;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecordsVO;
|
||||
import com.ruoyi.ss.cardGetRecords.domain.CardGetRecordsQuery;
|
||||
import com.ruoyi.ss.cardGetRecords.service.ICardGetRecordsService;
|
||||
|
||||
import static com.ruoyi.common.constant.ServiceConstants.CARD_STATUS_UNUSED;
|
||||
|
||||
/**
|
||||
* 卡券领取(购买)记录Service业务层处理
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-19
|
||||
*/
|
||||
@Service
|
||||
public class CardGetRecordsServiceImpl implements ICardGetRecordsService
|
||||
{
|
||||
@Autowired
|
||||
private CardGetRecordsMapper cardGetRecordsMapper;
|
||||
|
||||
/**
|
||||
* 查询卡券领取(购买)记录
|
||||
*
|
||||
* @param recordId 卡券领取(购买)记录主键
|
||||
* @return 卡券领取(购买)记录
|
||||
*/
|
||||
@Override
|
||||
public CardGetRecordsVO selectCardGetRecordsByRecordId(Long recordId)
|
||||
{
|
||||
return cardGetRecordsMapper.selectCardGetRecordsByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询卡券领取(购买)记录列表
|
||||
*
|
||||
* @param cardGetRecords 卡券领取(购买)记录
|
||||
* @return 卡券领取(购买)记录
|
||||
*/
|
||||
@Override
|
||||
public List<CardGetRecordsVO> selectCardGetRecordsList(CardGetRecordsQuery cardGetRecords)
|
||||
{
|
||||
return cardGetRecordsMapper.selectCardGetRecordsList(cardGetRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增卡券领取(购买)记录
|
||||
*
|
||||
* @param cardGetRecords 卡券领取(购买)记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCardGetRecords(CardGetRecords cardGetRecords)
|
||||
{
|
||||
return cardGetRecordsMapper.insertCardGetRecords(cardGetRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改卡券领取(购买)记录
|
||||
*
|
||||
* @param cardGetRecords 卡券领取(购买)记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCardGetRecords(CardGetRecords cardGetRecords)
|
||||
{
|
||||
return cardGetRecordsMapper.updateCardGetRecords(cardGetRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除卡券领取(购买)记录
|
||||
*
|
||||
* @param recordIds 需要删除的卡券领取(购买)记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCardGetRecordsByRecordIds(Long[] recordIds)
|
||||
{
|
||||
return cardGetRecordsMapper.deleteCardGetRecordsByRecordIds(recordIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除卡券领取(购买)记录信息
|
||||
*
|
||||
* @param recordId 卡券领取(购买)记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCardGetRecordsByRecordId(Long recordId)
|
||||
{
|
||||
return cardGetRecordsMapper.deleteCardGetRecordsByRecordId(recordId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户可用卡券
|
||||
*/
|
||||
@Override
|
||||
public List<CardGetRecordsVO> getAvailableCard(Long userId) {
|
||||
CardGetRecordsQuery cardGetRecordsQuery = new CardGetRecordsQuery();
|
||||
cardGetRecordsQuery.setUserId(userId);
|
||||
cardGetRecordsQuery.setStatus(CARD_STATUS_UNUSED);
|
||||
return cardGetRecordsMapper.selectCardGetRecordsList(cardGetRecordsQuery);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,75 @@
|
|||
package com.ruoyi.ss.checkoff.domain;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 核销记录对象 ss_checkoff_records
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
@Data
|
||||
public class CheckoffRecords extends BaseEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long checkoffId;
|
||||
|
||||
@Excel(name = "加密码")
|
||||
@ApiModelProperty("加密码")
|
||||
private String encryptedCode;
|
||||
|
||||
@Excel(name = "token")
|
||||
@ApiModelProperty("token")
|
||||
private String verifyToken;
|
||||
|
||||
@Excel(name = "抖音核销门店id")
|
||||
@ApiModelProperty("抖音核销门店id")
|
||||
private String poiId;
|
||||
|
||||
@Excel(name = "卡id")
|
||||
@ApiModelProperty("卡id")
|
||||
private Long cardId;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@Excel(name = "核销时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty("核销时间")
|
||||
private Date checkoffTime;
|
||||
|
||||
@Excel(name = "用户id")
|
||||
@ApiModelProperty("用户id")
|
||||
private Long userId;
|
||||
|
||||
@Excel(name = "状态")
|
||||
@ApiModelProperty("状态")
|
||||
private String status;
|
||||
|
||||
@Excel(name = "验签结果")
|
||||
@ApiModelProperty("验签结果")
|
||||
private String result;
|
||||
|
||||
@Excel(name = "原价")
|
||||
@ApiModelProperty("原价")
|
||||
private Integer originalAmount;
|
||||
|
||||
@Excel(name = "划线价")
|
||||
@ApiModelProperty("划线价")
|
||||
private Integer listMarketAmount;
|
||||
|
||||
@Excel(name = "实际支付金额")
|
||||
@ApiModelProperty("实际支付金额")
|
||||
private Integer payAmount;
|
||||
|
||||
@Excel(name = "skuId")
|
||||
@ApiModelProperty("skuId")
|
||||
private String skuId;
|
||||
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
package com.ruoyi.ss.checkoff.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CheckoffRecordsQuery extends CheckoffRecords{
|
||||
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
package com.ruoyi.ss.checkoff.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class CheckoffRecordsVO extends CheckoffRecords{
|
||||
|
||||
@ApiModelProperty("卡名称")
|
||||
private String cardName;
|
||||
|
||||
@ApiModelProperty("用户名")
|
||||
private String userName;
|
||||
|
||||
}
|
|
@ -0,0 +1,74 @@
|
|||
package com.ruoyi.ss.checkoff.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecords;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsVO;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 核销记录Mapper接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
public interface CheckoffRecordsMapper
|
||||
{
|
||||
/**
|
||||
* 查询核销记录
|
||||
*
|
||||
* @param checkoffId 核销记录主键
|
||||
* @return 核销记录
|
||||
*/
|
||||
public CheckoffRecordsVO selectCheckoffRecordsByCheckoffId(Long checkoffId);
|
||||
|
||||
/**
|
||||
* 最后一条核销记录
|
||||
*
|
||||
* @param cardId 卡券id
|
||||
* @return 结果
|
||||
*/
|
||||
CheckoffRecords selectCheckoffRecordsByCardId(Long cardId);
|
||||
|
||||
/**
|
||||
* 查询核销记录列表
|
||||
*
|
||||
* @param query 核销记录
|
||||
* @return 核销记录集合
|
||||
*/
|
||||
public List<CheckoffRecordsVO> selectCheckoffRecordsList(@Param("query")CheckoffRecordsQuery query);
|
||||
|
||||
/**
|
||||
* 新增核销记录
|
||||
*
|
||||
* @param checkoffRecords 核销记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCheckoffRecords(CheckoffRecords checkoffRecords);
|
||||
|
||||
/**
|
||||
* 修改核销记录
|
||||
*
|
||||
* @param checkoffRecords 核销记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCheckoffRecords(@Param("data") CheckoffRecords checkoffRecords);
|
||||
|
||||
/**
|
||||
* 删除核销记录
|
||||
*
|
||||
* @param checkoffId 核销记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCheckoffRecordsByCheckoffId(Long checkoffId);
|
||||
|
||||
/**
|
||||
* 批量删除核销记录
|
||||
*
|
||||
* @param checkoffIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCheckoffRecordsByCheckoffIds(Long[] checkoffIds);
|
||||
|
||||
|
||||
}
|
|
@ -0,0 +1,125 @@
|
|||
<?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="com.ruoyi.ss.checkoff.mapper.CheckoffRecordsMapper">
|
||||
|
||||
<resultMap type="CheckoffRecordsVO" id="CheckoffRecordsResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectCheckoffRecordsVo">
|
||||
select
|
||||
cr.checkoff_id,
|
||||
cr.encrypted_code,
|
||||
cr.verify_token,
|
||||
cr.poi_id,
|
||||
cr.card_id,
|
||||
c.name as cardName,
|
||||
cr.checkoff_time,
|
||||
cr.user_id,
|
||||
u.user_name userName,
|
||||
cr.status,
|
||||
cr.result,
|
||||
cr.original_amount,
|
||||
cr.list_market_amount,
|
||||
cr.pay_amount,
|
||||
cr.sku_id
|
||||
from ss_checkoff_records cr
|
||||
left join ss_card c on cr.card_id = c.coupon_id
|
||||
left join ss_user u on cr.user_id = u.user_id
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.encryptedCode != null and query.encryptedCode != ''"> and encrypted_code = #{query.encryptedCode}</if>
|
||||
<if test="query.verifyToken != null and query.verifyToken != ''"> and verify_token = #{query.verifyToken}</if>
|
||||
<if test="query.poiId != null and query.poiId != ''"> and poi_id = #{query.poiId}</if>
|
||||
<if test="query.cardId != null "> and card_id = #{query.cardId}</if>
|
||||
<if test="query.checkoffTime != null "> and checkoff_time = #{query.checkoffTime}</if>
|
||||
<if test="query.userId != null "> and user_id = #{query.userId}</if>
|
||||
<if test="query.status != null and query.status != ''"> and status = #{query.status}</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectCheckoffRecordsList" parameterType="CheckoffRecordsQuery" resultMap="CheckoffRecordsResult">
|
||||
<include refid="selectCheckoffRecordsVo"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectCheckoffRecordsByCheckoffId" parameterType="Long" resultMap="CheckoffRecordsResult">
|
||||
<include refid="selectCheckoffRecordsVo"/>
|
||||
where checkoff_id = #{checkoffId}
|
||||
</select>
|
||||
|
||||
<select id="selectCheckoffRecordsByCardId" parameterType="Long" resultMap="CheckoffRecordsResult">
|
||||
<include refid="selectCheckoffRecordsVo"/>
|
||||
where card_id = #{cardId}
|
||||
order by checkoff_time desc limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertCheckoffRecords" parameterType="CheckoffRecords">
|
||||
insert into ss_checkoff_records
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="checkoffId != null">checkoff_id,</if>
|
||||
<if test="encryptedCode != null">encrypted_code,</if>
|
||||
<if test="verifyToken != null">verify_token,</if>
|
||||
<if test="poiId != null">poi_id,</if>
|
||||
<if test="cardId != null">card_id,</if>
|
||||
<if test="checkoffTime != null">checkoff_time,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="status != null">status,</if>
|
||||
<if test="result != null">result,</if>
|
||||
<if test="originalAmount != null">original_amount,</if>
|
||||
<if test="listMarketAmount != null">list_market_amount,</if>
|
||||
<if test="payAmount != null">pay_amount,</if>
|
||||
<if test="skuId != null">sku_id,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="checkoffId != null">#{checkoffId},</if>
|
||||
<if test="encryptedCode != null">#{encryptedCode},</if>
|
||||
<if test="verifyToken != null">#{verifyToken},</if>
|
||||
<if test="poiId != null">#{poiId},</if>
|
||||
<if test="cardId != null">#{cardId},</if>
|
||||
<if test="checkoffTime != null">#{checkoffTime},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="status != null">#{status},</if>
|
||||
<if test="result != null">#{result},</if>
|
||||
<if test="originalAmount != null">#{originalAmount},</if>
|
||||
<if test="listMarketAmount != null">#{listMarketAmount},</if>
|
||||
<if test="payAmount != null">#{payAmount},</if>
|
||||
<if test="skuId != null">#{skuId},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateCheckoffRecords" parameterType="CheckoffRecords">
|
||||
update ss_checkoff_records
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where checkoff_id = #{data.checkoffId}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.encryptedCode != null">encrypted_code = #{data.encryptedCode},</if>
|
||||
<if test="data.verifyToken != null">verify_token = #{data.verifyToken},</if>
|
||||
<if test="data.poiId != null">poi_id = #{data.poiId},</if>
|
||||
<if test="data.cardId != null">card_id = #{data.cardId},</if>
|
||||
<if test="data.checkoffTime != null">checkoff_time = #{data.checkoffTime},</if>
|
||||
<if test="data.userId != null">user_id = #{data.userId},</if>
|
||||
<if test="data.status != null">status = #{data.status},</if>
|
||||
<if test="data.originalAmount != null">original_amount = #{data.originalAmount},</if>
|
||||
<if test="data.listMarketAmount != null">list_market_amount = #{data.listMarketAmount},</if>
|
||||
<if test="data.payAmount != null">pay_amount = #{data.payAmount},</if>
|
||||
<if test="data.skuId != null">sku_id = #{data.skuId},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteCheckoffRecordsByCheckoffId" parameterType="Long">
|
||||
delete from ss_checkoff_records where checkoff_id = #{checkoffId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteCheckoffRecordsByCheckoffIds" parameterType="String">
|
||||
delete from ss_checkoff_records where checkoff_id in
|
||||
<foreach item="checkoffId" collection="array" open="(" separator="," close=")">
|
||||
#{checkoffId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,71 @@
|
|||
package com.ruoyi.ss.checkoff.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecords;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsVO;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsQuery;
|
||||
|
||||
/**
|
||||
* 核销记录Service接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
public interface ICheckoffRecordsService
|
||||
{
|
||||
/**
|
||||
* 查询核销记录
|
||||
*
|
||||
* @param checkoffId 核销记录主键
|
||||
* @return 核销记录
|
||||
*/
|
||||
public CheckoffRecordsVO selectCheckoffRecordsByCheckoffId(Long checkoffId);
|
||||
|
||||
/**
|
||||
* 查询核销记录列表
|
||||
*
|
||||
* @param checkoffRecords 核销记录
|
||||
* @return 核销记录集合
|
||||
*/
|
||||
public List<CheckoffRecordsVO> selectCheckoffRecordsList(CheckoffRecordsQuery checkoffRecords);
|
||||
|
||||
/**
|
||||
* 新增核销记录
|
||||
*
|
||||
* @param checkoffRecords 核销记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertCheckoffRecords(CheckoffRecords checkoffRecords);
|
||||
|
||||
/**
|
||||
* 修改核销记录
|
||||
*
|
||||
* @param checkoffRecords 核销记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateCheckoffRecords(CheckoffRecords checkoffRecords);
|
||||
|
||||
/**
|
||||
* 批量删除核销记录
|
||||
*
|
||||
* @param checkoffIds 需要删除的核销记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCheckoffRecordsByCheckoffIds(Long[] checkoffIds);
|
||||
|
||||
/**
|
||||
* 删除核销记录信息
|
||||
*
|
||||
* @param checkoffId 核销记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteCheckoffRecordsByCheckoffId(Long checkoffId);
|
||||
|
||||
/**
|
||||
* 最后一条核销记录
|
||||
*
|
||||
* @param cardId 卡券id
|
||||
* @return 结果
|
||||
*/
|
||||
CheckoffRecords selectCheckoffRecordsByCardId(Long cardId);
|
||||
}
|
|
@ -0,0 +1,106 @@
|
|||
package com.ruoyi.ss.checkoff.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ss.checkoff.mapper.CheckoffRecordsMapper;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecords;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsVO;
|
||||
import com.ruoyi.ss.checkoff.domain.CheckoffRecordsQuery;
|
||||
import com.ruoyi.ss.checkoff.service.ICheckoffRecordsService;
|
||||
|
||||
/**
|
||||
* 核销记录Service业务层处理
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
@Service
|
||||
public class CheckoffRecordsServiceImpl implements ICheckoffRecordsService
|
||||
{
|
||||
@Autowired
|
||||
private CheckoffRecordsMapper checkoffRecordsMapper;
|
||||
|
||||
/**
|
||||
* 查询核销记录
|
||||
*
|
||||
* @param checkoffId 核销记录主键
|
||||
* @return 核销记录
|
||||
*/
|
||||
@Override
|
||||
public CheckoffRecordsVO selectCheckoffRecordsByCheckoffId(Long checkoffId)
|
||||
{
|
||||
return checkoffRecordsMapper.selectCheckoffRecordsByCheckoffId(checkoffId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询核销记录列表
|
||||
*
|
||||
* @param checkoffRecords 核销记录
|
||||
* @return 核销记录
|
||||
*/
|
||||
@Override
|
||||
public List<CheckoffRecordsVO> selectCheckoffRecordsList(CheckoffRecordsQuery checkoffRecords)
|
||||
{
|
||||
return checkoffRecordsMapper.selectCheckoffRecordsList(checkoffRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增核销记录
|
||||
*
|
||||
* @param checkoffRecords 核销记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertCheckoffRecords(CheckoffRecords checkoffRecords)
|
||||
{
|
||||
return checkoffRecordsMapper.insertCheckoffRecords(checkoffRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改核销记录
|
||||
*
|
||||
* @param checkoffRecords 核销记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateCheckoffRecords(CheckoffRecords checkoffRecords)
|
||||
{
|
||||
return checkoffRecordsMapper.updateCheckoffRecords(checkoffRecords);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除核销记录
|
||||
*
|
||||
* @param checkoffIds 需要删除的核销记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCheckoffRecordsByCheckoffIds(Long[] checkoffIds)
|
||||
{
|
||||
return checkoffRecordsMapper.deleteCheckoffRecordsByCheckoffIds(checkoffIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除核销记录信息
|
||||
*
|
||||
* @param checkoffId 核销记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteCheckoffRecordsByCheckoffId(Long checkoffId)
|
||||
{
|
||||
return checkoffRecordsMapper.deleteCheckoffRecordsByCheckoffId(checkoffId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 最后一条核销记录
|
||||
*
|
||||
* @param cardId 卡券id
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public CheckoffRecords selectCheckoffRecordsByCardId(Long cardId) {
|
||||
return checkoffRecordsMapper.selectCheckoffRecordsByCardId(cardId);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
package com.ruoyi.ss.mapping.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
import com.ruoyi.common.annotation.Excel;
|
||||
import com.ruoyi.common.core.domain.BaseEntity;
|
||||
|
||||
/**
|
||||
* 系统与第三方店铺映射关系对象 ss_store_mapping
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
@Data
|
||||
public class StoreMapping extends BaseEntity{
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long storeId;
|
||||
|
||||
@Excel(name = "第三方店铺id")
|
||||
@ApiModelProperty("第三方店铺id")
|
||||
private String tpStoreId;
|
||||
|
||||
@Excel(name = "1-抖音;2-美团")
|
||||
@ApiModelProperty("1-抖音;2-美团")
|
||||
private String type;
|
||||
|
||||
}
|
|
@ -0,0 +1,7 @@
|
|||
package com.ruoyi.ss.mapping.domain;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StoreMappingQuery extends StoreMapping{
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
package com.ruoyi.ss.mapping.domain;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class StoreMappingVO extends StoreMapping{
|
||||
|
||||
@ApiModelProperty("店铺名称")
|
||||
private String storeName;
|
||||
}
|
|
@ -0,0 +1,64 @@
|
|||
package com.ruoyi.ss.mapping.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMapping;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingVO;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingQuery;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
/**
|
||||
* 系统与第三方店铺映射关系Mapper接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
public interface StoreMappingMapper
|
||||
{
|
||||
/**
|
||||
* 查询系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeId 系统与第三方店铺映射关系主键
|
||||
* @return 系统与第三方店铺映射关系
|
||||
*/
|
||||
public StoreMappingVO selectStoreMappingByStoreId(Long storeId);
|
||||
|
||||
/**
|
||||
* 查询系统与第三方店铺映射关系列表
|
||||
*
|
||||
* @param query 系统与第三方店铺映射关系
|
||||
* @return 系统与第三方店铺映射关系集合
|
||||
*/
|
||||
public List<StoreMappingVO> selectStoreMappingList(@Param("query")StoreMappingQuery query);
|
||||
|
||||
/**
|
||||
* 新增系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeMapping 系统与第三方店铺映射关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreMapping(StoreMapping storeMapping);
|
||||
|
||||
/**
|
||||
* 修改系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeMapping 系统与第三方店铺映射关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreMapping(@Param("data") StoreMapping storeMapping);
|
||||
|
||||
/**
|
||||
* 删除系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeId 系统与第三方店铺映射关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreMappingByStoreId(Long storeId);
|
||||
|
||||
/**
|
||||
* 批量删除系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreMappingByStoreIds(Long[] storeIds);
|
||||
}
|
|
@ -0,0 +1,76 @@
|
|||
<?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="com.ruoyi.ss.mapping.mapper.StoreMappingMapper">
|
||||
|
||||
<resultMap type="StoreMappingVO" id="StoreMappingResult" autoMapping="true" />
|
||||
|
||||
<sql id="selectStoreMappingVo">
|
||||
select
|
||||
sm.store_id,
|
||||
sm.tp_store_id,
|
||||
s.name as storeName,
|
||||
sm.type,
|
||||
sm.create_time
|
||||
from ss_store_mapping sm
|
||||
left join ss_store s on sm.store_id = s.store_id
|
||||
</sql>
|
||||
|
||||
<sql id="searchCondition">
|
||||
<if test="query.tpStoreId != null and query.tpStoreId != ''"> and sm.tp_store_id = #{query.tpStoreId}</if>
|
||||
<if test="query.type != null and query.type != ''"> and sm.type = #{query.type}</if>
|
||||
</sql>
|
||||
|
||||
<select id="selectStoreMappingList" parameterType="StoreMappingQuery" resultMap="StoreMappingResult">
|
||||
<include refid="selectStoreMappingVo"/>
|
||||
<where>
|
||||
<include refid="searchCondition"/>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectStoreMappingByStoreId" parameterType="Long" resultMap="StoreMappingResult">
|
||||
<include refid="selectStoreMappingVo"/>
|
||||
where sm.store_id = #{storeId}
|
||||
</select>
|
||||
|
||||
<insert id="insertStoreMapping" parameterType="StoreMapping">
|
||||
insert into ss_store_mapping
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="storeId != null">store_id,</if>
|
||||
<if test="tpStoreId != null and tpStoreId != ''">tp_store_id,</if>
|
||||
<if test="type != null and type != ''">type,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="storeId != null">#{storeId},</if>
|
||||
<if test="tpStoreId != null and tpStoreId != ''">#{tpStoreId},</if>
|
||||
<if test="type != null and type != ''">#{type},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateStoreMapping" parameterType="StoreMapping">
|
||||
update ss_store_mapping
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<include refid="updateColumns"/>
|
||||
</trim>
|
||||
where store_id = #{data.storeId}
|
||||
</update>
|
||||
|
||||
<sql id="updateColumns">
|
||||
<if test="data.tpStoreId != null and data.tpStoreId != ''">tp_store_id = #{data.tpStoreId},</if>
|
||||
<if test="data.type != null and data.type != ''">type = #{data.type},</if>
|
||||
</sql>
|
||||
|
||||
<delete id="deleteStoreMappingByStoreId" parameterType="Long">
|
||||
delete from ss_store_mapping where store_id = #{storeId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteStoreMappingByStoreIds" parameterType="String">
|
||||
delete from ss_store_mapping where store_id in
|
||||
<foreach item="storeId" collection="array" open="(" separator="," close=")">
|
||||
#{storeId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
|
@ -0,0 +1,63 @@
|
|||
package com.ruoyi.ss.mapping.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMapping;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingVO;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingQuery;
|
||||
|
||||
/**
|
||||
* 系统与第三方店铺映射关系Service接口
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
public interface IStoreMappingService
|
||||
{
|
||||
/**
|
||||
* 查询系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeId 系统与第三方店铺映射关系主键
|
||||
* @return 系统与第三方店铺映射关系
|
||||
*/
|
||||
public StoreMappingVO selectStoreMappingByStoreId(Long storeId);
|
||||
|
||||
/**
|
||||
* 查询系统与第三方店铺映射关系列表
|
||||
*
|
||||
* @param storeMapping 系统与第三方店铺映射关系
|
||||
* @return 系统与第三方店铺映射关系集合
|
||||
*/
|
||||
public List<StoreMappingVO> selectStoreMappingList(StoreMappingQuery storeMapping);
|
||||
|
||||
/**
|
||||
* 新增系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeMapping 系统与第三方店铺映射关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertStoreMapping(StoreMapping storeMapping);
|
||||
|
||||
/**
|
||||
* 修改系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeMapping 系统与第三方店铺映射关系
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateStoreMapping(StoreMapping storeMapping);
|
||||
|
||||
/**
|
||||
* 批量删除系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeIds 需要删除的系统与第三方店铺映射关系主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreMappingByStoreIds(Long[] storeIds);
|
||||
|
||||
/**
|
||||
* 删除系统与第三方店铺映射关系信息
|
||||
*
|
||||
* @param storeId 系统与第三方店铺映射关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteStoreMappingByStoreId(Long storeId);
|
||||
}
|
|
@ -0,0 +1,98 @@
|
|||
package com.ruoyi.ss.mapping.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.ruoyi.common.utils.DateUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.ruoyi.ss.mapping.mapper.StoreMappingMapper;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMapping;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingVO;
|
||||
import com.ruoyi.ss.mapping.domain.StoreMappingQuery;
|
||||
import com.ruoyi.ss.mapping.service.IStoreMappingService;
|
||||
|
||||
/**
|
||||
* 系统与第三方店铺映射关系Service业务层处理
|
||||
*
|
||||
* @author qzz
|
||||
* @date 2025-03-18
|
||||
*/
|
||||
@Service
|
||||
public class StoreMappingServiceImpl implements IStoreMappingService
|
||||
{
|
||||
@Autowired
|
||||
private StoreMappingMapper storeMappingMapper;
|
||||
|
||||
/**
|
||||
* 查询系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeId 系统与第三方店铺映射关系主键
|
||||
* @return 系统与第三方店铺映射关系
|
||||
*/
|
||||
@Override
|
||||
public StoreMappingVO selectStoreMappingByStoreId(Long storeId)
|
||||
{
|
||||
return storeMappingMapper.selectStoreMappingByStoreId(storeId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询系统与第三方店铺映射关系列表
|
||||
*
|
||||
* @param storeMapping 系统与第三方店铺映射关系
|
||||
* @return 系统与第三方店铺映射关系
|
||||
*/
|
||||
@Override
|
||||
public List<StoreMappingVO> selectStoreMappingList(StoreMappingQuery storeMapping)
|
||||
{
|
||||
return storeMappingMapper.selectStoreMappingList(storeMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeMapping 系统与第三方店铺映射关系
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertStoreMapping(StoreMapping storeMapping)
|
||||
{
|
||||
storeMapping.setCreateTime(DateUtils.getNowDate());
|
||||
return storeMappingMapper.insertStoreMapping(storeMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeMapping 系统与第三方店铺映射关系
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateStoreMapping(StoreMapping storeMapping)
|
||||
{
|
||||
return storeMappingMapper.updateStoreMapping(storeMapping);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除系统与第三方店铺映射关系
|
||||
*
|
||||
* @param storeIds 需要删除的系统与第三方店铺映射关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStoreMappingByStoreIds(Long[] storeIds)
|
||||
{
|
||||
return storeMappingMapper.deleteStoreMappingByStoreIds(storeIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除系统与第三方店铺映射关系信息
|
||||
*
|
||||
* @param storeId 系统与第三方店铺映射关系主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteStoreMappingByStoreId(Long storeId)
|
||||
{
|
||||
return storeMappingMapper.deleteStoreMappingByStoreId(storeId);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user