From 5c8ddf6e449514e3d1eead132f00b433d9e65d85 Mon Sep 17 00:00:00 2001 From: Jruome <2559028966@qq.com> Date: Fri, 19 May 2023 18:04:40 +0800 Subject: [PATCH 1/5] =?UTF-8?q?uniapp=20=E6=94=AF=E4=BB=98=E5=9B=9E?= =?UTF-8?q?=E8=B0=83=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- yudao-ui-app/pages/member_equity/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/yudao-ui-app/pages/member_equity/index.vue b/yudao-ui-app/pages/member_equity/index.vue index aa4c071fe..a6b73b01f 100644 --- a/yudao-ui-app/pages/member_equity/index.vue +++ b/yudao-ui-app/pages/member_equity/index.vue @@ -141,7 +141,7 @@ background-repeat: no-repeat; background-attachment: fixed; - + .box-member { padding: 36rpx 40rpx; From 3b251f974515b55505cc5912fbb0c9d4eeded24e Mon Sep 17 00:00:00 2001 From: axzsd Date: Tue, 23 May 2023 14:07:48 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/Dockerfile-pro | 20 ++++++++++++++++++++ builds/docker-compose-prod.yml | 28 ++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) create mode 100644 builds/Dockerfile-pro create mode 100644 builds/docker-compose-prod.yml diff --git a/builds/Dockerfile-pro b/builds/Dockerfile-pro new file mode 100644 index 000000000..5d904f4c6 --- /dev/null +++ b/builds/Dockerfile-pro @@ -0,0 +1,20 @@ +FROM registry.cn-hangzhou.aliyuncs.com/lrh-public/openjdk:8u222-jre-up + +LABEL Author="axzsd" \ + Email="atva725@qq.com" \ + Description="创盈支付服务端" + +ENV SPRING_PROFILES_ACTIVE="prod" +ENV JAVA_OPTIONS "-Xms4000m -Xmx4096m \ +-XX:+HeapDumpOnOutOfMemoryError \ +-Dfile.encoding=UTF-8 \ +-Djava.awt.headless=true \ +-Dsun.net.client.defaultConnectTimeout=10000 \ +-Dsun.net.client.defaultReadTimeout=30000" + + +WORKDIR /work/projects/yudao-server +COPY yudao-server/target/yudao-server.jar /opt/app.jar + +EXPOSE 48080 +ENTRYPOINT exec java $JAVA_OPTIONS -jar -Dspring.profiles.active=${SPRING_PROFILES_ACTIVE} /opt/app.jar diff --git a/builds/docker-compose-prod.yml b/builds/docker-compose-prod.yml new file mode 100644 index 000000000..1a7a73eb6 --- /dev/null +++ b/builds/docker-compose-prod.yml @@ -0,0 +1,28 @@ +version: "3.9" +services: + yudao-server: + image: ${IMAGE_VERSION} + restart: always + privileged: true + container_name: yudao-server + environment: + TZ: Asia/Shanghai + SPRING_PROFILES_ACTIVE: prod +# volumes: +# - /opt/logs/cyywl:/work/projects/yudao-server + ulimits: + nproc: 65535 + nofile: + soft: 20000 + hard: 40000 + ports: + - "48080:48080" + deploy: + resources: + limits: + memory: 4096MB + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:48080/actuator/health"] + timeout: 30s + interval: 45s + retries: 3 \ No newline at end of file From 7a2b924b6469bfdb049322de36cdf9c8bdc85e6c Mon Sep 17 00:00:00 2001 From: axzsd Date: Tue, 23 May 2023 14:14:44 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=E6=9E=84=E5=BB=BA=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builds/docker-compose-prod.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) 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 From 270e45433e9f6e69c6f0ffa801afd27ce8dfaac2 Mon Sep 17 00:00:00 2001 From: tangqian Date: Thu, 25 May 2023 14:48:29 +0800 Subject: [PATCH 4/5] =?UTF-8?q?fix:=20=E5=85=85=E5=80=BC=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../request/product/DeleteCartRequest.java | 22 +++++++++++++++++++ .../controller/app/cart/CartController.java | 6 ++--- .../recharge/PhoneRecordServiceImpl.java | 8 +++++-- 3 files changed, 31 insertions(+), 5 deletions(-) create mode 100644 yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/request/product/DeleteCartRequest.java 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/recharge/PhoneRecordServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java index bbe6284c5..4d532996f 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/PhoneRecordServiceImpl.java @@ -7,7 +7,10 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.module.member.api.user.MemberUserApi; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.shop.controller.app.recharge.vo.PhoneRecordAdd; +import cn.iocoder.yudao.module.shop.dal.dataobject.order.StoreOrder; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Value; @@ -70,11 +73,12 @@ public class PhoneRecordServiceImpl implements PhoneRecordService { // 校验存在 validatePhoneRecordExists(id); // 删除 - phoneRecordMapper.deleteById(id); + phoneRecordMapper.delete(Wrappers.lambdaQuery().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); } } From f1755820b6ca29fc33679075abc4e93716b60c2e Mon Sep 17 00:00:00 2001 From: tangqian Date: Thu, 25 May 2023 15:30:21 +0800 Subject: [PATCH 5/5] =?UTF-8?q?fix:=20=E5=85=85=E5=80=BC=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../order/impl/StoreOrderServiceImpl.java | 24 +++++++------ .../recharge/PhoneRecordServiceImpl.java | 36 ++++++++++--------- 2 files changed, 33 insertions(+), 27 deletions(-) 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)); + phoneRecordMapper.delete(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, id)); } private void validatePhoneRecordExists(Long id) { @@ -96,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()); } @@ -119,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("手机号档位验证失败"); } } @@ -145,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; @@ -170,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;