From 16811aca026abb13339ae27cc3801a61dca598eb Mon Sep 17 00:00:00 2001 From: yuanye <418471657@qq.com> Date: Fri, 27 Sep 2024 15:53:59 +0800 Subject: [PATCH] 1 --- .../cornucopia/CornucopiaController.java | 101 +++++++++++ .../controller/order/BsOrderController.java | 69 ++++++++ .../com/hfkj/controller/ClientController.java | 26 ++- .../com/hfkj/controller/GoodsController.java | 35 +--- .../cornucopia/CornucopiaController.java | 91 ++++++++++ .../controller/order/BsOrderController.java | 106 ++++++++++++ .../cornucopia/BsCornucopiaConfigService.java | 68 ++++++++ .../BsCornucopiaLotteryRecordService.java | 57 +++++++ .../cornucopia/BsCornucopiaPoolService.java | 90 ++++++++++ .../Impl/BsCornucopiaConfigServiceImpl.java | 84 ++++++++++ .../BsCornucopiaLotteryRecordServiceImpl.java | 67 ++++++++ .../Impl/BsCornucopiaPoolServiceImpl.java | 157 ++++++++++++++++++ .../goods/impl/GoodsDataServiceImpl.java | 9 +- .../hfkj/service/order/BsOrderService.java | 13 ++ .../order/Impl/BsOrderServiceImpl.java | 42 ++++- .../service/order/OrderBusinessService.java | 19 ++- .../java/com/hfkj/service/pdd/PddService.java | 7 +- .../user/UserAccountRecordSourceTypeEnum.java | 4 + 18 files changed, 1000 insertions(+), 45 deletions(-) create mode 100644 bweb/src/main/java/com/hfkj/controller/cornucopia/CornucopiaController.java create mode 100644 bweb/src/main/java/com/hfkj/controller/order/BsOrderController.java create mode 100644 cweb/src/main/java/com/hfkj/controller/cornucopia/CornucopiaController.java create mode 100644 cweb/src/main/java/com/hfkj/controller/order/BsOrderController.java create mode 100644 service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaConfigService.java create mode 100644 service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaLotteryRecordService.java create mode 100644 service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaPoolService.java create mode 100644 service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaConfigServiceImpl.java create mode 100644 service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaLotteryRecordServiceImpl.java create mode 100644 service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaPoolServiceImpl.java diff --git a/bweb/src/main/java/com/hfkj/controller/cornucopia/CornucopiaController.java b/bweb/src/main/java/com/hfkj/controller/cornucopia/CornucopiaController.java new file mode 100644 index 0000000..87c88fe --- /dev/null +++ b/bweb/src/main/java/com/hfkj/controller/cornucopia/CornucopiaController.java @@ -0,0 +1,101 @@ +package com.hfkj.controller.cornucopia; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.controller.order.BsOrderController; +import com.hfkj.entity.BsCornucopiaConfig; +import com.hfkj.entity.BsCornucopiaPool; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.service.cornucopia.BsCornucopiaConfigService; +import com.hfkj.service.cornucopia.BsCornucopiaLotteryRecordService; +import com.hfkj.service.cornucopia.BsCornucopiaPoolService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.apache.commons.lang3.StringUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value="/cornucopia") +@Api(value="聚宝盆管理") +public class CornucopiaController { + + private static final Logger log = LoggerFactory.getLogger(CornucopiaController.class); + + @Resource + private BsCornucopiaConfigService cornucopiaConfigService; + + @Resource + private BsCornucopiaPoolService cornucopiaPoolService; + + @Resource + private BsCornucopiaLotteryRecordService cornucopiaLotteryRecordService; + + @RequestMapping(value="/editCornucopiaConfig",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "编辑聚宝盆开奖配置内容") + public ResponseData editCornucopiaConfig(@RequestBody BsCornucopiaConfig body, HttpServletRequest request) { + + try { + + if (body == null + || body.getType() == null + || body.getName() == null + || body.getProportion() == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + // 查询是否存在当前开奖内容 + BsCornucopiaConfig cornucopiaConfig = cornucopiaConfigService.queryDetail(body.getType()); + + if (cornucopiaConfig == null) { + cornucopiaConfig = new BsCornucopiaConfig(); + cornucopiaConfig.setStatus(1); + cornucopiaConfig.setCreateTime(new Date()); + } + + cornucopiaConfig.setUpdateTime(new Date()); + cornucopiaConfig.setType(body.getType()); + cornucopiaConfig.setName(body.getName()); + cornucopiaConfig.setProportion(body.getProportion()); + + cornucopiaConfigService.edit(cornucopiaConfig); + + return ResponseMsgUtil.success(cornucopiaConfig); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + + } + + @RequestMapping(value="/getCornucopiaConfig",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询聚宝盆配置参数列表") + public ResponseData getCornucopiaConfig() { + try { + + return ResponseMsgUtil.success(cornucopiaConfigService.queryAllList(new HashMap<>())); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/bweb/src/main/java/com/hfkj/controller/order/BsOrderController.java b/bweb/src/main/java/com/hfkj/controller/order/BsOrderController.java new file mode 100644 index 0000000..4f27c74 --- /dev/null +++ b/bweb/src/main/java/com/hfkj/controller/order/BsOrderController.java @@ -0,0 +1,69 @@ +package com.hfkj.controller.order; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.service.order.BsOrderService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value="/order") +@Api(value="订单管理") +public class BsOrderController { + + private static final Logger log = LoggerFactory.getLogger(BsOrderController.class); + + @Resource + private BsOrderService orderService; + + @RequestMapping(value="/getOrderList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData getOrderList(@RequestParam(value = "orderNo" , required = false) String orderNo, + @RequestParam(value = "type" , required = false) Integer type, + @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "userPhone" , required = false) String userPhone, + @RequestParam(value = "goodsName" , required = false) String goodsName, + @RequestParam(value = "createTimeS" , required = false) Long createTimeS, + @RequestParam(value = "createTimeE" , required = false) Long createTimeE, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize, HttpServletRequest request) { + try { + + + Map map = new HashMap<>(); + map.put("orderNo", orderNo); + map.put("userPhone", userPhone); + map.put("type", type); + map.put("status", status); + map.put("goodsName", goodsName); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(orderService.getOrderList(map))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/cweb/src/main/java/com/hfkj/controller/ClientController.java b/cweb/src/main/java/com/hfkj/controller/ClientController.java index 099b954..4238cd1 100644 --- a/cweb/src/main/java/com/hfkj/controller/ClientController.java +++ b/cweb/src/main/java/com/hfkj/controller/ClientController.java @@ -17,10 +17,7 @@ import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; @@ -81,6 +78,27 @@ public class ClientController { } } + + @RequestMapping(value = "/smsLogin", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "登录并注册") + public ResponseData smsLogin(@RequestParam(value = "phone" , required = true) String phone) { + try { + + + // 校验手机号格式 + if (!MemberValidateUtil.validatePhone(phone)) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请输入正确的手机号"); + } + + + return ResponseMsgUtil.success(userService.login(phone, UserLoginType.SMS, new HashMap<>(), null)); + + } catch (Exception e) { + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value="/loginOut",method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "退出登录") diff --git a/cweb/src/main/java/com/hfkj/controller/GoodsController.java b/cweb/src/main/java/com/hfkj/controller/GoodsController.java index afa0a2b..13524fa 100644 --- a/cweb/src/main/java/com/hfkj/controller/GoodsController.java +++ b/cweb/src/main/java/com/hfkj/controller/GoodsController.java @@ -38,8 +38,7 @@ public class GoodsController { @Autowired private UserCenter userCenter; - @Resource - private BsOrderService bsOrderService; + @RequestMapping(value="/goodsList",method = RequestMethod.GET) @ResponseBody @@ -63,11 +62,16 @@ public class GoodsController { goodsList = goodsDataService.goodsModelTaoBaoList(jsonObject); } else if (type == 2) { - JSONObject object = PddService.authority(); + // 用户session + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + Map mapUser = new HashMap<>(); + mapUser.put("uid", userSession.getUser().getId()); + JSONObject object = PddService.authority(mapUser.toString()); boolean generateAuthorityUrl = object.getJSONObject("authorityQueryResponse").getInteger("bind") == 0; if (generateAuthorityUrl && title != null) { goodsList = new ArrayList<>(); - JSONObject jsonObject = PddService.promotion(); + + JSONObject jsonObject = PddService.promotion(mapUser.toString()); JSONObject promotion = jsonObject.getJSONObject("rpPromotionUrlGenerateResponse").getJSONArray("urlList").getJSONObject(0); GoodsModel goodsModel = new GoodsModel(); goodsModel.setPddUrl(promotion); @@ -77,7 +81,7 @@ public class GoodsController { if (pageSize < 10) { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR , "pageSize的取值范围是10-100!"); } - JSONObject jsonObject = PddService.syncInvoke(title , pageNo , pageSize); + JSONObject jsonObject = PddService.syncInvoke(title , pageNo , pageSize , mapUser.toString()); goodsList = goodsDataService.goodsModelPddList(jsonObject); } @@ -93,28 +97,7 @@ public class GoodsController { } } - @RequestMapping(value="/create",method = RequestMethod.POST) - @ResponseBody - @ApiOperation(value = "创建订单") - public ResponseData create(@RequestBody JSONObject jsonObject) { - try { - - // 用户session - UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); - if (userSession == null) { - throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); - } - - jsonObject.put("userId", userSession.getUser().getId()); - jsonObject.put("userPhone", userSession.getUser().getPhone()); - - return ResponseMsgUtil.success(bsOrderService.create(jsonObject)); - } catch (Exception e) { - log.error("error!",e); - return ResponseMsgUtil.exception(e); - } - } @RequestMapping(value="/createCommand",method = RequestMethod.GET) @ResponseBody diff --git a/cweb/src/main/java/com/hfkj/controller/cornucopia/CornucopiaController.java b/cweb/src/main/java/com/hfkj/controller/cornucopia/CornucopiaController.java new file mode 100644 index 0000000..63afa0e --- /dev/null +++ b/cweb/src/main/java/com/hfkj/controller/cornucopia/CornucopiaController.java @@ -0,0 +1,91 @@ +package com.hfkj.controller.cornucopia; + +import com.alibaba.fastjson.JSONObject; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.service.cornucopia.BsCornucopiaConfigService; +import com.hfkj.service.cornucopia.BsCornucopiaLotteryRecordService; +import com.hfkj.service.cornucopia.BsCornucopiaPoolService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; + +@Controller +@RequestMapping(value="/cornucopia") +@Api(value="聚宝盆管理") +public class CornucopiaController { + + private static final Logger log = LoggerFactory.getLogger(CornucopiaController.class); + + @Resource + private BsCornucopiaConfigService cornucopiaConfigService; + + @Resource + private BsCornucopiaPoolService cornucopiaPoolService; + + @Resource + private BsCornucopiaLotteryRecordService cornucopiaLotteryRecordService; + + @Resource + private UserCenter userCenter; + + + @RequestMapping(value="/getCornucopiaConfig",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询聚宝盆配置参数列表") + public ResponseData getCornucopiaConfig() { + try { + + return ResponseMsgUtil.success(cornucopiaConfigService.queryAllList(new HashMap<>())); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/investmentCornucopia",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "投入聚宝盆") + public ResponseData investmentCornucopia(@RequestBody JSONObject body, HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + if (body == null|| + body.getInteger("type") == null || + body.getBigDecimal("goldCoin") == null + ) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.REQ_PARAMS_ERROR, ""); + } + + cornucopiaPoolService.investmentCornucopia(body.getInteger("type") , userModel.getAccount().getId() , body.getBigDecimal("goldCoin")); + + return ResponseMsgUtil.success("投入成功"); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + + +} diff --git a/cweb/src/main/java/com/hfkj/controller/order/BsOrderController.java b/cweb/src/main/java/com/hfkj/controller/order/BsOrderController.java new file mode 100644 index 0000000..51f2427 --- /dev/null +++ b/cweb/src/main/java/com/hfkj/controller/order/BsOrderController.java @@ -0,0 +1,106 @@ +package com.hfkj.controller.order; + +import com.alibaba.fastjson.JSONObject; +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.common.security.SessionObject; +import com.hfkj.common.security.UserCenter; +import com.hfkj.common.utils.ResponseMsgUtil; +import com.hfkj.model.ResponseData; +import com.hfkj.model.SecUserSessionObject; +import com.hfkj.model.UserSessionObject; +import com.hfkj.service.order.BsOrderService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +@Controller +@RequestMapping(value="/order") +@Api(value="订单管理") +public class BsOrderController { + + private static final Logger log = LoggerFactory.getLogger(BsOrderController.class); + + @Resource + private BsOrderService orderService; + + @Resource + private UserCenter userCenter; + + @Resource + private BsOrderService bsOrderService; + + @RequestMapping(value="/getOrderList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询列表") + public ResponseData getOrderList(@RequestParam(value = "orderNo" , required = false) String orderNo, + @RequestParam(value = "type" , required = false) Integer type, + @RequestParam(value = "status" , required = false) Integer status, + @RequestParam(value = "userPhone" , required = false) String userPhone, + @RequestParam(value = "goodsName" , required = false) String goodsName, + @RequestParam(value = "createTimeS" , required = false) Long createTimeS, + @RequestParam(value = "createTimeE" , required = false) Long createTimeE, + @RequestParam(value = "pageNum" , required = true) Integer pageNum, + @RequestParam(value = "pageSize" , required = true) Integer pageSize, HttpServletRequest request) { + try { + + SessionObject sessionObject = userCenter.getSessionObject(request); + SecUserSessionObject userModel = (SecUserSessionObject) sessionObject.getObject(); + + Map map = new HashMap<>(); + + + + map.put("orderNo", orderNo); + map.put("userPhone", userPhone); + map.put("type", type); + map.put("userId", userModel.getAccount().getId()); + map.put("status", status); + map.put("goodsName", goodsName); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(orderService.getOrderList(map))); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + + @RequestMapping(value="/create",method = RequestMethod.POST) + @ResponseBody + @ApiOperation(value = "创建订单") + public ResponseData create(@RequestBody JSONObject jsonObject) { + try { + + // 用户session + UserSessionObject userSession = userCenter.getSessionModel(UserSessionObject.class); + if (userSession == null) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.ACCOUNT_LOGIN_NOT, ""); + } + + jsonObject.put("userId", userSession.getUser().getId()); + jsonObject.put("userPhone", userSession.getUser().getPhone()); + + return ResponseMsgUtil.success(bsOrderService.create(jsonObject)); + + } catch (Exception e) { + log.error("error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaConfigService.java b/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaConfigService.java new file mode 100644 index 0000000..90a8071 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaConfigService.java @@ -0,0 +1,68 @@ +package com.hfkj.service.cornucopia; + +import com.hfkj.entity.BsCornucopiaConfig; + +import java.util.List; +import java.util.Map; + +public interface BsCornucopiaConfigService { + + /** + * @MethodName create + * @Description: 创建 + * @param cornucopiaConfig + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void create(BsCornucopiaConfig cornucopiaConfig); + + /** + * @MethodName update + * @Description: 更新 + * @param cornucopiaConfig + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void edit(BsCornucopiaConfig cornucopiaConfig); + + /** + * @MethodName delete + * @Description: 删除 + * @param id + * @param fullDelete + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void delete(Long id , Boolean fullDelete); + + /** + * @MethodName queryDetail + * @Description:查询详情 + * @param id + * @return: com.hfkj.entity.BsCornucopiaConfig + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + BsCornucopiaConfig queryDetail(Long id); + + /** + * @MethodName queryDetail + * @Description: + * @param type + * @return: com.hfkj.entity.BsCornucopiaConfig + * @Author: Sum1Dream + * @Date: 2024/9/27 下午2:28 + */ + BsCornucopiaConfig queryDetail(Integer type); + + /** + * @MethodName queryAllList + * @Description: map + * @param + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/9/27 上午11:42 + */ + List queryAllList(Map map); + +} diff --git a/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaLotteryRecordService.java b/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaLotteryRecordService.java new file mode 100644 index 0000000..7af746e --- /dev/null +++ b/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaLotteryRecordService.java @@ -0,0 +1,57 @@ +package com.hfkj.service.cornucopia; + +import com.hfkj.entity.BsCornucopiaLotteryRecord; + +import java.util.List; +import java.util.Map; + +public interface BsCornucopiaLotteryRecordService { + + /** + * @MethodName create + * @Description: 创建 + * @param cornucopiaLotteryRecord + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void create(BsCornucopiaLotteryRecord cornucopiaLotteryRecord); + + /** + * @MethodName update + * @Description: 更新 + * @param cornucopiaLotteryRecord + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void update(BsCornucopiaLotteryRecord cornucopiaLotteryRecord); + + /** + * @MethodName delete + * @Description: 删除 + * @param id + * @param fullDelete + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void delete(Long id , Boolean fullDelete); + + /** + * @MethodName queryDetail + * @Description:查询详情 + * @param id + * @return: com.hfkj.entity.BsCornucopiaLotteryRecord + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + BsCornucopiaLotteryRecord queryDetail(Long id); + + /** + * @MethodName queryAllList + * @Description: map + * @param + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/9/27 上午11:42 + */ + List queryAllList(Map map); +} diff --git a/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaPoolService.java b/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaPoolService.java new file mode 100644 index 0000000..8f68e8f --- /dev/null +++ b/service/src/main/java/com/hfkj/service/cornucopia/BsCornucopiaPoolService.java @@ -0,0 +1,90 @@ +package com.hfkj.service.cornucopia; + +import com.hfkj.entity.BsCornucopiaLotteryRecord; +import com.hfkj.entity.BsCornucopiaPool; +import com.hfkj.entity.BsCornucopiaPoolRecord; + +import java.math.BigDecimal; +import java.util.List; +import java.util.Map; + +public interface BsCornucopiaPoolService { + + /** + * @MethodName create + * @Description: 创建 + * @param cornucopiaPool + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void create(BsCornucopiaPool cornucopiaPool); + + /** + * @MethodName update + * @Description: 更新 + * @param cornucopiaPool + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void update(BsCornucopiaPool cornucopiaPool); + + /** + * @MethodName delete + * @Description: 删除 + * @param id + * @param fullDelete + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void delete(Long id , Boolean fullDelete); + + /** + * @MethodName queryDetail + * @Description:查询详情 + * @param id + * @return: com.hfkj.entity.BsCornucopiaPool + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + BsCornucopiaPool queryDetail(Long id); + + /** + * @MethodName queryAllList + * @Description: map + * @param + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/9/27 上午11:42 + */ + List queryAllList(Map map); + + /** + * @MethodName investmentCornucopia + * @Description: 投入聚宝盆 + * @param type + * @param userId + * @param goldCoin + * @Author: Sum1Dream + * @Date: 2024/9/27 下午2:50 + */ + void investmentCornucopia(Integer type , Long userId , BigDecimal goldCoin) throws Exception; + + /** + * @MethodName create + * @Description: 创建 + * @param cornucopiaPoolRecord + * @Author: Sum1Dream + * @Date: 2024/7/4 下午2:30 + */ + void create(BsCornucopiaPoolRecord cornucopiaPoolRecord); + + /** + * @MethodName queryAllList + * @Description: map + * @param + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/9/27 上午11:42 + */ + List queryAllListRecord(Map map); +} diff --git a/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaConfigServiceImpl.java b/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaConfigServiceImpl.java new file mode 100644 index 0000000..09d988c --- /dev/null +++ b/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaConfigServiceImpl.java @@ -0,0 +1,84 @@ +package com.hfkj.service.cornucopia.Impl; + +import com.hfkj.dao.BsCornucopiaConfigMapper; +import com.hfkj.entity.BsCornucopiaConfig; +import com.hfkj.entity.BsCornucopiaConfigExample; +import com.hfkj.service.cornucopia.BsCornucopiaConfigService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("bsCornucopiaConfigService") +public class BsCornucopiaConfigServiceImpl implements BsCornucopiaConfigService { + + @Resource + private BsCornucopiaConfigMapper bsCornucopiaConfigMapper; + + @Override + public void create(BsCornucopiaConfig cornucopiaConfig) { + bsCornucopiaConfigMapper.insert(cornucopiaConfig); + } + + @Override + public void edit(BsCornucopiaConfig cornucopiaConfig) { + + if (cornucopiaConfig.getId() == null) { + bsCornucopiaConfigMapper.insert(cornucopiaConfig); + } else { + bsCornucopiaConfigMapper.updateByPrimaryKey(cornucopiaConfig); + } + } + + @Override + public void delete(Long id, Boolean fullDelete) { + if (fullDelete) { + bsCornucopiaConfigMapper.deleteByPrimaryKey(id); + } else { + BsCornucopiaConfig cornucopiaConfig = queryDetail(id); + cornucopiaConfig.setStatus(0); + cornucopiaConfig.setUpdateTime(new Date()); + bsCornucopiaConfigMapper.updateByPrimaryKey(cornucopiaConfig); + } + } + + @Override + public BsCornucopiaConfig queryDetail(Long id) { + return bsCornucopiaConfigMapper.selectByPrimaryKey(id); + } + + @Override + public BsCornucopiaConfig queryDetail(Integer type) { + BsCornucopiaConfigExample example = new BsCornucopiaConfigExample(); + BsCornucopiaConfigExample.Criteria criteria = example.createCriteria(); + criteria.andTypeEqualTo(type); + + List list = bsCornucopiaConfigMapper.selectByExample(example); + + if (!list.isEmpty()) { + return list.get(0); + } + + return null; + } + + @Override + public List queryAllList(Map map) { + BsCornucopiaConfigExample example = new BsCornucopiaConfigExample(); + BsCornucopiaConfigExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } + + if (MapUtils.getString(map, "name") != null) { + criteria.andNameLike("%" + MapUtils.getString(map, "name") + "%"); + } + + return bsCornucopiaConfigMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaLotteryRecordServiceImpl.java b/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaLotteryRecordServiceImpl.java new file mode 100644 index 0000000..791b2c8 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaLotteryRecordServiceImpl.java @@ -0,0 +1,67 @@ +package com.hfkj.service.cornucopia.Impl; + +import com.hfkj.dao.BsCornucopiaLotteryRecordMapper; +import com.hfkj.entity.BsCornucopiaConfig; +import com.hfkj.entity.BsCornucopiaLotteryRecord; +import com.hfkj.entity.BsCornucopiaLotteryRecordExample; +import com.hfkj.service.cornucopia.BsCornucopiaLotteryRecordService; +import org.apache.commons.collections4.MapUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; + +@Service("bsCornucopiaLotteryRecordService") +public class BsCornucopiaLotteryRecordServiceImpl implements BsCornucopiaLotteryRecordService { + + + @Resource + private BsCornucopiaLotteryRecordMapper bsCornucopiaLotteryRecordMapper; + + @Override + public void create(BsCornucopiaLotteryRecord cornucopiaLotteryRecord) { + bsCornucopiaLotteryRecordMapper.insert(cornucopiaLotteryRecord); + } + + @Override + public void update(BsCornucopiaLotteryRecord cornucopiaLotteryRecord) { + bsCornucopiaLotteryRecordMapper.updateByPrimaryKeySelective(cornucopiaLotteryRecord); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + if (fullDelete) { + bsCornucopiaLotteryRecordMapper.deleteByPrimaryKey(id); + } else { + BsCornucopiaLotteryRecord cornucopiaLotteryRecord = queryDetail(id); + cornucopiaLotteryRecord.setStatus(0); + cornucopiaLotteryRecord.setUpdateTime(new Date()); + update(cornucopiaLotteryRecord); + } + } + + @Override + public BsCornucopiaLotteryRecord queryDetail(Long id) { + return bsCornucopiaLotteryRecordMapper.selectByPrimaryKey(id); + } + + @Override + public List queryAllList(Map map) { + BsCornucopiaLotteryRecordExample example = new BsCornucopiaLotteryRecordExample(); + BsCornucopiaLotteryRecordExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } + + if (MapUtils.getString(map, "lotteryNo") != null) { + criteria.andLotteryNoLike("%" + MapUtils.getString(map, "lotteryNo") + "%"); + } + + + return bsCornucopiaLotteryRecordMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaPoolServiceImpl.java b/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaPoolServiceImpl.java new file mode 100644 index 0000000..6b5e414 --- /dev/null +++ b/service/src/main/java/com/hfkj/service/cornucopia/Impl/BsCornucopiaPoolServiceImpl.java @@ -0,0 +1,157 @@ +package com.hfkj.service.cornucopia.Impl; + +import com.hfkj.common.exception.BaseException; +import com.hfkj.common.exception.ErrorCode; +import com.hfkj.common.exception.ErrorHelp; +import com.hfkj.common.exception.SysCode; +import com.hfkj.dao.BsCornucopiaPoolMapper; +import com.hfkj.dao.BsCornucopiaPoolRecordMapper; +import com.hfkj.entity.*; +import com.hfkj.service.cornucopia.BsCornucopiaPoolService; +import com.hfkj.service.user.BsUserAccountService; +import com.hfkj.sysenum.user.UserAccountRecordTypeEnum; +import org.apache.commons.collections4.MapUtils; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Propagation; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.Collections; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.concurrent.TimeUnit; + +@Service("bsCornucopiaPoolService") +public class BsCornucopiaPoolServiceImpl implements BsCornucopiaPoolService { + + + @Resource + private BsCornucopiaPoolMapper bsCornucopiaPoolMapper; + + @Resource + private BsCornucopiaPoolRecordMapper cornucopiaPoolRecordMapper; + + @Resource + private BsUserAccountService userAccountService; + + @Resource + private RedisTemplate redisTemplate; + private final String LOCK_KEY = "POOL_TRADE_LOCK_"; + + @Override + public void create(BsCornucopiaPool cornucopiaPool) { + bsCornucopiaPoolMapper.insert(cornucopiaPool); + } + + @Override + public void update(BsCornucopiaPool cornucopiaPool) { + bsCornucopiaPoolMapper.updateByPrimaryKeySelective(cornucopiaPool); + } + + @Override + public void delete(Long id, Boolean fullDelete) { + if (fullDelete) { + bsCornucopiaPoolMapper.deleteByPrimaryKey(id); + } else { + BsCornucopiaPool cornucopiaPool = queryDetail(id); + cornucopiaPool.setStatus(0); + cornucopiaPool.setUpdateTime(new Date()); + update(cornucopiaPool); + } + } + + @Override + public BsCornucopiaPool queryDetail(Long id) { + return bsCornucopiaPoolMapper.selectByPrimaryKey(id); + } + + @Override + public List queryAllList(Map map) { + + BsCornucopiaPoolExample example = new BsCornucopiaPoolExample(); + BsCornucopiaPoolExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } + + if (MapUtils.getString(map, "userName") != null) { + criteria.andUserNameLike("%" + MapUtils.getString(map, "userName") + "%"); + } + if (MapUtils.getLong(map, "userId") != null) { + criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId")); + } + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } + + return bsCornucopiaPoolMapper.selectByExample(example); + } + + @Override + @Transactional(propagation= Propagation.REQUIRED,rollbackFor= {RuntimeException.class}) + public void investmentCornucopia(Integer type, Long userId, BigDecimal goldCoin) throws Exception { + // 锁编号 + String lockKey = LOCK_KEY+userId; + // 获取锁 + Boolean lock = redisTemplate.opsForValue().setIfAbsent(lockKey, ""); + if (Boolean.TRUE.equals(lock)) { + try { + // 获取锁成功 + // 锁超时时间 10秒 + redisTemplate.expire(lockKey, 10, TimeUnit.SECONDS); + // 查询账户 + BsUserAccount userAccount = userAccountService.getAccount(userId); + // 判断当前账户余额是否足够投入 true 不够 false 够 + Boolean isMeet = userAccount.getGoldCoin().compareTo(goldCoin) < 0; + + // 判断是否充足 + if (isMeet) { + + } + + + } catch (BaseException e) { + // 释放锁 + redisTemplate.delete(lockKey); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, e.getErrorMsg()); + } catch (Exception e) { + // 释放锁 + redisTemplate.delete(lockKey); + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "啊偶~交易出现未知问题!请稍后重试"); + } + } else { + Thread.sleep(100); + investmentCornucopia(type , userId ,goldCoin); + } + } + + @Override + public void create(BsCornucopiaPoolRecord cornucopiaPoolRecord) { + cornucopiaPoolRecordMapper.insert(cornucopiaPoolRecord); + } + + @Override + public List queryAllListRecord(Map map) { + + BsCornucopiaPoolRecordExample example = new BsCornucopiaPoolRecordExample(); + BsCornucopiaPoolRecordExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getInteger(map, "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map, "type")); + } + if (MapUtils.getString(map, "userName") != null) { + criteria.andUserNameLike("%" + MapUtils.getString(map, "userName") + "%"); + } + if (MapUtils.getLong(map, "userId") != null) { + criteria.andUserIdEqualTo(MapUtils.getLong(map, "userId")); + } + if (MapUtils.getInteger(map, "status") != null) { + criteria.andStatusEqualTo(MapUtils.getInteger(map, "status")); + } + return cornucopiaPoolRecordMapper.selectByExample(example); + } +} diff --git a/service/src/main/java/com/hfkj/service/goods/impl/GoodsDataServiceImpl.java b/service/src/main/java/com/hfkj/service/goods/impl/GoodsDataServiceImpl.java index d240fba..ff19106 100644 --- a/service/src/main/java/com/hfkj/service/goods/impl/GoodsDataServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/goods/impl/GoodsDataServiceImpl.java @@ -58,7 +58,7 @@ public class GoodsDataServiceImpl implements GoodsDataService { // 商品佣金信息 incomeInfoModel = new IncomeInfoModel(); publishInfoModel = new PublishInfoModel(); - publishInfoModel.setClickUrl(publish_info.getString("click_url")); + publishInfoModel.setClickUrl("https:" + publish_info.getString("click_url")); if (publish_info.getString("coupon_share_url") != null) { publishInfoModel.setCouponShareUrl("https:" + publish_info.getString("coupon_share_url")); } @@ -182,9 +182,10 @@ public class GoodsDataServiceImpl implements GoodsDataService { // 价格促销信息 pricePromotionInfoModel = new PricePromotionInfoModel(); - pricePromotionInfoModel.setReservePrice(goods.getBigDecimal("minNormalPrice").divide(new BigDecimal(100) , 2 , RoundingMode.DOWN)); - pricePromotionInfoModel.setZkFinalPrice(goods.getBigDecimal("minGroupPrice").divide(new BigDecimal(100) , 2 , RoundingMode.DOWN)); - pricePromotionInfoModel.setFinalPromotionPrice(pricePromotionInfoModel.getZkFinalPrice()); + pricePromotionInfoModel.setFinalPromotionPrice(goods.getBigDecimal("minNormalPrice").divide(new BigDecimal(100) , 2 , RoundingMode.DOWN)); + pricePromotionInfoModel.setZkFinalPrice(pricePromotionInfoModel.getFinalPromotionPrice().add(morePromotionModel.getPromotionFee())); + pricePromotionInfoModel.setReservePrice(pricePromotionInfoModel.getZkFinalPrice()); + // 插入更多活动优惠 pricePromotionInfoModel.setMorePromotionList(morePromotionModels); diff --git a/service/src/main/java/com/hfkj/service/order/BsOrderService.java b/service/src/main/java/com/hfkj/service/order/BsOrderService.java index 87ceb2b..1cd6103 100644 --- a/service/src/main/java/com/hfkj/service/order/BsOrderService.java +++ b/service/src/main/java/com/hfkj/service/order/BsOrderService.java @@ -3,6 +3,9 @@ package com.hfkj.service.order; import com.alibaba.fastjson.JSONObject; import com.hfkj.entity.BsOrder; +import java.util.List; +import java.util.Map; + /** * @className: BsOrderService @@ -48,6 +51,16 @@ public interface BsOrderService { * @Date: 2024/9/24 下午3:08 */ BsOrder findByOrderNo(String orderNo); + + /** + * @MethodName getOrderList + * @Description: + * @param map + * @return: java.util.List + * @Author: Sum1Dream + * @Date: 2024/9/26 上午11:31 + */ + List getOrderList(Map map); } diff --git a/service/src/main/java/com/hfkj/service/order/Impl/BsOrderServiceImpl.java b/service/src/main/java/com/hfkj/service/order/Impl/BsOrderServiceImpl.java index bc0ad15..538eced 100644 --- a/service/src/main/java/com/hfkj/service/order/Impl/BsOrderServiceImpl.java +++ b/service/src/main/java/com/hfkj/service/order/Impl/BsOrderServiceImpl.java @@ -8,15 +8,13 @@ import com.hfkj.entity.BsOrder; import com.hfkj.entity.BsOrderExample; import com.hfkj.service.order.BsOrderService; import com.hfkj.service.order.OrderBusinessService; +import org.apache.commons.collections4.MapUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.core.annotation.OrderUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Service("bsOrderService") public class BsOrderServiceImpl implements BsOrderService { @@ -73,6 +71,7 @@ public class BsOrderServiceImpl implements BsOrderService { map.put("uid", order.getUserId()); map.put("searchId", body.getString("searchId")); map.put("goodsSign", body.getString("goodsSign")); + map.put("url", body.getString("url")); order.setCustomparameters(map.toString()); order.setGoodsName(body.getString("goodsName")); order.setType(body.getInteger("type")); @@ -82,7 +81,7 @@ public class BsOrderServiceImpl implements BsOrderService { // 淘宝订单业务 if (body.getInteger("type") == 1) { - + return orderBusinessService.taobaoUrl(order); } // 拼多多订单业务 if (body.getInteger("type") == 2) { @@ -114,4 +113,37 @@ public class BsOrderServiceImpl implements BsOrderService { return (BsOrder) o; } + + + @Override + public List getOrderList(Map map) { + BsOrderExample example = new BsOrderExample(); + BsOrderExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getString(map , "orderNo") != null) { + criteria.andOrderNoEqualTo(MapUtils.getString(map , "orderNo")); + } + if (MapUtils.getInteger(map , "type") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map , "type")); + } + if (MapUtils.getString(map , "userPhone") != null) { + criteria.andUserPhoneEqualTo(MapUtils.getString(map , "userPhone")); + } + if (MapUtils.getString(map , "goodsName") != null) { + criteria.andGoodsNameLike("%" + MapUtils.getString(map , "goodsName") + "%"); + } + if (MapUtils.getLong(map, "createTimeS") != null) { + criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "createTimeS"))); + } + if (MapUtils.getLong(map, "createTimeE") != null) { + criteria.andCreateTimeLessThan(new Date(MapUtils.getLong(map, "createTimeE"))); + } + if (MapUtils.getInteger(map , "status") != null) { + criteria.andTypeEqualTo(MapUtils.getInteger(map , "status")); + } + if (MapUtils.getLong(map , "userId") != null) { + criteria.andUserIdEqualTo(MapUtils.getLong(map , "userId")); + } + return bsOrderMapper.selectByExample(example); + } } diff --git a/service/src/main/java/com/hfkj/service/order/OrderBusinessService.java b/service/src/main/java/com/hfkj/service/order/OrderBusinessService.java index cae0107..f2cf724 100644 --- a/service/src/main/java/com/hfkj/service/order/OrderBusinessService.java +++ b/service/src/main/java/com/hfkj/service/order/OrderBusinessService.java @@ -4,9 +4,11 @@ import com.alibaba.fastjson.JSONObject; import com.hfkj.common.exception.ErrorCode; import com.hfkj.common.exception.ErrorHelp; import com.hfkj.common.exception.SysCode; +import com.hfkj.common.utils.ResponseMsgUtil; import com.hfkj.dao.BsOrderMapper; import com.hfkj.entity.BsOrder; import com.hfkj.service.pdd.PddService; +import com.hfkj.service.taobao.TaoBaoService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Component; @@ -27,8 +29,13 @@ public class OrderBusinessService { // 淘口令生成业务 - public JSONObject taobaoUrl(BsOrder bsOrder) { - return null; + public JSONObject taobaoUrl(BsOrder bsOrder) throws Exception{ + JSONObject jsonObject = JSONObject.parseObject(bsOrder.getCustomparameters()); + JSONObject object = TaoBaoService.createCommand(jsonObject.getString("url")); + if (!jsonObject.getBoolean("success")) { + throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "请求失败!"); + } + return object; } @@ -46,11 +53,15 @@ public class OrderBusinessService { throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "缺少goodsSign!"); } + Map mapUser = new HashMap<>(); + mapUser.put("uid", bsOrder.getUserId()); + mapUser.put("orderNo", bsOrder.getOrderNo()); + // 判断是否需要授权 - JSONObject object = PddService.authority(bsOrder.getCustomparameters()); + JSONObject object = PddService.authority(mapUser.toString()); boolean generateAuthorityUrl = object.getJSONObject("authorityQueryResponse").getInteger("bind") == 0; - JSONObject o = PddService.promotion(searchId , goodsSign , generateAuthorityUrl , bsOrder.getCustomparameters()); + JSONObject o = PddService.promotion(searchId , goodsSign , generateAuthorityUrl , mapUser.toString()); return o.getJSONObject("goodsPromotionUrlGenerateResponse").getJSONArray("goodsPromotionUrlList").getJSONObject(0); diff --git a/service/src/main/java/com/hfkj/service/pdd/PddService.java b/service/src/main/java/com/hfkj/service/pdd/PddService.java index ed7d81c..d5ce0fb 100644 --- a/service/src/main/java/com/hfkj/service/pdd/PddService.java +++ b/service/src/main/java/com/hfkj/service/pdd/PddService.java @@ -25,7 +25,7 @@ public class PddService { private static Logger log = LoggerFactory.getLogger(PddService.class); - public static JSONObject syncInvoke(String title , Long pageNo , Long pageSize) throws Exception { + public static JSONObject syncInvoke(String title , Long pageNo , Long pageSize , String customParameters) throws Exception { log.info("============ 拼多多请求-START ============="); String clientId = "71a050c5d93d4169a237539af44c7c33"; @@ -38,8 +38,10 @@ public class PddService { request.setPage(pageNo.intValue()); request.setPageSize(pageSize.intValue()); request.setSortType(0); + request.setPid("41483885_294044603"); request.setUseCustomized(true); request.setWithCoupon(true); + request.setCustomParameters(customParameters); PddDdkGoodsSearchResponse response = client.syncInvoke(request); log.info("请求接口:" + "syncInvoke"); @@ -93,7 +95,7 @@ public class PddService { * @Author: Sum1Dream * @Date: 2024/9/20 下午3:57 */ - public static JSONObject promotion() throws Exception { + public static JSONObject promotion(String customParameters) throws Exception { log.info("============ 拼多多请求-START ============="); String clientId = "71a050c5d93d4169a237539af44c7c33"; @@ -105,6 +107,7 @@ public class PddService { pIdList.add("41483885_294044603"); request.setPIdList(pIdList); request.setChannelType(10); + request.setCustomParameters(customParameters); PddDdkRpPromUrlGenerateResponse response = client.syncInvoke(request); log.info("请求接口:" + "promotion"); diff --git a/service/src/main/java/com/hfkj/sysenum/user/UserAccountRecordSourceTypeEnum.java b/service/src/main/java/com/hfkj/sysenum/user/UserAccountRecordSourceTypeEnum.java index 89265f3..fc8a95f 100644 --- a/service/src/main/java/com/hfkj/sysenum/user/UserAccountRecordSourceTypeEnum.java +++ b/service/src/main/java/com/hfkj/sysenum/user/UserAccountRecordSourceTypeEnum.java @@ -16,6 +16,10 @@ public enum UserAccountRecordSourceTypeEnum { * 自购元宝升级【优淘会员】等级 */ type2(2 , "升级优淘会员"), + /** + * 聚宝盆 + */ + type3(3 , "聚宝盆"), ; private Integer type;