| | |
| | | package com.matrix.system.padApi.action; |
| | | |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.matrix.component.asyncmessage.AsyncMessageManager; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | import com.matrix.system.hive.service.SysOrderService; |
| | | import com.matrix.system.hive.service.SysShopInfoService; |
| | | import com.matrix.system.padApi.dto.PadOrderListDto; |
| | | import com.matrix.system.padApi.dto.PadShowListDto; |
| | | import com.matrix.system.padApi.vo.PadOrderDetailVo; |
| | | import com.matrix.system.shopXcx.mqTask.AsyncMessageRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.assertj.core.util.Arrays; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.validation.annotation.Validated; |
| | |
| | | |
| | | @ApiOperation(value = "获取用户的可用充值卡", notes = "获取用户的可用充值卡") |
| | | @GetMapping(value = "getUseMoneyCard/{vipId}") |
| | | public AjaxResult getUseMoneyCard(Long vipId) { |
| | | public AjaxResult getUseMoneyCard(@PathVariable Long vipId) { |
| | | MoneyCardUse moneyCardUse = new MoneyCardUse(); |
| | | moneyCardUse.setVipId(vipId); |
| | | moneyCardUse.setStatus(Dictionary.MONEYCARD_STATUS_YX); |
| | |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | SysOrder order = orderService.findById(id); |
| | | order.setItems(orderItemDao.selectByOrderId(id)); |
| | | return AjaxResult.buildSuccessInstance(Arrays.asList(order)); |
| | | return AjaxResult.buildSuccessInstance(order); |
| | | } |
| | | |
| | | @ApiOperation(value = "列表显示搜索项目绑定的产品信息", notes = "列表显示搜索项目绑定的产品信息") |
| | | @PostMapping(value = "/showList") |
| | | public AjaxResult showList(@RequestBody ShoppingGoods shoppingGoods, PaginationVO pageVo) { |
| | | QueryUtil.setQueryLimit(shoppingGoods); |
| | | public AjaxResult showList(@RequestBody PadShowListDto padShowListDto) { |
| | | |
| | | int offset = (padShowListDto.getPageNum() - 1) * padShowListDto.getPageSize(); |
| | | int limit = padShowListDto.getPageSize(); |
| | | PaginationVO pageVo = new PaginationVO(); |
| | | pageVo.setOffset(offset); |
| | | pageVo.setLimit(limit); |
| | | |
| | | ShoppingGoods shoppingGoods = new ShoppingGoods(); |
| | | if(StrUtil.isNotEmpty(padShowListDto.getName())){ |
| | | shoppingGoods.setName(padShowListDto.getName()); |
| | | } |
| | | if(StrUtil.isNotEmpty(padShowListDto.getGoodType())){ |
| | | shoppingGoods.setGoodType(padShowListDto.getGoodType()); |
| | | } |
| | | // QueryUtil.setQueryLimit(shoppingGoods); |
| | | if(StringUtils.isBlank(pageVo.getSort())){ |
| | | pageVo.setOrder("desc"); |
| | | pageVo.setSort("createTime"); |
| | |
| | | sysOrderResult.setZkTotal(zkTotal.setScale(2, BigDecimal.ROUND_DOWN).doubleValue()); |
| | | sysOrderResult.setTotal(total.doubleValue()); |
| | | |
| | | return AjaxResult.buildSuccessInstance(java.util.Arrays.asList(sysOrderResult)); |
| | | return AjaxResult.buildSuccessInstance(sysOrderResult); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单支付", notes = "订单支付") |
| | |
| | | asyncMessageManager.sendMsg(AsyncMessageRouting.SEND_UNIFORM_TEMPLATE_MSG ,uniformMsgParam); |
| | | |
| | | //处理用户购买的产品 |
| | | return AjaxResult.buildSuccessInstance(java.util.Arrays.asList(sysOrder), "订单结算成功"); |
| | | return AjaxResult.buildSuccessInstance(sysOrder, "订单结算成功"); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单保存接口-挂单", notes = "订单保存接口-挂单") |
| | |
| | | //校验保存订单 |
| | | sysOrder = orderService.checkAndSaveOrder(sysOrder); |
| | | //处理用户购买的产品 |
| | | return AjaxResult.buildSuccessInstance(java.util.Arrays.asList(sysOrder), "订单保存成功"); |
| | | return AjaxResult.buildSuccessInstance(sysOrder, "订单保存成功"); |
| | | } |
| | | |
| | | |