diff --git a/ruoyi-common/pom.xml b/ruoyi-common/pom.xml index 2cbe71f..9c1e349 100644 --- a/ruoyi-common/pom.xml +++ b/ruoyi-common/pom.xml @@ -34,7 +34,16 @@ org.springframework.boot spring-boot-starter-security - + + + com.google.code.gson + gson + + + + com.squareup.okhttp3 + okhttp + com.github.pagehelper diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java index eb2f58f..b243f6c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/AppletController.java @@ -36,15 +36,9 @@ import java.math.BigDecimal; import org.springframework.web.bind.annotation.RequestBody; import com.ruoyi.system.config.QiniuConfig; import com.ruoyi.system.utils.QiniuUploadUtil; - -import static com.ruoyi.common.core.domain.AjaxResult.error; -import static com.ruoyi.common.core.domain.AjaxResult.success; -import static com.ruoyi.common.utils.PageUtils.startPage; - import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.ruoyi.system.domain.WechatTransfer; -import com.ruoyi.common.utils.SecurityUtils; import com.alibaba.fastjson2.JSONArray; import com.ruoyi.system.domain.QuoteCraft; import com.ruoyi.system.domain.QuoteType; @@ -139,21 +133,18 @@ public class AppletController extends BaseController { private IGoodsOrderCursorService goodsOrderCursorService; @Autowired private IWorkerApplyService workerApplyService; + @Autowired + private IUserMemberRechargeProgramService userMemberRechargeProgramService; + + @Autowired + private IUserMemberRechargeLogService userMemberRechargeLogService; + + @Autowired + private IUserMemnerConsumptionLogService userMemnerConsumptionLogService; - /** - * 生成订单号 - * 格式:年月日时分秒 + 4位随机数 - */ - private String generateNewOrderId() { - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss"); - String timeStr = sdf.format(new Date()); - int random = (int) ((Math.random() * 9 + 1) * 1000); - return timeStr + random; - } - /** * 获取服务分类列表 * @@ -191,48 +182,6 @@ public class AppletController extends BaseController { } -// /** -// * 获取服务分类列表 -// * -// * @param request HTTP请求对象 -// * @return 分类列表数据 -// *

-// * 接口说明: -// * - 获取状态为启用的服务分类 -// * - 自动添加图片CDN前缀 -// * - 支持用户登录状态验证 -// */ -// @GetMapping(value = "/api/form/apply/worker") -// public AjaxResult applyworker(@RequestBody Map params, HttpServletRequest request) { -// try { -// -// // 2. 验证用户登录状态 -// String token = request.getHeader("token"); -// Map userValidation = AppletLoginUtil.validateUserToken(token, usersService); -// if (!(Boolean) userValidation.get("valid")) { -// return AppletControllerUtil.appletUnauthorized(); -// } -// -// // 3. 获取用户信息 -// Users user = (Users) userValidation.get("user"); -// if (user == null) { -// return AppletControllerUtil.appletWarning("用户信息获取失败"); -// } -// -// -// -// return AppletControllerUtil.appletSuccess(""); -// } catch (Exception e) { -// return AppletControllerUtil.appletError("获取服务分类列表失败:" + e.getMessage()); -// } -// } - - - - - - - /** * 获取系统配置信息 * @@ -1106,39 +1055,7 @@ public class AppletController extends BaseController { } } -// /** -// * 获取服务商品详细信息 -// * -// * @param id 商品ID -// * @param request HTTP请求对象 -// * @return 商品详细信息 -// *

-// * 接口说明: -// * - 根据商品ID获取详细信息 -// * - 返回格式化的商品数据 -// * - 包含图片、基础信息等数组数据 -// */ -// @GetMapping(value = "/api/service/info/id/{id}") -// public AjaxResult serviceGoodsQuery(@PathVariable("id") long id, HttpServletRequest request) { -// try { -// // 参数验证 -// if (id <= 0) { -// return AppletControllerUtil.appletWarning("商品ID无效"); -// } -// -// // 查询商品信息 -// ServiceGoods serviceGoodsData = serviceGoodsService.selectServiceGoodsById(id); -// if (serviceGoodsData != null) { -// // 使用工具类转换数据格式 -// AppletControllerUtil.ServiceGoodsResponse response = new AppletControllerUtil.ServiceGoodsResponse(serviceGoodsData); -// return AppletControllerUtil.appletSuccess(response); -// } else { -// return AppletControllerUtil.appletWarning("商品不存在或已下架"); -// } -// } catch (Exception e) { -// return AppletControllerUtil.appletWarning("查询商品详情失败:" + e.getMessage()); -// } -// } + /** * 获取服务商品详细信息 @@ -1384,31 +1301,7 @@ public class AppletController extends BaseController { } } -// -// @GetMapping(value = "/api/user/info") -// public AjaxResult getUserByPhone(HttpServletRequest request) { -// String token = request.getHeader("token"); -// Map order_num = new HashMap<>(); -// Map goods_order_num = new HashMap<>(); -// Users users = usersService.selectUsersByRememberToken(token); -// if (users != null) { -// users.setRemember_token(users.getRememberToken()); -// order_num.put("pending_accept", 2); -// order_num.put("pending_service", 0); -// order_num.put("in_service", 0); -// order_num.put("other_status", 0); -// users.setOrder_num(order_num); -// goods_order_num.put("pending_accept", 0); -// goods_order_num.put("pending_service", 3); -// goods_order_num.put("in_service", 0); -// goods_order_num.put("other_status", 0); -// users.setGoods_order_num(goods_order_num); -// return AppletControllerUtil.appletSuccess(users); -// } else { -// return AppletControllerUtil.appletError("查询用户信息失败:"); -// } -// -// } + /** * 构建用户信息响应数据 @@ -1442,7 +1335,12 @@ public class AppletController extends BaseController { userInfo.put("total_comm", user.getTotalComm().toString() != null ? user.getTotalComm().toString() : "0.00"); userInfo.put("propose", user.getPropose().toString() != null ? user.getPropose().toString() : "0.00"); } - + if (user.getType().equals("1")) { + userInfo.put("balance", user.getBalance().toString() != null ? user.getBalance().toString() : "0.00"); + userInfo.put("ismember", user.getIsmember()); + userInfo.put("member_begin",user.getMemberBegin() != null ? sdf.format(user.getMemberBegin()) : null ); + userInfo.put("member_end",user.getMemberEnd() != null ? sdf.format(user.getMemberEnd()) : null ); + } userInfo.put("integral", user.getIntegral() != null ? user.getIntegral() : 0); userInfo.put("is_stop", user.getIsStop() != null ? user.getIsStop() : 1); @@ -1832,44 +1730,7 @@ public class AppletController extends BaseController { } - /** - * 获取服务商品详细信息 - * - * @param params 商品ID - * @param request HTTP请求对象 - * @return 商品详细信息 - *

- * 接口说明: - * - 根据商品ID获取详细信息 - * - 返回格式化的商品数据 - * - 包含图片、基础信息等数组数据 - */ - /** - * 手机号登录接口(未完整实现) - * - * @param params 包含code和phone参数 - * @param request HTTP请求对象 - * @return 登录结果 - * - * 功能说明: - * - 预留的手机号登录接口 - * - 当前实现不完整,需要补充验证逻辑 - * - 用于处理手机号码验证登录 - */ -// @GetMapping(value = "/user/phone/login") -// public AjaxResult getUserByPhone(@RequestBody Map params, HttpServletRequest request) { -// String code = (String) params.get("code"); -// String usercode = (String) params.get("phone"); -// -// if (code == null) { -// -// } -// if (usercode == null) { -// -// } -// return AppletControllerUtil.appletSuccess(); -// -// } + /** @@ -2089,46 +1950,7 @@ public class AppletController extends BaseController { } } - /** - * 企业付款接口(用于代付等场景) - * - * @param params 付款参数 - * @param request HTTP请求对象 - * @return 付款结果 - *

- * 请求参数格式: - * { - * "partnerTradeNo": "商户订单号", - * "openid": "用户openid", - * "amount": 付款金额(分), - * "desc": "付款描述" - * } - */ - @PostMapping(value = "/api/pay/transfer") - public AjaxResult transferToUser(@RequestBody Map params, HttpServletRequest request) { - try { - // 1. 验证用户登录状态(这里可能需要管理员权限) - String token = request.getHeader("token"); - Map userValidation = AppletLoginUtil.validateUserToken(token, usersService); - if (!(Boolean) userValidation.get("valid")) { - return AppletControllerUtil.appletWarning("用户未登录或token无效"); - } - WechatPayUtil wechatPayUtil = new WechatPayUtil(); - // 2. 企业付款 - Map transferResult = wechatPayUtil.transferToUser(params); - // 3. 返回结果 - boolean success = (Boolean) transferResult.get("success"); - if (success) { - return AppletControllerUtil.appletSuccess(transferResult); - } else { - return AppletControllerUtil.appletWarning((String) transferResult.get("message")); - } - - } catch (Exception e) { - return AppletControllerUtil.appletWarning("企业付款失败:" + e.getMessage()); - } - } /** @@ -2515,127 +2337,7 @@ public class AppletController extends BaseController { } } -// ... existing code ... -// /** -// * 查询用户优惠券列表 -// * -// * @param params 请求参数,包含status(优惠券状态)、product_id(指定商品ID)、price(最低价格) -// * @param request HTTP请求对象 -// * @return 返回用户优惠券列表 -// */ -// @PostMapping("/api/coupon/my/lst") -// public AjaxResult getMyCouponList(@RequestBody Map params, HttpServletRequest request) { -// try { -// // 1. 验证用户登录状态 -// String token = request.getHeader("token"); -// Map userValidation = AppletLoginUtil.validateUserToken(token, usersService); -// if (!(Boolean) userValidation.get("valid")) { -// return AppletControllerUtil.appletWarning("用户未登录或token无效"); -// } -// // 2. 获取用户信息 -// Users user = (Users) userValidation.get("user"); -// if (user == null) { -// return AppletControllerUtil.appletWarning("用户信息获取失败"); -// } - -// // 3. 解析查询参数 -// Long status = parseParamToLong(params.get("status"), "状态参数格式错误"); -// Long productId = parseParamToLong(params.get("product_id"), "商品ID参数格式错误"); -// Integer price = parseParamToInteger(params.get("price"), "价格参数格式错误"); - -// // 4. 查询用户的所有优惠券 -// CouponUser couponUserQuery = new CouponUser(); -// couponUserQuery.setUid(user.getId()); -// List couponUserList = couponUserService.selectCouponUserList(couponUserQuery); - -// // 5. 根据状态筛选优惠券 -// long currentTime = System.currentTimeMillis() / 1000; // 当前时间戳(秒) -// List filteredList = new ArrayList<>(); - -// if (status == null) { -// // 如果未指定状态,返回所有优惠券 -// filteredList = couponUserList; -// } else if (status == 1L) { -// // 未使用的优惠券 -// for (CouponUser coupon : couponUserList) { -// if (coupon.getStatus() != 2L && !isExpired(coupon, currentTime)) { -// filteredList.add(coupon); -// } -// } -// } else if (status == 2L) { -// // 已使用的优惠券 -// for (CouponUser coupon : couponUserList) { -// if (coupon.getStatus() != null && coupon.getStatus() == 2L) { -// filteredList.add(coupon); -// } -// } -// } else if (status == 3L) { -// // 已过期的优惠券 -// for (CouponUser coupon : couponUserList) { -// if (isExpired(coupon, currentTime)) { -// filteredList.add(coupon); -// } -// } -// } else if (status == 4L) { -// // 待领取的优惠券 - 只返回手动领取(type=2)且剩余数量大于0的优惠券 -// Coupons couponsQuery = new Coupons(); -// couponsQuery.setStatus(1L); // 启用状态 -// couponsQuery.setType(2L); // 手动领取类型 -// List availableCoupons = couponsService.selectCouponsList(couponsQuery); - -// for (Coupons coupon : availableCoupons) { -// // 检查剩余数量大于0且用户可领取 -// if (coupon.getCount() != null && coupon.getCount() > 0 && -// isCouponAvailableToReceive(coupon, user.getId(), currentTime)) { -// // 创建一个临时的CouponUser对象,包含完整的优惠券信息 -// CouponUser tempCouponUser = new CouponUser(); -// tempCouponUser.setCouponId(coupon.getId()); -// tempCouponUser.setUid(user.getId()); -// tempCouponUser.setStatus(0L); // 待领取状态 -// tempCouponUser.setCouponTitle(coupon.getTitle()); -// tempCouponUser.setCouponPrice(coupon.getPrice() != null ? coupon.getPrice().intValue() : 0); -// tempCouponUser.setMinPrice(coupon.getMinPrice() != null ? coupon.getMinPrice().longValue() : 0L); -// tempCouponUser.setCateId(coupon.getCateId()); -// tempCouponUser.setProductId(coupon.getProductId()); -// tempCouponUser.setReceiveType(coupon.getReceiveType() != null ? coupon.getReceiveType().toString() : "1"); - -// // 设置有效期 -// if (coupon.getCouponTime() != null) { -// // 如果有固定的有效期天数,计算失效时间 -// long loseTime = currentTime + (coupon.getCouponTime() * 24 * 60 * 60); -// tempCouponUser.setLoseTime(String.valueOf(loseTime)); -// } else if (coupon.getEndTime() != null) { -// // 如果有结束时间,使用结束时间作为失效时间 -// tempCouponUser.setLoseTime(String.valueOf(coupon.getEndTime())); -// } - -// filteredList.add(tempCouponUser); -// } -// } -// } - -// // 6. 商品ID筛选 -// if (productId != null) { -// filteredList = filteredList.stream() -// .filter(coupon -> productId.equals(coupon.getProductId())) -// .collect(Collectors.toList()); -// } - -// // 7. 价格筛选 -// List priceFilteredList = AppletControllerUtil.filterCouponsByPrice(filteredList, price); - -// // 8. 使用工具类处理数据格式化 -// List> resultList = AppletControllerUtil.buildCouponUserList( -// priceFilteredList, serviceCateService); - -// return AppletControllerUtil.appletSuccess(resultList); - -// } catch (Exception e) { -// System.err.println("查询用户优惠券列表异常:" + e.getMessage()); -// return AppletControllerUtil.appletWarning("查询优惠券列表失败:" + e.getMessage()); -// } -// } /** * 解析参数为Long类型 @@ -3205,6 +2907,10 @@ public AjaxResult getUserNotificationStatus(HttpServletRequest request) { } } + + + + /** * 用户订阅消息授权接口 * @@ -4380,45 +4086,6 @@ public AjaxResult getMyCouponCount(HttpServletRequest request) { return AppletControllerUtil.appletWarning("用户信息获取失败"); } -// // 3. 查询用户的所有优惠券 -// CouponUser couponUserQuery = new CouponUser(); -// couponUserQuery.setUid(user.getId()); -// List userCouponList = couponUserService.selectCouponUserList(couponUserQuery); -// -// // 4. 统计各种状态的优惠券数量 -// int unusedCount = 0; // 未使用数量 (one) -// int usedCount = 0; // 已使用数量 (two) -// int expiredCount = 0; // 已过期数量 (three) -// -// long currentTime = System.currentTimeMillis() / 1000; // 当前时间戳(秒) -// -// for (CouponUser couponUser : userCouponList) { -// // 检查是否已使用 -// if (couponUser.getStatus() != null && couponUser.getStatus() == 2L) { -// usedCount++; -// } else { -// // 检查是否已过期 -// if (isExpired(couponUser, currentTime)) { -// expiredCount++; -// } else { -// // 未使用且未过期 -// unusedCount++; -// } -// } -// } -// -// // 5. 查询可领取的优惠券数量 -// Coupons couponsQuery = new Coupons(); -// couponsQuery.setStatus(1L); // 启用状态 -// List availableCoupons = couponsService.selectCouponsList(couponsQuery); -// -// int availableToReceiveCount = 0; // 待领取数量 (four) -// for (Coupons coupon : availableCoupons) { -// if (isCouponAvailableToReceive(coupon, user.getId(), currentTime)) { -// availableToReceiveCount++; -// } -// } - // 6. 构建返回数据 Map countData = new HashMap<>(); countData.put("one", couponUserService.selectCountCouponsByUid(user.getId(), 1L)); // 未使用数量 @@ -4498,82 +4165,6 @@ private boolean isCouponAvailableToReceive(Coupons coupon, Long userId, long cur return true; } - -// /** -// * 商品下单接口 -// * POST /api/service/create/order -// * 参数:{"0":{"product_id":2,"num":1,"sku":{...},"address_id":26,"deduction":"","mark":""}} -// */ -// @PostMapping("/api/service/create/order") -// public AjaxResult createGoodsOrder(@RequestBody Map params, HttpServletRequest request) { -// try { -// // 1. 校验用户登录 -// String token = request.getHeader("token"); -// Map userValidation = AppletLoginUtil.validateUserToken(token, usersService); -// if (!(Boolean) userValidation.get("valid")) { -// return AppletControllerUtil.appletError("用户未登录或token无效"); -// } -// Users user = (Users) userValidation.get("user"); -// if (user == null) { -// return AppletControllerUtil.appletError("用户信息获取失败"); -// } -// // 2. 解析参数 -// Map orderParams = (Map) params.get("0"); -// if (orderParams == null) { -// return AppletControllerUtil.appletError("参数错误"); -// } -// Long productId = Long.valueOf(orderParams.get("product_id").toString()); -// Integer num = Integer.valueOf(orderParams.get("num").toString()); -// Map sku = (Map) orderParams.get("sku"); -// Long addressId = Long.valueOf(orderParams.get("address_id").toString()); -// String deduction = orderParams.get("deduction") != null ? orderParams.get("deduction").toString() : ""; -// String mark = orderParams.get("mark") != null ? orderParams.get("mark").toString() : ""; -// // 3. 查询商品信息 -// ServiceGoods serviceGoods = serviceGoodsService.selectServiceGoodsById(productId); -// if (serviceGoods == null) { -// return AppletControllerUtil.appletError("商品不存在"); -// } -// // 4. 查询地址信息 -// UserAddress userAddress = userAddressService.selectUserAddressById(addressId); -// if (userAddress == null) { -// return AppletControllerUtil.appletError("地址不存在"); -// } -// // 5. 计算金额 -// BigDecimal price = new BigDecimal(sku.get("price").toString()); -// BigDecimal totalPrice = price.multiply(BigDecimal.valueOf(num)); -// // 6. 组装订单 -// GoodsOrder order = new GoodsOrder(); -// order.setType(2); // 商品订单 -// order.setMainOrderId("WX" + System.currentTimeMillis()); -// order.setOrderId("B" + System.currentTimeMillis()); -// order.setUid(user.getId()); -// order.setProductId(productId); -// order.setNum(Long.valueOf(num)); -// order.setSku(com.alibaba.fastjson2.JSONObject.toJSONString(sku)); -// order.setAddressId(addressId); -// order.setName(userAddress.getName()); -// order.setPhone(userAddress.getPhone()); -// order.setAddress(userAddress.getAddressName()); -// order.setStatus(1L); -// order.setGoodPrice(price); -// order.setTotalPrice(totalPrice); -// order.setDeduction(deduction.isEmpty() ? BigDecimal.ZERO : new BigDecimal(deduction)); -// order.setMark(mark); -// order.setCreatedAt(new Date()); -// order.setUpdatedAt(new Date()); -// // 7. 插入订单 -// int result = goodsOrderService.insertGoodsOrder(order); -// if (result > 0) { -// return AppletControllerUtil.appletSuccess("下单成功"); -// } else { -// return AppletControllerUtil.appletError("下单失败"); -// } -// } catch (Exception e) { -// return AppletControllerUtil.appletError("下单异常: " + e.getMessage()); -// } -// } - - /** * 创建服务订单(支持多商品批量下单) * @@ -4664,7 +4255,6 @@ public AjaxResult createServiceOrder(@RequestBody Map params, Ht if (coupon != null) { coupon.setStatus(2L); } - //coupon.setUseTime(new Date().getTime()); couponUserService.updateCouponUser(coupon) ; // 创建商品订单 GoodsOrder goodsOrder = new GoodsOrder(); @@ -4818,7 +4408,6 @@ public AjaxResult createServiceOrder(@RequestBody Map params, Ht if (hasGoodsOrder && totalAmount.compareTo(BigDecimal.ZERO) > 0) { // 使用工具类简化微信支付参数组装 Map payResult = wechatPayUtil.createBatchOrderAndPay(user.getOpenid(), mainOrderId, new BigDecimal(0.01), orderList.size(), "https://7ce20b15.r5.cpolar.xyz/api/goods/pay/notify"); - //Map payResult = wechatPayUtil.createBatchOrderAndPay(user.getOpenid(), mainOrderId, totalAmount, orderList.size()); if (payResult != null && Boolean.TRUE.equals(payResult.get("success"))) { Map responseData = new HashMap<>(); responseData.put("mainOrderId", mainOrderId); @@ -8000,5 +7589,202 @@ private void setDefaultConfig(Map configData) { configData.put("hot", new String[]{"水电维修", "家电清洗", "灯具维修", "墙面翻新", "门窗家具", "改造维修", "防水维修"}); configData.put("kf", ""); } +//---------------------------------------------------------会员模块------------------------------------------------------------------------ + + /** + * 会员充值支付接口 + */ + + @PostMapping("api/member/recharge/pay") + public AjaxResult memberRechargePay(@RequestBody Map params, HttpServletRequest request) { + // 1. 验证用户登录状态 + String token = request.getHeader("token"); + Map userValidation = AppletLoginUtil.validateUserToken(token, usersService); + if (!(Boolean) userValidation.get("valid")) { + return AppletControllerUtil.appletWarning("用户未登录或token无效"); + } + // 2. 获取用户信息 + Users user = (Users) userValidation.get("user"); + if (user == null) { + return AppletControllerUtil.appletWarning("用户信息获取失败"); + } + + // 新增参数判断逻辑:只允许 id 和 money 有一个有值,不允许两个都为空或 null,如果两个都有值,只走 id 有值的逻辑 + Object idObj = params.get("id"); + Object moneyObj = params.get("money"); + boolean idEmpty = (idObj == null || idObj.toString().trim().isEmpty()); + boolean moneyEmpty = (moneyObj == null || moneyObj.toString().trim().isEmpty()); + if (idEmpty && moneyEmpty) { + return AppletControllerUtil.appletWarning("参数不能为空,类目和金额必须有一个有值"); + } + // 如果 id 和 money 都有值,只走 id 逻辑,money 置空 + if (!idEmpty && !moneyEmpty) { + moneyObj = null; + } + + String money = ""; + UserMemberRechargeLog userMemberRechargeLog = new UserMemberRechargeLog(); + userMemberRechargeLog.setUid(Math.toIntExact(user.getId())); + userMemberRechargeLog.setOrderid(GenerateCustomCode.generCreateOrder("DYZ")); + userMemberRechargeLog.setPaytype(0); + userMemberRechargeLog.setPaytime(new Date()); + + if (!idEmpty) { // id 有值,优先走 id 逻辑 + UserMemberRechargeProgram userMemberRechargeProgram = userMemberRechargeProgramService.selectUserMemberRechargeProgramById(Integer.valueOf(idObj.toString())); + if (userMemberRechargeProgram != null) { + userMemberRechargeLog.setInmoney(userMemberRechargeProgram.getMoney()); + userMemberRechargeLog.setComemoney(userMemberRechargeProgram.getDiscount()); + userMemberRechargeLog.setReamk("购买" + userMemberRechargeProgram.getRechargename() + "应付" + userMemberRechargeProgram.getMoney() + "元,应到" + userMemberRechargeProgram.getDiscount() + "元"); + userMemberRechargeLog.setProid(userMemberRechargeProgram.getId()); + money = userMemberRechargeProgram.getMoney().toString(); + // type大于0就是会员包年充值,回调需要特殊处理 + if (userMemberRechargeProgram.getType() > 0) { + userMemberRechargeLog.setIsmember(1); + } else { + userMemberRechargeLog.setIsmember(2); + } + } + } else if (!moneyEmpty) { // 只有 money 有值 + money = moneyObj.toString(); + userMemberRechargeLog.setInmoney(new BigDecimal(money)); + userMemberRechargeLog.setComemoney(new BigDecimal(money)); + userMemberRechargeLog.setIsmember(2); + userMemberRechargeLog.setReamk("会员现金充值" + money + "元"); + } + + if (userMemberRechargeLogService.insertUserMemberRechargeLog(userMemberRechargeLog) > 0) { + Map payResult = wechatPayUtil.createBatchOrderAndPay( + user.getOpenid(), + userMemberRechargeLog.getId().toString(), + new BigDecimal("0.01"), + 1, + "https://7ce20b15.r5.cpolar.xyz/api/recharge/pay/notify"); + if (payResult != null && Boolean.TRUE.equals(payResult.get("success"))) { + Map responseData = new HashMap<>(); + responseData.put("mainOrderId", String.valueOf(userMemberRechargeLog.getId().toString())); + //responseData.put("orderList", orderList); + responseData.put("totalAmount", money); + responseData.put("prepayId", payResult.get("prepayId")); + // 直接合并所有支付参数 + responseData.putAll(payResult); + return AppletControllerUtil.appletSuccess(responseData); + } else { + String errorMsg = payResult != null ? (String) payResult.get("message") : "微信支付下单失败"; + return AppletControllerUtil.appletWarning("支付下单失败:" + errorMsg); + } + } + return AppletControllerUtil.appletWarning("支付失败"); + } + + /** + * 获取充值类目(用于充值项目选择) + */ + @GetMapping("/api/member/recharge/catalogue") + public AjaxResult getRechargeCatalogue() { + try { + UserMemberRechargeProgram query = new UserMemberRechargeProgram(); + query.setStatus(0); + query.setType(0); + List list = userMemberRechargeProgramService.selectUserMemberRechargeProgramList(query); + return AppletControllerUtil.appletSuccess(list); + } catch (Exception e) { + return AppletControllerUtil.appletError("获取充值类目失败:" + e.getMessage()); + } + } + + + /** + * 获取包年充值项目 + */ + @GetMapping("/api/member/recharge/catal/{id}") + public AjaxResult getRechargeCatalyear(@PathVariable("id") int id) { + + + try { + + + + + + UserMemberRechargeProgram query = new UserMemberRechargeProgram(); + query.setStatus(0); + query.setType(id); + List list = userMemberRechargeProgramService.selectUserMemberRechargeProgramList(query); + if (!list.isEmpty()){ + return AppletControllerUtil.appletSuccess(list); + }else{ + return AppletControllerUtil.appletWarning("暂无数据"); + } + + } catch (Exception e) { + return AppletControllerUtil.appletError("获取充值类目失败:" + e.getMessage()); + } + } + + + /** + * 获取用户充值记录 + */ + @GetMapping("/api/member/recharge/log") + public AjaxResult getRechargelog(HttpServletRequest request) { + // 1. 验证用户登录状态 + String token = request.getHeader("token"); + Map userValidation = AppletLoginUtil.validateUserToken(token, usersService); + if (!(Boolean) userValidation.get("valid")) { + return AppletControllerUtil.appletWarning("用户未登录或token无效"); + } + // 2. 获取用户信息 + Users user = (Users) userValidation.get("user"); + if (user == null) { + return AppletControllerUtil.appletWarning("用户信息获取失败"); + } + try { + UserMemberRechargeLog query = new UserMemberRechargeLog(); + query.setUid(Math.toIntExact(user.getId())); + + List list = userMemberRechargeLogService.selectUserMemberRechargeLogList(query); + if (!list.isEmpty()){ + return AppletControllerUtil.appletSuccess(list); + }else{ + return AppletControllerUtil.appletWarning("暂无数据"); + } + + } catch (Exception e) { + return AppletControllerUtil.appletError("获取数据失败:" + e.getMessage()); + } + } + + + /** + * 获取用户消费记录 + */ + @GetMapping("/api/member/consumption/log") + public AjaxResult getconsumptionlog(HttpServletRequest request) { + // 1. 验证用户登录状态 + String token = request.getHeader("token"); + Map userValidation = AppletLoginUtil.validateUserToken(token, usersService); + if (!(Boolean) userValidation.get("valid")) { + return AppletControllerUtil.appletWarning("用户未登录或token无效"); + } + // 2. 获取用户信息 + Users user = (Users) userValidation.get("user"); + if (user == null) { + return AppletControllerUtil.appletWarning("用户信息获取失败"); + } + try { + UserMemnerConsumptionLog query = new UserMemnerConsumptionLog(); + query.setUid(Math.toIntExact(user.getId())); + List list = userMemnerConsumptionLogService.selectUserMemnerConsumptionLogList(query); + if (!list.isEmpty()){ + return AppletControllerUtil.appletSuccess(list.getFirst()); + }else{ + return AppletControllerUtil.appletWarning("暂无数据"); + } + + } catch (Exception e) { + return AppletControllerUtil.appletError("获取充值类目失败:" + e.getMessage()); + } + } + } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/CoursorUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/CoursorUtil.java index c31baab..90f9b8b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/CoursorUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/CoursorUtil.java @@ -2,7 +2,9 @@ package com.ruoyi.system.controller; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.spring.SpringUtils; import com.ruoyi.system.ControllerUtil.AppletControllerUtil; +import com.ruoyi.system.ControllerUtil.WechatPayUtil; import com.ruoyi.system.domain.ServiceGoods; import com.ruoyi.system.domain.GoodsOrderCursor; import com.ruoyi.system.service.IServiceGoodsService; @@ -34,41 +36,34 @@ public class CoursorUtil extends BaseController { @Autowired private IGoodsOrderCursorService goodsOrderCursorService; - /** - * 获取服务商品详细信息 - * - * @param id 商品ID - * @param request HTTP请求对象 - * @return 商品详细信息 - *

- * 接口说明: - * - 根据商品ID获取详细信息 - * - type=1时返回服务商品格式 - * - type=2时返回普通商品格式 - * - 包含图片、基础信息等数组数据 - */ - @GetMapping(value = "/api/service/infoData/id/{id}") - public AjaxResult serviceGoodsDataQuery(@PathVariable("id") long id, HttpServletRequest request) { - try { - // 参数验证 - if (id <= 0) { - return AppletControllerUtil.appletError("商品ID无效"); - } - - // 查询商品信息 - ServiceGoods serviceGoodsData = serviceGoodsService.selectServiceGoodsById(id); - if (serviceGoodsData == null) { - return AppletControllerUtil.appletError("商品不存在或已下架"); - } - - // 构建返回数据 - Map goodsData = buildServiceGoodsResponse(serviceGoodsData); - return AppletControllerUtil.appletSuccess(goodsData); - - } catch (Exception e) { - return AppletControllerUtil.appletError("查询商品详情失败:" + e.getMessage()); - } - } +// /** +// * 获取服务商品详细信息 +// * +// +// * @param request HTTP请求对象 +// * @return 商品详细信息 +// *

+// * 接口说明: +// * - 根据商品ID获取详细信息 +// * - type=1时返回服务商品格式 +// * - type=2时返回普通商品格式 +// * - 包含图片、基础信息等数组数据 +// */ +// @GetMapping(value = "/api/service/infoData/id") +// public AjaxResult serviceGoodsDataQuery(HttpServletRequest request) { +// // 测试 payForFriend 方法 +// WechatPayUtil util = SpringUtils.getBean(WechatPayUtil.class); +// String payerOpenid = "oHTYB7fPTrgG_4zw8CQTZ_Yz3QDU"; +// String payeeOpenid = "oHTYB7ctO6k4ICmy73HnU0aNRZIo"; +// int totalFee = 100; // 单位:分 +// String orderNo = "TESTORDER123456"; +// String body = "测试代付"; +// String notifyUrl = "https://yourdomain.com/api/wechat/pay/notify"; +// String remark = "测试备注"; +// Map result = util.payForFriend(payerOpenid, payeeOpenid, totalFee, orderNo, body, notifyUrl, remark); +// System.out.println("payForFriend result: " + result); +// return null; +// } /** * 获取订单游标信息 diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/PayNotifyController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/PayNotifyController.java index 58816e2..913bdf9 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controller/PayNotifyController.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/PayNotifyController.java @@ -3,6 +3,7 @@ package com.ruoyi.system.controller; import com.alibaba.fastjson2.JSONObject; import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.StringUtils; import com.ruoyi.system.ControllerUtil.GenerateCustomCode; import com.ruoyi.system.ControllerUtil.WXsendMsgUtil; @@ -19,7 +20,8 @@ import javax.servlet.http.HttpServletRequest; import java.math.BigDecimal; import java.time.LocalDateTime; import java.time.ZoneId; -import java.util.Date; +import java.util.Calendar; + import java.util.Date; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -75,6 +77,19 @@ public class PayNotifyController extends BaseController { @Autowired private IWorkerMoneyLogService workerMoneyLogService; + + + @Autowired + private IUserMemberRechargeLogService userMemberRechargeLogService; + + @Autowired + private IUserMemberRechargeProgramService userMemberRechargeProgramService; + + @Autowired + private IUserMemnerConsumptionLogService userMemnerConsumptionLogService; + + + /** * 商品支付回调接口 * @@ -157,6 +172,103 @@ public class PayNotifyController extends BaseController { } } + + + + + /** + * 商品支付回调接口 + * + * @param request HTTP请求对象 + * @return XML格式响应给微信服务器 + *IUserMemberRechargeLogService userMemberRechargeLogService; + * 处理商品订单的支付成功回调: + * 1. 验证支付签名 + * 2. 更新商品订单支付状态 + * 3. 更新订单支付时间和交易号 + * 4. 处理库存扣减等业务逻辑 + */ + @PostMapping(value = "/api/recharge/pay/notify") + public String apirechargePayNotify(HttpServletRequest request) { + try { + logger.info("支付回调通知,开始处理..."); + + // 1. 使用WechatPayUtil处理支付回调 + Map notifyResult = wechatPayUtil.handlePayNotify(request); + + // 2. 检查处理结果 + boolean success = (Boolean) notifyResult.get("success"); + String message = (String) notifyResult.get("message"); + + if (!success) { + logger.error("支付回调处理失败:{}", message); + return buildFailResponse("商品支付回调处理失败"); + } + // 3. 获取支付信息 + Map paymentInfo = (Map) notifyResult.get("paymentInfo"); + String outTradeNo = (String) paymentInfo.get("outTradeNo"); + String transactionId = (String) paymentInfo.get("transactionId"); + String totalFee = (String) paymentInfo.get("totalFee"); + UserMemberRechargeLog userMemberRechargeLog = userMemberRechargeLogService.selectUserMemberRechargeLogById(Integer.parseInt(outTradeNo)); + if (userMemberRechargeLog!=null){ + Users users =usersService.selectUsersById(Long.valueOf(userMemberRechargeLog.getUid())); + if (users!=null){ + userMemberRechargeLog.setPaytype(1); + userMemberRechargeLog.setTransactionId(transactionId); + userMemberRechargeLogService.updateUserMemberRechargeLog(userMemberRechargeLog); + users.setBalance(users.getBalance().add(userMemberRechargeLog.getComemoney())); + usersService.updateUsers(users); + WXsendMsgUtil.sendUserPayMoney(users.getOpenid(),"充值成功",totalFee,"1","充值成功"); + //如果是会员包年充值就需要先充值后消费,形成一个用户余额不变动,但是用户的流水里面需要提现出用户的这次消费情况 + if (userMemberRechargeLog.getIsmember()==1){ + UserMemnerConsumptionLog userMemnerConsumptionLog = new UserMemnerConsumptionLog(); + userMemnerConsumptionLog.setUid(Math.toIntExact(users.getId())); + userMemnerConsumptionLog.setConsumptiontype(2); + userMemnerConsumptionLog.setConsumptiontime(new Date()); + userMemnerConsumptionLog.setConsumptionmoney(userMemberRechargeLog.getComemoney()); + userMemnerConsumptionLog.setReamk("会员包年充值"); + userMemnerConsumptionLog.setBeformoney(users.getBalance()); + userMemnerConsumptionLog.setAftermoney(users.getBalance().subtract(userMemberRechargeLog.getComemoney())); + userMemnerConsumptionLog.setNowmoney(users.getBalance().subtract(userMemberRechargeLog.getComemoney())); + userMemnerConsumptionLogService.insertUserMemnerConsumptionLog(userMemnerConsumptionLog); + users.setBalance(users.getBalance().subtract(userMemberRechargeLog.getComemoney())); + users.setIsmember(1); + users.setMemberBegin(new Date()); + //会员结束时间是一年后 + Calendar calendar = Calendar.getInstance(); + calendar.add(Calendar.YEAR, 1); + users.setMemberEnd(calendar.getTime()); + + usersService.updateUsers(users); + } + //WXsendMsgUtil.sendUserForMoneySuccess(users.getOpenid(),userMemberRechargeLog,users); + } + } + Users users1 =usersService.selectUsersById(Long.valueOf(userMemberRechargeLog.getUid())); + //最后无论如何平台流水需要添加,让平台看到流水和账目 + PayMoneyLog payMoneyLog = new PayMoneyLog(); + payMoneyLog.setOid(Long.valueOf(userMemberRechargeLog.getId())); + payMoneyLog.setOrderId(userMemberRechargeLog.getOrderid()); + payMoneyLog.setUid(Long.valueOf(userMemberRechargeLog.getUid())); + payMoneyLog.setUname(users1.getName()); + payMoneyLog.setPrice(userMemberRechargeLog.getInmoney()); + payMoneyLog.setMark(userMemberRechargeLog.getReamk()); + payMoneyLog.setPayTime(new Date()); + payMoneyLogService.insertPayMoneyLog(payMoneyLog); + //sendWechatMessage(users,outTradeNo); + logger.info("用户支付回调处理成功,订单号:{}", outTradeNo); + return buildSuccessResponse(); + + } catch (Exception e) { + logger.error("商品支付回调处理异常:", e); + return buildFailResponse("商品支付回调处理异常"); + } + } + + + + + /** * 上门费支付回调接口 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserBenefitPointsController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserBenefitPointsController.java new file mode 100644 index 0000000..8510a89 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserBenefitPointsController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.UserBenefitPoints; +import com.ruoyi.system.service.IUserBenefitPointsService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 购物消费福利金Controller + * + * @author ruoyi + * @date 2025-06-27 + */ +@RestController +@RequestMapping("/system/points") +public class UserBenefitPointsController extends BaseController +{ + @Autowired + private IUserBenefitPointsService userBenefitPointsService; + + /** + * 查询购物消费福利金列表 + */ + @PreAuthorize("@ss.hasPermi('system:points:list')") + @GetMapping("/list") + public TableDataInfo list(UserBenefitPoints userBenefitPoints) + { + startPage(); + List list = userBenefitPointsService.selectUserBenefitPointsList(userBenefitPoints); + return getDataTable(list); + } + + /** + * 导出购物消费福利金列表 + */ + @PreAuthorize("@ss.hasPermi('system:points:export')") + @Log(title = "购物消费福利金", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, UserBenefitPoints userBenefitPoints) + { + List list = userBenefitPointsService.selectUserBenefitPointsList(userBenefitPoints); + ExcelUtil util = new ExcelUtil(UserBenefitPoints.class); + util.exportExcel(response, list, "购物消费福利金数据"); + } + + /** + * 获取购物消费福利金详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:points:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(userBenefitPointsService.selectUserBenefitPointsById(id)); + } + + /** + * 新增购物消费福利金 + */ + @PreAuthorize("@ss.hasPermi('system:points:add')") + @Log(title = "购物消费福利金", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody UserBenefitPoints userBenefitPoints) + { + return toAjax(userBenefitPointsService.insertUserBenefitPoints(userBenefitPoints)); + } + + /** + * 修改购物消费福利金 + */ + @PreAuthorize("@ss.hasPermi('system:points:edit')") + @Log(title = "购物消费福利金", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody UserBenefitPoints userBenefitPoints) + { + return toAjax(userBenefitPointsService.updateUserBenefitPoints(userBenefitPoints)); + } + + /** + * 删除购物消费福利金 + */ + @PreAuthorize("@ss.hasPermi('system:points:remove')") + @Log(title = "购物消费福利金", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(userBenefitPointsService.deleteUserBenefitPointsByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemberRechargeLogController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemberRechargeLogController.java new file mode 100644 index 0000000..65faf39 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemberRechargeLogController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.UserMemberRechargeLog; +import com.ruoyi.system.service.IUserMemberRechargeLogService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 用户充值记录Controller + * + * @author ruoyi + * @date 2025-06-26 + */ +@RestController +@RequestMapping("/system/UserMemberRechargeLog") +public class UserMemberRechargeLogController extends BaseController +{ + @Autowired + private IUserMemberRechargeLogService userMemberRechargeLogService; + + /** + * 查询用户充值记录列表 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemberRechargeLog:list')") + @GetMapping("/list") + public TableDataInfo list(UserMemberRechargeLog userMemberRechargeLog) + { + startPage(); + List list = userMemberRechargeLogService.selectUserMemberRechargeLogList(userMemberRechargeLog); + return getDataTable(list); + } + + /** + * 导出用户充值记录列表 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemberRechargeLog:export')") + @Log(title = "用户充值记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, UserMemberRechargeLog userMemberRechargeLog) + { + List list = userMemberRechargeLogService.selectUserMemberRechargeLogList(userMemberRechargeLog); + ExcelUtil util = new ExcelUtil(UserMemberRechargeLog.class); + util.exportExcel(response, list, "用户充值记录数据"); + } + + /** + * 获取用户充值记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemberRechargeLog:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(userMemberRechargeLogService.selectUserMemberRechargeLogById(id)); + } + + /** + * 新增用户充值记录 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemberRechargeLog:add')") + @Log(title = "用户充值记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody UserMemberRechargeLog userMemberRechargeLog) + { + return toAjax(userMemberRechargeLogService.insertUserMemberRechargeLog(userMemberRechargeLog)); + } + + /** + * 修改用户充值记录 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemberRechargeLog:edit')") + @Log(title = "用户充值记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody UserMemberRechargeLog userMemberRechargeLog) + { + return toAjax(userMemberRechargeLogService.updateUserMemberRechargeLog(userMemberRechargeLog)); + } + + /** + * 删除用户充值记录 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemberRechargeLog:remove')") + @Log(title = "用户充值记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(userMemberRechargeLogService.deleteUserMemberRechargeLogByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemberRechargeProgramController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemberRechargeProgramController.java new file mode 100644 index 0000000..373f077 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemberRechargeProgramController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.UserMemberRechargeProgram; +import com.ruoyi.system.service.IUserMemberRechargeProgramService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 充值类目Controller + * + * @author ruoyi + * @date 2025-06-26 + */ +@RestController +@RequestMapping("/system/program") +public class UserMemberRechargeProgramController extends BaseController +{ + @Autowired + private IUserMemberRechargeProgramService userMemberRechargeProgramService; + + /** + * 查询充值类目列表 + */ + @PreAuthorize("@ss.hasPermi('system:program:list')") + @GetMapping("/list") + public TableDataInfo list(UserMemberRechargeProgram userMemberRechargeProgram) + { + startPage(); + List list = userMemberRechargeProgramService.selectUserMemberRechargeProgramList(userMemberRechargeProgram); + return getDataTable(list); + } + + /** + * 导出充值类目列表 + */ + @PreAuthorize("@ss.hasPermi('system:program:export')") + @Log(title = "充值类目", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, UserMemberRechargeProgram userMemberRechargeProgram) + { + List list = userMemberRechargeProgramService.selectUserMemberRechargeProgramList(userMemberRechargeProgram); + ExcelUtil util = new ExcelUtil(UserMemberRechargeProgram.class); + util.exportExcel(response, list, "充值类目数据"); + } + + /** + * 获取充值类目详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:program:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(userMemberRechargeProgramService.selectUserMemberRechargeProgramById(Math.toIntExact(id))); + } + + /** + * 新增充值类目 + */ + @PreAuthorize("@ss.hasPermi('system:program:add')") + @Log(title = "充值类目", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody UserMemberRechargeProgram userMemberRechargeProgram) + { + return toAjax(userMemberRechargeProgramService.insertUserMemberRechargeProgram(userMemberRechargeProgram)); + } + + /** + * 修改充值类目 + */ + @PreAuthorize("@ss.hasPermi('system:program:edit')") + @Log(title = "充值类目", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody UserMemberRechargeProgram userMemberRechargeProgram) + { + return toAjax(userMemberRechargeProgramService.updateUserMemberRechargeProgram(userMemberRechargeProgram)); + } + + /** + * 删除充值类目 + */ + @PreAuthorize("@ss.hasPermi('system:program:remove')") + @Log(title = "充值类目", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(userMemberRechargeProgramService.deleteUserMemberRechargeProgramByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemnerConsumptionLogController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemnerConsumptionLogController.java new file mode 100644 index 0000000..dbc85bf --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UserMemnerConsumptionLogController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.UserMemnerConsumptionLog; +import com.ruoyi.system.service.IUserMemnerConsumptionLogService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 用户消费余额记录Controller + * + * @author ruoyi + * @date 2025-06-26 + */ +@RestController +@RequestMapping("/system/UserMemnerConsumptionLog") +public class UserMemnerConsumptionLogController extends BaseController +{ + @Autowired + private IUserMemnerConsumptionLogService userMemnerConsumptionLogService; + + /** + * 查询用户消费余额记录列表 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemnerConsumptionLog:list')") + @GetMapping("/list") + public TableDataInfo list(UserMemnerConsumptionLog userMemnerConsumptionLog) + { + startPage(); + List list = userMemnerConsumptionLogService.selectUserMemnerConsumptionLogList(userMemnerConsumptionLog); + return getDataTable(list); + } + + /** + * 导出用户消费余额记录列表 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemnerConsumptionLog:export')") + @Log(title = "用户消费余额记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, UserMemnerConsumptionLog userMemnerConsumptionLog) + { + List list = userMemnerConsumptionLogService.selectUserMemnerConsumptionLogList(userMemnerConsumptionLog); + ExcelUtil util = new ExcelUtil(UserMemnerConsumptionLog.class); + util.exportExcel(response, list, "用户消费余额记录数据"); + } + + /** + * 获取用户消费余额记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemnerConsumptionLog:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(userMemnerConsumptionLogService.selectUserMemnerConsumptionLogById(id)); + } + + /** + * 新增用户消费余额记录 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemnerConsumptionLog:add')") + @Log(title = "用户消费余额记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody UserMemnerConsumptionLog userMemnerConsumptionLog) + { + return toAjax(userMemnerConsumptionLogService.insertUserMemnerConsumptionLog(userMemnerConsumptionLog)); + } + + /** + * 修改用户消费余额记录 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemnerConsumptionLog:edit')") + @Log(title = "用户消费余额记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody UserMemnerConsumptionLog userMemnerConsumptionLog) + { + return toAjax(userMemnerConsumptionLogService.updateUserMemnerConsumptionLog(userMemnerConsumptionLog)); + } + + /** + * 删除用户消费余额记录 + */ + @PreAuthorize("@ss.hasPermi('system:UserMemnerConsumptionLog:remove')") + @Log(title = "用户消费余额记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(userMemnerConsumptionLogService.deleteUserMemnerConsumptionLogByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersInvoiceInfoController.java b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersInvoiceInfoController.java new file mode 100644 index 0000000..0e41d8b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controller/UsersInvoiceInfoController.java @@ -0,0 +1,104 @@ +package com.ruoyi.system.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.system.domain.UsersInvoiceInfo; +import com.ruoyi.system.service.IUsersInvoiceInfoService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 发票信息Controller + * + * @author ruoyi + * @date 2025-06-27 + */ +@RestController +@RequestMapping("/system/info") +public class UsersInvoiceInfoController extends BaseController +{ + @Autowired + private IUsersInvoiceInfoService usersInvoiceInfoService; + + /** + * 查询发票信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:info:list')") + @GetMapping("/list") + public TableDataInfo list(UsersInvoiceInfo usersInvoiceInfo) + { + startPage(); + List list = usersInvoiceInfoService.selectUsersInvoiceInfoList(usersInvoiceInfo); + return getDataTable(list); + } + + /** + * 导出发票信息列表 + */ + @PreAuthorize("@ss.hasPermi('system:info:export')") + @Log(title = "发票信息", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, UsersInvoiceInfo usersInvoiceInfo) + { + List list = usersInvoiceInfoService.selectUsersInvoiceInfoList(usersInvoiceInfo); + ExcelUtil util = new ExcelUtil(UsersInvoiceInfo.class); + util.exportExcel(response, list, "发票信息数据"); + } + + /** + * 获取发票信息详细信息 + */ + @PreAuthorize("@ss.hasPermi('system:info:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Integer id) + { + return success(usersInvoiceInfoService.selectUsersInvoiceInfoById(id)); + } + + /** + * 新增发票信息 + */ + @PreAuthorize("@ss.hasPermi('system:info:add')") + @Log(title = "发票信息", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody UsersInvoiceInfo usersInvoiceInfo) + { + return toAjax(usersInvoiceInfoService.insertUsersInvoiceInfo(usersInvoiceInfo)); + } + + /** + * 修改发票信息 + */ + @PreAuthorize("@ss.hasPermi('system:info:edit')") + @Log(title = "发票信息", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody UsersInvoiceInfo usersInvoiceInfo) + { + return toAjax(usersInvoiceInfoService.updateUsersInvoiceInfo(usersInvoiceInfo)); + } + + /** + * 删除发票信息 + */ + @PreAuthorize("@ss.hasPermi('system:info:remove')") + @Log(title = "发票信息", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Integer[] ids) + { + return toAjax(usersInvoiceInfoService.deleteUsersInvoiceInfoByIds(ids)); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/AppletControllerUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/AppletControllerUtil.java index 940cc45..623ee3d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/AppletControllerUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/AppletControllerUtil.java @@ -2217,6 +2217,7 @@ public class AppletControllerUtil { String integralTemplate = "pv3cba-wPoinUbBZSskp0KpDNnJwrHqS0rvGBfDNQ1M"; // 积分相关通知 String successTemplate = "YKnuTCAD-oEEhNGoI3LUVkAqNsykOMTcyrf71S9vev8"; // 成功通知 String workerTemplate = "5lA-snytEPl25fBS7rf6rQi8Y0i5HOSdG0JMVdUnMcU"; // 工作人员通知 + String payTemplate = "5rd-P19jRZaOkBXJlsG-SZDx_ZSEkvwIsGt_UoQAF6c"; // 支付消息通知 // 构建不同类型的通知订阅状态 List integralList = new ArrayList<>(); @@ -2242,9 +2243,45 @@ public class AppletControllerUtil { notificationStatus.put("a", workerTemplate); + + List paymsgList = new ArrayList<>(); + paymsgList.add(payTemplate); + notificationStatus.put("payinfo", paymsgList); + + notificationStatus.put("pay_template", payTemplate); + + return notificationStatus; } + + + + + /** + * 构建小程序zhifu通知订阅状态数据 + * + * @param user 用户对象 + * @return 小程序通知订阅状态数据 + */ + public static Map buildMiniProgramNotificationpayStatus(Users user) { + Map notificationStatus = new HashMap<>(); + + // 定义三个消息模板ID + String payTemplate = "5rd-P19jRZaOkBXJlsG-SZDx_ZSEkvwIsGt_UoQAF6c"; // 积分相关通知 + + + List workersList = new ArrayList<>(); + workersList.add(payTemplate); + notificationStatus.put("template_id", workersList); + + notificationStatus.put("template", payTemplate); + + return notificationStatus; + } + + + /** * 验证积分兑换参数 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/BalancePayUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/BalancePayUtil.java new file mode 100644 index 0000000..0ab5068 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/BalancePayUtil.java @@ -0,0 +1,70 @@ +package com.ruoyi.system.ControllerUtil; + +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.utils.spring.SpringUtils; +import com.ruoyi.system.domain.Users; +import com.ruoyi.system.domain.UserMemnerConsumptionLog; +import com.ruoyi.system.service.IUserMemnerConsumptionLogService; +import com.ruoyi.system.service.IUsersService; +import java.math.BigDecimal; +import java.util.Date; + +/** + * 余额支付工具类 + * + * @author + */ +public class BalancePayUtil { + + private static final IUserMemnerConsumptionLogService userMemnerConsumptionLogService = SpringUtils.getBean(IUserMemnerConsumptionLogService.class); + + private static final IUsersService usersService = SpringUtils.getBean(IUsersService.class); + + /** + * 用户余额支付 + * @param user 用户对象 + * @param amount 支付金额 + * @return AjaxResult 支付结果 + */ + public static AjaxResult balancePay(Users user, BigDecimal amount) { + if (user == null || user.getId() == null) { + return AjaxResult.error("用户信息无效"); + } + if (amount == null || amount.compareTo(BigDecimal.ZERO) <= 0) { + return AjaxResult.error("支付金额无效"); + } + if (user.getBalance() == null) { + return AjaxResult.error("用户余额信息异常"); + } + if (user.getBalance().compareTo(amount) < 0) { + return AjaxResult.error("余额不足"); + } + // 记录支付前余额 + BigDecimal beforeBalance = user.getBalance(); + // 扣减余额 + user.setBalance(user.getBalance().subtract(amount)); + int updateResult = usersService.updateUsers(user); + if (updateResult <= 0) { + return AjaxResult.error("扣减余额失败"); + } + // 写入消费记录 + UserMemnerConsumptionLog log = new UserMemnerConsumptionLog(); + log.setUid(Math.toIntExact(user.getId())); + log.setConsumptiontype(1); // 1=余额支付 + log.setConsumptiontime(new Date()); + log.setConsumptionmoney(amount); + log.setReamk("余额支付消费"); + log.setBeformoney(beforeBalance); + log.setAftermoney(user.getBalance()); + log.setNowmoney(user.getBalance()); + userMemnerConsumptionLogService.insertUserMemnerConsumptionLog(log); + // 推送支付成功消息 + try { + WXsendMsgUtil.sendUserPayMoney(user.getOpenid(), "余额支付成功", amount.toString(), "1", "余额支付成功"); + } catch (Exception e) { + // 推送失败不影响主流程 + System.err.println("余额支付消息推送失败: " + e.getMessage()); + } + return AjaxResult.success("余额支付成功"); + } +} \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/WXsendMsgUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/WXsendMsgUtil.java index 3b1acbd..02ac822 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/WXsendMsgUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/WXsendMsgUtil.java @@ -35,6 +35,9 @@ public class WXsendMsgUtil { private static final String PAY_SUCCESS="YKnuTCAD-oEEhNGoI3LUVkAqNsykOMTcyrf71S9vev8"; //下单成功通知 private static final String ORDER_STATUS="5lA-snytEPl25fBS7rf6rQi8Y0i5HOSdG0JMVdUnMcU"; // ##订单状态通知 private static final String PAY_GOODS="pv3cba-wPoinUbBZSskp0KpDNnJwrHqS0rvGBfDNQ1M"; //##商品支付通知 + private static final String PAY_USERS="5rd-P19jRZaOkBXJlsG-SZDx_ZSEkvwIsGt_UoQAF6c"; //##用户支付状态通知 + + /** * 获取微信小程序全局唯一后台接口调用凭据 access_token @@ -341,4 +344,26 @@ public class WXsendMsgUtil { return PublicPush(wxMssVo); } + + + //出发上门的微信推送 + public static String sendUserPayMoney(String openid,String reamk,String paymoney,String status,String nr) throws Exception { + // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); + //拼接推送的模版 + WxMssVo wxMssVo = new WxMssVo(); + wxMssVo.setTouser(openid);//用户的openid(要发送给那个用户,通常这里应该动态传进来的) + wxMssVo.setTemplate_id(ORDER_STATUS);//订阅消息模板id + wxMssVo.setPage("/pages/mine/serveOrder/details"); + Map m = new HashMap<>(3); + m.put("thing2", new TemplateData(nr)); + m.put("amount3", new TemplateData(paymoney)); + m.put("phrase4", new TemplateData(status)); + m.put("thing6", new TemplateData(reamk)); + wxMssVo.setData(m); + return PublicPush(wxMssVo); + } + + + + } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/WechatPayUtil.java b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/WechatPayUtil.java index 07e8e30..965c49b 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/WechatPayUtil.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/controllerUtil/WechatPayUtil.java @@ -366,14 +366,13 @@ public class WechatPayUtil { } /** - * 企业付款到零钱(用于代付完成后的资金转移) + * 企业付款到零钱(微信支付v3接口实现) * * @param transferInfo 付款信息 * @return 付款结果 */ - public Map transferToUser(Map transferInfo) { + public Map transferToUserV3(Map transferInfo) { Map result = new HashMap<>(); - try { // 1. 参数验证 String validationError = validateTransferParams(transferInfo); @@ -382,55 +381,75 @@ public class WechatPayUtil { result.put("message", validationError); return result; } - - // 2. 构建付款参数 - Map params = buildTransferParams(transferInfo); - - // 3. 生成签名 - String sign = generateSign(params, wechatConfig().getApikey()); - params.put("sign", sign); - // 设置请求头,指定字符编码为UTF-8 - HttpHeaders headers = new HttpHeaders(); - headers.set("Content-Type", "application/xml;charset=UTF-8"); - headers.set("Accept", "application/xml;charset=UTF-8"); - headers.set("User-Agent", "Mozilla/5.0"); + // 2. 构建v3接口参数 + // 你需要在WechatConfig中补充v3相关配置,如apiv3Key、privateKeyPath、serialNo + // 并在application.yml中配置 + // 示例: + // wechat.apiv3-key=xxxx + // wechat.private-key-path=classpath:apiclient_key.pem + // wechat.serial-no=xxxx + String appid = wechatConfig().getAppid(); + String mchid = wechatConfig().getMchid(); + // TODO: 你需要在WechatConfig中添加getApiv3Key/getPrivateKeyPath/getSerialNo方法 + String outBatchNo = transferInfo.getOrDefault("outBatchNo", "BATCH" + System.currentTimeMillis()).toString(); + String batchName = transferInfo.getOrDefault("batchName", "企业付款").toString(); + String batchRemark = transferInfo.getOrDefault("batchRemark", "企业付款到零钱").toString(); + int totalAmount = Integer.parseInt(transferInfo.get("amount").toString()); + int totalNum = 1; + String openid = transferInfo.get("openid").toString(); + String detailNo = transferInfo.getOrDefault("detailNo", "DETAIL" + System.currentTimeMillis()).toString(); + String transferRemark = transferInfo.getOrDefault("desc", "企业付款").toString(); + + Map detail = new HashMap<>(); + detail.put("out_detail_no", detailNo); + detail.put("transfer_amount", totalAmount); + detail.put("transfer_remark", transferRemark); + detail.put("openid", openid); + // detail.put("user_name", ...); // 如需校验姓名 + + List> detailList = new ArrayList<>(); + detailList.add(detail); + + Map params = new HashMap<>(); + params.put("appid", appid); + params.put("out_batch_no", outBatchNo); + params.put("batch_name", batchName); + params.put("batch_remark", batchRemark); + params.put("total_amount", totalAmount); + params.put("total_num", totalNum); + params.put("transfer_detail_list", detailList); + + String bodyJson = new com.alibaba.fastjson2.JSONObject(params).toJSONString(); + + // 3. 生成v3签名串,构造Authorization头 + // 你需要实现buildV3Authorization方法,或引入微信支付v3官方SDK + // String authorization = buildV3Authorization("POST", "/v3/transfer/batches", bodyJson, ...); + // TODO: 你需要实现v3签名算法,参考微信官方文档 + String authorization = "请实现v3签名算法,生成Authorization头"; + + // 4. 发送请求 + String v3Url = "https://api.mch.weixin.qq.com/v3/transfer/batches"; + org.springframework.http.HttpHeaders headers = new org.springframework.http.HttpHeaders(); + headers.set("Authorization", authorization); + headers.set("Content-Type", "application/json"); + headers.set("Accept", "application/json"); + org.springframework.http.HttpEntity requestEntity = new org.springframework.http.HttpEntity<>(bodyJson, headers); + org.springframework.http.ResponseEntity response = restTemplate.exchange(v3Url, org.springframework.http.HttpMethod.POST, requestEntity, String.class); - // 4. 发送请求(需要证书) - String xmlRequest = mapToXml(params); - // HttpEntity requestEntity = new HttpEntity<>(xmlRequest, headers); - // 注意:企业付款接口需要使用客户端证书,这里简化处理 - String resourcePath = getClass().getClassLoader().getResource(wechatConfig().getCertpath()).getPath(); - ResponseEntity response = restTemplate.postForEntity(WECHAT_TRANSFER_URL, xmlRequest,String.class, resourcePath); - // 5. 解析响应 - Map responseMap = xmlToMap(response.getBody()); - if (SUCCESS_CODE.equals(responseMap.get("return_code")) && - SUCCESS_CODE.equals(responseMap.get("result_code"))) { - - Map transferResult = new HashMap<>(); - transferResult.put("partnerTradeNo", responseMap.get("partner_trade_no")); - transferResult.put("paymentNo", responseMap.get("payment_no")); - transferResult.put("paymentTime", responseMap.get("payment_time")); - - result.put("success", true); - result.put("transferInfo", transferResult); - result.put("message", "企业付款成功"); - - } else { - result.put("success", false); - result.put("message", "企业付款失败:" + - (responseMap.get("err_code_des") != null ? responseMap.get("err_code_des") : - responseMap.get("return_msg"))); - } - + // 你需要根据微信v3返回结构处理,部分字段加密需用apiv3Key解密 + // 这里只做简单返回 + result.put("success", true); + result.put("response", response.getBody()); + result.put("message", "企业付款v3接口请求已发送,请根据返回内容进一步处理"); } catch (Exception e) { result.put("success", false); - result.put("message", "企业付款异常:" + e.getMessage()); + result.put("message", "企业付款v3异常:" + e.getMessage()); } - return result; } + /** * 获取证书。 * @@ -456,9 +475,19 @@ public class WechatPayUtil { } } - public static void main(String[] args) throws IOException { - getCertificate("D:/javacode/RuoYi-Vue-master/ruoyi-admin/target/classes/wechat/apiclient_cert.p12"); - } +// public static void main(String[] args) throws IOException { +// // 测试 payForFriend 方法 +// WechatPayUtil util = SpringUtils.getBean(WechatPayUtil.class); +// String payerOpenid = "test_payer_openid"; +// String payeeOpenid = "test_payee_openid"; +// int totalFee = 100; // 单位:分 +// String orderNo = "TESTORDER123456"; +// String body = "测试代付"; +// String notifyUrl = "https://yourdomain.com/api/wechat/pay/notify"; +// String remark = "测试备注"; +// Map result = util.payForFriend(payerOpenid, payeeOpenid, totalFee, orderNo, body, notifyUrl, remark); +// System.out.println("payForFriend result: " + result); +// } /** @@ -829,5 +858,194 @@ public class WechatPayUtil { return params; } +// /** +// * 微信代付(企业付款到零钱) +// * @param payerOpenid 代付人openid +// * @param payeeOpenid 被代付人openid +// * @param totalFee 代付金额(单位:分,整型) +// * @param orderNo 原订单号 +// * @param body 商品描述 +// * @param notifyUrl 回调通知地址 +// * @param remark 备注(可选) +// * @return 代付结果Map +// */ +// public Map payForFriend(String payerOpenid, String payeeOpenid, int totalFee, String orderNo, String body, String notifyUrl, String remark) { +// Map payForInfo = new HashMap<>(); +// payForInfo.put("orderNo", orderNo); +// payForInfo.put("payerOpenid", payerOpenid); +// payForInfo.put("payeeOpenid", payeeOpenid); +// payForInfo.put("totalFee", totalFee); +// payForInfo.put("body", body); +// payForInfo.put("notifyUrl", notifyUrl); +// if (remark != null) payForInfo.put("remark", remark); +// // 构建attach +// String attach = buildPayForAttach(payForInfo); +// // 构建转账参数 +// Map transferInfo = new HashMap<>(); +// transferInfo.put("partnerTradeNo", generatePayForOrderNo(orderNo)); +// transferInfo.put("openid", payeeOpenid); +// transferInfo.put("amount", totalFee); +// transferInfo.put("desc", body); +// transferInfo.put("checkName", "NO_CHECK"); +// transferInfo.put("attach", attach); +// // 这里可根据需要添加 reUserName 等参数 +// // 发起企业付款 +// return transferToUser(transferInfo); +// } +// public static void main(String[] args) throws IOException { +// // 测试 payForFriend 方法 +// WechatPayUtil util = SpringUtils.getBean(WechatPayUtil.class); +// String payerOpenid = "oHTYB7fPTrgG_4zw8CQTZ_Yz3QDU"; +// String payeeOpenid = "oHTYB7ctO6k4ICmy73HnU0aNRZIo"; +// int totalFee = 100; // 单位:分 +// String orderNo = "TESTORDER123456"; +// String body = "测试代付"; +// String notifyUrl = "https://yourdomain.com/api/wechat/pay/notify"; +// String remark = "测试备注"; +// Map result = util.payForFriend(payerOpenid, payeeOpenid, totalFee, orderNo, body, notifyUrl, remark); +// System.out.println("payForFriend result: " + result); +// } + +// public static void main(String[] args) throws IOException { +// // 测试 payForFriend 方法 +// WechatPayUtil util = SpringUtils.getBean(WechatPayUtil.class); +// String payerOpenid = "test_payer_openid"; +// String payeeOpenid = "test_payee_openid"; +// int totalFee = 100; // 单位:分 +// String orderNo = "TESTORDER123456"; +// String body = "测试代付"; +// String notifyUrl = "https://yourdomain.com/api/wechat/pay/notify"; +// String remark = "测试备注"; +// Map result = util.payForFriend(payerOpenid, payeeOpenid, totalFee, orderNo, body, notifyUrl, remark); +// System.out.println("payForFriend result: " + result); +// } + + // ===================== 微信支付v3 小程序支付相关接口 ===================== + + /** + * v3 小程序支付下单(JSAPI) + * @param openid 用户openid + * @param orderNo 商户订单号 + * @param totalFee 支付金额(分) + * @param body 商品描述 + * @param notifyUrl 回调通知地址 + * @return 下单结果,包含前端调起支付的参数 + */ + public Map v3JsapiPay(String openid, String orderNo, int totalFee, String body, String notifyUrl) { + Map result = new HashMap<>(); + try { + // 1. 构建v3下单参数 + String appid = wechatConfig().getAppid(); + String mchid = wechatConfig().getMchid(); + // TODO: 你需要在WechatConfig中补充apiv3Key、privateKeyPath、serialNo等配置 + Map amount = new HashMap<>(); + amount.put("total", totalFee); + amount.put("currency", "CNY"); + Map payer = new HashMap<>(); + payer.put("openid", openid); + Map params = new HashMap<>(); + params.put("appid", appid); + params.put("mchid", mchid); + params.put("description", body); + params.put("out_trade_no", orderNo); + params.put("notify_url", notifyUrl); + params.put("amount", amount); + params.put("payer", payer); + String bodyJson = new com.alibaba.fastjson2.JSONObject(params).toJSONString(); + + // 2. 生成v3签名串,构造Authorization头 + // TODO: 你需要实现v3签名算法,生成Authorization头 + String authorization = "请实现v3签名算法,生成Authorization头"; + + // 3. 发送请求 + String v3Url = "https://api.mch.weixin.qq.com/v3/pay/transactions/jsapi"; + org.springframework.http.HttpHeaders headers = new org.springframework.http.HttpHeaders(); + headers.set("Authorization", authorization); + headers.set("Content-Type", "application/json"); + headers.set("Accept", "application/json"); + org.springframework.http.HttpEntity requestEntity = new org.springframework.http.HttpEntity<>(bodyJson, headers); + org.springframework.http.ResponseEntity response = restTemplate.exchange(v3Url, org.springframework.http.HttpMethod.POST, requestEntity, String.class); + + // 4. 解析响应,获取prepay_id + // TODO: 你需要根据微信v3返回结构处理,部分字段加密需用apiv3Key解密 + // 这里只做简单返回 + result.put("success", true); + result.put("response", response.getBody()); + result.put("message", "v3下单接口请求已发送,请根据返回内容进一步处理"); + } catch (Exception e) { + result.put("success", false); + result.put("message", "v3下单异常:" + e.getMessage()); + } + return result; + } + + /** + * v3 申请退款 + * @param orderNo 商户订单号 + * @param refundNo 退款单号 + * @param totalFee 订单总金额(分) + * @param refundFee 退款金额(分) + * @param reason 退款原因 + * @param notifyUrl 退款回调通知地址 + * @return 退款结果 + */ + public Map v3Refund(String orderNo, String refundNo, int totalFee, int refundFee, String reason, String notifyUrl) { + Map result = new HashMap<>(); + try { + String appid = wechatConfig().getAppid(); + String mchid = wechatConfig().getMchid(); + // TODO: 你需要在WechatConfig中补充apiv3Key、privateKeyPath、serialNo等配置 + Map amount = new HashMap<>(); + amount.put("refund", refundFee); + amount.put("total", totalFee); + amount.put("currency", "CNY"); + Map params = new HashMap<>(); + params.put("out_trade_no", orderNo); + params.put("out_refund_no", refundNo); + params.put("reason", reason); + params.put("notify_url", notifyUrl); + params.put("amount", amount); + String bodyJson = new com.alibaba.fastjson2.JSONObject(params).toJSONString(); + + // 2. 生成v3签名串,构造Authorization头 + // TODO: 你需要实现v3签名算法,生成Authorization头 + String authorization = "请实现v3签名算法,生成Authorization头"; + + // 3. 发送请求 + String v3Url = "https://api.mch.weixin.qq.com/v3/refund/domestic/refunds"; + org.springframework.http.HttpHeaders headers = new org.springframework.http.HttpHeaders(); + headers.set("Authorization", authorization); + headers.set("Content-Type", "application/json"); + headers.set("Accept", "application/json"); + org.springframework.http.HttpEntity requestEntity = new org.springframework.http.HttpEntity<>(bodyJson, headers); + org.springframework.http.ResponseEntity response = restTemplate.exchange(v3Url, org.springframework.http.HttpMethod.POST, requestEntity, String.class); + + // 4. 解析响应 + // TODO: 你需要根据微信v3返回结构处理,部分字段加密需用apiv3Key解密 + result.put("success", true); + result.put("response", response.getBody()); + result.put("message", "v3退款接口请求已发送,请根据返回内容进一步处理"); + } catch (Exception e) { + result.put("success", false); + result.put("message", "v3退款异常:" + e.getMessage()); + } + return result; + } + + /** + * v3 商户提现(转账到零钱) + * @param openid 用户openid + * @param amount 金额(分) + * @param desc 提现描述 + * @return 提现结果 + */ + public Map v3Withdraw(String openid, int amount, String desc) { + Map transferInfo = new HashMap<>(); + transferInfo.put("openid", openid); + transferInfo.put("amount", amount); + transferInfo.put("desc", desc); + // 你可以根据需要补充outBatchNo、batchName、batchRemark等参数 + return transferToUserV3(transferInfo); + } } \ No newline at end of file diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserBenefitPoints.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserBenefitPoints.java new file mode 100644 index 0000000..1336a44 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserBenefitPoints.java @@ -0,0 +1,223 @@ +package com.ruoyi.system.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 购物消费福利金对象 user_benefit_points + * + * @author ruoyi + * @date 2025-06-27 + */ +public class UserBenefitPoints extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + private Long id; + + /** 类别 1服务金 2消费金 */ + @Excel(name = "类别 1服务金 2消费金") + private Long type; + + /** 操作时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "操作时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date dotime; + + /** 订单金额 */ + @Excel(name = "订单金额") + private BigDecimal ordermoney; + + /** 金额 */ + @Excel(name = "金额") + private BigDecimal money; + + /** 数据类别 1收入 2支出 */ + @Excel(name = "数据类别 1收入 2支出") + private Long ordertype; + + /** 用户id */ + @Excel(name = "用户id") + private Long uid; + + /** 操作前用户余额 */ + @Excel(name = "操作前用户余额") + private BigDecimal beformoney; + + /** 操作后用户余额 */ + @Excel(name = "操作后用户余额") + private BigDecimal aftremoney; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createdAt; + + /** 修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date updatedAt; + + /** 对应订单 id */ + @Excel(name = "对应订单 id") + private Long orderid; + + /** 备注说明 */ + @Excel(name = "备注说明") + private String reamk; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setType(Long type) + { + this.type = type; + } + + public Long getType() + { + return type; + } + + public void setDotime(Date dotime) + { + this.dotime = dotime; + } + + public Date getDotime() + { + return dotime; + } + + public void setOrdermoney(BigDecimal ordermoney) + { + this.ordermoney = ordermoney; + } + + public BigDecimal getOrdermoney() + { + return ordermoney; + } + + public void setMoney(BigDecimal money) + { + this.money = money; + } + + public BigDecimal getMoney() + { + return money; + } + + public void setOrdertype(Long ordertype) + { + this.ordertype = ordertype; + } + + public Long getOrdertype() + { + return ordertype; + } + + public void setUid(Long uid) + { + this.uid = uid; + } + + public Long getUid() + { + return uid; + } + + public void setBeformoney(BigDecimal beformoney) + { + this.beformoney = beformoney; + } + + public BigDecimal getBeformoney() + { + return beformoney; + } + + public void setAftremoney(BigDecimal aftremoney) + { + this.aftremoney = aftremoney; + } + + public BigDecimal getAftremoney() + { + return aftremoney; + } + + public void setCreatedAt(Date createdAt) + { + this.createdAt = createdAt; + } + + public Date getCreatedAt() + { + return createdAt; + } + + public void setUpdatedAt(Date updatedAt) + { + this.updatedAt = updatedAt; + } + + public Date getUpdatedAt() + { + return updatedAt; + } + + public void setOrderid(Long orderid) + { + this.orderid = orderid; + } + + public Long getOrderid() + { + return orderid; + } + + public void setReamk(String reamk) + { + this.reamk = reamk; + } + + public String getReamk() + { + return reamk; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("type", getType()) + .append("dotime", getDotime()) + .append("ordermoney", getOrdermoney()) + .append("money", getMoney()) + .append("ordertype", getOrdertype()) + .append("uid", getUid()) + .append("beformoney", getBeformoney()) + .append("aftremoney", getAftremoney()) + .append("createdAt", getCreatedAt()) + .append("updatedAt", getUpdatedAt()) + .append("orderid", getOrderid()) + .append("reamk", getReamk()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemberRechargeLog.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemberRechargeLog.java new file mode 100644 index 0000000..fe44ac4 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemberRechargeLog.java @@ -0,0 +1,240 @@ +package com.ruoyi.system.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 用户充值记录对象 user_member_recharge_log + * + * @author ruoyi + * @date 2025-06-26 + */ +public class UserMemberRechargeLog extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** id主键 */ + private Integer id; + + /** 用户id */ + @Excel(name = "用户id") + private Integer uid; + + /** 支付方式0 微信,1其他(预留) */ + @Excel(name = "支付方式0 微信,1其他", readConverterExp = "预=留") + private Integer paytype; + + /** 支付时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date paytime; + + /** 充值金额 */ + @Excel(name = "充值金额") + private BigDecimal inmoney; + + /** 微信支付单号 */ + @Excel(name = "微信支付单号") + private String transactionId; + + /** 微信充值单号 */ + @Excel(name = "充值单号") + private String orderid; + + + /** 充值产品id */ + @Excel(name = "充值产品id") + private Integer proid; + + + /** 微信充值单号 */ + @Excel(name = "应到账金额") + private BigDecimal comemoney; + + + /** 微信充值单号 */ + @Excel(name = "充值说明") + private String reamk; + + /** 充值产品id */ + @Excel(name = "此次支付是否购买会员 1是 2不是") + private Integer ismember; + + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createdAt; + + /** 修改时间 */ + private Date updatedAt; + + /** 隐藏时间 */ + private Date deletedAt; + + /** 逻辑删除状态0正常显示,1不给人显示,但数据还在 */ + private Integer del; + + public void setId(Integer id) + { + this.id = id; + } + + public Integer getId() + { + return id; + } + + public void setUid(Integer uid) + { + this.uid = uid; + } + + public Integer getUid() + { + return uid; + } + + public void setPaytype(Integer paytype) + { + this.paytype = paytype; + } + + public Integer getPaytype() + { + return paytype; + } + + public void setPaytime(Date paytime) + { + this.paytime = paytime; + } + + public Date getPaytime() + { + return paytime; + } + + public void setInmoney(BigDecimal inmoney) + { + this.inmoney = inmoney; + } + + public BigDecimal getInmoney() + { + return inmoney; + } + + public void setTransactionId(String transactionId) + { + this.transactionId = transactionId; + } + + public String getTransactionId() + { + return transactionId; + } + + public void setCreatedAt(Date createdAt) + { + this.createdAt = createdAt; + } + + public Date getCreatedAt() + { + return createdAt; + } + + public void setUpdatedAt(Date updatedAt) + { + this.updatedAt = updatedAt; + } + + public Date getUpdatedAt() + { + return updatedAt; + } + + public void setDeletedAt(Date deletedAt) + { + this.deletedAt = deletedAt; + } + + public Date getDeletedAt() + { + return deletedAt; + } + + public void setDel(Integer del) + { + this.del = del; + } + + public Integer getDel() + { + return del; + } + + public String getOrderid() { + return orderid; + } + + public void setOrderid(String orderid) { + this.orderid = orderid; + } + + + public Integer getProid() { + return proid; + } + + public void setProid(Integer proid) { + this.proid = proid; + } + + public BigDecimal getComemoney() { + return comemoney; + } + + public void setComemoney(BigDecimal comemoney) { + this.comemoney = comemoney; + } + + public String getReamk() { + return reamk; + } + + public void setReamk(String reamk) { + this.reamk = reamk; + } + + + public Integer getIsmember() { + return ismember; + } + + public void setIsmember(Integer ismember) { + this.ismember = ismember; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("uid", getUid()) + .append("paytype", getPaytype()) + .append("paytime", getPaytime()) + .append("inmoney", getInmoney()) + .append("transactionId", getTransactionId()) + .append("createdAt", getCreatedAt()) + .append("updatedAt", getUpdatedAt()) + .append("deletedAt", getDeletedAt()) + .append("del", getDel()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemberRechargeProgram.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemberRechargeProgram.java new file mode 100644 index 0000000..916dd5b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemberRechargeProgram.java @@ -0,0 +1,174 @@ +package com.ruoyi.system.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 充值类目对象 user_member_recharge_program + * + * @author ruoyi + * @date 2025-06-26 + */ +public class UserMemberRechargeProgram extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Integer id; + + /** 充值说明 */ + @Excel(name = "充值说明") + private String rechargename; + + /** 充值金额 */ + @Excel(name = "充值金额") + private BigDecimal money; + + /** 优惠后金额 */ + @Excel(name = "优惠后金额") + private BigDecimal discount; + + /** 备注 */ + @Excel(name = "备注") + private String reamk; + + /** 状态 */ + @Excel(name = "状态") + private Integer status; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createdAt; + + /** 修改时间 */ + private Date updatedAt; + + /** 删除时间 */ + private Date deletedAt; + + /** 类别 */ + @Excel(name = "类别") + private Integer type; + + public void setId(Integer id) + { + this.id = id; + } + + public Integer getId() + { + return id; + } + + public void setRechargename(String rechargename) + { + this.rechargename = rechargename; + } + + public String getRechargename() + { + return rechargename; + } + + public void setMoney(BigDecimal money) + { + this.money = money; + } + + public BigDecimal getMoney() + { + return money; + } + + public void setDiscount(BigDecimal discount) + { + this.discount = discount; + } + + public BigDecimal getDiscount() + { + return discount; + } + + public void setReamk(String reamk) + { + this.reamk = reamk; + } + + public String getReamk() + { + return reamk; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + + public void setCreatedAt(Date createdAt) + { + this.createdAt = createdAt; + } + + public Date getCreatedAt() + { + return createdAt; + } + + public void setUpdatedAt(Date updatedAt) + { + this.updatedAt = updatedAt; + } + + public Date getUpdatedAt() + { + return updatedAt; + } + + public void setDeletedAt(Date deletedAt) + { + this.deletedAt = deletedAt; + } + + public Date getDeletedAt() + { + return deletedAt; + } + + public void setType(Integer type) + { + this.type = type; + } + + public Integer getType() + { + return type; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("rechargename", getRechargename()) + .append("money", getMoney()) + .append("discount", getDiscount()) + .append("reamk", getReamk()) + .append("status", getStatus()) + .append("createdAt", getCreatedAt()) + .append("updatedAt", getUpdatedAt()) + .append("deletedAt", getDeletedAt()) + .append("type", getType()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemnerConsumptionLog.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemnerConsumptionLog.java new file mode 100644 index 0000000..caec52a --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UserMemnerConsumptionLog.java @@ -0,0 +1,220 @@ +package com.ruoyi.system.domain; + +import java.math.BigDecimal; +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 用户消费余额记录对象 user_memner_consumption_log + * + * @author ruoyi + * @date 2025-06-26 + */ +public class UserMemnerConsumptionLog extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键id */ + private Integer id; + + /** 用户id */ + @Excel(name = "用户id") + private Integer uid; + + /** 消费类别 0商城消费 1服务类消费 2其他消费 */ + @Excel(name = "消费类别 0商城消费 1服务类消费 2其他消费") + private Integer consumptiontype; + + /** 消费时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "消费时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date consumptiontime; + + /** 消费金额 */ + @Excel(name = "消费金额") + private BigDecimal consumptionmoney; + + /** 备注说明 */ + @Excel(name = "备注说明") + private String reamk; + + /** 消费前用户余额 */ + @Excel(name = "消费前用户余额") + private BigDecimal beformoney; + + /** 消费后用户余额 */ + @Excel(name = "消费后用户余额") + private BigDecimal aftermoney; + + /** 当前用户余额 */ + @Excel(name = "当前用户余额") + private BigDecimal nowmoney; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createdAt; + + /** 修改时间 */ + private Date updatedAt; + + /** 删除时间 */ + private Date deletedAt; + + /** 删除标记 */ + @Excel(name = "删除标记") + private Integer del; + + public void setId(Integer id) + { + this.id = id; + } + + public Integer getId() + { + return id; + } + + public void setUid(Integer uid) + { + this.uid = uid; + } + + public Integer getUid() + { + return uid; + } + + public void setConsumptiontype(Integer consumptiontype) + { + this.consumptiontype = consumptiontype; + } + + public Integer getConsumptiontype() + { + return consumptiontype; + } + + public void setConsumptiontime(Date consumptiontime) + { + this.consumptiontime = consumptiontime; + } + + public Date getConsumptiontime() + { + return consumptiontime; + } + + public void setConsumptionmoney(BigDecimal consumptionmoney) + { + this.consumptionmoney = consumptionmoney; + } + + public BigDecimal getConsumptionmoney() + { + return consumptionmoney; + } + + public void setReamk(String reamk) + { + this.reamk = reamk; + } + + public String getReamk() + { + return reamk; + } + + public void setBeformoney(BigDecimal beformoney) + { + this.beformoney = beformoney; + } + + public BigDecimal getBeformoney() + { + return beformoney; + } + + public void setAftermoney(BigDecimal aftermoney) + { + this.aftermoney = aftermoney; + } + + public BigDecimal getAftermoney() + { + return aftermoney; + } + + public void setNowmoney(BigDecimal nowmoney) + { + this.nowmoney = nowmoney; + } + + public BigDecimal getNowmoney() + { + return nowmoney; + } + + public void setCreatedAt(Date createdAt) + { + this.createdAt = createdAt; + } + + public Date getCreatedAt() + { + return createdAt; + } + + public void setUpdatedAt(Date updatedAt) + { + this.updatedAt = updatedAt; + } + + public Date getUpdatedAt() + { + return updatedAt; + } + + public void setDeletedAt(Date deletedAt) + { + this.deletedAt = deletedAt; + } + + public Date getDeletedAt() + { + return deletedAt; + } + + public void setDel(Integer del) + { + this.del = del; + } + + public Integer getDel() + { + return del; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("uid", getUid()) + .append("consumptiontype", getConsumptiontype()) + .append("consumptiontime", getConsumptiontime()) + .append("consumptionmoney", getConsumptionmoney()) + .append("reamk", getReamk()) + .append("beformoney", getBeformoney()) + .append("aftermoney", getAftermoney()) + .append("nowmoney", getNowmoney()) + .append("createdAt", getCreatedAt()) + .append("updatedAt", getUpdatedAt()) + .append("deletedAt", getDeletedAt()) + .append("del", getDel()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Users.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Users.java index 41eb299..31f39c7 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/domain/Users.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/Users.java @@ -137,6 +137,35 @@ public class Users extends BaseEntity @Excel(name = "1:虚拟号码-已认证") private Integer middleAuth; + + @Excel(name = "用户余额") + private BigDecimal balance; + + @Excel(name = "消费金") + private BigDecimal consumption; + + @Excel(name = "服务金") + private BigDecimal servicefee; + + @Excel(name = "会员 0:不是 1:是") + private Integer ismember; + + /** 禁止接单开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "会员开始时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date memberBegin; + + /** 禁止接单开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "会员结束时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date memberEnd; + + + /** 禁止接单开始时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "生日", width = 30, dateFormat = "yyyy-MM-dd") + private Date birthday; + /** $column.columnComment */ @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") private Date createdAt; @@ -539,6 +568,63 @@ public class Users extends BaseEntity this.goods_order_num = goods_order_num; } + public Date getMemberEnd() { + return memberEnd; + } + + public void setMemberEnd(Date memberEnd) { + this.memberEnd = memberEnd; + } + + public Date getMemberBegin() { + return memberBegin; + } + + public void setMemberBegin(Date memberBegin) { + this.memberBegin = memberBegin; + } + + public Integer getIsmember() { + return ismember; + } + + public void setIsmember(Integer ismember) { + this.ismember = ismember; + } + + public BigDecimal getBalance() { + return balance; + } + + public void setBalance(BigDecimal balance) { + this.balance = balance; + } + + + public BigDecimal getServicefee() { + return servicefee; + } + + public void setServicefee(BigDecimal servicefee) { + this.servicefee = servicefee; + } + + public BigDecimal getConsumption() { + return consumption; + } + + public void setConsumption(BigDecimal consumption) { + this.consumption = consumption; + } + + public Date getBirthday() { + return birthday; + } + + public void setBirthday(Date birthday) { + this.birthday = birthday; + } + @Override public String toString() { return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/domain/UsersInvoiceInfo.java b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UsersInvoiceInfo.java new file mode 100644 index 0000000..c8433ea --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/domain/UsersInvoiceInfo.java @@ -0,0 +1,236 @@ +package com.ruoyi.system.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 发票信息对象 users_invoice_info + * + * @author ruoyi + * @date 2025-06-27 + */ +public class UsersInvoiceInfo extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键ID */ + private Integer id; + + /** 维护人员ID(关联users表) */ + @Excel(name = "维护人员ID", readConverterExp = "关=联users表") + private Integer uid; + + /** 发票抬头 */ + @Excel(name = "发票抬头") + private String invoiceTitle; + + /** 纳税人识别号 */ + @Excel(name = "纳税人识别号") + private String taxNumber; + + /** 开户银行 */ + @Excel(name = "开户银行") + private String bankName; + + /** 银行账号 */ + @Excel(name = "银行账号") + private String bankAccount; + + /** 单位地址 */ + @Excel(name = "单位地址") + private String address; + + /** 联系电话 */ + @Excel(name = "联系电话") + private String phone; + + /** 联系邮箱 */ + @Excel(name = "联系邮箱") + private String email; + + /** 微信号 */ + @Excel(name = "微信号") + private String wechat; + + /** 发票类型(1-增值税普通发票 2-专用发票) */ + @Excel(name = "发票类型", readConverterExp = "1=-增值税普通发票,2=-专用发票") + private Integer type; + + /** 发票类别(0-个人,1-企业) */ + @Excel(name = "发票类别", readConverterExp = "0=-个人,1-企业") + private Integer category; + + /** 创建时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date createdAt; + + /** 修改时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "修改时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date updatedAt; + + public void setId(Integer id) + { + this.id = id; + } + + public Integer getId() + { + return id; + } + + public void setUid(Integer uid) + { + this.uid = uid; + } + + public Integer getUid() + { + return uid; + } + + public void setInvoiceTitle(String invoiceTitle) + { + this.invoiceTitle = invoiceTitle; + } + + public String getInvoiceTitle() + { + return invoiceTitle; + } + + public void setTaxNumber(String taxNumber) + { + this.taxNumber = taxNumber; + } + + public String getTaxNumber() + { + return taxNumber; + } + + public void setBankName(String bankName) + { + this.bankName = bankName; + } + + public String getBankName() + { + return bankName; + } + + public void setBankAccount(String bankAccount) + { + this.bankAccount = bankAccount; + } + + public String getBankAccount() + { + return bankAccount; + } + + public void setAddress(String address) + { + this.address = address; + } + + public String getAddress() + { + return address; + } + + public void setPhone(String phone) + { + this.phone = phone; + } + + public String getPhone() + { + return phone; + } + + public void setEmail(String email) + { + this.email = email; + } + + public String getEmail() + { + return email; + } + + public void setWechat(String wechat) + { + this.wechat = wechat; + } + + public String getWechat() + { + return wechat; + } + + public void setType(Integer type) + { + this.type = type; + } + + public Integer getType() + { + return type; + } + + public void setCategory(Integer category) + { + this.category = category; + } + + public Integer getCategory() + { + return category; + } + + public void setCreatedAt(Date createdAt) + { + this.createdAt = createdAt; + } + + public Date getCreatedAt() + { + return createdAt; + } + + public void setUpdatedAt(Date updatedAt) + { + this.updatedAt = updatedAt; + } + + public Date getUpdatedAt() + { + return updatedAt; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("uid", getUid()) + .append("invoiceTitle", getInvoiceTitle()) + .append("taxNumber", getTaxNumber()) + .append("bankName", getBankName()) + .append("bankAccount", getBankAccount()) + .append("address", getAddress()) + .append("phone", getPhone()) + .append("email", getEmail()) + .append("wechat", getWechat()) + .append("type", getType()) + .append("category", getCategory()) + .append("createdAt", getCreatedAt()) + .append("updatedAt", getUpdatedAt()) + .toString(); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBenefitPointsMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBenefitPointsMapper.java new file mode 100644 index 0000000..edbef97 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserBenefitPointsMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.UserBenefitPoints; + +/** + * 购物消费福利金Mapper接口 + * + * @author ruoyi + * @date 2025-06-27 + */ +public interface UserBenefitPointsMapper +{ + /** + * 查询购物消费福利金 + * + * @param id 购物消费福利金主键 + * @return 购物消费福利金 + */ + public UserBenefitPoints selectUserBenefitPointsById(Long id); + + /** + * 查询购物消费福利金列表 + * + * @param userBenefitPoints 购物消费福利金 + * @return 购物消费福利金集合 + */ + public List selectUserBenefitPointsList(UserBenefitPoints userBenefitPoints); + + /** + * 新增购物消费福利金 + * + * @param userBenefitPoints 购物消费福利金 + * @return 结果 + */ + public int insertUserBenefitPoints(UserBenefitPoints userBenefitPoints); + + /** + * 修改购物消费福利金 + * + * @param userBenefitPoints 购物消费福利金 + * @return 结果 + */ + public int updateUserBenefitPoints(UserBenefitPoints userBenefitPoints); + + /** + * 删除购物消费福利金 + * + * @param id 购物消费福利金主键 + * @return 结果 + */ + public int deleteUserBenefitPointsById(Long id); + + /** + * 批量删除购物消费福利金 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteUserBenefitPointsByIds(Long[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemberRechargeLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemberRechargeLogMapper.java new file mode 100644 index 0000000..94188d2 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemberRechargeLogMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.UserMemberRechargeLog; + +/** + * 用户充值记录Mapper接口 + * + * @author ruoyi + * @date 2025-06-26 + */ +public interface UserMemberRechargeLogMapper +{ + /** + * 查询用户充值记录 + * + * @param id 用户充值记录主键 + * @return 用户充值记录 + */ + public UserMemberRechargeLog selectUserMemberRechargeLogById(Integer id); + + /** + * 查询用户充值记录列表 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 用户充值记录集合 + */ + public List selectUserMemberRechargeLogList(UserMemberRechargeLog userMemberRechargeLog); + + /** + * 新增用户充值记录 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 结果 + */ + public int insertUserMemberRechargeLog(UserMemberRechargeLog userMemberRechargeLog); + + /** + * 修改用户充值记录 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 结果 + */ + public int updateUserMemberRechargeLog(UserMemberRechargeLog userMemberRechargeLog); + + /** + * 删除用户充值记录 + * + * @param id 用户充值记录主键 + * @return 结果 + */ + public int deleteUserMemberRechargeLogById(Integer id); + + /** + * 批量删除用户充值记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteUserMemberRechargeLogByIds(Integer[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemberRechargeProgramMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemberRechargeProgramMapper.java new file mode 100644 index 0000000..618bdfd --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemberRechargeProgramMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.UserMemberRechargeProgram; + +/** + * 充值类目Mapper接口 + * + * @author ruoyi + * @date 2025-06-26 + */ +public interface UserMemberRechargeProgramMapper +{ + /** + * 查询充值类目 + * + * @param id 充值类目主键 + * @return 充值类目 + */ + public UserMemberRechargeProgram selectUserMemberRechargeProgramById(Integer id); + + /** + * 查询充值类目列表 + * + * @param userMemberRechargeProgram 充值类目 + * @return 充值类目集合 + */ + public List selectUserMemberRechargeProgramList(UserMemberRechargeProgram userMemberRechargeProgram); + + /** + * 新增充值类目 + * + * @param userMemberRechargeProgram 充值类目 + * @return 结果 + */ + public int insertUserMemberRechargeProgram(UserMemberRechargeProgram userMemberRechargeProgram); + + /** + * 修改充值类目 + * + * @param userMemberRechargeProgram 充值类目 + * @return 结果 + */ + public int updateUserMemberRechargeProgram(UserMemberRechargeProgram userMemberRechargeProgram); + + /** + * 删除充值类目 + * + * @param id 充值类目主键 + * @return 结果 + */ + public int deleteUserMemberRechargeProgramById(Long id); + + /** + * 批量删除充值类目 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteUserMemberRechargeProgramByIds(Long[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemnerConsumptionLogMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemnerConsumptionLogMapper.java new file mode 100644 index 0000000..757f254 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UserMemnerConsumptionLogMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.UserMemnerConsumptionLog; + +/** + * 用户消费余额记录Mapper接口 + * + * @author ruoyi + * @date 2025-06-26 + */ +public interface UserMemnerConsumptionLogMapper +{ + /** + * 查询用户消费余额记录 + * + * @param id 用户消费余额记录主键 + * @return 用户消费余额记录 + */ + public UserMemnerConsumptionLog selectUserMemnerConsumptionLogById(Integer id); + + /** + * 查询用户消费余额记录列表 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 用户消费余额记录集合 + */ + public List selectUserMemnerConsumptionLogList(UserMemnerConsumptionLog userMemnerConsumptionLog); + + /** + * 新增用户消费余额记录 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 结果 + */ + public int insertUserMemnerConsumptionLog(UserMemnerConsumptionLog userMemnerConsumptionLog); + + /** + * 修改用户消费余额记录 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 结果 + */ + public int updateUserMemnerConsumptionLog(UserMemnerConsumptionLog userMemnerConsumptionLog); + + /** + * 删除用户消费余额记录 + * + * @param id 用户消费余额记录主键 + * @return 结果 + */ + public int deleteUserMemnerConsumptionLogById(Integer id); + + /** + * 批量删除用户消费余额记录 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteUserMemnerConsumptionLogByIds(Integer[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UsersInvoiceInfoMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UsersInvoiceInfoMapper.java new file mode 100644 index 0000000..80beb77 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/UsersInvoiceInfoMapper.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.mapper; + +import java.util.List; +import com.ruoyi.system.domain.UsersInvoiceInfo; + +/** + * 发票信息Mapper接口 + * + * @author ruoyi + * @date 2025-06-27 + */ +public interface UsersInvoiceInfoMapper +{ + /** + * 查询发票信息 + * + * @param id 发票信息主键 + * @return 发票信息 + */ + public UsersInvoiceInfo selectUsersInvoiceInfoById(Integer id); + + /** + * 查询发票信息列表 + * + * @param usersInvoiceInfo 发票信息 + * @return 发票信息集合 + */ + public List selectUsersInvoiceInfoList(UsersInvoiceInfo usersInvoiceInfo); + + /** + * 新增发票信息 + * + * @param usersInvoiceInfo 发票信息 + * @return 结果 + */ + public int insertUsersInvoiceInfo(UsersInvoiceInfo usersInvoiceInfo); + + /** + * 修改发票信息 + * + * @param usersInvoiceInfo 发票信息 + * @return 结果 + */ + public int updateUsersInvoiceInfo(UsersInvoiceInfo usersInvoiceInfo); + + /** + * 删除发票信息 + * + * @param id 发票信息主键 + * @return 结果 + */ + public int deleteUsersInvoiceInfoById(Integer id); + + /** + * 批量删除发票信息 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteUsersInvoiceInfoByIds(Integer[] ids); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserBenefitPointsService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserBenefitPointsService.java new file mode 100644 index 0000000..8993ae0 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserBenefitPointsService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.UserBenefitPoints; + +/** + * 购物消费福利金Service接口 + * + * @author ruoyi + * @date 2025-06-27 + */ +public interface IUserBenefitPointsService +{ + /** + * 查询购物消费福利金 + * + * @param id 购物消费福利金主键 + * @return 购物消费福利金 + */ + public UserBenefitPoints selectUserBenefitPointsById(Long id); + + /** + * 查询购物消费福利金列表 + * + * @param userBenefitPoints 购物消费福利金 + * @return 购物消费福利金集合 + */ + public List selectUserBenefitPointsList(UserBenefitPoints userBenefitPoints); + + /** + * 新增购物消费福利金 + * + * @param userBenefitPoints 购物消费福利金 + * @return 结果 + */ + public int insertUserBenefitPoints(UserBenefitPoints userBenefitPoints); + + /** + * 修改购物消费福利金 + * + * @param userBenefitPoints 购物消费福利金 + * @return 结果 + */ + public int updateUserBenefitPoints(UserBenefitPoints userBenefitPoints); + + /** + * 批量删除购物消费福利金 + * + * @param ids 需要删除的购物消费福利金主键集合 + * @return 结果 + */ + public int deleteUserBenefitPointsByIds(Long[] ids); + + /** + * 删除购物消费福利金信息 + * + * @param id 购物消费福利金主键 + * @return 结果 + */ + public int deleteUserBenefitPointsById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemberRechargeLogService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemberRechargeLogService.java new file mode 100644 index 0000000..5ce3d46 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemberRechargeLogService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.UserMemberRechargeLog; + +/** + * 用户充值记录Service接口 + * + * @author ruoyi + * @date 2025-06-26 + */ +public interface IUserMemberRechargeLogService +{ + /** + * 查询用户充值记录 + * + * @param id 用户充值记录主键 + * @return 用户充值记录 + */ + public UserMemberRechargeLog selectUserMemberRechargeLogById(Integer id); + + /** + * 查询用户充值记录列表 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 用户充值记录集合 + */ + public List selectUserMemberRechargeLogList(UserMemberRechargeLog userMemberRechargeLog); + + /** + * 新增用户充值记录 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 结果 + */ + public int insertUserMemberRechargeLog(UserMemberRechargeLog userMemberRechargeLog); + + /** + * 修改用户充值记录 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 结果 + */ + public int updateUserMemberRechargeLog(UserMemberRechargeLog userMemberRechargeLog); + + /** + * 批量删除用户充值记录 + * + * @param ids 需要删除的用户充值记录主键集合 + * @return 结果 + */ + public int deleteUserMemberRechargeLogByIds(Integer[] ids); + + /** + * 删除用户充值记录信息 + * + * @param id 用户充值记录主键 + * @return 结果 + */ + public int deleteUserMemberRechargeLogById(Integer id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemberRechargeProgramService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemberRechargeProgramService.java new file mode 100644 index 0000000..85d6b22 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemberRechargeProgramService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.UserMemberRechargeProgram; + +/** + * 充值类目Service接口 + * + * @author ruoyi + * @date 2025-06-26 + */ +public interface IUserMemberRechargeProgramService +{ + /** + * 查询充值类目 + * + * @param id 充值类目主键 + * @return 充值类目 + */ + public UserMemberRechargeProgram selectUserMemberRechargeProgramById(Integer id); + + /** + * 查询充值类目列表 + * + * @param userMemberRechargeProgram 充值类目 + * @return 充值类目集合 + */ + public List selectUserMemberRechargeProgramList(UserMemberRechargeProgram userMemberRechargeProgram); + + /** + * 新增充值类目 + * + * @param userMemberRechargeProgram 充值类目 + * @return 结果 + */ + public int insertUserMemberRechargeProgram(UserMemberRechargeProgram userMemberRechargeProgram); + + /** + * 修改充值类目 + * + * @param userMemberRechargeProgram 充值类目 + * @return 结果 + */ + public int updateUserMemberRechargeProgram(UserMemberRechargeProgram userMemberRechargeProgram); + + /** + * 批量删除充值类目 + * + * @param ids 需要删除的充值类目主键集合 + * @return 结果 + */ + public int deleteUserMemberRechargeProgramByIds(Long[] ids); + + /** + * 删除充值类目信息 + * + * @param id 充值类目主键 + * @return 结果 + */ + public int deleteUserMemberRechargeProgramById(Long id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemnerConsumptionLogService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemnerConsumptionLogService.java new file mode 100644 index 0000000..fecac67 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUserMemnerConsumptionLogService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.UserMemnerConsumptionLog; + +/** + * 用户消费余额记录Service接口 + * + * @author ruoyi + * @date 2025-06-26 + */ +public interface IUserMemnerConsumptionLogService +{ + /** + * 查询用户消费余额记录 + * + * @param id 用户消费余额记录主键 + * @return 用户消费余额记录 + */ + public UserMemnerConsumptionLog selectUserMemnerConsumptionLogById(Integer id); + + /** + * 查询用户消费余额记录列表 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 用户消费余额记录集合 + */ + public List selectUserMemnerConsumptionLogList(UserMemnerConsumptionLog userMemnerConsumptionLog); + + /** + * 新增用户消费余额记录 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 结果 + */ + public int insertUserMemnerConsumptionLog(UserMemnerConsumptionLog userMemnerConsumptionLog); + + /** + * 修改用户消费余额记录 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 结果 + */ + public int updateUserMemnerConsumptionLog(UserMemnerConsumptionLog userMemnerConsumptionLog); + + /** + * 批量删除用户消费余额记录 + * + * @param ids 需要删除的用户消费余额记录主键集合 + * @return 结果 + */ + public int deleteUserMemnerConsumptionLogByIds(Integer[] ids); + + /** + * 删除用户消费余额记录信息 + * + * @param id 用户消费余额记录主键 + * @return 结果 + */ + public int deleteUserMemnerConsumptionLogById(Integer id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/IUsersInvoiceInfoService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUsersInvoiceInfoService.java new file mode 100644 index 0000000..aae9a82 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/IUsersInvoiceInfoService.java @@ -0,0 +1,61 @@ +package com.ruoyi.system.service; + +import java.util.List; +import com.ruoyi.system.domain.UsersInvoiceInfo; + +/** + * 发票信息Service接口 + * + * @author ruoyi + * @date 2025-06-27 + */ +public interface IUsersInvoiceInfoService +{ + /** + * 查询发票信息 + * + * @param id 发票信息主键 + * @return 发票信息 + */ + public UsersInvoiceInfo selectUsersInvoiceInfoById(Integer id); + + /** + * 查询发票信息列表 + * + * @param usersInvoiceInfo 发票信息 + * @return 发票信息集合 + */ + public List selectUsersInvoiceInfoList(UsersInvoiceInfo usersInvoiceInfo); + + /** + * 新增发票信息 + * + * @param usersInvoiceInfo 发票信息 + * @return 结果 + */ + public int insertUsersInvoiceInfo(UsersInvoiceInfo usersInvoiceInfo); + + /** + * 修改发票信息 + * + * @param usersInvoiceInfo 发票信息 + * @return 结果 + */ + public int updateUsersInvoiceInfo(UsersInvoiceInfo usersInvoiceInfo); + + /** + * 批量删除发票信息 + * + * @param ids 需要删除的发票信息主键集合 + * @return 结果 + */ + public int deleteUsersInvoiceInfoByIds(Integer[] ids); + + /** + * 删除发票信息信息 + * + * @param id 发票信息主键 + * @return 结果 + */ + public int deleteUsersInvoiceInfoById(Integer id); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserBenefitPointsServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserBenefitPointsServiceImpl.java new file mode 100644 index 0000000..f8630db --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserBenefitPointsServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.UserBenefitPointsMapper; +import com.ruoyi.system.domain.UserBenefitPoints; +import com.ruoyi.system.service.IUserBenefitPointsService; + +/** + * 购物消费福利金Service业务层处理 + * + * @author ruoyi + * @date 2025-06-27 + */ +@Service +public class UserBenefitPointsServiceImpl implements IUserBenefitPointsService +{ + @Autowired + private UserBenefitPointsMapper userBenefitPointsMapper; + + /** + * 查询购物消费福利金 + * + * @param id 购物消费福利金主键 + * @return 购物消费福利金 + */ + @Override + public UserBenefitPoints selectUserBenefitPointsById(Long id) + { + return userBenefitPointsMapper.selectUserBenefitPointsById(id); + } + + /** + * 查询购物消费福利金列表 + * + * @param userBenefitPoints 购物消费福利金 + * @return 购物消费福利金 + */ + @Override + public List selectUserBenefitPointsList(UserBenefitPoints userBenefitPoints) + { + return userBenefitPointsMapper.selectUserBenefitPointsList(userBenefitPoints); + } + + /** + * 新增购物消费福利金 + * + * @param userBenefitPoints 购物消费福利金 + * @return 结果 + */ + @Override + public int insertUserBenefitPoints(UserBenefitPoints userBenefitPoints) + { + return userBenefitPointsMapper.insertUserBenefitPoints(userBenefitPoints); + } + + /** + * 修改购物消费福利金 + * + * @param userBenefitPoints 购物消费福利金 + * @return 结果 + */ + @Override + public int updateUserBenefitPoints(UserBenefitPoints userBenefitPoints) + { + return userBenefitPointsMapper.updateUserBenefitPoints(userBenefitPoints); + } + + /** + * 批量删除购物消费福利金 + * + * @param ids 需要删除的购物消费福利金主键 + * @return 结果 + */ + @Override + public int deleteUserBenefitPointsByIds(Long[] ids) + { + return userBenefitPointsMapper.deleteUserBenefitPointsByIds(ids); + } + + /** + * 删除购物消费福利金信息 + * + * @param id 购物消费福利金主键 + * @return 结果 + */ + @Override + public int deleteUserBenefitPointsById(Long id) + { + return userBenefitPointsMapper.deleteUserBenefitPointsById(id); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemberRechargeLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemberRechargeLogServiceImpl.java new file mode 100644 index 0000000..c6577a6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemberRechargeLogServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.UserMemberRechargeLogMapper; +import com.ruoyi.system.domain.UserMemberRechargeLog; +import com.ruoyi.system.service.IUserMemberRechargeLogService; + +/** + * 用户充值记录Service业务层处理 + * + * @author ruoyi + * @date 2025-06-26 + */ +@Service +public class UserMemberRechargeLogServiceImpl implements IUserMemberRechargeLogService +{ + @Autowired + private UserMemberRechargeLogMapper userMemberRechargeLogMapper; + + /** + * 查询用户充值记录 + * + * @param id 用户充值记录主键 + * @return 用户充值记录 + */ + @Override + public UserMemberRechargeLog selectUserMemberRechargeLogById(Integer id) + { + return userMemberRechargeLogMapper.selectUserMemberRechargeLogById(id); + } + + /** + * 查询用户充值记录列表 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 用户充值记录 + */ + @Override + public List selectUserMemberRechargeLogList(UserMemberRechargeLog userMemberRechargeLog) + { + return userMemberRechargeLogMapper.selectUserMemberRechargeLogList(userMemberRechargeLog); + } + + /** + * 新增用户充值记录 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 结果 + */ + @Override + public int insertUserMemberRechargeLog(UserMemberRechargeLog userMemberRechargeLog) + { + return userMemberRechargeLogMapper.insertUserMemberRechargeLog(userMemberRechargeLog); + } + + /** + * 修改用户充值记录 + * + * @param userMemberRechargeLog 用户充值记录 + * @return 结果 + */ + @Override + public int updateUserMemberRechargeLog(UserMemberRechargeLog userMemberRechargeLog) + { + return userMemberRechargeLogMapper.updateUserMemberRechargeLog(userMemberRechargeLog); + } + + /** + * 批量删除用户充值记录 + * + * @param ids 需要删除的用户充值记录主键 + * @return 结果 + */ + @Override + public int deleteUserMemberRechargeLogByIds(Integer[] ids) + { + return userMemberRechargeLogMapper.deleteUserMemberRechargeLogByIds(ids); + } + + /** + * 删除用户充值记录信息 + * + * @param id 用户充值记录主键 + * @return 结果 + */ + @Override + public int deleteUserMemberRechargeLogById(Integer id) + { + return userMemberRechargeLogMapper.deleteUserMemberRechargeLogById(id); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemberRechargeProgramServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemberRechargeProgramServiceImpl.java new file mode 100644 index 0000000..6e18705 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemberRechargeProgramServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.UserMemberRechargeProgramMapper; +import com.ruoyi.system.domain.UserMemberRechargeProgram; +import com.ruoyi.system.service.IUserMemberRechargeProgramService; + +/** + * 充值类目Service业务层处理 + * + * @author ruoyi + * @date 2025-06-26 + */ +@Service +public class UserMemberRechargeProgramServiceImpl implements IUserMemberRechargeProgramService +{ + @Autowired + private UserMemberRechargeProgramMapper userMemberRechargeProgramMapper; + + /** + * 查询充值类目 + * + * @param id 充值类目主键 + * @return 充值类目 + */ + @Override + public UserMemberRechargeProgram selectUserMemberRechargeProgramById(Integer id) + { + return userMemberRechargeProgramMapper.selectUserMemberRechargeProgramById(id); + } + + /** + * 查询充值类目列表 + * + * @param userMemberRechargeProgram 充值类目 + * @return 充值类目 + */ + @Override + public List selectUserMemberRechargeProgramList(UserMemberRechargeProgram userMemberRechargeProgram) + { + return userMemberRechargeProgramMapper.selectUserMemberRechargeProgramList(userMemberRechargeProgram); + } + + /** + * 新增充值类目 + * + * @param userMemberRechargeProgram 充值类目 + * @return 结果 + */ + @Override + public int insertUserMemberRechargeProgram(UserMemberRechargeProgram userMemberRechargeProgram) + { + return userMemberRechargeProgramMapper.insertUserMemberRechargeProgram(userMemberRechargeProgram); + } + + /** + * 修改充值类目 + * + * @param userMemberRechargeProgram 充值类目 + * @return 结果 + */ + @Override + public int updateUserMemberRechargeProgram(UserMemberRechargeProgram userMemberRechargeProgram) + { + return userMemberRechargeProgramMapper.updateUserMemberRechargeProgram(userMemberRechargeProgram); + } + + /** + * 批量删除充值类目 + * + * @param ids 需要删除的充值类目主键 + * @return 结果 + */ + @Override + public int deleteUserMemberRechargeProgramByIds(Long[] ids) + { + return userMemberRechargeProgramMapper.deleteUserMemberRechargeProgramByIds(ids); + } + + /** + * 删除充值类目信息 + * + * @param id 充值类目主键 + * @return 结果 + */ + @Override + public int deleteUserMemberRechargeProgramById(Long id) + { + return userMemberRechargeProgramMapper.deleteUserMemberRechargeProgramById(id); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemnerConsumptionLogServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemnerConsumptionLogServiceImpl.java new file mode 100644 index 0000000..a2465cc --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UserMemnerConsumptionLogServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.UserMemnerConsumptionLogMapper; +import com.ruoyi.system.domain.UserMemnerConsumptionLog; +import com.ruoyi.system.service.IUserMemnerConsumptionLogService; + +/** + * 用户消费余额记录Service业务层处理 + * + * @author ruoyi + * @date 2025-06-26 + */ +@Service +public class UserMemnerConsumptionLogServiceImpl implements IUserMemnerConsumptionLogService +{ + @Autowired + private UserMemnerConsumptionLogMapper userMemnerConsumptionLogMapper; + + /** + * 查询用户消费余额记录 + * + * @param id 用户消费余额记录主键 + * @return 用户消费余额记录 + */ + @Override + public UserMemnerConsumptionLog selectUserMemnerConsumptionLogById(Integer id) + { + return userMemnerConsumptionLogMapper.selectUserMemnerConsumptionLogById(id); + } + + /** + * 查询用户消费余额记录列表 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 用户消费余额记录 + */ + @Override + public List selectUserMemnerConsumptionLogList(UserMemnerConsumptionLog userMemnerConsumptionLog) + { + return userMemnerConsumptionLogMapper.selectUserMemnerConsumptionLogList(userMemnerConsumptionLog); + } + + /** + * 新增用户消费余额记录 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 结果 + */ + @Override + public int insertUserMemnerConsumptionLog(UserMemnerConsumptionLog userMemnerConsumptionLog) + { + return userMemnerConsumptionLogMapper.insertUserMemnerConsumptionLog(userMemnerConsumptionLog); + } + + /** + * 修改用户消费余额记录 + * + * @param userMemnerConsumptionLog 用户消费余额记录 + * @return 结果 + */ + @Override + public int updateUserMemnerConsumptionLog(UserMemnerConsumptionLog userMemnerConsumptionLog) + { + return userMemnerConsumptionLogMapper.updateUserMemnerConsumptionLog(userMemnerConsumptionLog); + } + + /** + * 批量删除用户消费余额记录 + * + * @param ids 需要删除的用户消费余额记录主键 + * @return 结果 + */ + @Override + public int deleteUserMemnerConsumptionLogByIds(Integer[] ids) + { + return userMemnerConsumptionLogMapper.deleteUserMemnerConsumptionLogByIds(ids); + } + + /** + * 删除用户消费余额记录信息 + * + * @param id 用户消费余额记录主键 + * @return 结果 + */ + @Override + public int deleteUserMemnerConsumptionLogById(Integer id) + { + return userMemnerConsumptionLogMapper.deleteUserMemnerConsumptionLogById(id); + } +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UsersInvoiceInfoServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UsersInvoiceInfoServiceImpl.java new file mode 100644 index 0000000..f348615 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/UsersInvoiceInfoServiceImpl.java @@ -0,0 +1,93 @@ +package com.ruoyi.system.service.impl; + +import java.util.List; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.ruoyi.system.mapper.UsersInvoiceInfoMapper; +import com.ruoyi.system.domain.UsersInvoiceInfo; +import com.ruoyi.system.service.IUsersInvoiceInfoService; + +/** + * 发票信息Service业务层处理 + * + * @author ruoyi + * @date 2025-06-27 + */ +@Service +public class UsersInvoiceInfoServiceImpl implements IUsersInvoiceInfoService +{ + @Autowired + private UsersInvoiceInfoMapper usersInvoiceInfoMapper; + + /** + * 查询发票信息 + * + * @param id 发票信息主键 + * @return 发票信息 + */ + @Override + public UsersInvoiceInfo selectUsersInvoiceInfoById(Integer id) + { + return usersInvoiceInfoMapper.selectUsersInvoiceInfoById(id); + } + + /** + * 查询发票信息列表 + * + * @param usersInvoiceInfo 发票信息 + * @return 发票信息 + */ + @Override + public List selectUsersInvoiceInfoList(UsersInvoiceInfo usersInvoiceInfo) + { + return usersInvoiceInfoMapper.selectUsersInvoiceInfoList(usersInvoiceInfo); + } + + /** + * 新增发票信息 + * + * @param usersInvoiceInfo 发票信息 + * @return 结果 + */ + @Override + public int insertUsersInvoiceInfo(UsersInvoiceInfo usersInvoiceInfo) + { + return usersInvoiceInfoMapper.insertUsersInvoiceInfo(usersInvoiceInfo); + } + + /** + * 修改发票信息 + * + * @param usersInvoiceInfo 发票信息 + * @return 结果 + */ + @Override + public int updateUsersInvoiceInfo(UsersInvoiceInfo usersInvoiceInfo) + { + return usersInvoiceInfoMapper.updateUsersInvoiceInfo(usersInvoiceInfo); + } + + /** + * 批量删除发票信息 + * + * @param ids 需要删除的发票信息主键 + * @return 结果 + */ + @Override + public int deleteUsersInvoiceInfoByIds(Integer[] ids) + { + return usersInvoiceInfoMapper.deleteUsersInvoiceInfoByIds(ids); + } + + /** + * 删除发票信息信息 + * + * @param id 发票信息主键 + * @return 结果 + */ + @Override + public int deleteUsersInvoiceInfoById(Integer id) + { + return usersInvoiceInfoMapper.deleteUsersInvoiceInfoById(id); + } +} diff --git a/ruoyi-system/src/main/resources/mapper/system/UserBenefitPointsMapper.xml b/ruoyi-system/src/main/resources/mapper/system/UserBenefitPointsMapper.xml new file mode 100644 index 0000000..c5bd4a8 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/UserBenefitPointsMapper.xml @@ -0,0 +1,111 @@ + + + + + + + + + + + + + + + + + + + + + + select id, type, dotime, ordermoney, money, ordertype, uid, beformoney, aftremoney, created_at, updated_at, orderid, reamk from user_benefit_points + + + + + + + + insert into user_benefit_points + + type, + dotime, + ordermoney, + money, + ordertype, + uid, + beformoney, + aftremoney, + created_at, + updated_at, + orderid, + reamk, + + + #{type}, + #{dotime}, + #{ordermoney}, + #{money}, + #{ordertype}, + #{uid}, + #{beformoney}, + #{aftremoney}, + #{createdAt}, + #{updatedAt}, + #{orderid}, + #{reamk}, + + + + + update user_benefit_points + + type = #{type}, + dotime = #{dotime}, + ordermoney = #{ordermoney}, + money = #{money}, + ordertype = #{ordertype}, + uid = #{uid}, + beformoney = #{beformoney}, + aftremoney = #{aftremoney}, + created_at = #{createdAt}, + updated_at = #{updatedAt}, + orderid = #{orderid}, + reamk = #{reamk}, + + where id = #{id} + + + + delete from user_benefit_points where id = #{id} + + + + delete from user_benefit_points where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/UserMemberRechargeLogMapper.xml b/ruoyi-system/src/main/resources/mapper/system/UserMemberRechargeLogMapper.xml new file mode 100644 index 0000000..439bcb5 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/UserMemberRechargeLogMapper.xml @@ -0,0 +1,104 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select id, uid, paytype, paytime, inmoney, transaction_id, created_at, updated_at,deleted_at,orderid ,reamk,comemoney,ismember,proid,del from user_member_recharge_log + + + + + + + + insert into user_member_recharge_log + + uid, + paytype, + paytime, + inmoney, + transaction_id, + deleted_at, + del, + orderid, + proid, + comemoney, + reamk, + ismember, + created_at, + updated_at + + + #{uid}, + #{paytype}, + #{paytime}, + #{inmoney}, + #{transactionId}, + #{deletedAt}, + #{del}, + #{orderid}, + #{proid}, + #{comemoney}, + #{reamk}, + #{ismember}, + NOW(), + NOW() + + + + + update user_member_recharge_log + + paytype = #{paytype}, + paytime = #{paytime}, + inmoney = #{inmoney}, + transaction_id = #{transactionId}, + updated_at = NOW(), + deleted_at = #{deletedAt}, + del = #{del}, + + where id = #{id} + + + + delete from user_member_recharge_log where id = #{id} + + + + delete from user_member_recharge_log where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/UserMemberRechargeProgramMapper.xml b/ruoyi-system/src/main/resources/mapper/system/UserMemberRechargeProgramMapper.xml new file mode 100644 index 0000000..47588b1 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/UserMemberRechargeProgramMapper.xml @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + select id, rechargename, money, discount, reamk, status, created_at, updated_at, deleted_at, type from user_member_recharge_program + + + + + + + + insert into user_member_recharge_program + + rechargename, + money, + discount, + reamk, + status, + deleted_at, + type, + created_at, + updated_at + + + #{rechargename}, + #{money}, + #{discount}, + #{reamk}, + #{status}, + #{deletedAt}, + #{type}, + NOW(), + NOW() + + + + + update user_member_recharge_program + + rechargename = #{rechargename}, + money = #{money}, + discount = #{discount}, + reamk = #{reamk}, + status = #{status}, + deleted_at = #{deletedAt}, + type = #{type}, + updated_at = NOW() + + where id = #{id} + + + + delete from user_member_recharge_program where id = #{id} + + + + delete from user_member_recharge_program where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/UserMemnerConsumptionLogMapper.xml b/ruoyi-system/src/main/resources/mapper/system/UserMemnerConsumptionLogMapper.xml new file mode 100644 index 0000000..f56f3b9 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/UserMemnerConsumptionLogMapper.xml @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + select id, uid, consumptiontype, consumptiontime, consumptionmoney, reamk, beformoney, aftermoney, nowmoney, created_at, updated_at, deleted_at, del from user_memner_consumption_log + + + + + + + + insert into user_memner_consumption_log + + uid, + consumptiontype, + consumptiontime, + consumptionmoney, + reamk, + beformoney, + aftermoney, + nowmoney, + deleted_at, + del, + created_at, + updated_at + + + #{uid}, + #{consumptiontype}, + #{consumptiontime}, + #{consumptionmoney}, + #{reamk}, + #{beformoney}, + #{aftermoney}, + #{nowmoney}, + #{deletedAt}, + #{del}, + NOW(), + NOW() + + + + + update user_memner_consumption_log + + uid = #{uid}, + consumptiontype = #{consumptiontype}, + consumptiontime = #{consumptiontime}, + consumptionmoney = #{consumptionmoney}, + reamk = #{reamk}, + beformoney = #{beformoney}, + aftermoney = #{aftermoney}, + nowmoney = #{nowmoney}, + updated_at = NOW(), + deleted_at = #{deletedAt}, + del = #{del}, + + where id = #{id} + + + + delete from user_memner_consumption_log where id = #{id} + + + + delete from user_memner_consumption_log where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/UsersInvoiceInfoMapper.xml b/ruoyi-system/src/main/resources/mapper/system/UsersInvoiceInfoMapper.xml new file mode 100644 index 0000000..24e94b8 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/system/UsersInvoiceInfoMapper.xml @@ -0,0 +1,114 @@ + + + + + + + + + + + + + + + + + + + + + + + select id, uid, invoice_title, tax_number, bank_name, bank_account, address, phone, email, wechat, type, category, created_at, updated_at from users_invoice_info + + + + + + + + insert into users_invoice_info + + uid, + invoice_title, + tax_number, + bank_name, + bank_account, + address, + phone, + email, + wechat, + type, + category, + created_at, + updated_at, + + + #{uid}, + #{invoiceTitle}, + #{taxNumber}, + #{bankName}, + #{bankAccount}, + #{address}, + #{phone}, + #{email}, + #{wechat}, + #{type}, + #{category}, + #{createdAt}, + #{updatedAt}, + + + + + update users_invoice_info + + uid = #{uid}, + invoice_title = #{invoiceTitle}, + tax_number = #{taxNumber}, + bank_name = #{bankName}, + bank_account = #{bankAccount}, + address = #{address}, + phone = #{phone}, + email = #{email}, + wechat = #{wechat}, + type = #{type}, + category = #{category}, + created_at = #{createdAt}, + updated_at = #{updatedAt}, + + where id = #{id} + + + + delete from users_invoice_info where id = #{id} + + + + delete from users_invoice_info where id in + + #{id} + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/system/UsersMapper.xml b/ruoyi-system/src/main/resources/mapper/system/UsersMapper.xml index 9f23924..07be350 100644 --- a/ruoyi-system/src/main/resources/mapper/system/UsersMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/UsersMapper.xml @@ -1,51 +1,95 @@ + PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - select id, name, nickname, phone, password, remember_token, openid, avatar, type, worker_time, integral, total_integral, status, level, commission, total_comm, margin, job_number, prohibit_time, prohibit_time_num, toa, service_city_pid, service_city_ids, skill_ids, propose, login_status, is_stop, middle_auth, created_at, updated_at from users + select id, + name, + nickname, + phone, + password, + remember_token, + openid, + avatar, + type, + worker_time, + integral, + total_integral, + status, + level, + commission, + total_comm, + margin, + job_number, + prohibit_time, + prohibit_time_num, + toa, + service_city_pid, + service_city_ids, + skill_ids, + propose, + login_status, + is_stop, + middle_auth, + balance, + ismember, + member_begin, + member_end, + created_at, + is_work, + consumption, + servicefee, + birthday, + updated_at + from users - + - - - ORDER BY job_number DESC - LIMIT 1; + + ORDER BY job_number DESC LIMIT 1; - \ No newline at end of file diff --git a/ruoyi-ui/src/api/system/UserMemberRechargeLog.js b/ruoyi-ui/src/api/system/UserMemberRechargeLog.js new file mode 100644 index 0000000..32e5609 --- /dev/null +++ b/ruoyi-ui/src/api/system/UserMemberRechargeLog.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询用户充值记录列表 +export function listUserMemberRechargeLog(query) { + return request({ + url: '/system/UserMemberRechargeLog/list', + method: 'get', + params: query + }) +} + +// 查询用户充值记录详细 +export function getUserMemberRechargeLog(id) { + return request({ + url: '/system/UserMemberRechargeLog/' + id, + method: 'get' + }) +} + +// 新增用户充值记录 +export function addUserMemberRechargeLog(data) { + return request({ + url: '/system/UserMemberRechargeLog', + method: 'post', + data: data + }) +} + +// 修改用户充值记录 +export function updateUserMemberRechargeLog(data) { + return request({ + url: '/system/UserMemberRechargeLog', + method: 'put', + data: data + }) +} + +// 删除用户充值记录 +export function delUserMemberRechargeLog(id) { + return request({ + url: '/system/UserMemberRechargeLog/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/UserMemnerConsumptionLog.js b/ruoyi-ui/src/api/system/UserMemnerConsumptionLog.js new file mode 100644 index 0000000..328f4c9 --- /dev/null +++ b/ruoyi-ui/src/api/system/UserMemnerConsumptionLog.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询用户消费余额记录列表 +export function listUserMemnerConsumptionLog(query) { + return request({ + url: '/system/UserMemnerConsumptionLog/list', + method: 'get', + params: query + }) +} + +// 查询用户消费余额记录详细 +export function getUserMemnerConsumptionLog(id) { + return request({ + url: '/system/UserMemnerConsumptionLog/' + id, + method: 'get' + }) +} + +// 新增用户消费余额记录 +export function addUserMemnerConsumptionLog(data) { + return request({ + url: '/system/UserMemnerConsumptionLog', + method: 'post', + data: data + }) +} + +// 修改用户消费余额记录 +export function updateUserMemnerConsumptionLog(data) { + return request({ + url: '/system/UserMemnerConsumptionLog', + method: 'put', + data: data + }) +} + +// 删除用户消费余额记录 +export function delUserMemnerConsumptionLog(id) { + return request({ + url: '/system/UserMemnerConsumptionLog/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/dict/info.js b/ruoyi-ui/src/api/system/dict/info.js new file mode 100644 index 0000000..bb0c411 --- /dev/null +++ b/ruoyi-ui/src/api/system/dict/info.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询发票信息列表 +export function listInfo(query) { + return request({ + url: '/system/info/list', + method: 'get', + params: query + }) +} + +// 查询发票信息详细 +export function getInfo(id) { + return request({ + url: '/system/info/' + id, + method: 'get' + }) +} + +// 新增发票信息 +export function addInfo(data) { + return request({ + url: '/system/info', + method: 'post', + data: data + }) +} + +// 修改发票信息 +export function updateInfo(data) { + return request({ + url: '/system/info', + method: 'put', + data: data + }) +} + +// 删除发票信息 +export function delInfo(id) { + return request({ + url: '/system/info/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/dict/points.js b/ruoyi-ui/src/api/system/dict/points.js new file mode 100644 index 0000000..cecf2c1 --- /dev/null +++ b/ruoyi-ui/src/api/system/dict/points.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询购物消费福利金列表 +export function listPoints(query) { + return request({ + url: '/system/points/list', + method: 'get', + params: query + }) +} + +// 查询购物消费福利金详细 +export function getPoints(id) { + return request({ + url: '/system/points/' + id, + method: 'get' + }) +} + +// 新增购物消费福利金 +export function addPoints(data) { + return request({ + url: '/system/points', + method: 'post', + data: data + }) +} + +// 修改购物消费福利金 +export function updatePoints(data) { + return request({ + url: '/system/points', + method: 'put', + data: data + }) +} + +// 删除购物消费福利金 +export function delPoints(id) { + return request({ + url: '/system/points/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/info.js b/ruoyi-ui/src/api/system/info.js new file mode 100644 index 0000000..bb0c411 --- /dev/null +++ b/ruoyi-ui/src/api/system/info.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询发票信息列表 +export function listInfo(query) { + return request({ + url: '/system/info/list', + method: 'get', + params: query + }) +} + +// 查询发票信息详细 +export function getInfo(id) { + return request({ + url: '/system/info/' + id, + method: 'get' + }) +} + +// 新增发票信息 +export function addInfo(data) { + return request({ + url: '/system/info', + method: 'post', + data: data + }) +} + +// 修改发票信息 +export function updateInfo(data) { + return request({ + url: '/system/info', + method: 'put', + data: data + }) +} + +// 删除发票信息 +export function delInfo(id) { + return request({ + url: '/system/info/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/api/system/program.js b/ruoyi-ui/src/api/system/program.js new file mode 100644 index 0000000..d784935 --- /dev/null +++ b/ruoyi-ui/src/api/system/program.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询充值类目列表 +export function listProgram(query) { + return request({ + url: '/system/program/list', + method: 'get', + params: query + }) +} + +// 查询充值类目详细 +export function getProgram(id) { + return request({ + url: '/system/program/' + id, + method: 'get' + }) +} + +// 新增充值类目 +export function addProgram(data) { + return request({ + url: '/system/program', + method: 'post', + data: data + }) +} + +// 修改充值类目 +export function updateProgram(data) { + return request({ + url: '/system/program', + method: 'put', + data: data + }) +} + +// 删除充值类目 +export function delProgram(id) { + return request({ + url: '/system/program/' + id, + method: 'delete' + }) +} diff --git a/ruoyi-ui/src/views/system/Order/index.vue b/ruoyi-ui/src/views/system/Order/index.vue index 49c4563..8220ebb 100644 --- a/ruoyi-ui/src/views/system/Order/index.vue +++ b/ruoyi-ui/src/views/system/Order/index.vue @@ -1682,7 +1682,7 @@ export default { } } else { this.fileList = []; - } + } this.open = true; this.title = "修改订单"; }); @@ -2611,7 +2611,7 @@ export default { imageListOnly() { return this.fileList.filter(url => this.isImage(url)); } - } + } } diff --git a/ruoyi-ui/src/views/system/SiteConfig/index.vue b/ruoyi-ui/src/views/system/SiteConfig/index.vue index 3b64ca6..737f000 100644 --- a/ruoyi-ui/src/views/system/SiteConfig/index.vue +++ b/ruoyi-ui/src/views/system/SiteConfig/index.vue @@ -16,6 +16,14 @@ % + + + % + + + + % + @@ -117,6 +125,17 @@ + + + + + + + 提交 + 重置 + + + 保存全部配置 @@ -140,10 +159,11 @@ export default { loading: true, activeTab: 'base', SiteConfigList: [], - config_one: {}, + config_one: {}, config_two: {}, config_three: {}, config_four: {}, + config_five: {}, total: 0, // 系统配置表格数据 // 基本信息 baseForm: { @@ -151,6 +171,8 @@ export default { startTime: '', endTime: '', marginRate: 10, + consumption: 0, + servicefee: 0, orderScore: 100, hotwords: ['水电维修', '家电清洗', '灯具维修', '墙面翻新', '门窗家具', '疏通维修', '防水维修'], qrUrl: '' @@ -161,10 +183,12 @@ export default { intro: '', marginDesc: '' }, - + memberForm:{ + member: '' + }, // 下单时间配置 orderTimes: [ - + ], // 时间配置 timeForm: { @@ -188,16 +212,16 @@ export default { this.SiteConfigList = response.rows // config_one 基本信息 - this.config_one=response.rows.find(item => item.name === 'config_one') - const configOneObj =JSON.parse(this.config_one.value) - - - if (configOneObj) { + this.config_one = response.rows.find(item => item.name === 'config_one') + if (this.config_one && this.config_one.value) { + const configOneObj = JSON.parse(this.config_one.value) this.baseForm = { phone: configOneObj.phone || '', - startTime:configOneObj.loot_start || '', + startTime: configOneObj.loot_start || '', endTime: configOneObj.loot_end || '', marginRate: configOneObj.margin || 10, + consumption: configOneObj.consumption || 0, + servicefee: configOneObj.servicefee || 0, orderScore: configOneObj.orderScore || 100, hotwords: configOneObj.hot || [], qrUrl: configOneObj.kf || '', @@ -205,10 +229,9 @@ export default { } // config_two 文本配置 - this.config_two=response.rows.find(item => item.name === 'config_two') - const configTwoObj =JSON.parse(this.config_two.value) - - if (configTwoObj) { + this.config_two = response.rows.find(item => item.name === 'config_two') + if (this.config_two && this.config_two.value) { + const configTwoObj = JSON.parse(this.config_two.value) this.textForm = { company: configTwoObj.name || '', intro: configTwoObj.brief || '', @@ -216,27 +239,34 @@ export default { } } - // config_three 下单时间配置 - this.config_three=response.rows.find(item => item.name === 'config_three') - - let _data=JSON.parse(this.config_three.value) - for(let key in _data.time){ - const [start, end] =_data.time[key].key.split('-'); - this.orderTimes.push({ - start: start || '', - end: end || '', - count: _data.time[key].num || 99 - }) + // config_five 会员配置 + this.config_five = response.rows.find(item => item.name === 'config_five') + if (this.config_five && this.config_five.value) { + const configfiveObj = JSON.parse(this.config_five.value) + this.memberForm = { member: configfiveObj.member || '' } + } + + // config_three 下单时间配置 + this.config_three = response.rows.find(item => item.name === 'config_three') + this.orderTimes = [] + if (this.config_three && this.config_three.value) { + let _data = JSON.parse(this.config_three.value) + if (_data && _data.time) { + for (let key in _data.time) { + const [start, end] = _data.time[key].key.split('-'); + this.orderTimes.push({ + start: start || '', + end: end || '', + count: _data.time[key].num || 99 + }) + } + } } - - - // config_four 时间配置 - this.config_four=response.rows.find(item => item.name === 'config_four') - const configFourObj =JSON.parse(this.config_four.value) - - if (configFourObj) { + this.config_four = response.rows.find(item => item.name === 'config_four') + if (this.config_four && this.config_four.value) { + const configFourObj = JSON.parse(this.config_four.value) this.timeForm = { withdrawDays: configFourObj.time || [], autoOrderMinutes: configFourObj.order_time || 10, @@ -302,7 +332,7 @@ export default { }, resetOrderTime() { this.orderTimes = [ - + ] }, // 时间配置 @@ -312,6 +342,9 @@ export default { resetTime() { this.timeForm = { withdrawDays: ['8号', '18号', '28号'], autoOrderMinutes: 10, cancelOrderDays: 7 } }, + resetMember() { + this.memberForm = { member: '' } + }, async saveAllConfig(e) { // 1. 组装 config_one const config_one = { @@ -319,6 +352,8 @@ export default { loot_start: this.baseForm.startTime, loot_end: this.baseForm.endTime, margin: this.baseForm.marginRate, + consumption: this.baseForm.consumption, + servicefee: this.baseForm.servicefee, orderScore: this.baseForm.orderScore, hot: this.baseForm.hotwords, kf: this.baseForm.qrUrl @@ -342,6 +377,10 @@ export default { order_time: this.timeForm.autoOrderMinutes, remove_time: this.timeForm.cancelOrderDays }; + // 5. 组装 config_five + const config_five = { + member: this.memberForm.member + }; try { if(e=='1'){ await updateSiteConfig({ name: 'config_one',id:this.config_one.id, value: JSON.stringify(config_one) }); @@ -351,6 +390,8 @@ if(e=='1'){ await updateSiteConfig({ name: 'config_three',id:this.config_three.id, value: JSON.stringify(config_three) }); }else if(e=='4'){ await updateSiteConfig({ name: 'config_four',id:this.config_four.id, value: JSON.stringify(config_four) }); +}else if(e=='5'){ + await updateSiteConfig({ name: 'config_five',id:this.config_five.id, value: JSON.stringify(config_five) }); } this.$message.success('保存成功!'); this.getList(); diff --git a/ruoyi-ui/src/views/system/UserMemberRechargeLog/index.vue b/ruoyi-ui/src/views/system/UserMemberRechargeLog/index.vue new file mode 100644 index 0000000..eb2739b --- /dev/null +++ b/ruoyi-ui/src/views/system/UserMemberRechargeLog/index.vue @@ -0,0 +1,307 @@ + + + diff --git a/ruoyi-ui/src/views/system/UserMemnerConsumptionLog/index.vue b/ruoyi-ui/src/views/system/UserMemnerConsumptionLog/index.vue new file mode 100644 index 0000000..bf632c1 --- /dev/null +++ b/ruoyi-ui/src/views/system/UserMemnerConsumptionLog/index.vue @@ -0,0 +1,332 @@ + + + diff --git a/ruoyi-ui/src/views/system/info/index.vue b/ruoyi-ui/src/views/system/info/index.vue new file mode 100644 index 0000000..1347d59 --- /dev/null +++ b/ruoyi-ui/src/views/system/info/index.vue @@ -0,0 +1,431 @@ + + + diff --git a/ruoyi-ui/src/views/system/points/index.vue b/ruoyi-ui/src/views/system/points/index.vue new file mode 100644 index 0000000..49acc4d --- /dev/null +++ b/ruoyi-ui/src/views/system/points/index.vue @@ -0,0 +1,429 @@ + + + diff --git a/ruoyi-ui/src/views/system/program/index.vue b/ruoyi-ui/src/views/system/program/index.vue new file mode 100644 index 0000000..89a5461 --- /dev/null +++ b/ruoyi-ui/src/views/system/program/index.vue @@ -0,0 +1,368 @@ + + +