From 40ae93e712ec9e3d78fec7fd50a2b5cc0b851229 Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期六, 26 八月 2023 16:59:57 +0800 Subject: [PATCH] 新增订单模块 订单核销 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/api/VolunteerIntegralMerchantApi.java | 110 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 files changed, 106 insertions(+), 4 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 749b706..9f570f2 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,10 +2,13 @@ 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.*; @@ -166,10 +169,6 @@ } - - - - @DeleteMapping("/deleteById") public R VolunteerIntegralMerchantDeleteById(@RequestParam("id") String id) { @@ -181,7 +180,110 @@ 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) + { + return vceService.getList(pageNum,pageSize,goodsId,orderNumber,goodsName, + condition,userName,communityId,userId); + } + + /** + * 查询详情 + * @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()+""); + item.setNeedScore(userInfoVO.getLoveIntegral()); + return vceService.insertData(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); + } } -- Gitblit v1.7.1