diff --git a/builds/docker-compose-prod.yml b/builds/docker-compose-prod.yml index 1a7a73eb6..d10aa09e1 100644 --- a/builds/docker-compose-prod.yml +++ b/builds/docker-compose-prod.yml @@ -25,4 +25,10 @@ services: test: ["CMD", "curl", "-f", "http://localhost:48080/actuator/health"] timeout: 30s interval: 45s - retries: 3 \ No newline at end of file + retries: 3 + networks: + - app_net +networks: + app_net: + external: true + name: cyywlnet \ No newline at end of file diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/product/DeleteCartRequest.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/product/DeleteCartRequest.java new file mode 100644 index 000000000..659106579 --- /dev/null +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/product/DeleteCartRequest.java @@ -0,0 +1,22 @@ +package cn.iocoder.yudao.module.shop.request.product; + +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.Data; + +import javax.validation.constraints.NotNull; +import java.io.Serializable; +import java.util.List; + +/** + * @Title:DelectCartRequest + * @Description: TODO + * @author: tangqian + * @date: 2023/5/25 13:03 + * @version: V1.0.0 + */ +@Data +public class DeleteCartRequest implements Serializable { + private static final long serialVersionUID = 8471460222619043734L; + @Schema(description = "商品id") + private List ids; +} diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/cart/CartController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/cart/CartController.java index 0867dbd9c..e0277e6d7 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/cart/CartController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/cart/CartController.java @@ -6,6 +6,7 @@ import cn.iocoder.yudao.framework.common.pojo.PageParam; import cn.iocoder.yudao.module.shop.request.product.CartNumRequest; import cn.iocoder.yudao.module.shop.request.product.CartRequest; import cn.iocoder.yudao.module.shop.request.product.CartResetRequest; +import cn.iocoder.yudao.module.shop.request.product.DeleteCartRequest; import cn.iocoder.yudao.module.shop.response.product.CartInfoResponse; import cn.iocoder.yudao.module.shop.service.product.StoreCartService; import com.github.pagehelper.PageInfo; @@ -78,12 +79,11 @@ public class CartController { /** * 删除购物车表 - * @param ids 购物车ids */ @Operation(summary = "删除") @RequestMapping(value = "/delete", method = RequestMethod.POST) - public CommonResult delete(@RequestParam(value = "ids") List ids) { - if (storeCartService.deleteCartByIds(ids)) { + public CommonResult delete(@RequestBody @Validated DeleteCartRequest request) { + if (storeCartService.deleteCartByIds(request.getIds())) { return CommonResult.success("删除购物车成功"); } else { return CommonResult.error(GlobalErrorCodeConstants.OPERATION_ERROR.getCode(), "删除购物车失败"); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java index f738d88d6..4e186ad42 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/StoreOrderServiceImpl.java @@ -1223,8 +1223,8 @@ public class StoreOrderServiceImpl extends ServiceImpl orderInfos = request.getOrderInfos(); Assert.isTrue(!CollectionUtils.isEmpty(orderInfos), "订单信息不能为空!"); @@ -1455,15 +1456,16 @@ public class StoreOrderServiceImpl extends ServiceImpl collect = orderInfos.stream().map(OrderContentRequest.OrderInfo::getGearId).collect(Collectors.toList()); List rechargeGearDOList = rechargeGearService.getRechargeGearList(collect); - rechargeGearDOList.forEach(rechargeGearDO->{ - Boolean flag = phoneRecordService.verifyPhone(request.getConfirmPhone(),rechargeGearDO.getRefundAmount().intValue()+""); + rechargeGearDOList.forEach(rechargeGearDO -> { + Boolean flag = phoneRecordService.verifyPhone(request.getUserPhone(), rechargeGearDO.getRefundAmount().intValue() + ""); if (flag) { throw new ServiceException("该挡位:" + rechargeGearDO.getName() + "你已购买,请勿重复操作"); } }); List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery() - .eq(PhoneRecordDO::getUserId, user.getMobile()) + .eq(PhoneRecordDO::getPhone, user.getMobile()) + .eq(PhoneRecordDO::getDeleted, 0) .in(PhoneRecordDO::getRechargeGearId, collect)); if (!CollectionUtils.isEmpty(infoDOS)) { @@ -1481,7 +1483,7 @@ public class StoreOrderServiceImpl extends ServiceImpllambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id)); } private void validatePhoneRecordExists(Long id) { - if (phoneRecordMapper.selectById(id) == null) { + PhoneRecordDO phoneRecordDO = phoneRecordMapper.selectOne(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id)); + if (phoneRecordDO == null) { throw exception(PHONE_RECORD_NOT_EXISTS); } } @@ -92,7 +99,7 @@ public class PhoneRecordServiceImpl implements PhoneRecordService { @Override public PageResult getPhoneRecordPage(PhoneRecordPageReqVO pageReqVO) { Page page = new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()); - phoneRecordMapper.findListPage(page,pageReqVO); + phoneRecordMapper.findListPage(page, pageReqVO); return new PageResult<>(page.getRecords(), page.getTotal()); } @@ -115,17 +122,18 @@ public class PhoneRecordServiceImpl implements PhoneRecordService { @Override public Boolean verifyPhone(String phone, String gear) { JSONObject param = new JSONObject(); - param.put("phone",phone); - param.put("gear",gear); - String result = HttpRequest.post(phoneUrl+"query/verify") - .header("token",token) + param.put("phone", phone); + param.put("gear", gear); + String result = HttpRequest.post(phoneUrl + "query/verify") + .header("token", token) .body(JSONObject.toJSONString(param)) .execute() .body(); JSONObject resultJson = JSONObject.parseObject(result); - if("0000".equals(resultJson.get("code"))){ + log.info("query/verify:返回参数{}", resultJson); + if ("0000".equals(resultJson.get("code"))) { return resultJson.getBoolean("body"); - }else{ + } else { throw new ServiceException("手机号档位验证失败"); } } @@ -141,13 +149,13 @@ public class PhoneRecordServiceImpl implements PhoneRecordService { */ @Override public Boolean deletePhoneGear(String orderId) { - String result = HttpRequest.post(phoneUrl+"query/deleteReport?orderNo="+orderId) - .header("token",token) + String result = HttpRequest.post(phoneUrl + "query/deleteReport?orderNo=" + orderId) + .header("token", token) .execute() .body(); JSONObject resultJson = JSONObject.parseObject(result); - log.info("删除提报{}",JSONObject.toJSONString(resultJson)); - if("0000".equals(resultJson.get("code"))){ + log.info("删除提报{}", JSONObject.toJSONString(resultJson)); + if ("0000".equals(resultJson.get("code"))) { return true; } return false; @@ -166,14 +174,14 @@ public class PhoneRecordServiceImpl implements PhoneRecordService { */ @Override public Boolean insertPhone(List data) { - String result = HttpRequest.post(phoneUrl+"query/createReport") - .header("token",token) + String result = HttpRequest.post(phoneUrl + "query/createReport") + .header("token", token) .body(JSONObject.toJSONString(data)) .execute() .body(); JSONObject resultJson = JSONObject.parseObject(result); - log.info("提报新增返回结果{}",JSONObject.toJSONString(resultJson)); - if("0000".equals(resultJson.get("code"))){ + log.info("提报新增返回结果{}", JSONObject.toJSONString(resultJson)); + if ("0000".equals(resultJson.get("code"))) { return true; } return false; diff --git a/yudao-ui-app/pages/member_equity/index.vue b/yudao-ui-app/pages/member_equity/index.vue index b33bdf62d..48ba82993 100644 --- a/yudao-ui-app/pages/member_equity/index.vue +++ b/yudao-ui-app/pages/member_equity/index.vue @@ -170,6 +170,7 @@ } + .box-member { padding: 36rpx 40rpx; border-radius: 20rpx;