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 diff --git a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/order/StoreOrderDetailInfoResponse.java b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/order/StoreOrderDetailInfoResponse.java index b8663a3c1..931d07b87 100644 --- a/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/order/StoreOrderDetailInfoResponse.java +++ b/yudao-module-mall/yudao-module-shop-api/src/main/java/cn/iocoder/yudao/module/shop/response/order/StoreOrderDetailInfoResponse.java @@ -1,9 +1,11 @@ package cn.iocoder.yudao.module.shop.response.order; +import com.fasterxml.jackson.annotation.JsonFormat; import io.swagger.v3.oas.annotations.media.Schema; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; import java.io.Serializable; import java.math.BigDecimal; @@ -85,6 +87,8 @@ public class StoreOrderDetailInfoResponse implements Serializable { private String payType; @Schema(description = "创建时间") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") private Date createTime; @Schema(description = "订单状态(0:待发货;1:待收货;2:已收货,待评价;3:已完成;)") 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 b276db42f..10cb26d90 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 @@ -52,6 +52,8 @@ import cn.iocoder.yudao.module.shop.utils.RedisUtil; import cn.iocoder.yudao.module.shop.vo.order.LogisticsResultVo; import cn.iocoder.yudao.module.shop.vo.order.StoreDateRangeSqlPram; import cn.iocoder.yudao.module.shop.vo.order.StoreOrderInfoOldVo; +import cn.iocoder.yudao.module.system.api.dept.DeptApi; +import cn.iocoder.yudao.module.system.api.dept.dto.DeptRespDTO; import com.alipay.api.AlipayApiException; import com.alipay.api.internal.util.AlipaySignature; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -147,6 +149,8 @@ public class StoreOrderServiceImpl extends ServiceImpl orderInfos = request.getOrderInfos(); orderDO.setOrderId(code); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java index a184481e6..7ce76a52e 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeGearServiceImpl.java @@ -107,21 +107,16 @@ public class RechargeGearServiceImpl implements RechargeGearService { List rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.lambdaQuery() .eq(RechargeGearDO::getDeleted, 0)); List rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); - RechargeOrderDO orderDO = orderMapper.selectOne(Wrappers.lambdaQuery().eq(RechargeOrderDO::getUid, loginUser.getId()) - .eq(RechargeOrderDO::getPaid,1) - .last("LIMIT 1")); - if (Objects.nonNull(orderDO)) { - List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderDO.getId())); - Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); - rechargeGearRespVOS.forEach(vo -> { - List infoDOS1 = collect.get(vo.getId()); - if (!CollectionUtils.isEmpty(infoDOS1)) { - vo.setIsExist("1"); - } else { - vo.setIsExist("0"); - } - }); - } + List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId())); + Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); + rechargeGearRespVOS.forEach(vo -> { + List infoDOS1 = collect.get(vo.getId()); + if (!CollectionUtils.isEmpty(infoDOS1)) { + vo.setIsExist("1"); + } else { + vo.setIsExist("0"); + } + }); return rechargeGearRespVOS; } @@ -130,21 +125,16 @@ public class RechargeGearServiceImpl implements RechargeGearService { List rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.lambdaQuery() .eq(RechargeGearDO::getDeleted, 0)); List rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); - RechargeOrderDO orderDO = orderMapper.selectOne(Wrappers.lambdaQuery().eq(RechargeOrderDO::getUserPhone, phone) - .eq(RechargeOrderDO::getPaid,1) - .last("LIMIT 1")); - if (Objects.nonNull(orderDO)) { - List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getRechargeOrderId, orderDO.getId())); - Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); - rechargeGearRespVOS.forEach(vo -> { - List infoDOS1 = collect.get(vo.getId()); - if (!CollectionUtils.isEmpty(infoDOS1)) { - vo.setIsExist("1"); - } else { - vo.setIsExist("0"); - } - }); - } + List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getPhone, phone)); + Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); + rechargeGearRespVOS.forEach(vo -> { + List infoDOS1 = collect.get(vo.getId()); + if (!CollectionUtils.isEmpty(infoDOS1)) { + vo.setIsExist("1"); + } else { + vo.setIsExist("0"); + } + }); return rechargeGearRespVOS; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml index d4b6e789e..840d91eeb 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/recharge/RechargeOrderMapper.xml @@ -33,6 +33,7 @@ left join system_dept d on d.id = a.dept_id + order by a.pay_time desc