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/admin/express/vo/ShippingTemplatesFreeRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java index b535a5a8b..0cbd27334 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesFreeRespVO.java @@ -51,4 +51,7 @@ public class ShippingTemplatesFreeRespVO implements Serializable { @Schema(description = "分组唯一值", required = true) private String uniqid; + + @Schema(description = "城市名称描述") + private String title; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesNoDeliveryRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesNoDeliveryRespVO.java index 2dbd2744c..d5a703913 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesNoDeliveryRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesNoDeliveryRespVO.java @@ -39,4 +39,7 @@ public class ShippingTemplatesNoDeliveryRespVO implements Serializable { @Schema(description = "省ID, 多个逗号分割。 全国 all", required = true, example = "1,2,3,4") private String provinceId; + + @Schema(description = "城市名称描述", required = true) + private String title; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java index 4bd4be343..d44f44ede 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/express/vo/ShippingTemplatesRegionRespVO.java @@ -58,4 +58,7 @@ public class ShippingTemplatesRegionRespVO implements Serializable { @Schema(description = "分组唯一值", required = true) private String uniqid; + @Schema(description = "城市名称描述") + private String title; + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/WxPayNotifyController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/WxPayNotifyController.java index 3f665e32b..5fb07fcf5 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/WxPayNotifyController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/notify/WxPayNotifyController.java @@ -3,6 +3,7 @@ package cn.iocoder.yudao.module.shop.controller.admin.notify; import cn.hutool.core.util.NumberUtil; import cn.hutool.json.JSONUtil; +import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper; import cn.iocoder.yudao.module.shop.service.order.StoreOrderService; @@ -46,7 +47,7 @@ public class WxPayNotifyController { private StoreOrderService storeOrderService; @Autowired private RechargeOrderMapper rechargeOrderMapper; - + @Autowired private PhoneRecordService phoneRecordService; @@ -115,6 +116,7 @@ public class WxPayNotifyController { * @return: */ @PostMapping("/refund_notify") + @TenantIgnore public String wxPayRefundNotify(@RequestBody String jsonData, HttpServletRequest request, HttpServletResponse response) throws Exception { // 支付结果通用通知文档: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7 // 支付成功结果通知 @@ -134,18 +136,22 @@ public class WxPayNotifyController { BigDecimal payerTotal = NumberUtil.div(result.getAmount().getPayerTotal() + "", "100", 2); // 处理相关逻辑 RechargeOrderDO orderDO = rechargeOrderMapper.selectOne(Wrappers.lambdaQuery().eq(RechargeOrderDO::getOrderId, result.getOutTradeNo())); - if (payerTotal.compareTo(orderDO.getPayPrice()) != 0) { - log.error("支付金额不匹配,订单实际支付金额:{},微信入参验证金额:{}", orderDO.getPayPrice(), payerTotal); - return "failure"; + if(orderDO!=null){ + if (payerTotal.compareTo(orderDO.getPayPrice()) != 0) { + log.error("支付金额不匹配,订单实际支付金额:{},微信入参验证金额:{}", orderDO.getPayPrice(), payerTotal); + return "failure"; + } + orderDO.setRefundStatus(2); + orderDO.setPaid(2); + rechargeOrderMapper.updateById(orderDO); + //删除提报记录 + phoneRecordService.deletePhoneGear(orderDO.getOrderId()); + //删除本地提报记录 + phoneRecordService.deletePhoneRecord(orderDO.getId()); + // 修改订单状态 + // 写入 + response.setStatus(HttpServletResponse.SC_OK); } - orderDO.setRefundStatus(2); - orderDO.setPaid(2); - rechargeOrderMapper.updateById(orderDO); - //删除提报记录 - phoneRecordService.deletePhoneGear(orderDO.getOrderId()); - // 修改订单状态 - // 写入 - response.setStatus(HttpServletResponse.SC_OK); return "success"; } } catch (Exception e) { diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderBaseVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderBaseVO.java index b17255741..be86d0bfa 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderBaseVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderBaseVO.java @@ -32,7 +32,7 @@ public class RechargeOrderBaseVO { @Schema(description = "用户id", required = true, example = "28969") @NotNull(message = "用户id不能为空") - private Integer uid; + private Long uid; @Schema(description = "用户姓名", required = true, example = "张三") @NotNull(message = "用户姓名不能为空") diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderExportReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderExportReqVO.java index b2da768c3..b0bc6caac 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderExportReqVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderExportReqVO.java @@ -22,7 +22,7 @@ public class RechargeOrderExportReqVO { private Long tenantId; @Schema(description = "用户id", example = "28969") - private Integer uid; + private Long uid; @Schema(description = "用户姓名", example = "张三") private String realName; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java index 42b1cdd75..ccb6d0728 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/admin/recharge/vo/RechargeOrderPageReqVO.java @@ -24,7 +24,7 @@ public class RechargeOrderPageReqVO extends PageParam { private Long tenantId; @Schema(description = "用户id", example = "28969") - private Integer uid; + private Long uid; @Schema(description = "用户姓名", example = "张三") private String realName; 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/controller/app/member/MemberController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/member/MemberController.java index ae181e67f..cc7bca07b 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/member/MemberController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/member/MemberController.java @@ -74,4 +74,12 @@ public class MemberController { return CommonResult.success(rechargeGearService.memberByPhoneGradeInfo(phone)); } + // 充值列表记录 + @Operation(summary = "根据手机号获取充值充值记录") + @RequestMapping(value = "/memberOrderInfoByPhone", method = RequestMethod.GET) + @PreAuthenticated + @TenantIgnore + public CommonResult> memberOrderInfoByPhone(@RequestParam String phone) { + return CommonResult.success(rechargeOrderService.memberOrderInfoByPhone(phone)); + } } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/recharge/AppPhoneRecordController.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/recharge/AppPhoneRecordController.java index 7addc129a..1e5f9a16c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/recharge/AppPhoneRecordController.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/controller/app/recharge/AppPhoneRecordController.java @@ -37,42 +37,4 @@ import static cn.iocoder.yudao.framework.operatelog.core.enums.OperateTypeEnum.E @Slf4j public class AppPhoneRecordController { - @Resource - private PhoneRecordService phoneRecordService; - - - @Value("${phone.query-url}") - private String phoneUrl; - - @Value("${phone.token}") - private String token; - - - @PostMapping("test") - public CommonResult test(@RequestBody List data){ - 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"))){ - return success(null); - } - return success(null); - } - @PostMapping("delete") - public CommonResult delete(@RequestBody String data){ - String result = HttpRequest.post(phoneUrl+"query/deleteReport?orderNo="+data) - .header("token",token) - .execute() - .body(); - JSONObject resultJson = JSONObject.parseObject(result); - log.info("删除返回结果{}",JSONObject.toJSONString(resultJson)); - if("0000".equals(resultJson.get("code"))){ - return success(null); - } - return success(null); - } } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java index 05590bedf..eee0c694c 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesFreeDO.java @@ -69,4 +69,9 @@ public class ShippingTemplatesFreeDO implements Serializable { *是否无效 */ private Boolean status; + + /** + * 城市名称描述 + */ + private String title; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java index 8dcbcb291..7790300b3 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesNoDeliveryDO.java @@ -50,5 +50,10 @@ public class ShippingTemplatesNoDeliveryDO implements Serializable { */ private String uniqid; + /** + * 城市名称描述 + */ + private String title; + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java index efcf7d02c..17b544165 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/express/ShippingTemplatesRegionDO.java @@ -81,5 +81,10 @@ public class ShippingTemplatesRegionDO implements Serializable { */ private Boolean status; + /** + * 城市名称描述 + */ + private String title; + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/log/StoreProductLog.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/log/StoreProductLog.java index 408c9a0fa..99a655e00 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/log/StoreProductLog.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/log/StoreProductLog.java @@ -43,7 +43,7 @@ public class StoreProductLog implements Serializable { private Integer productId; @Schema(description= "用户ID") - private Integer uid; + private Long uid; @Schema(description= "是否浏览") private Boolean visitNum; diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/RechargeOrderDO.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/RechargeOrderDO.java index f6b920dd8..a4674ece1 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/RechargeOrderDO.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/dataobject/recharge/RechargeOrderDO.java @@ -44,7 +44,7 @@ public class RechargeOrderDO extends TenantBaseDO { /** * 用户id */ - private Integer uid; + private Long uid; /** * 用户姓名 */ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/order/StoreOrderMapper.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/order/StoreOrderMapper.java index ee135c8dd..610a740a8 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/order/StoreOrderMapper.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/dal/mysql/order/StoreOrderMapper.java @@ -70,5 +70,5 @@ public interface StoreOrderMapper extends BaseMapperX { * @param uid 用户uid * @param spreadId 推广人uid */ - OrderBrokerageData getBrokerageData(@Param("uid") Integer uid, @Param("spreadId") Integer spreadId); + OrderBrokerageData getBrokerageData(@Param("uid") Long uid, @Param("spreadId") Integer spreadId); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/category/impl/CategoryServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/category/impl/CategoryServiceImpl.java index 2fd93790a..cdd14f808 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/category/impl/CategoryServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/category/impl/CategoryServiceImpl.java @@ -317,7 +317,6 @@ public class CategoryServiceImpl extends ServiceImpl i list.add(tree); } } - log.info("无限极分类 : getTree:" + JsonUtils.toJsonString(list)); return list; } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java index 42cd393dd..9082dca02 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/express/impl/ShippingTemplatesFreeServiceImpl.java @@ -67,7 +67,7 @@ public class ShippingTemplatesFreeServiceImpl extends ServiceImpl { * @param pageParamRequest 分页参数 * @return 订单结果列表 */ - List getUserOrderList(Integer uid, Integer status, PageParam pageParamRequest); + List getUserOrderList(Long uid, Integer status, PageParam pageParamRequest); /** * 创建订单 * @param storeOrder 订单参数 @@ -141,21 +141,21 @@ public interface StoreOrderService extends IService { * @param seckillId 秒杀商品id * @return 用户当天的秒杀商品订单数量 */ - List getUserCurrentDaySecKillOrders(Integer uid, Integer seckillId); + List getUserCurrentDaySecKillOrders(Long uid, Integer seckillId); /** * 获取用户当前的砍价订单 * @param uid 用户uid * @return 用户当前的砍价订单 */ - List getUserCurrentBargainOrders(Integer uid, Integer bargainId); + List getUserCurrentBargainOrders(Long uid, Integer bargainId); /** * 获取用户当前的拼团订单 * @param uid 用户uid * @return 用户当前的拼团订单 */ - List getUserCurrentCombinationOrders(Integer uid, Integer combinationId); + List getUserCurrentCombinationOrders(Long uid, Integer combinationId); StoreOrder getByOderId(String orderId); @@ -206,7 +206,7 @@ public interface StoreOrderService extends IService { * @param uid 用户uid * @return Integer */ - Long getOrderCountByUid(Integer uid); + Long getOrderCountByUid(Long uid); /** * 获取用户总消费金额 @@ -220,7 +220,7 @@ public interface StoreOrderService extends IService { * @param uid 用户uid * @return Integer */ - Long getOrderCountByUidAndDate(Integer uid, String date); + Long getOrderCountByUidAndDate(Long uid, String date); /** * 获取用户消费金额(时间) @@ -380,7 +380,7 @@ public interface StoreOrderService extends IService { * @param uid 用户uid * @param spreadId 推广人uid */ - OrderBrokerageData getBrokerageData(Integer uid, Integer spreadId); + OrderBrokerageData getBrokerageData(Long uid, Integer spreadId); /** * 会员充值 diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/OrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/OrderServiceImpl.java index ed0231f75..ded5c0bdf 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/OrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/order/impl/OrderServiceImpl.java @@ -325,13 +325,13 @@ public class OrderServiceImpl implements OrderService { @Override public OrderDataResponse orderData(String dateLimit, Integer type, String payType) { OrderDataResponse response = new OrderDataResponse(); - if (type.equals(2)) { + if (type!=null && type==2) { type = null; } // 已完成订单数量 response.setCompleteCount(getCount(dateLimit, Constants.ORDER_STATUS_COMPLETE, type)); // 待核销订单数量 - response.setEvaluatedCount(getCount(dateLimit, Constants.ORDER_STATUS_STR_TOBE_WRITTEN_OFF, type)); +// response.setEvaluatedCount(getCount(dateLimit, Constants.ORDER_STATUS_STR_TOBE_WRITTEN_OFF, type)); // 支付订单总数 response.setOrderCount(getCount(dateLimit, Constants.ORDER_STATUS_ALL, type)); // 待收货订单数量 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 7c7cba6a7..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 @@ -231,7 +231,7 @@ public class StoreOrderServiceImpl extends ServiceImpl getUserOrderList(Integer uid, Integer status, PageParam pageParamRequest) { + public List getUserOrderList(Long uid, Integer status, PageParam pageParamRequest) { PageHelper.startPage(pageParamRequest.getPageNo(), pageParamRequest.getPageSize()); LambdaQueryWrapper lqw = new LambdaQueryWrapper<>(); orderUtil.statusApiByWhere(lqw, status); @@ -541,7 +541,7 @@ public class StoreOrderServiceImpl extends ServiceImpl getUserCurrentDaySecKillOrders(Integer uid, Integer seckillId) { + public List getUserCurrentDaySecKillOrders(Long uid, Integer seckillId) { String dayStart = DateUtils.nowDateTime(Constants.DATE_FORMAT_START); String dayEnd = DateUtils.nowDateTime(Constants.DATE_FORMAT_END); LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); @@ -560,7 +560,7 @@ public class StoreOrderServiceImpl extends ServiceImpl getUserCurrentBargainOrders(Integer uid, Integer bargainId) { + public List getUserCurrentBargainOrders(Long uid, Integer bargainId) { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.eq(StoreOrder::getUid, uid); lqw.eq(StoreOrder::getBargainId, bargainId); @@ -576,7 +576,7 @@ public class StoreOrderServiceImpl extends ServiceImpl getUserCurrentCombinationOrders(Integer uid, Integer combinationId) { + public List getUserCurrentCombinationOrders(Long uid, Integer combinationId) { LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); lqw.eq(StoreOrder::getUid, uid); lqw.eq(StoreOrder::getCombinationId, combinationId); @@ -724,7 +724,7 @@ public class StoreOrderServiceImpl extends ServiceImpl lqw = Wrappers.lambdaQuery(); lqw.eq(StoreOrder::getPaid, true); lqw.eq(StoreOrder::getIsDel, false); @@ -759,7 +759,7 @@ public class StoreOrderServiceImpl extends ServiceImpl lqw = Wrappers.lambdaQuery(); lqw.eq(StoreOrder::getPaid, true); lqw.eq(StoreOrder::getIsDel, false); @@ -1165,7 +1165,7 @@ public class StoreOrderServiceImpl extends ServiceImpl orderInfos = request.getOrderInfos(); orderDO.setOrderId(code); - orderDO.setUid(user.getId().intValue()); + orderDO.setUid(user.getId()); orderDO.setRealName(user.getNickname()); orderDO.setUserPhone(StringUtils.isEmpty(request.getUserPhone()) ? user.getMobile() : request.getUserPhone()); orderDO.setConfirmPhone(StringUtils.isEmpty(request.getConfirmPhone()) ? user.getMobile() : request.getConfirmPhone()); @@ -1447,6 +1448,7 @@ public class StoreOrderServiceImpl extends ServiceImpl orderInfos = request.getOrderInfos(); Assert.isTrue(!CollectionUtils.isEmpty(orderInfos), "订单信息不能为空!"); @@ -1454,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.getId()) + .eq(PhoneRecordDO::getPhone, user.getMobile()) + .eq(PhoneRecordDO::getDeleted, 0) .in(PhoneRecordDO::getRechargeGearId, collect)); if (!CollectionUtils.isEmpty(infoDOS)) { @@ -1480,7 +1483,7 @@ public class StoreOrderServiceImpl extends ServiceImpl lqr = Wrappers.lambdaQuery(); lqr.eq(StoreProductRelation::getUid, uid); lqr.eq(StoreProductRelation::getType,"collect"); 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..1a818f28b 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,15 +7,21 @@ 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; import org.springframework.stereotype.Service; + import javax.annotation.Resource; + import org.springframework.validation.annotation.Validated; import java.util.*; + import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.PhoneRecordDO; import cn.iocoder.yudao.framework.common.pojo.PageResult; @@ -70,11 +76,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); } } @@ -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-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 5821a7322..88a3d09df 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 @@ -1,35 +1,33 @@ package cn.iocoder.yudao.module.shop.service.recharge; import cn.iocoder.yudao.framework.common.exception.ServiceException; +import cn.iocoder.yudao.framework.common.pojo.PageResult; import cn.iocoder.yudao.framework.security.core.LoginUser; 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.admin.recharge.vo.*; +import cn.iocoder.yudao.module.shop.convert.recharge.RechargeGearConvert; import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.PhoneRecordDO; -import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderDO; -import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeOrderInfoDO; +import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeGearDO; import cn.iocoder.yudao.module.shop.dal.mysql.recharge.PhoneRecordMapper; +import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeGearMapper; import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderInfoMapper; import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeOrderMapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; - -import javax.annotation.Resource; - import org.springframework.util.Assert; import org.springframework.util.CollectionUtils; import org.springframework.validation.annotation.Validated; -import java.util.*; +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; -import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.*; -import cn.iocoder.yudao.module.shop.dal.dataobject.recharge.RechargeGearDO; -import cn.iocoder.yudao.framework.common.pojo.PageResult; - -import cn.iocoder.yudao.module.shop.convert.recharge.RechargeGearConvert; -import cn.iocoder.yudao.module.shop.dal.mysql.recharge.RechargeGearMapper; - import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception; -import static cn.iocoder.yudao.module.shop.enums.ErrorCodeConstants.*; +import static cn.iocoder.yudao.module.shop.enums.ErrorCodeConstants.RECHARGE_GEAR_NOT_EXISTS; /** * 充值档位 Service 实现类 @@ -48,6 +46,8 @@ public class RechargeGearServiceImpl implements RechargeGearService { private RechargeOrderMapper orderMapper; @Resource private PhoneRecordMapper phoneRecordMapper; + @Autowired + private MemberUserApi userService; @Override public Long createRechargeGear(RechargeGearCreateReqVO createReqVO) { @@ -104,6 +104,7 @@ public class RechargeGearServiceImpl implements RechargeGearService { @Override public List getGradeInfo() { LoginUser loginUser = SecurityFrameworkUtils.getLoginUser(); + MemberUserRespDTO user = userService.getUser(loginUser.getId()); Assert.notNull(loginUser, "登录失效,请重新登录!"); List rechargeGearDOS = rechargeGearMapper.selectList(Wrappers.lambdaQuery() .eq(RechargeGearDO::getDeleted, 0)); @@ -111,7 +112,7 @@ public class RechargeGearServiceImpl implements RechargeGearService { throw new ServiceException("未初始化档次信息!"); } List rechargeGearRespVOS = RechargeGearConvert.INSTANCE.convertList(rechargeGearDOS); - List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getUserId, loginUser.getId())); + List infoDOS = phoneRecordMapper.selectList(Wrappers.lambdaQuery().eq(PhoneRecordDO::getPhone, user.getMobile())); Map> collect = infoDOS.stream().collect(Collectors.groupingBy(PhoneRecordDO::getRechargeGearId)); rechargeGearRespVOS.forEach(vo -> { List infoDOS1 = collect.get(vo.getId()); diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java index 3fe88778c..c9c9a089f 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderService.java @@ -76,4 +76,6 @@ public interface RechargeOrderService { List memberOrderInfo(); MemberHeadResponse memberHeadInfo(); + + List memberOrderInfoByPhone(String phone); } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java index 0169f12e2..8813f9654 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/java/cn/iocoder/yudao/module/shop/service/recharge/RechargeOrderServiceImpl.java @@ -171,4 +171,35 @@ public class RechargeOrderServiceImpl implements RechargeOrderService { return response; } + @Override + public List memberOrderInfoByPhone(String phone) { + List orderDOS = rechargeOrderMapper.selectList(Wrappers.lambdaQuery() + .eq(RechargeOrderDO::getUserPhone, phone).eq(RechargeOrderDO::getPaid, 1)); + if (!CollectionUtils.isEmpty(orderDOS)) { + List rechargeOrderRespVOS = RechargeOrderConvert.INSTANCE.convertList(orderDOS); + List collect1 = rechargeOrderRespVOS.stream().map(RechargeOrderBaseVO::getOrderId).collect(Collectors.toList()); + List infoDOS = infoMapper.selectList(Wrappers.lambdaQuery().in(RechargeOrderInfoDO::getOrderNo, collect1)); + Map> collect = infoDOS.stream().collect(Collectors.groupingBy(RechargeOrderInfoDO::getOrderNo)); + for (RechargeOrderRespVO orderDO : rechargeOrderRespVOS) { + StringBuilder grade = new StringBuilder(); + List infoDOS1 = collect.get(orderDO.getOrderId()); + for (RechargeOrderInfoDO infoDO : infoDOS1) { + if (infoDO.getPrice().compareTo(new BigDecimal("240")) == 0) { + grade.append("套餐1,"); + } else if (infoDO.getPrice().compareTo(new BigDecimal("400")) == 0) { + grade.append("套餐2,"); + } else if (infoDO.getPrice().compareTo(new BigDecimal("640")) == 0) { + grade.append("套餐3"); + } + } + orderDO.setGrade(grade.toString()); + DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd"); + orderDO.setStringCreateTime(orderDO.getCreateTime().format(formatter)); + } + + return rechargeOrderRespVOS; + } + return null; + } + } diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml index 76ef60c67..b82a15ce5 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesFreeMapper.xml @@ -3,6 +3,22 @@ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml index 680a2f38a..6b042f88e 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesNoDeliveryMapper.xml @@ -3,6 +3,22 @@ diff --git a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml index 063f68943..1aefe98c4 100644 --- a/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml +++ b/yudao-module-mall/yudao-module-shop-biz/src/main/resources/mapper/express/ShippingTemplatesRegionMapper.xml @@ -3,6 +3,22 @@ diff --git a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java index 8e511b3a4..62faaf15c 100644 --- a/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java +++ b/yudao-module-member/yudao-module-member-api/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApi.java @@ -80,7 +80,7 @@ public interface MemberUserApi { MemberUserRespDTO getInfo(); - void saveMemberUser(String phone); + void saveMemberUser(String phone,Long promoterId); PromoterDTO getPromoterDOByUserId(Long userId); } diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java index abb82eedb..17603857a 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/api/user/MemberUserApiImpl.java @@ -5,9 +5,11 @@ import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore; import cn.iocoder.yudao.module.member.api.user.dto.MemberUserRespDTO; import cn.iocoder.yudao.module.member.api.user.dto.PromoterDTO; +import cn.iocoder.yudao.module.member.controller.app.auth.vo.AppAuthSmsLoginReqVO; import cn.iocoder.yudao.module.member.convert.user.UserConvert; import cn.iocoder.yudao.module.member.dal.dataobject.promoter.PromoterDO; import cn.iocoder.yudao.module.member.dal.dataobject.user.MemberUserDO; +import cn.iocoder.yudao.module.member.service.auth.MemberAuthService; import cn.iocoder.yudao.module.member.service.promoter.PromoterService; import cn.iocoder.yudao.module.member.service.user.MemberUserService; import com.thoughtworks.xstream.core.SecurityUtils; @@ -31,6 +33,8 @@ public class MemberUserApiImpl implements MemberUserApi { private MemberUserService userService; @Resource private PromoterService promoterService; + @Resource + private MemberAuthService authService; @Override @TenantIgnore @@ -103,8 +107,12 @@ public class MemberUserApiImpl implements MemberUserApi { } @Override - public void saveMemberUser(String phone) { - userService.saveMemberUser(phone); + public void saveMemberUser(String phone,Long promoterId) { + AppAuthSmsLoginReqVO reqVO = new AppAuthSmsLoginReqVO(); + reqVO.setMobile(phone); + reqVO.setPromoterId(promoterId); + reqVO.setRealName("初始化账号"); + authService.initialize(reqVO); } @Override diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java index d1f32cfd8..67c527d96 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthService.java @@ -44,6 +44,14 @@ public interface MemberAuthService { */ Long register(@Valid AppAuthSmsLoginReqVO reqVO); + /** + * 初始化账号 + * + * @param reqVO 登陆信息 + * @return 登录结果 + */ + Long initialize(@Valid AppAuthSmsLoginReqVO reqVO); + /** * 社交登录,使用 code 授权码 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java index 3a6df452f..2bfe917b5 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/auth/MemberAuthServiceImpl.java @@ -139,6 +139,19 @@ public class MemberAuthServiceImpl implements MemberAuthService { return memberUserDO.getId(); } + @Override + public Long initialize(AppAuthSmsLoginReqVO reqVO) { + // 校验验证码 + String userIp = getClientIP(); + // 用户已经存在 + MemberUserDO user = userService.getUserByMobile(reqVO.getMobile()); + if (user != null) { + throw new ServiceException(ErrorCodeConstants.AUTH_MOBILE_EXISTS); + } + MemberUserDO memberUserDO = userService.createUserIfAbsent(reqVO.getMobile(),reqVO.getRealName(), userIp,reqVO.getPromoterId()); + return memberUserDO.getId(); + } + @Override public AppAuthLoginRespVO socialLogin(AppAuthSocialLoginReqVO reqVO) { // 使用 code 授权码,进行登录。然后,获得到绑定的用户编号 diff --git a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java index 86a5f2110..c5243d4ff 100644 --- a/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java +++ b/yudao-module-member/yudao-module-member-biz/src/main/java/cn/iocoder/yudao/module/member/service/user/MemberUserServiceImpl.java @@ -101,7 +101,7 @@ public class MemberUserServiceImpl implements MemberUserService { user.setMobile(mobile); user.setNickname(realName); user.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 默认开启 - user.setPassword(encodePassword(password)); // 加密密码 + user.setPassword(encodePassword("123456")); // 加密密码 user.setRegisterIp(registerIp); user.setPromoterId(promoterId); memberUserMapper.insert(user); diff --git a/yudao-server/src/main/resources/application-local.yaml b/yudao-server/src/main/resources/application-local.yaml index 577224347..ff034d196 100644 --- a/yudao-server/src/main/resources/application-local.yaml +++ b/yudao-server/src/main/resources/application-local.yaml @@ -255,5 +255,5 @@ justauth: timeout: 24h # 超时时长,目前只对 Redis 缓存生效,默认 3 分钟 phone: - query-url: http://192.168.1.189:4006/cyywl-phone-query-api/ + query-url: http://phone.cyywl.top/cyywl-phone-query-api/ token: eyIwLnR5cCI6IkpXVCIsImFsZyI6IkhTNTEyIn0 \ No newline at end of file diff --git a/yudao-ui-admin/src/views/deliverGoods/freightSet/creatTemplates.vue b/yudao-ui-admin/src/views/deliverGoods/freightSet/creatTemplates.vue index 4fbafa4d8..9a1761ef2 100644 --- a/yudao-ui-admin/src/views/deliverGoods/freightSet/creatTemplates.vue +++ b/yudao-ui-admin/src/views/deliverGoods/freightSet/creatTemplates.vue @@ -6,7 +6,7 @@ width="70%" :before-close="handleClose" > - + @@ -31,7 +31,6 @@ collapse-tags clearable filterable - @change="changeRegion" /> @@ -306,9 +305,6 @@ export default { noRegion: [] } }, - changeRegion(value) { - console.log(value) - }, changeRadio(num) { this.columns = Object.assign({}, statusMap[num - 1]) }, @@ -346,8 +342,10 @@ export default { name: info.name, type: info.type, appoint: info.appoint, + noDelivery: info.noDelivery, sort: info.sort }) + console.log(this.ruleForm) this.columns = Object.assign({}, statusMap[this.ruleForm.type - 1]) this.$nextTick(() => { loadingInstance.close() @@ -374,8 +372,8 @@ export default { shippingRegion() { logistics.shippingRegion({ tempId: this.tempId }).then(res => { res.data.forEach((item, index) => { - item.title = JSON.parse(item.title) - item.city_ids = item.title + // item.title = JSON.parse(item.title) + item.city_ids = JSON.parse(item.title) }) this.ruleForm.region = res.data }) @@ -385,23 +383,16 @@ export default { logistics.shippingFree({ tempId: this.tempId }).then(res => { res.data.forEach((item, index) => { // item.title = JSON.parse(item.title) - item.city_ids = item.cityId.split(',') + item.city_ids = JSON.parse(item.title) }) this.ruleForm.free = res.data - console.log(this.ruleForm.free ) }) }, // 包邮 shippingNodelivery() { logistics.shippingNodelivery({ tempId: this.tempId }).then(res => { - res.data.forEach((item, index) => { - // item.title = JSON.parse(item.title) - item.city_ids = item.cityId.split(',') - }) - this.ruleForm.noDelivery = res.data - console.log(this.ruleForm.noDelivery ) - + this.ruleForm.noRegion = JSON.parse(res.data[0].title) }) }, removeChild(list){ @@ -462,9 +453,11 @@ export default { } this.ruleForm.region.forEach((el, index) => { if(el.city_ids.length > 0){ - el.cityId = JSON.stringify(el.city_ids) + el.title = JSON.stringify(el.city_ids) + el.cityId = el.city_ids.join(",") }else{ el.cityId = 'all' + el.title = 0 } }) param.shippingTemplatesRegionRespVOList = this.ruleForm.region @@ -484,9 +477,11 @@ export default { if (this.ruleForm.appoint) { this.ruleForm.free.forEach((el, index) => { if(el.city_ids.length > 0){ - el.cityId = JSON.stringify(el.city_ids) + el.title = JSON.stringify(el.city_ids) + el.cityId = el.city_ids.join(",") }else{ el.cityId = 'all' + el.title = 0 } }) param.shippingTemplatesFreeRespVOList = this.ruleForm.free @@ -504,13 +499,10 @@ export default { // }) } if (this.ruleForm.noDelivery) { - param.shippingTemplatesNoDeliveryRespVOS = [{ - cityId:[], - }] - this.ruleForm.noRegion.forEach((item,index) => { - param.shippingTemplatesNoDeliveryRespVOS[0].cityId.push(item[2]) - }) - param.shippingTemplatesNoDeliveryRespVOS[0].cityId = param.shippingTemplatesNoDeliveryRespVOS[0].cityId.join(",") + param.shippingTemplatesNoDeliveryRespVOS = { + title:JSON.stringify(this.ruleForm.noRegion), + cityId:this.ruleForm.noRegion.join(','), + } } if (this.type === 0) { logistics.shippingSave(param).then(res => { diff --git a/yudao-ui-app/.hbuilderx/launch.json b/yudao-ui-app/.hbuilderx/launch.json index ee5be7746..4bbcf3cba 100644 --- a/yudao-ui-app/.hbuilderx/launch.json +++ b/yudao-ui-app/.hbuilderx/launch.json @@ -10,6 +10,10 @@ { "launchtype" : "local" }, + "h5" : + { + "launchtype" : "local" + }, "mp-weixin" : { "launchtype" : "local" diff --git a/yudao-ui-app/api/member.js b/yudao-ui-app/api/member.js index 6f93e6d05..5b62e3e21 100644 --- a/yudao-ui-app/api/member.js +++ b/yudao-ui-app/api/member.js @@ -15,6 +15,13 @@ export function memberOrderInfo(){ return request.get('api/order/member/memberOrderInfo', {}) } +/** + * 根据当前手机号获取账号的充值记录 + */ +export function memberOrderInfoByPhone(phone){ + return request.get(`api/order/member/memberOrderInfoByPhone?phone=${phone}`, {}) +} + /** * 查询权益档位信息 */ diff --git a/yudao-ui-app/components/paymentMember/index.vue b/yudao-ui-app/components/paymentMember/index.vue index 122525432..a55247b9c 100644 --- a/yudao-ui-app/components/paymentMember/index.vue +++ b/yudao-ui-app/components/paymentMember/index.vue @@ -216,7 +216,7 @@ width: 100%; border-radius: 16rpx 16rpx 0 0; background-color: #fff; - padding-bottom: 100rpx; + padding-bottom: 20%; z-index: 99; transition: all 0.3s cubic-bezier(0.25, 0.5, 0.5, 0.9); transform: translate3d(0, 100%, 0); diff --git a/yudao-ui-app/config/app.js b/yudao-ui-app/config/app.js index fd0473db6..2932f77a1 100644 --- a/yudao-ui-app/config/app.js +++ b/yudao-ui-app/config/app.js @@ -1,14 +1,12 @@ -// let domain = 'http://api.cyywl.top' -let domain = 'http://192.168.1.188:48080' +let domain = process.env.APP_BASE_URL module.exports = { // 请求域名 格式: https://您的域名 // #ifdef MP HTTP_REQUEST_URL: domain, // #endif - HTTP_ADMIN_URL:'http://api.cyywl.top', //PC后台的API请求地址,上传图片用 - // HTTP_ADMIN_URL:'http://192.168.1.188:48080', //PC后台的API请求地址,上传图片用 + HTTP_ADMIN_URL: process.env.APP_BASE_URL, //PC后台的API请求地址,上传图片用 // #ifdef H5 //H5接口是浏览器地址 // HTTP_REQUEST_URL: window.location.protocol+"//"+window.location.host, diff --git a/yudao-ui-app/main.js b/yudao-ui-app/main.js index b6b8b459d..36bb9d4c3 100644 --- a/yudao-ui-app/main.js +++ b/yudao-ui-app/main.js @@ -18,32 +18,32 @@ import { parseQuery } from "./utils"; import Auth from './libs/wechat'; import { SPREAD } from './config/cache'; Vue.prototype.$wechat = Auth; -let cookieName = "VCONSOLE", - query = parseQuery(), - urlSpread = query["spread"], - vconsole = query[cookieName.toLowerCase()], - md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式 - md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式 +// let cookieName = "VCONSOLE", +// query = parseQuery(), +// urlSpread = query["spread"], +// // vconsole = query[cookieName.toLowerCase()], +// vconsole = "b14d1e9baeced9bb7525ab19ee35f2d2", +// md5Crmeb = "b14d1e9baeced9bb7525ab19ee35f2d2", //CRMEB MD5 加密开启vconsole模式 +// md5UnCrmeb = "3dca2162c4e101b7656793a1af20295c"; //UN_CREMB MD5 加密关闭vconsole模式 -if (urlSpread !== undefined) { - var spread = Cache.get(SPREAD); - urlSpread = parseInt(urlSpread); - if (!Number.isNaN(urlSpread) && spread !== urlSpread) { - Cache.set("spread", urlSpread || 0); - } else if (spread === 0 || typeof spread !== "number") { - Cache.set("spread", urlSpread || 0); - } -} +// if (urlSpread !== undefined) { +// var spread = Cache.get(SPREAD); +// urlSpread = parseInt(urlSpread); +// if (!Number.isNaN(urlSpread) && spread !== urlSpread) { +// Cache.set("spread", urlSpread || 0); +// } else if (spread === 0 || typeof spread !== "number") { +// Cache.set("spread", urlSpread || 0); +// } +// } -if (vconsole !== undefined) { - if (vconsole === md5UnCrmeb && Cache.has(cookieName)) - Cache.clear(cookieName); -} else vconsole = Cache.get(cookieName); +// if (vconsole !== undefined) { +// if (vconsole === md5UnCrmeb && Cache.has(cookieName)) +// Cache.clear(cookieName); +// } else vconsole = Cache.get(cookieName); import VConsole from './components/vconsole.min.js' -if (vconsole !== undefined && vconsole === md5Crmeb) { - Cache.set(cookieName, md5Crmeb, 3600); +if (process.env.isVConsole) { let vConsole = new VConsole(); } diff --git a/yudao-ui-app/package.json b/yudao-ui-app/package.json index e147ae429..40092a0fc 100644 --- a/yudao-ui-app/package.json +++ b/yudao-ui-app/package.json @@ -13,5 +13,25 @@ "clipboard": "^2.0.11", "html-to-image": "^1.11.11", "qrcode": "^1.5.3" + }, + "uni-app": { + "scripts": { + "dev": { + "title": "开发版", + "env": { + "UNI_PLATFORM": "h5", + "isVConsole": true, + "APP_BASE_URL": "http://192.168.1.147:48080" + } + }, + "prod": { + "title": "生产版", + "env": { + "UNI_PLATFORM": "h5", + "isVConsole": false, + "APP_BASE_URL": "http://api.cyywl.top" + } + } + } } } diff --git a/yudao-ui-app/pages.json b/yudao-ui-app/pages.json index f8d4d0e20..310088462 100644 --- a/yudao-ui-app/pages.json +++ b/yudao-ui-app/pages.json @@ -22,6 +22,12 @@ "navigationBarTitleText": "权益明细" } }, + { + "path": "pages/member_back/index", + "style": { + "navigationBarTitleText": "话费返回" + } + }, { "path": "pages/member_equity/index", "style": { @@ -589,15 +595,15 @@ { "pagePath": "pages/index/index", "iconPath": "static/images/tabbar/nav_icon_shop.png", - "selectedIconPath": "static/images/1-002.png", + "selectedIconPath": "static/images/tabbar/nav_icon_shop_active.png", "text": "商城" }, - // { - // "pagePath": "pages/goods_cate/goods_cate", - // "iconPath": "static/images/tabbar/nav_icon_sort.png", - // "selectedIconPath": "static/images/2-002.png", - // "text": "分类" - // }, + { + "pagePath": "pages/goods_cate/goods_cate", + "iconPath": "static/images/tabbar/nav_icon_sort.png", + "selectedIconPath": "static/images/tabbar/nav_icon_sort_active.png", + "text": "分类" + }, { "pagePath": "pages/member_application/index", "iconPath": "static/images/tabbar/nav_icon_member.png", diff --git a/yudao-ui-app/pages/index/index.vue b/yudao-ui-app/pages/index/index.vue index a050f62f6..16229b2fd 100644 --- a/yudao-ui-app/pages/index/index.vue +++ b/yudao-ui-app/pages/index/index.vue @@ -40,7 +40,7 @@ - + {{item.storeName}} - + - + @@ -108,13 +108,13 @@ import { getTemlIds } from '@/api/api.js'; - + // import { // SUBSCRIBE_MESSAGE, // TIPS_KEY // } from '@/config/cache'; // #endif - // #ifdef H5 + // #ifdef H5 import { follow } from '@/api/public.js'; @@ -370,17 +370,17 @@ go(){ console.log(this.productList,'------') }, - + // 获取banner和userInfo getBanners(){ - + // console.log(this.$store.tenantId,'tenantId') getBanner().then(res=>{ this.bannerList = res.data.list[0] console.log(this.bannerList,'banner') }) console.log(this.userInfo.userId,'userInfo111111') - + }, getCoupon: function(id, index) { let that = this; @@ -487,7 +487,7 @@ this.getGroomList(); this.shareApi(); this.getcouponList(); - + // #ifdef H5 // that.subscribe = res.data.subscribe; // #endif @@ -629,7 +629,7 @@ get_host_product: function() { let that = this; that.loading = true; - + if (that.hotScroll) return getProductHot( that.hotPage, @@ -648,7 +648,9 @@ // 获取H5 搜索框高度 let appSearchH = uni.createSelectorQuery().select(".serch-wrapper"); appSearchH.boundingClientRect(function(data) { - self.searchH = data.height + if(data){ + self.searchH = data.height + } }).exec() // #endif }, @@ -716,13 +718,13 @@ .left { width: 164rpx; height: 164rpx; - + .image { border: 3rpx solid #EE5423; border-radius: 50%; border: linear-gradient(0deg, #F77C4D, #EE5423); } - + } .center { width: 330rpx; @@ -801,7 +803,7 @@ display: flex; justify-content: center; align-items: center; - + } .hot { width: 663rpx; @@ -810,7 +812,7 @@ margin-left: 44rpx; background: #fff; border-radius: 20rpx; - + .contain { width: 100%; height: 1rpx; @@ -942,7 +944,7 @@ background: #fff; overflow: hidden; border-radius: 20rpx; - + image { width: 100%; height: 294rpx; @@ -970,7 +972,7 @@ } .car { position: absolute; - + width: 60rpx; height: 60rpx; background: url(@/static/images/shop/car.png); @@ -982,11 +984,11 @@ ::v-deep .notice{ .u-icon__icon { color: #FF4802 !important; - + span { font-size: 28rpx; } -} - +} + } diff --git a/yudao-ui-app/pages/member_application/index.vue b/yudao-ui-app/pages/member_application/index.vue index 92b2bcd13..246760382 100644 --- a/yudao-ui-app/pages/member_application/index.vue +++ b/yudao-ui-app/pages/member_application/index.vue @@ -58,16 +58,6 @@ }, data() { return { - // list: [ - // { - // name:'购买记录', - // fontSize:'28' - // }, - // { - // name:'为他人充值', - // fontSize:'28' - // }, - // ], memberData: [], payInfo: { userPhone: '', @@ -97,7 +87,7 @@ }; }, - async onLoad() { + async onShow() { try{ uni.showLoading({ title: '加载中', @@ -106,7 +96,7 @@ const res = await memberGradeInfo() if(res.data.some((item) => !!parseInt(item.isExist))){ uni.setTabBarItem({ - index: 0, + index: 2, pagePath: '/pages/member_equity/index' }) uni.switchTab({ @@ -114,7 +104,7 @@ }) }else{ uni.setTabBarItem({ - index: 0, + index: 2, pagePath: '/pages/member_application/index' }) } diff --git a/yudao-ui-app/pages/member_back/index.vue b/yudao-ui-app/pages/member_back/index.vue new file mode 100644 index 000000000..5e86d3abf --- /dev/null +++ b/yudao-ui-app/pages/member_back/index.vue @@ -0,0 +1,325 @@ + + + + + diff --git a/yudao-ui-app/pages/member_equity/index.vue b/yudao-ui-app/pages/member_equity/index.vue index 31cf1db87..48ba82993 100644 --- a/yudao-ui-app/pages/member_equity/index.vue +++ b/yudao-ui-app/pages/member_equity/index.vue @@ -10,11 +10,11 @@ 再升1级即可获得【XX】等6项权益 - 购买记录 + 购买记录 - 为他人充值 + 代他人充值 @@ -22,7 +22,7 @@ 会员等级{{vipData.findIndex((item) => item == memberDetail.grade) +1}}级 - + @@ -47,11 +47,11 @@ - 带返还金额 (元) + 待返还金额 (元) {{list[list.findIndex((i) => item.gear == i.name)].name-item.totalMoney}} - 带返还期额 + 待返还期额 {{item.frequency}}x12 @@ -81,15 +81,15 @@ list: [ { img:'../../static/images/member240.png', - name:'360' + name:360 }, { img:'../../static/images/member400.png', - name:'600' + name:600 }, { img:'../../static/images/member960.png', - name:'900' + name:900 }, ], vipData:['普通会员','中级会员','高级会员'], @@ -99,16 +99,16 @@ }; }, computed: mapGetters(['userInfo']), - async onLoad() { + async onShow() { const resful = await memberGradeInfo() if(resful.data.some((item) => !!parseInt(item.isExist))){ uni.setTabBarItem({ - index: 0, + index: 2, pagePath: '/pages/member_equity/index' }) }else{ uni.setTabBarItem({ - index: 0, + index: 2, pagePath: '/pages/member_application/index' }) uni.switchTab({ @@ -117,8 +117,7 @@ } const res = await memberHeadInfo() this.memberDetail = res.data - // this.userInfo.mobile - const equity = await query(13668261228) + const equity = await query(this.userInfo.mobile) this.equityData = equity.data }, methods: { @@ -171,6 +170,7 @@ } + .box-member { padding: 36rpx 40rpx; border-radius: 20rpx; @@ -257,12 +257,12 @@ margin-bottom: 10rpx; } - button { + .right-button { + border-radius: 18rpx; margin-top: 10rpx; padding: 7rpx 16rpx; background: #F22E60; border-image: linear-gradient(0deg, #A8052E, #FFFFFF) 10 10; - border-radius: 18rpx; font-size: 22rpx; font-family: PingFang SC; font-weight: 400; diff --git a/yudao-ui-app/pages/member_others/index.vue b/yudao-ui-app/pages/member_others/index.vue index 37371e058..76c3d5af7 100644 --- a/yudao-ui-app/pages/member_others/index.vue +++ b/yudao-ui-app/pages/member_others/index.vue @@ -43,7 +43,6 @@