From 70d2a5d0f9c6951b2d4cac954041ed73582ff7eb Mon Sep 17 00:00:00 2001 From: liujie <1793218484@qq.com> Date: 星期一, 09 六月 2025 11:54:00 +0800 Subject: [PATCH] 6.9新增登录失败冻结逻辑 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java | 212 +++++++++++++++++++++++++++++++++++++++++++++++----- 1 files changed, 190 insertions(+), 22 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java index eeac215..abf5287 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java @@ -2,16 +2,23 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.panzhihua.common.controller.BaseController; +import com.panzhihua.common.model.vos.LoginUserInfoVO; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.VolunteerCreditsExchangeVO; import com.panzhihua.common.model.vos.community.VolunteerIntegralMerchantVO; import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.entity.VolunteerIntegralMerchant; +import com.panzhihua.service_community.service.VolunteerCreditsExchangeService; import com.panzhihua.service_community.service.VolunteerIntegralMerchantService; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; + +/** + * 商品内容逻辑 + */ @Slf4j @RestController @RequestMapping("/VolunteerIntegralMerchant") @@ -38,12 +45,14 @@ */ @GetMapping("/queryList") public R VolunteerIntegralMerchantQueryList(@RequestParam("pageNum") int pageNum, - @RequestParam("pageSize") int pageSize, - @RequestParam("name") String name, - @RequestParam("state") String state) + @RequestParam("pageSize") int pageSize, + @RequestParam(value = "name", required = false) String name, + @RequestParam(value = "state", required = false) String state, + @RequestParam(value = "goodType", required = false) String goodType, + @RequestParam(value = "merchantId", required = false) String merchantId) { Page page=new Page<VolunteerIntegralMerchant>(pageNum,pageSize); - return R.ok(merchantService.queryList(page,name,state)); + return R.ok(merchantService.queryList(page,name,state,goodType,merchantId)); } /** @@ -75,13 +84,7 @@ return R.fail("商品所需积分不能为空"); } - if(StringUtils.isEmpty(vimVO.getCommodityValue())) - { - return R.fail("商品价值不能为空"); - } - //默认下架状态 - vimVO.setState("0"); int num= merchantService.insertVolunteer(vimVO); if(num>0) @@ -111,20 +114,9 @@ vimVO.setCommunityId(getCommunityId()+""); } - if(StringUtils.isEmpty(vimVO.getName())) - { - return R.fail("商品名称不能为空"); - } - - if(StringUtils.isEmpty(vimVO.getIntegral())) { return R.fail("商品所需积分不能为空"); - } - - if(StringUtils.isEmpty(vimVO.getCommodityValue())) - { - return R.fail("商品价值不能为空"); } int num= merchantService.updateById(vimVO); @@ -135,8 +127,42 @@ return R.fail("操作失败"); } + + @PostMapping("/unmount") + public R VolunteerIntegralMerchantUnmount(@RequestBody VolunteerIntegralMerchantVO vimVO) + { + + if(vimVO==null) + { + return R.fail("参数不能为空"); + } + + if(StringUtils.isEmpty(vimVO.getId())) + { + return R.fail("上下架商品id不能为空"); + } + + if(StringUtils.isEmpty(vimVO.getState())) + { + vimVO.setState("1"); + } + + if(StringUtils.isEmpty(vimVO.getCommunityId())) + { + vimVO.setCommunityId(getCommunityId()+""); + } + + int num= merchantService.updateById(vimVO); + if(num>0) + { + return R.ok(); + } + return R.fail("操作失败"); + } + + @DeleteMapping("/deleteById") - public R VolunteerIntegralMerchantDeleteById(@RequestParam String id) + public R VolunteerIntegralMerchantDeleteById(@RequestParam("id") String id) { int num= merchantService.deleteById(id); if(num>0) @@ -146,4 +172,146 @@ return R.fail("操作失败"); } + /*********************************************************************************************************** + * + * + * 订单兑换 + * + * + ***********************************************************************************************************/ + @Resource + private VolunteerCreditsExchangeService vceService; + + /** + * 分页查询 + * @param + * @return + */ + @GetMapping("/order/getList") + public R getList(@RequestParam("pageNum") int pageNum, + @RequestParam("pageSize") int pageSize, + @RequestParam(value = "goodsId", required = false) String goodsId, + @RequestParam(value = "orderNumber", required = false) String orderNumber, + @RequestParam(value = "goodsName", required = false) String goodsName, + @RequestParam(value = "condition", required = false) String condition, + @RequestParam(value = "userName", required = false) String userName, + @RequestParam(value = "communityId", required = false) String communityId, + @RequestParam(value = "userId", required = false) String userId, + @RequestParam(value = "orderType", required = false) String orderType, + @RequestParam(value = "merchantId", required = false) String merchantId) + { + return vceService.getList(pageNum,pageSize,goodsId,orderNumber,goodsName, + condition,userName,communityId,userId,orderType,merchantId); + } + + /** + * 查询详情 + * @param id + * @return + */ + @GetMapping("/order/getData") + public R getData(@RequestParam("id") String id) + { + if(StringUtils.isEmpty(id)) + { + return R.fail("订单id不能为空"); + } + return vceService.getData(id); + } + + /** + * 新增 + * @param + * @return + */ + @PostMapping("/order/insertData") + public R insertData(@RequestBody VolunteerCreditsExchangeVO item) + { + LoginUserInfoVO userInfoVO= getLoginUserInfo(); + if(StringUtils.isEmpty(item.getCommunityId())) + { + item.setCommunityId(userInfoVO.getCommunityId()+""); + } + + item.setUserId(userInfoVO.getUserId()+""); + return vceService.insertData(item); + } + + /** + * 新增用户购买商家商品记录 + * @param + * @return + */ + @PostMapping("/order/insertMerchantData") + public R insertMerchantData(@RequestBody VolunteerCreditsExchangeVO item) + { + LoginUserInfoVO userInfoVO= getLoginUserInfo(); + if(StringUtils.isEmpty(item.getCommunityId())) + { + item.setCommunityId(userInfoVO.getCommunityId()+""); + } + + item.setUserId(userInfoVO.getUserId()+""); + return vceService.insertMerchantData(item); + } + + /** + * 更新 + * @param item + * @return + */ + @PostMapping("/order/update") + public R update(@RequestBody VolunteerCreditsExchangeVO item) + { + return vceService.update(item); + } + + /** + * 删除 + * @param id + * @return + */ + @DeleteMapping("/order/delete") + public R delete(@RequestParam("id") String id) + { + if(StringUtils.isEmpty(id)) + { + return R.fail("订单id不能为空"); + } + return vceService.delete(id); + } + + /** + * 核销 + * @param id + * @return + */ + @GetMapping("/order/conditionData") + public R conditionData(@RequestParam("id") String id) + { + if(StringUtils.isEmpty(id)) + { + return R.fail("订单id不能为空"); + } + return vceService.conditionData(id); + } + + + + /** + * 社区取消订单 + * @param id + * @return + */ + @GetMapping("/order/communityCancellation") + public R communityCancellation(@RequestParam("id") String id) + { + if(StringUtils.isEmpty(id)) + { + return R.fail("订单id不能为空"); + } + return vceService.communityCancellation(id); + } + + } -- Gitblit v1.7.1