202506251738

This commit is contained in:
张潘 2025-06-27 15:22:49 +08:00
parent 44ca8c32d6
commit 323a00026a
53 changed files with 6766 additions and 713 deletions

View File

@ -34,7 +34,16 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId> <artifactId>spring-boot-starter-security</artifactId>
</dependency> </dependency>
<!-- Google Gson -->
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
</dependency>
<!-- OkHttp -->
<dependency>
<groupId>com.squareup.okhttp3</groupId>
<artifactId>okhttp</artifactId>
</dependency>
<!-- pagehelper 分页插件 --> <!-- pagehelper 分页插件 -->
<dependency> <dependency>
<groupId>com.github.pagehelper</groupId> <groupId>com.github.pagehelper</groupId>

View File

@ -36,15 +36,9 @@ import java.math.BigDecimal;
import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RequestBody;
import com.ruoyi.system.config.QiniuConfig; import com.ruoyi.system.config.QiniuConfig;
import com.ruoyi.system.utils.QiniuUploadUtil; 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.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.ruoyi.system.domain.WechatTransfer; import com.ruoyi.system.domain.WechatTransfer;
import com.ruoyi.common.utils.SecurityUtils;
import com.alibaba.fastjson2.JSONArray; import com.alibaba.fastjson2.JSONArray;
import com.ruoyi.system.domain.QuoteCraft; import com.ruoyi.system.domain.QuoteCraft;
import com.ruoyi.system.domain.QuoteType; import com.ruoyi.system.domain.QuoteType;
@ -139,21 +133,18 @@ public class AppletController extends BaseController {
private IGoodsOrderCursorService goodsOrderCursorService; private IGoodsOrderCursorService goodsOrderCursorService;
@Autowired @Autowired
private IWorkerApplyService workerApplyService; 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 分类列表数据
// * <p>
// * 接口说明
// * - 获取状态为启用的服务分类
// * - 自动添加图片CDN前缀
// * - 支持用户登录状态验证
// */
// @GetMapping(value = "/api/form/apply/worker")
// public AjaxResult applyworker(@RequestBody Map<String, Object> params, HttpServletRequest request) {
// try {
//
// // 2. 验证用户登录状态
// String token = request.getHeader("token");
// Map<String, Object> 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 商品详细信息
// * <p>
// * 接口说明
// * - 根据商品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<String, Object> order_num = new HashMap<>();
// Map<String, Object> 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("total_comm", user.getTotalComm().toString() != null ? user.getTotalComm().toString() : "0.00");
userInfo.put("propose", user.getPropose().toString() != null ? user.getPropose().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("integral", user.getIntegral() != null ? user.getIntegral() : 0);
userInfo.put("is_stop", user.getIsStop() != null ? user.getIsStop() : 1); 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 商品详细信息
* <p>
* 接口说明
* - 根据商品ID获取详细信息
* - 返回格式化的商品数据
* - 包含图片基础信息等数组数据
*/
/**
* 手机号登录接口(未完整实现)
*
* @param params 包含code和phone参数
* @param request HTTP请求对象
* @return 登录结果
*
* 功能说明
* - 预留的手机号登录接口
* - 当前实现不完整需要补充验证逻辑
* - 用于处理手机号码验证登录
*/
// @GetMapping(value = "/user/phone/login")
// public AjaxResult getUserByPhone(@RequestBody Map<String, Object> 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 付款结果
* <p>
* 请求参数格式
* {
* "partnerTradeNo": "商户订单号",
* "openid": "用户openid",
* "amount": 付款金额
* "desc": "付款描述"
* }
*/
@PostMapping(value = "/api/pay/transfer")
public AjaxResult transferToUser(@RequestBody Map<String, Object> params, HttpServletRequest request) {
try {
// 1. 验证用户登录状态这里可能需要管理员权限
String token = request.getHeader("token");
Map<String, Object> userValidation = AppletLoginUtil.validateUserToken(token, usersService);
if (!(Boolean) userValidation.get("valid")) {
return AppletControllerUtil.appletWarning("用户未登录或token无效");
}
WechatPayUtil wechatPayUtil = new WechatPayUtil();
// 2. 企业付款
Map<String, Object> 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<String, Object> params, HttpServletRequest request) {
// try {
// // 1. 验证用户登录状态
// String token = request.getHeader("token");
// Map<String, Object> 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<CouponUser> couponUserList = couponUserService.selectCouponUserList(couponUserQuery);
// // 5. 根据状态筛选优惠券
// long currentTime = System.currentTimeMillis() / 1000; // 当前时间戳
// List<CouponUser> 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<Coupons> 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<CouponUser> priceFilteredList = AppletControllerUtil.filterCouponsByPrice(filteredList, price);
// // 8. 使用工具类处理数据格式化
// List<Map<String, Object>> resultList = AppletControllerUtil.buildCouponUserList(
// priceFilteredList, serviceCateService);
// return AppletControllerUtil.appletSuccess(resultList);
// } catch (Exception e) {
// System.err.println("查询用户优惠券列表异常:" + e.getMessage());
// return AppletControllerUtil.appletWarning("查询优惠券列表失败:" + e.getMessage());
// }
// }
/** /**
* 解析参数为Long类型 * 解析参数为Long类型
@ -3205,6 +2907,10 @@ public AjaxResult getUserNotificationStatus(HttpServletRequest request) {
} }
} }
/** /**
* 用户订阅消息授权接口 * 用户订阅消息授权接口
* *
@ -4380,45 +4086,6 @@ public AjaxResult getMyCouponCount(HttpServletRequest request) {
return AppletControllerUtil.appletWarning("用户信息获取失败"); return AppletControllerUtil.appletWarning("用户信息获取失败");
} }
// // 3. 查询用户的所有优惠券
// CouponUser couponUserQuery = new CouponUser();
// couponUserQuery.setUid(user.getId());
// List<CouponUser> 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<Coupons> availableCoupons = couponsService.selectCouponsList(couponsQuery);
//
// int availableToReceiveCount = 0; // 待领取数量 (four)
// for (Coupons coupon : availableCoupons) {
// if (isCouponAvailableToReceive(coupon, user.getId(), currentTime)) {
// availableToReceiveCount++;
// }
// }
// 6. 构建返回数据 // 6. 构建返回数据
Map<String, Object> countData = new HashMap<>(); Map<String, Object> countData = new HashMap<>();
countData.put("one", couponUserService.selectCountCouponsByUid(user.getId(), 1L)); // 未使用数量 countData.put("one", couponUserService.selectCountCouponsByUid(user.getId(), 1L)); // 未使用数量
@ -4498,82 +4165,6 @@ private boolean isCouponAvailableToReceive(Coupons coupon, Long userId, long cur
return true; 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<String, Object> params, HttpServletRequest request) {
// try {
// // 1. 校验用户登录
// String token = request.getHeader("token");
// Map<String, Object> 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<String, Object> orderParams = (Map<String, Object>) 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<String, Object> sku = (Map<String, Object>) 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<String, Object> params, Ht
if (coupon != null) { if (coupon != null) {
coupon.setStatus(2L); coupon.setStatus(2L);
} }
//coupon.setUseTime(new Date().getTime());
couponUserService.updateCouponUser(coupon) ; couponUserService.updateCouponUser(coupon) ;
// 创建商品订单 // 创建商品订单
GoodsOrder goodsOrder = new GoodsOrder(); GoodsOrder goodsOrder = new GoodsOrder();
@ -4818,7 +4408,6 @@ public AjaxResult createServiceOrder(@RequestBody Map<String, Object> params, Ht
if (hasGoodsOrder && totalAmount.compareTo(BigDecimal.ZERO) > 0) { if (hasGoodsOrder && totalAmount.compareTo(BigDecimal.ZERO) > 0) {
// 使用工具类简化微信支付参数组装 // 使用工具类简化微信支付参数组装
Map<String, Object> payResult = wechatPayUtil.createBatchOrderAndPay(user.getOpenid(), mainOrderId, new BigDecimal(0.01), orderList.size(), "https://7ce20b15.r5.cpolar.xyz/api/goods/pay/notify"); Map<String, Object> payResult = wechatPayUtil.createBatchOrderAndPay(user.getOpenid(), mainOrderId, new BigDecimal(0.01), orderList.size(), "https://7ce20b15.r5.cpolar.xyz/api/goods/pay/notify");
//Map<String, Object> payResult = wechatPayUtil.createBatchOrderAndPay(user.getOpenid(), mainOrderId, totalAmount, orderList.size());
if (payResult != null && Boolean.TRUE.equals(payResult.get("success"))) { if (payResult != null && Boolean.TRUE.equals(payResult.get("success"))) {
Map<String, Object> responseData = new HashMap<>(); Map<String, Object> responseData = new HashMap<>();
responseData.put("mainOrderId", mainOrderId); responseData.put("mainOrderId", mainOrderId);
@ -8000,5 +7589,202 @@ private void setDefaultConfig(Map<String, Object> configData) {
configData.put("hot", new String[]{"水电维修", "家电清洗", "灯具维修", "墙面翻新", "门窗家具", "改造维修", "防水维修"}); configData.put("hot", new String[]{"水电维修", "家电清洗", "灯具维修", "墙面翻新", "门窗家具", "改造维修", "防水维修"});
configData.put("kf", ""); configData.put("kf", "");
} }
//---------------------------------------------------------会员模块------------------------------------------------------------------------
/**
* 会员充值支付接口
*/
@PostMapping("api/member/recharge/pay")
public AjaxResult memberRechargePay(@RequestBody Map<String, Object> params, HttpServletRequest request) {
// 1. 验证用户登录状态
String token = request.getHeader("token");
Map<String, Object> 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<String, Object> 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<String, Object> 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<UserMemberRechargeProgram> 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<UserMemberRechargeProgram> 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<String, Object> 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<UserMemberRechargeLog> 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<String, Object> 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<UserMemnerConsumptionLog> list = userMemnerConsumptionLogService.selectUserMemnerConsumptionLogList(query);
if (!list.isEmpty()){
return AppletControllerUtil.appletSuccess(list.getFirst());
}else{
return AppletControllerUtil.appletWarning("暂无数据");
}
} catch (Exception e) {
return AppletControllerUtil.appletError("获取充值类目失败:" + e.getMessage());
}
}
} }

View File

@ -2,7 +2,9 @@ package com.ruoyi.system.controller;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; 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.AppletControllerUtil;
import com.ruoyi.system.ControllerUtil.WechatPayUtil;
import com.ruoyi.system.domain.ServiceGoods; import com.ruoyi.system.domain.ServiceGoods;
import com.ruoyi.system.domain.GoodsOrderCursor; import com.ruoyi.system.domain.GoodsOrderCursor;
import com.ruoyi.system.service.IServiceGoodsService; import com.ruoyi.system.service.IServiceGoodsService;
@ -34,41 +36,34 @@ public class CoursorUtil extends BaseController {
@Autowired @Autowired
private IGoodsOrderCursorService goodsOrderCursorService; private IGoodsOrderCursorService goodsOrderCursorService;
/** // /**
* 获取服务商品详细信息 // * 获取服务商品详细信息
* // *
* @param id 商品ID //
* @param request HTTP请求对象 // * @param request HTTP请求对象
* @return 商品详细信息 // * @return 商品详细信息
* <p> // * <p>
* 接口说明 // * 接口说明
* - 根据商品ID获取详细信息 // * - 根据商品ID获取详细信息
* - type=1时返回服务商品格式 // * - type=1时返回服务商品格式
* - type=2时返回普通商品格式 // * - type=2时返回普通商品格式
* - 包含图片基础信息等数组数据 // * - 包含图片基础信息等数组数据
*/ // */
@GetMapping(value = "/api/service/infoData/id/{id}") // @GetMapping(value = "/api/service/infoData/id")
public AjaxResult serviceGoodsDataQuery(@PathVariable("id") long id, HttpServletRequest request) { // public AjaxResult serviceGoodsDataQuery(HttpServletRequest request) {
try { // // 测试 payForFriend 方法
// 参数验证 // WechatPayUtil util = SpringUtils.getBean(WechatPayUtil.class);
if (id <= 0) { // String payerOpenid = "oHTYB7fPTrgG_4zw8CQTZ_Yz3QDU";
return AppletControllerUtil.appletError("商品ID无效"); // String payeeOpenid = "oHTYB7ctO6k4ICmy73HnU0aNRZIo";
} // int totalFee = 100; // 单位
// String orderNo = "TESTORDER123456";
// 查询商品信息 // String body = "测试代付";
ServiceGoods serviceGoodsData = serviceGoodsService.selectServiceGoodsById(id); // String notifyUrl = "https://yourdomain.com/api/wechat/pay/notify";
if (serviceGoodsData == null) { // String remark = "测试备注";
return AppletControllerUtil.appletError("商品不存在或已下架"); // Map<String, Object> result = util.payForFriend(payerOpenid, payeeOpenid, totalFee, orderNo, body, notifyUrl, remark);
} // System.out.println("payForFriend result: " + result);
// return null;
// 构建返回数据 // }
Map<String, Object> goodsData = buildServiceGoodsResponse(serviceGoodsData);
return AppletControllerUtil.appletSuccess(goodsData);
} catch (Exception e) {
return AppletControllerUtil.appletError("查询商品详情失败:" + e.getMessage());
}
}
/** /**
* 获取订单游标信息 * 获取订单游标信息

View File

@ -3,6 +3,7 @@ package com.ruoyi.system.controller;
import com.alibaba.fastjson2.JSONObject; import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.system.ControllerUtil.GenerateCustomCode; import com.ruoyi.system.ControllerUtil.GenerateCustomCode;
import com.ruoyi.system.ControllerUtil.WXsendMsgUtil; import com.ruoyi.system.ControllerUtil.WXsendMsgUtil;
@ -19,7 +20,8 @@ import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.time.ZoneId; import java.time.ZoneId;
import java.util.Date; import java.util.Calendar;
import java.util.Date;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -75,6 +77,19 @@ public class PayNotifyController extends BaseController {
@Autowired @Autowired
private IWorkerMoneyLogService workerMoneyLogService; 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<String, Object> 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<String, Object> paymentInfo = (Map<String, Object>) 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("商品支付回调处理异常");
}
}
/** /**
* 上门费支付回调接口 * 上门费支付回调接口
* *

View File

@ -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<UserBenefitPoints> 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<UserBenefitPoints> list = userBenefitPointsService.selectUserBenefitPointsList(userBenefitPoints);
ExcelUtil<UserBenefitPoints> util = new ExcelUtil<UserBenefitPoints>(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));
}
}

View File

@ -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<UserMemberRechargeLog> 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<UserMemberRechargeLog> list = userMemberRechargeLogService.selectUserMemberRechargeLogList(userMemberRechargeLog);
ExcelUtil<UserMemberRechargeLog> util = new ExcelUtil<UserMemberRechargeLog>(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));
}
}

View File

@ -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<UserMemberRechargeProgram> 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<UserMemberRechargeProgram> list = userMemberRechargeProgramService.selectUserMemberRechargeProgramList(userMemberRechargeProgram);
ExcelUtil<UserMemberRechargeProgram> util = new ExcelUtil<UserMemberRechargeProgram>(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));
}
}

View File

@ -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<UserMemnerConsumptionLog> 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<UserMemnerConsumptionLog> list = userMemnerConsumptionLogService.selectUserMemnerConsumptionLogList(userMemnerConsumptionLog);
ExcelUtil<UserMemnerConsumptionLog> util = new ExcelUtil<UserMemnerConsumptionLog>(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));
}
}

View File

@ -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<UsersInvoiceInfo> 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<UsersInvoiceInfo> list = usersInvoiceInfoService.selectUsersInvoiceInfoList(usersInvoiceInfo);
ExcelUtil<UsersInvoiceInfo> util = new ExcelUtil<UsersInvoiceInfo>(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));
}
}

View File

@ -2217,6 +2217,7 @@ public class AppletControllerUtil {
String integralTemplate = "pv3cba-wPoinUbBZSskp0KpDNnJwrHqS0rvGBfDNQ1M"; // 积分相关通知 String integralTemplate = "pv3cba-wPoinUbBZSskp0KpDNnJwrHqS0rvGBfDNQ1M"; // 积分相关通知
String successTemplate = "YKnuTCAD-oEEhNGoI3LUVkAqNsykOMTcyrf71S9vev8"; // 成功通知 String successTemplate = "YKnuTCAD-oEEhNGoI3LUVkAqNsykOMTcyrf71S9vev8"; // 成功通知
String workerTemplate = "5lA-snytEPl25fBS7rf6rQi8Y0i5HOSdG0JMVdUnMcU"; // 工作人员通知 String workerTemplate = "5lA-snytEPl25fBS7rf6rQi8Y0i5HOSdG0JMVdUnMcU"; // 工作人员通知
String payTemplate = "5rd-P19jRZaOkBXJlsG-SZDx_ZSEkvwIsGt_UoQAF6c"; // 支付消息通知
// 构建不同类型的通知订阅状态 // 构建不同类型的通知订阅状态
List<String> integralList = new ArrayList<>(); List<String> integralList = new ArrayList<>();
@ -2242,9 +2243,45 @@ public class AppletControllerUtil {
notificationStatus.put("a", workerTemplate); notificationStatus.put("a", workerTemplate);
List<String> paymsgList = new ArrayList<>();
paymsgList.add(payTemplate);
notificationStatus.put("payinfo", paymsgList);
notificationStatus.put("pay_template", payTemplate);
return notificationStatus; return notificationStatus;
} }
/**
* 构建小程序zhifu通知订阅状态数据
*
* @param user 用户对象
* @return 小程序通知订阅状态数据
*/
public static Map<String, Object> buildMiniProgramNotificationpayStatus(Users user) {
Map<String, Object> notificationStatus = new HashMap<>();
// 定义三个消息模板ID
String payTemplate = "5rd-P19jRZaOkBXJlsG-SZDx_ZSEkvwIsGt_UoQAF6c"; // 积分相关通知
List<String> workersList = new ArrayList<>();
workersList.add(payTemplate);
notificationStatus.put("template_id", workersList);
notificationStatus.put("template", payTemplate);
return notificationStatus;
}
/** /**
* 验证积分兑换参数 * 验证积分兑换参数
* *

View File

@ -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("余额支付成功");
}
}

View File

@ -35,6 +35,9 @@ public class WXsendMsgUtil {
private static final String PAY_SUCCESS="YKnuTCAD-oEEhNGoI3LUVkAqNsykOMTcyrf71S9vev8"; //下单成功通知 private static final String PAY_SUCCESS="YKnuTCAD-oEEhNGoI3LUVkAqNsykOMTcyrf71S9vev8"; //下单成功通知
private static final String ORDER_STATUS="5lA-snytEPl25fBS7rf6rQi8Y0i5HOSdG0JMVdUnMcU"; // ##订单状态通知 private static final String ORDER_STATUS="5lA-snytEPl25fBS7rf6rQi8Y0i5HOSdG0JMVdUnMcU"; // ##订单状态通知
private static final String PAY_GOODS="pv3cba-wPoinUbBZSskp0KpDNnJwrHqS0rvGBfDNQ1M"; //##商品支付通知 private static final String PAY_GOODS="pv3cba-wPoinUbBZSskp0KpDNnJwrHqS0rvGBfDNQ1M"; //##商品支付通知
private static final String PAY_USERS="5rd-P19jRZaOkBXJlsG-SZDx_ZSEkvwIsGt_UoQAF6c"; //##用户支付状态通知
/** /**
* 获取微信小程序全局唯一后台接口调用凭据 access_token * 获取微信小程序全局唯一后台接口调用凭据 access_token
@ -341,4 +344,26 @@ public class WXsendMsgUtil {
return PublicPush(wxMssVo); 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<String, TemplateData> 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);
}
} }

View File

@ -366,14 +366,13 @@ public class WechatPayUtil {
} }
/** /**
* 企业付款到零钱用于代付完成后的资金转移 * 企业付款到零钱微信支付v3接口实现
* *
* @param transferInfo 付款信息 * @param transferInfo 付款信息
* @return 付款结果 * @return 付款结果
*/ */
public Map<String, Object> transferToUser(Map<String, Object> transferInfo) { public Map<String, Object> transferToUserV3(Map<String, Object> transferInfo) {
Map<String, Object> result = new HashMap<>(); Map<String, Object> result = new HashMap<>();
try { try {
// 1. 参数验证 // 1. 参数验证
String validationError = validateTransferParams(transferInfo); String validationError = validateTransferParams(transferInfo);
@ -382,55 +381,75 @@ public class WechatPayUtil {
result.put("message", validationError); result.put("message", validationError);
return result; return result;
} }
// 2. 构建付款参数
Map<String, String> params = buildTransferParams(transferInfo);
// 3. 生成签名
String sign = generateSign(params, wechatConfig().getApikey());
params.put("sign", sign);
// 设置请求头指定字符编码为UTF-8 // 2. 构建v3接口参数
HttpHeaders headers = new HttpHeaders(); // 你需要在WechatConfig中补充v3相关配置如apiv3KeyprivateKeyPathserialNo
headers.set("Content-Type", "application/xml;charset=UTF-8"); // 并在application.yml中配置
headers.set("Accept", "application/xml;charset=UTF-8"); // 示例
headers.set("User-Agent", "Mozilla/5.0"); // 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<String, Object> 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<Map<String, Object>> detailList = new ArrayList<>();
detailList.add(detail);
Map<String, Object> 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<String> requestEntity = new org.springframework.http.HttpEntity<>(bodyJson, headers);
org.springframework.http.ResponseEntity<String> response = restTemplate.exchange(v3Url, org.springframework.http.HttpMethod.POST, requestEntity, String.class);
// 4. 发送请求需要证书
String xmlRequest = mapToXml(params);
// HttpEntity<String> requestEntity = new HttpEntity<>(xmlRequest, headers);
// 注意企业付款接口需要使用客户端证书这里简化处理
String resourcePath = getClass().getClassLoader().getResource(wechatConfig().getCertpath()).getPath();
ResponseEntity<String> response = restTemplate.postForEntity(WECHAT_TRANSFER_URL, xmlRequest,String.class, resourcePath);
// 5. 解析响应 // 5. 解析响应
Map<String, String> responseMap = xmlToMap(response.getBody()); // 你需要根据微信v3返回结构处理部分字段加密需用apiv3Key解密
if (SUCCESS_CODE.equals(responseMap.get("return_code")) && // 这里只做简单返回
SUCCESS_CODE.equals(responseMap.get("result_code"))) { result.put("success", true);
result.put("response", response.getBody());
Map<String, Object> transferResult = new HashMap<>(); result.put("message", "企业付款v3接口请求已发送请根据返回内容进一步处理");
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")));
}
} catch (Exception e) { } catch (Exception e) {
result.put("success", false); result.put("success", false);
result.put("message", "企业付款异常:" + e.getMessage()); result.put("message", "企业付款v3异常" + e.getMessage());
} }
return result; return result;
} }
/** /**
* 获取证书 * 获取证书
* *
@ -456,9 +475,19 @@ public class WechatPayUtil {
} }
} }
public static void main(String[] args) throws IOException { // public static void main(String[] args) throws IOException {
getCertificate("D:/javacode/RuoYi-Vue-master/ruoyi-admin/target/classes/wechat/apiclient_cert.p12"); // // 测试 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<String, Object> 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; return params;
} }
// /**
// * 微信代付企业付款到零钱
// * @param payerOpenid 代付人openid
// * @param payeeOpenid 被代付人openid
// * @param totalFee 代付金额单位整型
// * @param orderNo 原订单号
// * @param body 商品描述
// * @param notifyUrl 回调通知地址
// * @param remark 备注可选
// * @return 代付结果Map
// */
// public Map<String, Object> payForFriend(String payerOpenid, String payeeOpenid, int totalFee, String orderNo, String body, String notifyUrl, String remark) {
// Map<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> 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<String, Object> v3JsapiPay(String openid, String orderNo, int totalFee, String body, String notifyUrl) {
Map<String, Object> result = new HashMap<>();
try {
// 1. 构建v3下单参数
String appid = wechatConfig().getAppid();
String mchid = wechatConfig().getMchid();
// TODO: 你需要在WechatConfig中补充apiv3KeyprivateKeyPathserialNo等配置
Map<String, Object> amount = new HashMap<>();
amount.put("total", totalFee);
amount.put("currency", "CNY");
Map<String, Object> payer = new HashMap<>();
payer.put("openid", openid);
Map<String, Object> 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<String> requestEntity = new org.springframework.http.HttpEntity<>(bodyJson, headers);
org.springframework.http.ResponseEntity<String> 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<String, Object> v3Refund(String orderNo, String refundNo, int totalFee, int refundFee, String reason, String notifyUrl) {
Map<String, Object> result = new HashMap<>();
try {
String appid = wechatConfig().getAppid();
String mchid = wechatConfig().getMchid();
// TODO: 你需要在WechatConfig中补充apiv3KeyprivateKeyPathserialNo等配置
Map<String, Object> amount = new HashMap<>();
amount.put("refund", refundFee);
amount.put("total", totalFee);
amount.put("currency", "CNY");
Map<String, Object> 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<String> requestEntity = new org.springframework.http.HttpEntity<>(bodyJson, headers);
org.springframework.http.ResponseEntity<String> 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<String, Object> v3Withdraw(String openid, int amount, String desc) {
Map<String, Object> transferInfo = new HashMap<>();
transferInfo.put("openid", openid);
transferInfo.put("amount", amount);
transferInfo.put("desc", desc);
// 你可以根据需要补充outBatchNobatchNamebatchRemark等参数
return transferToUserV3(transferInfo);
}
} }

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -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();
}
}

View File

@ -137,6 +137,35 @@ public class Users extends BaseEntity
@Excel(name = "1虚拟号码-已认证") @Excel(name = "1虚拟号码-已认证")
private Integer middleAuth; 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 */ /** $column.columnComment */
@Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()") @Excel(name = "${comment}", readConverterExp = "$column.readConverterExp()")
private Date createdAt; private Date createdAt;
@ -539,6 +568,63 @@ public class Users extends BaseEntity
this.goods_order_num = goods_order_num; 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 @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

View File

@ -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();
}
}

View File

@ -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<UserBenefitPoints> 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);
}

View File

@ -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<UserMemberRechargeLog> 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);
}

View File

@ -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<UserMemberRechargeProgram> 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);
}

View File

@ -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<UserMemnerConsumptionLog> 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);
}

View File

@ -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<UsersInvoiceInfo> 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);
}

View File

@ -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<UserBenefitPoints> 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);
}

View File

@ -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<UserMemberRechargeLog> 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);
}

View File

@ -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<UserMemberRechargeProgram> 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);
}

View File

@ -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<UserMemnerConsumptionLog> 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);
}

View File

@ -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<UsersInvoiceInfo> 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);
}

View File

@ -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<UserBenefitPoints> 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);
}
}

View File

@ -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<UserMemberRechargeLog> 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);
}
}

View File

@ -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<UserMemberRechargeProgram> 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);
}
}

View File

@ -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<UserMemnerConsumptionLog> 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);
}
}

View File

@ -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<UsersInvoiceInfo> 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);
}
}

View File

@ -0,0 +1,111 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.UserBenefitPointsMapper">
<resultMap type="UserBenefitPoints" id="UserBenefitPointsResult">
<result property="id" column="id" />
<result property="type" column="type" />
<result property="dotime" column="dotime" />
<result property="ordermoney" column="ordermoney" />
<result property="money" column="money" />
<result property="ordertype" column="ordertype" />
<result property="uid" column="uid" />
<result property="beformoney" column="beformoney" />
<result property="aftremoney" column="aftremoney" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="orderid" column="orderid" />
<result property="reamk" column="reamk" />
</resultMap>
<sql id="selectUserBenefitPointsVo">
select id, type, dotime, ordermoney, money, ordertype, uid, beformoney, aftremoney, created_at, updated_at, orderid, reamk from user_benefit_points
</sql>
<select id="selectUserBenefitPointsList" parameterType="UserBenefitPoints" resultMap="UserBenefitPointsResult">
<include refid="selectUserBenefitPointsVo"/>
<where>
<if test="type != null "> and type = #{type}</if>
<if test="dotime != null "> and dotime = #{dotime}</if>
<if test="ordermoney != null "> and ordermoney = #{ordermoney}</if>
<if test="money != null "> and money = #{money}</if>
<if test="ordertype != null "> and ordertype = #{ordertype}</if>
<if test="uid != null "> and uid = #{uid}</if>
<if test="beformoney != null "> and beformoney = #{beformoney}</if>
<if test="aftremoney != null "> and aftremoney = #{aftremoney}</if>
<if test="createdAt != null "> and created_at = #{createdAt}</if>
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if>
<if test="orderid != null "> and orderid = #{orderid}</if>
<if test="reamk != null and reamk != ''"> and reamk = #{reamk}</if>
</where>
</select>
<select id="selectUserBenefitPointsById" parameterType="Long" resultMap="UserBenefitPointsResult">
<include refid="selectUserBenefitPointsVo"/>
where id = #{id}
</select>
<insert id="insertUserBenefitPoints" parameterType="UserBenefitPoints" useGeneratedKeys="true" keyProperty="id">
insert into user_benefit_points
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="type != null">type,</if>
<if test="dotime != null">dotime,</if>
<if test="ordermoney != null">ordermoney,</if>
<if test="money != null">money,</if>
<if test="ordertype != null">ordertype,</if>
<if test="uid != null">uid,</if>
<if test="beformoney != null">beformoney,</if>
<if test="aftremoney != null">aftremoney,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
<if test="orderid != null">orderid,</if>
<if test="reamk != null">reamk,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="type != null">#{type},</if>
<if test="dotime != null">#{dotime},</if>
<if test="ordermoney != null">#{ordermoney},</if>
<if test="money != null">#{money},</if>
<if test="ordertype != null">#{ordertype},</if>
<if test="uid != null">#{uid},</if>
<if test="beformoney != null">#{beformoney},</if>
<if test="aftremoney != null">#{aftremoney},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
<if test="orderid != null">#{orderid},</if>
<if test="reamk != null">#{reamk},</if>
</trim>
</insert>
<update id="updateUserBenefitPoints" parameterType="UserBenefitPoints">
update user_benefit_points
<trim prefix="SET" suffixOverrides=",">
<if test="type != null">type = #{type},</if>
<if test="dotime != null">dotime = #{dotime},</if>
<if test="ordermoney != null">ordermoney = #{ordermoney},</if>
<if test="money != null">money = #{money},</if>
<if test="ordertype != null">ordertype = #{ordertype},</if>
<if test="uid != null">uid = #{uid},</if>
<if test="beformoney != null">beformoney = #{beformoney},</if>
<if test="aftremoney != null">aftremoney = #{aftremoney},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
<if test="orderid != null">orderid = #{orderid},</if>
<if test="reamk != null">reamk = #{reamk},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserBenefitPointsById" parameterType="Long">
delete from user_benefit_points where id = #{id}
</delete>
<delete id="deleteUserBenefitPointsByIds" parameterType="String">
delete from user_benefit_points where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.UserMemberRechargeLogMapper">
<resultMap type="UserMemberRechargeLog" id="UserMemberRechargeLogResult">
<result property="id" column="id" />
<result property="uid" column="uid" />
<result property="paytype" column="paytype" />
<result property="paytime" column="paytime" />
<result property="inmoney" column="inmoney" />
<result property="orderid" column="orderid" />
<result property="proid" column="proid" />
<result property="reamk" column="reamk" />
<result property="comemoney" column="comemoney" />
<result property="ismember" column="ismember" />
<result property="transactionId" column="transaction_id" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" />
<result property="del" column="del" />
</resultMap>
<sql id="selectUserMemberRechargeLogVo">
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
</sql>
<select id="selectUserMemberRechargeLogList" parameterType="UserMemberRechargeLog" resultMap="UserMemberRechargeLogResult">
<include refid="selectUserMemberRechargeLogVo"/>
<where>
<if test="uid != null "> and uid = #{uid}</if>
</where>
order by updated_at desc
</select>
<select id="selectUserMemberRechargeLogById" parameterType="Integer" resultMap="UserMemberRechargeLogResult">
<include refid="selectUserMemberRechargeLogVo"/>
where id = #{id}
</select>
<insert id="insertUserMemberRechargeLog" parameterType="UserMemberRechargeLog" useGeneratedKeys="true" keyProperty="id">
insert into user_member_recharge_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">uid,</if>
<if test="paytype != null">paytype,</if>
<if test="paytime != null">paytime,</if>
<if test="inmoney != null">inmoney,</if>
<if test="transactionId != null">transaction_id,</if>
<if test="deletedAt != null">deleted_at,</if>
<if test="del != null">del,</if>
<if test="orderid != null">orderid,</if>
<if test="proid != null">proid,</if>
<if test="comemoney != null">comemoney,</if>
<if test="reamk != null">reamk,</if>
<if test="ismember != null">ismember,</if>
created_at,
updated_at
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">#{uid},</if>
<if test="paytype != null">#{paytype},</if>
<if test="paytime != null">#{paytime},</if>
<if test="inmoney != null">#{inmoney},</if>
<if test="transactionId != null">#{transactionId},</if>
<if test="deletedAt != null">#{deletedAt},</if>
<if test="del != null">#{del},</if>
<if test="orderid != null">#{orderid},</if>
<if test="proid != null">#{proid},</if>
<if test="comemoney != null">#{comemoney},</if>
<if test="reamk != null">#{reamk},</if>
<if test="ismember != null">#{ismember},</if>
NOW(),
NOW()
</trim>
</insert>
<update id="updateUserMemberRechargeLog" parameterType="UserMemberRechargeLog">
update user_member_recharge_log
<trim prefix="SET" suffixOverrides=",">
<if test="paytype != null">paytype = #{paytype},</if>
<if test="paytime != null">paytime = #{paytime},</if>
<if test="inmoney != null">inmoney = #{inmoney},</if>
<if test="transactionId != null">transaction_id = #{transactionId},</if>
updated_at = NOW(),
<if test="deletedAt != null">deleted_at = #{deletedAt},</if>
<if test="del != null">del = #{del},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserMemberRechargeLogById" parameterType="Integer">
delete from user_member_recharge_log where id = #{id}
</delete>
<delete id="deleteUserMemberRechargeLogByIds" parameterType="String">
delete from user_member_recharge_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.UserMemberRechargeProgramMapper">
<resultMap type="UserMemberRechargeProgram" id="UserMemberRechargeProgramResult">
<result property="id" column="id" />
<result property="rechargename" column="rechargename" />
<result property="money" column="money" />
<result property="discount" column="discount" />
<result property="reamk" column="reamk" />
<result property="status" column="status" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" />
<result property="type" column="type" />
</resultMap>
<sql id="selectUserMemberRechargeProgramVo">
select id, rechargename, money, discount, reamk, status, created_at, updated_at, deleted_at, type from user_member_recharge_program
</sql>
<select id="selectUserMemberRechargeProgramList" parameterType="UserMemberRechargeProgram" resultMap="UserMemberRechargeProgramResult">
<include refid="selectUserMemberRechargeProgramVo"/>
<where>
<if test="rechargename != null and rechargename != ''"> and rechargename like concat('%', #{rechargename}, '%')</if>
<if test="reamk != null and reamk != ''"> and reamk like concat('%', #{reamk}, '%')</if>
<if test="status != null "> and status = #{status}</if>
<if test="type != null "> and type = #{type}</if>
</where>
order by updated_at desc
</select>
<select id="selectUserMemberRechargeProgramById" parameterType="Integer" resultMap="UserMemberRechargeProgramResult">
<include refid="selectUserMemberRechargeProgramVo"/>
where id = #{id}
</select>
<insert id="insertUserMemberRechargeProgram" parameterType="UserMemberRechargeProgram">
insert into user_member_recharge_program
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="rechargename != null">rechargename,</if>
<if test="money != null">money,</if>
<if test="discount != null">discount,</if>
<if test="reamk != null">reamk,</if>
<if test="status != null">status,</if>
<if test="deletedAt != null">deleted_at,</if>
<if test="type != null">type,</if>
created_at,
updated_at
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="rechargename != null">#{rechargename},</if>
<if test="money != null">#{money},</if>
<if test="discount != null">#{discount},</if>
<if test="reamk != null">#{reamk},</if>
<if test="status != null">#{status},</if>
<if test="deletedAt != null">#{deletedAt},</if>
<if test="type != null">#{type},</if>
NOW(),
NOW()
</trim>
</insert>
<update id="updateUserMemberRechargeProgram" parameterType="UserMemberRechargeProgram">
update user_member_recharge_program
<trim prefix="SET" suffixOverrides=",">
<if test="rechargename != null">rechargename = #{rechargename},</if>
<if test="money != null">money = #{money},</if>
<if test="discount != null">discount = #{discount},</if>
<if test="reamk != null">reamk = #{reamk},</if>
<if test="status != null">status = #{status},</if>
<if test="deletedAt != null">deleted_at = #{deletedAt},</if>
<if test="type != null">type = #{type},</if>
updated_at = NOW()
</trim>
where id = #{id}
</update>
<delete id="deleteUserMemberRechargeProgramById" parameterType="Long">
delete from user_member_recharge_program where id = #{id}
</delete>
<delete id="deleteUserMemberRechargeProgramByIds" parameterType="String">
delete from user_member_recharge_program where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.UserMemnerConsumptionLogMapper">
<resultMap type="UserMemnerConsumptionLog" id="UserMemnerConsumptionLogResult">
<result property="id" column="id" />
<result property="uid" column="uid" />
<result property="consumptiontype" column="consumptiontype" />
<result property="consumptiontime" column="consumptiontime" />
<result property="consumptionmoney" column="consumptionmoney" />
<result property="reamk" column="reamk" />
<result property="beformoney" column="beformoney" />
<result property="aftermoney" column="aftermoney" />
<result property="nowmoney" column="nowmoney" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
<result property="deletedAt" column="deleted_at" />
<result property="del" column="del" />
</resultMap>
<sql id="selectUserMemnerConsumptionLogVo">
select id, uid, consumptiontype, consumptiontime, consumptionmoney, reamk, beformoney, aftermoney, nowmoney, created_at, updated_at, deleted_at, del from user_memner_consumption_log
</sql>
<select id="selectUserMemnerConsumptionLogList" parameterType="UserMemnerConsumptionLog" resultMap="UserMemnerConsumptionLogResult">
<include refid="selectUserMemnerConsumptionLogVo"/>
<where>
<if test="uid != null "> and uid = #{uid}</if>
<if test="del != null "> and del = #{del}</if>
</where>
order by updated_at desc
</select>
<select id="selectUserMemnerConsumptionLogById" parameterType="Integer" resultMap="UserMemnerConsumptionLogResult">
<include refid="selectUserMemnerConsumptionLogVo"/>
where id = #{id}
</select>
<insert id="insertUserMemnerConsumptionLog" parameterType="UserMemnerConsumptionLog" useGeneratedKeys="true" keyProperty="id">
insert into user_memner_consumption_log
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">uid,</if>
<if test="consumptiontype != null">consumptiontype,</if>
<if test="consumptiontime != null">consumptiontime,</if>
<if test="consumptionmoney != null">consumptionmoney,</if>
<if test="reamk != null">reamk,</if>
<if test="beformoney != null">beformoney,</if>
<if test="aftermoney != null">aftermoney,</if>
<if test="nowmoney != null">nowmoney,</if>
<if test="deletedAt != null">deleted_at,</if>
<if test="del != null">del,</if>
created_at,
updated_at
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">#{uid},</if>
<if test="consumptiontype != null">#{consumptiontype},</if>
<if test="consumptiontime != null">#{consumptiontime},</if>
<if test="consumptionmoney != null">#{consumptionmoney},</if>
<if test="reamk != null">#{reamk},</if>
<if test="beformoney != null">#{beformoney},</if>
<if test="aftermoney != null">#{aftermoney},</if>
<if test="nowmoney != null">#{nowmoney},</if>
<if test="deletedAt != null">#{deletedAt},</if>
<if test="del != null">#{del},</if>
NOW(),
NOW()
</trim>
</insert>
<update id="updateUserMemnerConsumptionLog" parameterType="UserMemnerConsumptionLog">
update user_memner_consumption_log
<trim prefix="SET" suffixOverrides=",">
<if test="uid != null">uid = #{uid},</if>
<if test="consumptiontype != null">consumptiontype = #{consumptiontype},</if>
<if test="consumptiontime != null">consumptiontime = #{consumptiontime},</if>
<if test="consumptionmoney != null">consumptionmoney = #{consumptionmoney},</if>
<if test="reamk != null">reamk = #{reamk},</if>
<if test="beformoney != null">beformoney = #{beformoney},</if>
<if test="aftermoney != null">aftermoney = #{aftermoney},</if>
<if test="nowmoney != null">nowmoney = #{nowmoney},</if>
updated_at = NOW(),
<if test="deletedAt != null">deleted_at = #{deletedAt},</if>
<if test="del != null">del = #{del},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUserMemnerConsumptionLogById" parameterType="Integer">
delete from user_memner_consumption_log where id = #{id}
</delete>
<delete id="deleteUserMemnerConsumptionLogByIds" parameterType="String">
delete from user_memner_consumption_log where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,114 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.UsersInvoiceInfoMapper">
<resultMap type="UsersInvoiceInfo" id="UsersInvoiceInfoResult">
<result property="id" column="id" />
<result property="uid" column="uid" />
<result property="invoiceTitle" column="invoice_title" />
<result property="taxNumber" column="tax_number" />
<result property="bankName" column="bank_name" />
<result property="bankAccount" column="bank_account" />
<result property="address" column="address" />
<result property="phone" column="phone" />
<result property="email" column="email" />
<result property="wechat" column="wechat" />
<result property="type" column="type" />
<result property="category" column="category" />
<result property="createdAt" column="created_at" />
<result property="updatedAt" column="updated_at" />
</resultMap>
<sql id="selectUsersInvoiceInfoVo">
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
</sql>
<select id="selectUsersInvoiceInfoList" parameterType="UsersInvoiceInfo" resultMap="UsersInvoiceInfoResult">
<include refid="selectUsersInvoiceInfoVo"/>
<where>
<if test="uid != null "> and uid = #{uid}</if>
<if test="invoiceTitle != null and invoiceTitle != ''"> and invoice_title = #{invoiceTitle}</if>
<if test="taxNumber != null and taxNumber != ''"> and tax_number = #{taxNumber}</if>
<if test="bankName != null and bankName != ''"> and bank_name like concat('%', #{bankName}, '%')</if>
<if test="bankAccount != null and bankAccount != ''"> and bank_account = #{bankAccount}</if>
<if test="address != null and address != ''"> and address = #{address}</if>
<if test="phone != null and phone != ''"> and phone = #{phone}</if>
<if test="email != null and email != ''"> and email = #{email}</if>
<if test="wechat != null and wechat != ''"> and wechat = #{wechat}</if>
<if test="type != null "> and type = #{type}</if>
<if test="category != null "> and category = #{category}</if>
</where>
</select>
<select id="selectUsersInvoiceInfoById" parameterType="Integer" resultMap="UsersInvoiceInfoResult">
<include refid="selectUsersInvoiceInfoVo"/>
where id = #{id}
</select>
<insert id="insertUsersInvoiceInfo" parameterType="UsersInvoiceInfo" useGeneratedKeys="true" keyProperty="id">
insert into users_invoice_info
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="uid != null">uid,</if>
<if test="invoiceTitle != null">invoice_title,</if>
<if test="taxNumber != null">tax_number,</if>
<if test="bankName != null">bank_name,</if>
<if test="bankAccount != null">bank_account,</if>
<if test="address != null">address,</if>
<if test="phone != null">phone,</if>
<if test="email != null">email,</if>
<if test="wechat != null">wechat,</if>
<if test="type != null">type,</if>
<if test="category != null">category,</if>
<if test="createdAt != null">created_at,</if>
<if test="updatedAt != null">updated_at,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="uid != null">#{uid},</if>
<if test="invoiceTitle != null">#{invoiceTitle},</if>
<if test="taxNumber != null">#{taxNumber},</if>
<if test="bankName != null">#{bankName},</if>
<if test="bankAccount != null">#{bankAccount},</if>
<if test="address != null">#{address},</if>
<if test="phone != null">#{phone},</if>
<if test="email != null">#{email},</if>
<if test="wechat != null">#{wechat},</if>
<if test="type != null">#{type},</if>
<if test="category != null">#{category},</if>
<if test="createdAt != null">#{createdAt},</if>
<if test="updatedAt != null">#{updatedAt},</if>
</trim>
</insert>
<update id="updateUsersInvoiceInfo" parameterType="UsersInvoiceInfo">
update users_invoice_info
<trim prefix="SET" suffixOverrides=",">
<if test="uid != null">uid = #{uid},</if>
<if test="invoiceTitle != null">invoice_title = #{invoiceTitle},</if>
<if test="taxNumber != null">tax_number = #{taxNumber},</if>
<if test="bankName != null">bank_name = #{bankName},</if>
<if test="bankAccount != null">bank_account = #{bankAccount},</if>
<if test="address != null">address = #{address},</if>
<if test="phone != null">phone = #{phone},</if>
<if test="email != null">email = #{email},</if>
<if test="wechat != null">wechat = #{wechat},</if>
<if test="type != null">type = #{type},</if>
<if test="category != null">category = #{category},</if>
<if test="createdAt != null">created_at = #{createdAt},</if>
<if test="updatedAt != null">updated_at = #{updatedAt},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteUsersInvoiceInfoById" parameterType="Integer">
delete from users_invoice_info where id = #{id}
</delete>
<delete id="deleteUsersInvoiceInfoByIds" parameterType="String">
delete from users_invoice_info where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -1,51 +1,95 @@
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper <!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.ruoyi.system.mapper.UsersMapper"> <mapper namespace="com.ruoyi.system.mapper.UsersMapper">
<resultMap type="Users" id="UsersResult">
<resultMap type="Users" id="UsersResult"> <result property="id" column="id"/>
<result property="id" column="id" /> <result property="name" column="name"/>
<result property="name" column="name" /> <result property="nickname" column="nickname"/>
<result property="nickname" column="nickname" /> <result property="phone" column="phone"/>
<result property="phone" column="phone" /> <result property="password" column="password"/>
<result property="password" column="password" /> <result property="rememberToken" column="remember_token"/>
<result property="rememberToken" column="remember_token" /> <result property="openid" column="openid"/>
<result property="openid" column="openid" /> <result property="avatar" column="avatar"/>
<result property="avatar" column="avatar" /> <result property="type" column="type"/>
<result property="type" column="type" /> <result property="workerTime" column="worker_time"/>
<result property="workerTime" column="worker_time" /> <result property="integral" column="integral"/>
<result property="integral" column="integral" /> <result property="totalIntegral" column="total_integral"/>
<result property="totalIntegral" column="total_integral" /> <result property="status" column="status"/>
<result property="status" column="status" /> <result property="level" column="level"/>
<result property="level" column="level" /> <result property="isWork" column="is_work"/>
<result property="isWork" column="is_work" /> <result property="commission" column="commission"/>
<result property="commission" column="commission" /> <result property="totalComm" column="total_comm"/>
<result property="totalComm" column="total_comm" /> <result property="margin" column="margin"/>
<result property="margin" column="margin" /> <result property="jobNumber" column="job_number"/>
<result property="jobNumber" column="job_number" /> <result property="prohibitTime" column="prohibit_time"/>
<result property="prohibitTime" column="prohibit_time" /> <result property="prohibitTimeNum" column="prohibit_time_num"/>
<result property="prohibitTimeNum" column="prohibit_time_num" /> <result property="toa" column="toa"/>
<result property="toa" column="toa" /> <result property="serviceCityPid" column="service_city_pid"/>
<result property="serviceCityPid" column="service_city_pid" /> <result property="serviceCityIds" column="service_city_ids"/>
<result property="serviceCityIds" column="service_city_ids" /> <result property="skillIds" column="skill_ids"/>
<result property="skillIds" column="skill_ids" /> <result property="propose" column="propose"/>
<result property="propose" column="propose" /> <result property="loginStatus" column="login_status"/>
<result property="loginStatus" column="login_status" /> <result property="isStop" column="is_stop"/>
<result property="isStop" column="is_stop" /> <result property="middleAuth" column="middle_auth"/>
<result property="middleAuth" column="middle_auth" /> <result property="consumption" column="consumption"/>
<result property="createdAt" column="created_at" /> <result property="servicefee" column="servicefee"/>
<result property="updatedAt" column="updated_at" /> <result property="birthday" column="birthday"/>
<result property="balance" column="balance"/>
<result property="ismember" column="ismember"/>
<result property="memberBegin" column="member_begin"/>
<result property="memberEnd" column="member_end"/>
<result property="createdAt" column="created_at"/>
<result property="updatedAt" column="updated_at"/>
</resultMap> </resultMap>
<sql id="selectUsersVo"> <sql id="selectUsersVo">
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
</sql> </sql>
<select id="selectUsersList" parameterType="Users" resultMap="UsersResult"> <select id="selectUsersList" parameterType="Users" resultMap="UsersResult">
<include refid="selectUsersVo"/> <include refid="selectUsersVo"/>
<where> <where>
<if test="totalCommMin != null and totalCommMax != null"> <if test="totalCommMin != null and totalCommMax != null">
and total_comm BETWEEN #{totalCommMin} AND #{totalCommMax} and total_comm BETWEEN #{totalCommMin} AND #{totalCommMax}
</if> </if>
@ -59,42 +103,99 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</if> </if>
<if test="name != null and name != ''">
and name like concat('%', #{name}, '%')
</if>
<if test="nickname != null and nickname != ''">
and nickname like concat('%', #{nickname}, '%')
</if>
<if test="jobNumber != null">
and job_number like concat('%', #{jobNumber}, '%')
</if>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if> <if test="phone != null and phone != ''">
<if test="nickname != null and nickname != ''"> and nickname like concat('%', #{nickname}, '%')</if> and phone like concat('%', #{phone}, '%')
<if test="jobNumber != null "> and job_number like concat('%', #{jobNumber}, '%')</if> </if>
<if test="password != null and password != ''">
and password = #{password}
</if>
<if test="rememberToken != null and rememberToken != ''">
and remember_token = #{rememberToken}
</if>
<if test="openid != null and openid != ''">
and openid = #{openid}
</if>
<if test="avatar != null and avatar != ''">
and avatar = #{avatar}
</if>
<if test="type != null and type != ''">
and type = #{type}
</if>
<if test="workerTime != null">
and worker_time = #{workerTime}
</if>
<if test="integral != null">
and integral = #{integral}
</if>
<if test="totalIntegral != null">
and total_integral = #{totalIntegral}
</if>
<if test="status != null">
and status = #{status}
</if>
<if test="level != null">
and level = #{level}
</if>
<if test="commission != null">
and commission = #{commission}
</if>
<if test="totalComm != null">
and total_comm = #{totalComm}
</if>
<if test="margin != null">
and margin = #{margin}
</if>
<if test="phone != null and phone != ''"> and phone like concat('%', #{phone}, '%')</if> <if test="prohibitTime != null">
<if test="password != null and password != ''"> and password = #{password}</if> and prohibit_time = #{prohibitTime}
<if test="rememberToken != null and rememberToken != ''"> and remember_token = #{rememberToken}</if> </if>
<if test="openid != null and openid != ''"> and openid = #{openid}</if> <if test="prohibitTimeNum != null">
<if test="avatar != null and avatar != ''"> and avatar = #{avatar}</if> and prohibit_time_num = #{prohibitTimeNum}
<if test="type != null and type != ''"> and type = #{type}</if> </if>
<if test="workerTime != null "> and worker_time = #{workerTime}</if> <if test="toa != null">
<if test="integral != null "> and integral = #{integral}</if> and toa = #{toa}
<if test="totalIntegral != null "> and total_integral = #{totalIntegral}</if> </if>
<if test="status != null "> and status = #{status}</if> <if test="serviceCityPid != null">
<if test="level != null "> and level = #{level}</if> and service_city_pid = #{serviceCityPid}
<if test="commission != null "> and commission = #{commission}</if> </if>
<if test="totalComm != null "> and total_comm = #{totalComm}</if> <if test="serviceCityIds != null and serviceCityIds != ''">
<if test="margin != null "> and margin = #{margin}</if> and service_city_ids = #{serviceCityIds}
</if>
<if test="prohibitTime != null "> and prohibit_time = #{prohibitTime}</if> <if test="skillIds != null and skillIds != ''">
<if test="prohibitTimeNum != null "> and prohibit_time_num = #{prohibitTimeNum}</if> and skill_ids = #{skillIds}
<if test="toa != null "> and toa = #{toa}</if> </if>
<if test="serviceCityPid != null "> and service_city_pid = #{serviceCityPid}</if> <if test="propose != null">
<if test="serviceCityIds != null and serviceCityIds != ''"> and service_city_ids = #{serviceCityIds}</if> and propose = #{propose}
<if test="skillIds != null and skillIds != ''"> and skill_ids = #{skillIds}</if> </if>
<if test="propose != null "> and propose = #{propose}</if> <if test="loginStatus != null">
<if test="loginStatus != null "> and login_status = #{loginStatus}</if> and login_status = #{loginStatus}
<if test="isStop != null "> and is_stop = #{isStop}</if> </if>
<if test="middleAuth != null "> and middle_auth = #{middleAuth}</if> <if test="isStop != null">
<if test="createdAt != null "> and created_at = #{createdAt}</if> and is_stop = #{isStop}
<if test="updatedAt != null "> and updated_at = #{updatedAt}</if> </if>
<if test="middleAuth != null">
and middle_auth = #{middleAuth}
</if>
<if test="createdAt != null">
and created_at = #{createdAt}
</if>
<if test="updatedAt != null">
and updated_at = #{updatedAt}
</if>
</where> </where>
order by id desc order by id desc
</select> </select>
<select id="selectUsersById" parameterType="Long" resultMap="UsersResult"> <select id="selectUsersById" parameterType="Long" resultMap="UsersResult">
<include refid="selectUsersVo"/> <include refid="selectUsersVo"/>
where id = #{id} where id = #{id}
@ -102,10 +203,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<select id="selectUsersIsMaxNumber" parameterType="Long" resultMap="UsersResult"> <select id="selectUsersIsMaxNumber" parameterType="Long" resultMap="UsersResult">
<include refid="selectUsersVo"/>
<include refid="selectUsersVo"/> ORDER BY job_number DESC LIMIT 1;
ORDER BY job_number DESC
LIMIT 1;
</select> </select>
<select id="selectUsersByRememberToken" parameterType="String" resultMap="UsersResult"> <select id="selectUsersByRememberToken" parameterType="String" resultMap="UsersResult">
@ -128,115 +227,351 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertUsers" parameterType="Users" useGeneratedKeys="true" keyProperty="id"> <insert id="insertUsers" parameterType="Users" useGeneratedKeys="true" keyProperty="id">
insert into users insert into users
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">name,</if> <if test="name != null and name != ''">
<if test="nickname != null">nickname,</if> name,
<if test="phone != null">phone,</if> </if>
<if test="password != null">password,</if> <if test="nickname != null">
<if test="rememberToken != null">remember_token,</if> nickname,
<if test="openid != null">openid,</if> </if>
<if test="avatar != null">avatar,</if> <if test="phone != null">
<if test="type != null and type != ''">type,</if> phone,
<if test="workerTime != null">worker_time,</if> </if>
<if test="integral != null">integral,</if> <if test="password != null">
<if test="totalIntegral != null">total_integral,</if> password,
<if test="status != null">status,</if> </if>
<if test="level != null">level,</if> <if test="rememberToken != null">
<if test="isWork != null">is_work,</if> remember_token,
</if>
<if test="openid != null">
openid,
</if>
<if test="avatar != null">
avatar,
</if>
<if test="type != null and type != ''">
type,
</if>
<if test="workerTime != null">
worker_time,
</if>
<if test="integral != null">
integral,
</if>
<if test="totalIntegral != null">
total_integral,
</if>
<if test="status != null">
status,
</if>
<if test="level != null">
level,
</if>
<if test="isWork != null">
is_work,
</if>
<if test="commission != null">
commission,
</if>
<if test="totalComm != null">
total_comm,
</if>
<if test="margin != null">
margin,
</if>
<if test="jobNumber != null">
job_number,
</if>
<if test="prohibitTime != null">
prohibit_time,
</if>
<if test="prohibitTimeNum != null">
prohibit_time_num,
</if>
<if test="toa != null">
toa,
</if>
<if test="serviceCityPid != null">
service_city_pid,
</if>
<if test="serviceCityIds != null">
service_city_ids,
</if>
<if test="skillIds != null">
skill_ids,
</if>
<if test="propose != null">
propose,
</if>
<if test="loginStatus != null">
login_status,
</if>
<if test="isStop != null">
is_stop,
</if>
<if test="middleAuth != null">
middle_auth,
</if>
<if test="balance != null">
balance,
</if>
<if test="ismember != null">
ismember,
</if>
<if test="memberBegin != null">
member_begin,
</if>
<if test="memberEnd != null">
member_end,
</if>
<if test="consumption != null">
consumption,
</if>
<if test="servicefee != null">
servicefee,
</if>
<if test="birthday != null">
birthday,
</if>
<if test="commission != null">commission,</if>
<if test="totalComm != null">total_comm,</if>
<if test="margin != null">margin,</if>
<if test="jobNumber != null">job_number,</if>
<if test="prohibitTime != null">prohibit_time,</if>
<if test="prohibitTimeNum != null">prohibit_time_num,</if>
<if test="toa != null">toa,</if>
<if test="serviceCityPid != null">service_city_pid,</if>
<if test="serviceCityIds != null">service_city_ids,</if>
<if test="skillIds != null">skill_ids,</if>
<if test="propose != null">propose,</if>
<if test="loginStatus != null">login_status,</if>
<if test="isStop != null">is_stop,</if>
<if test="middleAuth != null">middle_auth,</if>
created_at, created_at,
updated_at updated_at
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null and name != ''">#{name},</if> <if test="name != null and name != ''">
<if test="nickname != null">#{nickname},</if> #{name},
<if test="phone != null">#{phone},</if> </if>
<if test="password != null">#{password},</if> <if test="nickname != null">
<if test="rememberToken != null">#{rememberToken},</if> #{nickname},
<if test="openid != null">#{openid},</if> </if>
<if test="avatar != null">#{avatar},</if> <if test="phone != null">
<if test="type != null and type != ''">#{type},</if> #{phone},
<if test="workerTime != null">#{workerTime},</if> </if>
<if test="integral != null">#{integral},</if> <if test="password != null">
<if test="totalIntegral != null">#{totalIntegral},</if> #{password},
<if test="status != null">#{status},</if> </if>
<if test="level != null">#{level},</if> <if test="rememberToken != null">
<if test="isWork != null">#{isWork},</if> #{rememberToken},
<if test="commission != null">#{commission},</if> </if>
<if test="totalComm != null">#{totalComm},</if> <if test="openid != null">
<if test="margin != null">#{margin},</if> #{openid},
<if test="jobNumber != null">#{jobNumber},</if> </if>
<if test="prohibitTime != null">#{prohibitTime},</if> <if test="avatar != null">
<if test="prohibitTimeNum != null">#{prohibitTimeNum},</if> #{avatar},
<if test="toa != null">#{toa},</if> </if>
<if test="serviceCityPid != null">#{serviceCityPid},</if> <if test="type != null and type != ''">
<if test="serviceCityIds != null">#{serviceCityIds},</if> #{type},
<if test="skillIds != null">#{skillIds},</if> </if>
<if test="propose != null">#{propose},</if> <if test="workerTime != null">
<if test="loginStatus != null">#{loginStatus},</if> #{workerTime},
<if test="isStop != null">#{isStop},</if> </if>
<if test="middleAuth != null">#{middleAuth},</if> <if test="integral != null">
#{integral},
</if>
<if test="totalIntegral != null">
#{totalIntegral},
</if>
<if test="status != null">
#{status},
</if>
<if test="level != null">
#{level},
</if>
<if test="isWork != null">
#{isWork},
</if>
<if test="commission != null">
#{commission},
</if>
<if test="totalComm != null">
#{totalComm},
</if>
<if test="margin != null">
#{margin},
</if>
<if test="jobNumber != null">
#{jobNumber},
</if>
<if test="prohibitTime != null">
#{prohibitTime},
</if>
<if test="prohibitTimeNum != null">
#{prohibitTimeNum},
</if>
<if test="toa != null">
#{toa},
</if>
<if test="serviceCityPid != null">
#{serviceCityPid},
</if>
<if test="serviceCityIds != null">
#{serviceCityIds},
</if>
<if test="skillIds != null">
#{skillIds},
</if>
<if test="propose != null">
#{propose},
</if>
<if test="loginStatus != null">
#{loginStatus},
</if>
<if test="isStop != null">
#{isStop},
</if>
<if test="middleAuth != null">
#{middleAuth},
</if>
<if test="balance != null">
#{middleAuth},
</if>
<if test="ismember != null">
#{middleAuth},
</if>
<if test="memberBegin != null">
#{memberBegin},
</if>
<if test="memberEnd != null">
#{memberEnd},
</if>
<if test="consumption != null">
#{consumption},
</if>
<if test="servicefee != null">
#{servicefee},
</if>
<if test="birthday != null">
#{birthday},
</if>
NOW(), NOW(),
NOW() NOW()
</trim> </trim>
</insert> </insert>
<update id="updateUsers" parameterType="Users"> <update id="updateUsers" parameterType="Users">
update users update users
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="name != null and name != ''">name = #{name},</if> <if test="name != null and name != ''">
<if test="nickname != null">nickname = #{nickname},</if> name = #{name},
<if test="phone != null">phone = #{phone},</if> </if>
<if test="password != null">password = #{password},</if> <if test="nickname != null">
<if test="rememberToken != null">remember_token = #{rememberToken},</if> nickname = #{nickname},
<if test="openid != null">openid = #{openid},</if> </if>
<if test="avatar != null">avatar = #{avatar},</if> <if test="phone != null">
<if test="type != null and type != ''">type = #{type},</if> phone = #{phone},
<if test="workerTime != null">worker_time = #{workerTime},</if> </if>
<if test="integral != null">integral = #{integral},</if> <if test="password != null">
<if test="totalIntegral != null">total_integral = #{totalIntegral},</if> password = #{password},
<if test="status != null">status = #{status},</if> </if>
<if test="level != null">level = #{level},</if> <if test="rememberToken != null">
<if test="isWork != null">is_work = #{isWork},</if> remember_token = #{rememberToken},
<if test="commission != null">commission = #{commission},</if> </if>
<if test="totalComm != null">total_comm = #{totalComm},</if> <if test="openid != null">
<if test="margin != null">margin = #{margin},</if> openid = #{openid},
<if test="jobNumber != null">job_number = #{jobNumber},</if> </if>
<if test="prohibitTime != null">prohibit_time = #{prohibitTime},</if> <if test="avatar != null">
<if test="prohibitTimeNum != null">prohibit_time_num = #{prohibitTimeNum},</if> avatar = #{avatar},
<if test="toa != null">toa = #{toa},</if> </if>
<if test="serviceCityPid != null">service_city_pid = #{serviceCityPid},</if> <if test="type != null and type != ''">
<if test="serviceCityIds != null">service_city_ids = #{serviceCityIds},</if> type = #{type},
<if test="skillIds != null">skill_ids = #{skillIds},</if> </if>
<if test="propose != null">propose = #{propose},</if> <if test="workerTime != null">
<if test="loginStatus != null">login_status = #{loginStatus},</if> worker_time = #{workerTime},
<if test="isStop != null">is_stop = #{isStop},</if> </if>
<if test="middleAuth != null">middle_auth = #{middleAuth},</if> <if test="integral != null">
updated_at = NOW(), integral = #{integral},
<if test="createdAt != null">created_at = #{createdAt},</if> </if>
<if test="totalIntegral != null">
total_integral = #{totalIntegral},
</if>
<if test="status != null">
status = #{status},
</if>
<if test="level != null">
level = #{level},
</if>
<if test="isWork != null">
is_work = #{isWork},
</if>
<if test="commission != null">
commission = #{commission},
</if>
<if test="totalComm != null">
total_comm = #{totalComm},
</if>
<if test="margin != null">
margin = #{margin},
</if>
<if test="jobNumber != null">
job_number = #{jobNumber},
</if>
<if test="prohibitTime != null">
prohibit_time = #{prohibitTime},
</if>
<if test="prohibitTimeNum != null">
prohibit_time_num = #{prohibitTimeNum},
</if>
<if test="toa != null">
toa = #{toa},
</if>
<if test="serviceCityPid != null">
service_city_pid = #{serviceCityPid},
</if>
<if test="serviceCityIds != null">
service_city_ids = #{serviceCityIds},
</if>
<if test="skillIds != null">
skill_ids = #{skillIds},
</if>
<if test="propose != null">
propose = #{propose},
</if>
<if test="loginStatus != null">
login_status = #{loginStatus},
</if>
<if test="isStop != null">
is_stop = #{isStop},
</if>
<if test="middleAuth != null">
middle_auth = #{middleAuth},
</if>
<if test="balance != null">
balance = #{balance},
</if>
<if test="ismember != null">
ismember = #{ismember},
</if>
<if test="memberBegin != null">
member_begin = #{memberBegin},
</if>
<if test="memberEnd != null">
member_end = #{memberEnd},
</if>
<if test="consumption != null">
consumption = #{consumption},
</if>
<if test="servicefee != null">
servicefee = #{servicefee},
</if>
<if test="birthday != null">
birthday = #{birthday},
</if>
updated_at = NOW()
</trim> </trim>
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteUsersById" parameterType="Long"> <delete id="deleteUsersById" parameterType="Long">
delete from users where id = #{id} delete
from users
where id = #{id}
</delete> </delete>
<delete id="deleteUsersByIds" parameterType="String"> <delete id="deleteUsersByIds" parameterType="String">
delete from users where id in delete
from users where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
@ -249,5 +584,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id} #{id}
</foreach> </foreach>
</select> </select>
</mapper> </mapper>

View File

@ -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'
})
}

View File

@ -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'
})
}

View File

@ -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'
})
}

View File

@ -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'
})
}

View File

@ -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'
})
}

View File

@ -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'
})
}

View File

@ -1682,7 +1682,7 @@ export default {
} }
} else { } else {
this.fileList = []; this.fileList = [];
} }
this.open = true; this.open = true;
this.title = "修改订单"; this.title = "修改订单";
}); });
@ -2611,7 +2611,7 @@ export default {
imageListOnly() { imageListOnly() {
return this.fileList.filter(url => this.isImage(url)); return this.fileList.filter(url => this.isImage(url));
} }
} }
} }
</script> </script>

View File

@ -16,6 +16,14 @@
<el-input-number v-model="baseForm.marginRate" :min="0" :max="100" /> <el-input-number v-model="baseForm.marginRate" :min="0" :max="100" />
<span style="margin-left: 8px">%</span> <span style="margin-left: 8px">%</span>
</el-form-item> </el-form-item>
<el-form-item label="消费金">
<el-input-number v-model="baseForm.consumption" :min="0" :max="100" />
<span style="margin-left: 8px">%</span>
</el-form-item>
<el-form-item label="服务金">
<el-input-number v-model="baseForm.servicefee" :min="0" :max="100" />
<span style="margin-left: 8px">%</span>
</el-form-item>
<el-form-item label="下单送积分"> <el-form-item label="下单送积分">
<el-input v-model="baseForm.orderScore" style="width: 120px" /> <el-input v-model="baseForm.orderScore" style="width: 120px" />
<el-tooltip content="下单支付金额多少元赠送1积分不填则不赠送" placement="right"> <el-tooltip content="下单支付金额多少元赠送1积分不填则不赠送" placement="right">
@ -117,6 +125,17 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</el-tab-pane> </el-tab-pane>
<el-tab-pane label="会员配置" name="config_five">
<el-form :model="memberForm" label-width="120px" class="tab-form">
<el-form-item label="会员权益说明">
<quill-editor v-model="memberForm.member" :options="editorOptions" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="saveAllConfig('5')">提交</el-button>
<el-button @click="resetMember">重置</el-button>
</el-form-item>
</el-form>
</el-tab-pane>
</el-tabs> </el-tabs>
<el-button type="primary" style="margin-top: 24px;" @click="saveAllConfig">保存全部配置</el-button> <el-button type="primary" style="margin-top: 24px;" @click="saveAllConfig">保存全部配置</el-button>
</div> </div>
@ -140,10 +159,11 @@ export default {
loading: true, loading: true,
activeTab: 'base', activeTab: 'base',
SiteConfigList: [], SiteConfigList: [],
config_one: {}, config_one: {},
config_two: {}, config_two: {},
config_three: {}, config_three: {},
config_four: {}, config_four: {},
config_five: {},
total: 0, // total: 0, //
// //
baseForm: { baseForm: {
@ -151,6 +171,8 @@ export default {
startTime: '', startTime: '',
endTime: '', endTime: '',
marginRate: 10, marginRate: 10,
consumption: 0,
servicefee: 0,
orderScore: 100, orderScore: 100,
hotwords: ['水电维修', '家电清洗', '灯具维修', '墙面翻新', '门窗家具', '疏通维修', '防水维修'], hotwords: ['水电维修', '家电清洗', '灯具维修', '墙面翻新', '门窗家具', '疏通维修', '防水维修'],
qrUrl: '' qrUrl: ''
@ -161,10 +183,12 @@ export default {
intro: '', intro: '',
marginDesc: '' marginDesc: ''
}, },
memberForm:{
member: ''
},
// //
orderTimes: [ orderTimes: [
], ],
// //
timeForm: { timeForm: {
@ -188,16 +212,16 @@ export default {
this.SiteConfigList = response.rows this.SiteConfigList = response.rows
// config_one // config_one
this.config_one=response.rows.find(item => item.name === 'config_one') this.config_one = response.rows.find(item => item.name === 'config_one')
const configOneObj =JSON.parse(this.config_one.value) if (this.config_one && this.config_one.value) {
const configOneObj = JSON.parse(this.config_one.value)
if (configOneObj) {
this.baseForm = { this.baseForm = {
phone: configOneObj.phone || '', phone: configOneObj.phone || '',
startTime:configOneObj.loot_start || '', startTime: configOneObj.loot_start || '',
endTime: configOneObj.loot_end || '', endTime: configOneObj.loot_end || '',
marginRate: configOneObj.margin || 10, marginRate: configOneObj.margin || 10,
consumption: configOneObj.consumption || 0,
servicefee: configOneObj.servicefee || 0,
orderScore: configOneObj.orderScore || 100, orderScore: configOneObj.orderScore || 100,
hotwords: configOneObj.hot || [], hotwords: configOneObj.hot || [],
qrUrl: configOneObj.kf || '', qrUrl: configOneObj.kf || '',
@ -205,10 +229,9 @@ export default {
} }
// config_two // config_two
this.config_two=response.rows.find(item => item.name === 'config_two') this.config_two = response.rows.find(item => item.name === 'config_two')
const configTwoObj =JSON.parse(this.config_two.value) if (this.config_two && this.config_two.value) {
const configTwoObj = JSON.parse(this.config_two.value)
if (configTwoObj) {
this.textForm = { this.textForm = {
company: configTwoObj.name || '', company: configTwoObj.name || '',
intro: configTwoObj.brief || '', intro: configTwoObj.brief || '',
@ -216,27 +239,34 @@ export default {
} }
} }
// config_three // config_five
this.config_three=response.rows.find(item => item.name === 'config_three') this.config_five = response.rows.find(item => item.name === 'config_five')
if (this.config_five && this.config_five.value) {
let _data=JSON.parse(this.config_three.value) const configfiveObj = JSON.parse(this.config_five.value)
for(let key in _data.time){ this.memberForm = { member: configfiveObj.member || '' }
const [start, end] =_data.time[key].key.split('-'); }
this.orderTimes.push({
start: start || '', // config_three
end: end || '', this.config_three = response.rows.find(item => item.name === 'config_three')
count: _data.time[key].num || 99 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 // config_four
this.config_four=response.rows.find(item => item.name === 'config_four') this.config_four = response.rows.find(item => item.name === 'config_four')
const configFourObj =JSON.parse(this.config_four.value) if (this.config_four && this.config_four.value) {
const configFourObj = JSON.parse(this.config_four.value)
if (configFourObj) {
this.timeForm = { this.timeForm = {
withdrawDays: configFourObj.time || [], withdrawDays: configFourObj.time || [],
autoOrderMinutes: configFourObj.order_time || 10, autoOrderMinutes: configFourObj.order_time || 10,
@ -302,7 +332,7 @@ export default {
}, },
resetOrderTime() { resetOrderTime() {
this.orderTimes = [ this.orderTimes = [
] ]
}, },
// //
@ -312,6 +342,9 @@ export default {
resetTime() { resetTime() {
this.timeForm = { withdrawDays: ['8号', '18号', '28号'], autoOrderMinutes: 10, cancelOrderDays: 7 } this.timeForm = { withdrawDays: ['8号', '18号', '28号'], autoOrderMinutes: 10, cancelOrderDays: 7 }
}, },
resetMember() {
this.memberForm = { member: '' }
},
async saveAllConfig(e) { async saveAllConfig(e) {
// 1. config_one // 1. config_one
const config_one = { const config_one = {
@ -319,6 +352,8 @@ export default {
loot_start: this.baseForm.startTime, loot_start: this.baseForm.startTime,
loot_end: this.baseForm.endTime, loot_end: this.baseForm.endTime,
margin: this.baseForm.marginRate, margin: this.baseForm.marginRate,
consumption: this.baseForm.consumption,
servicefee: this.baseForm.servicefee,
orderScore: this.baseForm.orderScore, orderScore: this.baseForm.orderScore,
hot: this.baseForm.hotwords, hot: this.baseForm.hotwords,
kf: this.baseForm.qrUrl kf: this.baseForm.qrUrl
@ -342,6 +377,10 @@ export default {
order_time: this.timeForm.autoOrderMinutes, order_time: this.timeForm.autoOrderMinutes,
remove_time: this.timeForm.cancelOrderDays remove_time: this.timeForm.cancelOrderDays
}; };
// 5. config_five
const config_five = {
member: this.memberForm.member
};
try { try {
if(e=='1'){ if(e=='1'){
await updateSiteConfig({ name: 'config_one',id:this.config_one.id, value: JSON.stringify(config_one) }); 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) }); await updateSiteConfig({ name: 'config_three',id:this.config_three.id, value: JSON.stringify(config_three) });
}else if(e=='4'){ }else if(e=='4'){
await updateSiteConfig({ name: 'config_four',id:this.config_four.id, value: JSON.stringify(config_four) }); 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.$message.success('保存成功!');
this.getList(); this.getList();

View File

@ -0,0 +1,307 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户id" prop="uid">
<el-input
v-model="queryParams.uid"
placeholder="请输入用户id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:UserMemberRechargeLog:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:UserMemberRechargeLog:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:UserMemberRechargeLog:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:UserMemberRechargeLog:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="UserMemberRechargeLogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="id主键" align="center" prop="id" />
<el-table-column label="用户id" align="center" prop="uid" />
<el-table-column label="支付方式0 微信1其他" align="center" prop="paytype" />
<el-table-column label="支付时间" align="center" prop="paytime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.paytime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="充值金额" align="center" prop="inmoney" />
<el-table-column label="微信支付单号" align="center" prop="transactionId" />
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:UserMemberRechargeLog:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:UserMemberRechargeLog:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改用户充值记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户id" prop="uid">
<el-input v-model="form.uid" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="支付时间" prop="paytime">
<el-date-picker clearable
v-model="form.paytime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择支付时间">
</el-date-picker>
</el-form-item>
<el-form-item label="充值金额" prop="inmoney">
<el-input v-model="form.inmoney" placeholder="请输入充值金额" />
</el-form-item>
<el-form-item label="微信支付单号" prop="transactionId">
<el-input v-model="form.transactionId" placeholder="请输入微信支付单号" />
</el-form-item>
<el-form-item label="创建时间" prop="createdAt">
<el-date-picker clearable
v-model="form.createdAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="修改时间" prop="updatedAt">
<el-date-picker clearable
v-model="form.updatedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择修改时间">
</el-date-picker>
</el-form-item>
<el-form-item label="隐藏时间" prop="deletedAt">
<el-date-picker clearable
v-model="form.deletedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择隐藏时间">
</el-date-picker>
</el-form-item>
<el-form-item label="逻辑删除状态0正常显示1不给人显示但数据还在" prop="del">
<el-input v-model="form.del" placeholder="请输入逻辑删除状态0正常显示1不给人显示但数据还在" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listUserMemberRechargeLog, getUserMemberRechargeLog, delUserMemberRechargeLog, addUserMemberRechargeLog, updateUserMemberRechargeLog } from "@/api/system/UserMemberRechargeLog"
export default {
name: "UserMemberRechargeLog",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
UserMemberRechargeLogList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
uid: null,
},
//
form: {},
//
rules: {
}
}
},
created() {
this.getList()
},
methods: {
/** 查询用户充值记录列表 */
getList() {
this.loading = true
listUserMemberRechargeLog(this.queryParams).then(response => {
this.UserMemberRechargeLogList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
uid: null,
paytype: null,
paytime: null,
inmoney: null,
transactionId: null,
createdAt: null,
updatedAt: null,
deletedAt: null,
del: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加用户充值记录"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getUserMemberRechargeLog(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改用户充值记录"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateUserMemberRechargeLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addUserMemberRechargeLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除用户充值记录编号为"' + ids + '"的数据项?').then(function() {
return delUserMemberRechargeLog(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/UserMemberRechargeLog/export', {
...this.queryParams
}, `UserMemberRechargeLog_${new Date().getTime()}.xlsx`)
}
}
}
</script>

View File

@ -0,0 +1,332 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="用户id" prop="uid">
<el-input
v-model="queryParams.uid"
placeholder="请输入用户id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="删除标记" prop="del">
<el-input
v-model="queryParams.del"
placeholder="请输入删除标记"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:UserMemnerConsumptionLog:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:UserMemnerConsumptionLog:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:UserMemnerConsumptionLog:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:UserMemnerConsumptionLog:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="UserMemnerConsumptionLogList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" />
<el-table-column label="用户id" align="center" prop="uid" />
<el-table-column label="消费类别 0商城消费 1服务类消费 2其他消费" align="center" prop="consumptiontype" />
<el-table-column label="消费时间" align="center" prop="consumptiontime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.consumptiontime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="消费金额" align="center" prop="consumptionmoney" />
<el-table-column label="备注说明" align="center" prop="reamk" />
<el-table-column label="消费前用户余额" align="center" prop="beformoney" />
<el-table-column label="消费后用户余额" align="center" prop="aftermoney" />
<el-table-column label="当前用户余额" align="center" prop="nowmoney" />
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="删除标记" align="center" prop="del" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:UserMemnerConsumptionLog:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:UserMemnerConsumptionLog:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改用户消费余额记录对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="用户id" prop="uid">
<el-input v-model="form.uid" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="消费时间" prop="consumptiontime">
<el-date-picker clearable
v-model="form.consumptiontime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择消费时间">
</el-date-picker>
</el-form-item>
<el-form-item label="消费金额" prop="consumptionmoney">
<el-input v-model="form.consumptionmoney" placeholder="请输入消费金额" />
</el-form-item>
<el-form-item label="备注说明" prop="reamk">
<el-input v-model="form.reamk" placeholder="请输入备注说明" />
</el-form-item>
<el-form-item label="消费前用户余额" prop="beformoney">
<el-input v-model="form.beformoney" placeholder="请输入消费前用户余额" />
</el-form-item>
<el-form-item label="消费后用户余额" prop="aftermoney">
<el-input v-model="form.aftermoney" placeholder="请输入消费后用户余额" />
</el-form-item>
<el-form-item label="当前用户余额" prop="nowmoney">
<el-input v-model="form.nowmoney" placeholder="请输入当前用户余额" />
</el-form-item>
<el-form-item label="创建时间" prop="createdAt">
<el-date-picker clearable
v-model="form.createdAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="修改时间" prop="updatedAt">
<el-date-picker clearable
v-model="form.updatedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择修改时间">
</el-date-picker>
</el-form-item>
<el-form-item label="删除时间" prop="deletedAt">
<el-date-picker clearable
v-model="form.deletedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择删除时间">
</el-date-picker>
</el-form-item>
<el-form-item label="删除标记" prop="del">
<el-input v-model="form.del" placeholder="请输入删除标记" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listUserMemnerConsumptionLog, getUserMemnerConsumptionLog, delUserMemnerConsumptionLog, addUserMemnerConsumptionLog, updateUserMemnerConsumptionLog } from "@/api/system/UserMemnerConsumptionLog"
export default {
name: "UserMemnerConsumptionLog",
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
UserMemnerConsumptionLogList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
uid: null,
del: null
},
//
form: {},
//
rules: {
}
}
},
created() {
this.getList()
},
methods: {
/** 查询用户消费余额记录列表 */
getList() {
this.loading = true
listUserMemnerConsumptionLog(this.queryParams).then(response => {
this.UserMemnerConsumptionLogList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
uid: null,
consumptiontype: null,
consumptiontime: null,
consumptionmoney: null,
reamk: null,
beformoney: null,
aftermoney: null,
nowmoney: null,
createdAt: null,
updatedAt: null,
deletedAt: null,
del: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加用户消费余额记录"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getUserMemnerConsumptionLog(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改用户消费余额记录"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateUserMemnerConsumptionLog(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addUserMemnerConsumptionLog(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除用户消费余额记录编号为"' + ids + '"的数据项?').then(function() {
return delUserMemnerConsumptionLog(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/UserMemnerConsumptionLog/export', {
...this.queryParams
}, `UserMemnerConsumptionLog_${new Date().getTime()}.xlsx`)
}
}
}
</script>

View File

@ -0,0 +1,431 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="维护人员ID" prop="uid">
<el-input
v-model="queryParams.uid"
placeholder="请输入维护人员ID"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="发票抬头" prop="invoiceTitle">
<el-input
v-model="queryParams.invoiceTitle"
placeholder="请输入发票抬头"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="纳税人识别号" prop="taxNumber">
<el-input
v-model="queryParams.taxNumber"
placeholder="请输入纳税人识别号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="开户银行" prop="bankName">
<el-input
v-model="queryParams.bankName"
placeholder="请输入开户银行"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="银行账号" prop="bankAccount">
<el-input
v-model="queryParams.bankAccount"
placeholder="请输入银行账号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="单位地址" prop="address">
<el-input
v-model="queryParams.address"
placeholder="请输入单位地址"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input
v-model="queryParams.phone"
placeholder="请输入联系电话"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="联系邮箱" prop="email">
<el-input
v-model="queryParams.email"
placeholder="请输入联系邮箱"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="微信号" prop="wechat">
<el-input
v-model="queryParams.wechat"
placeholder="请输入微信号"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="发票类型" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择发票类型" clearable>
<el-option
v-for="dict in dict.type.invoice_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="发票类别" prop="category">
<el-input
v-model="queryParams.category"
placeholder="请输入发票类别"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:info:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:info:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:info:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:info:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="infoList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="id" />
<el-table-column label="维护人员ID" align="center" prop="uid" />
<el-table-column label="发票抬头" align="center" prop="invoiceTitle" />
<el-table-column label="纳税人识别号" align="center" prop="taxNumber" />
<el-table-column label="开户银行" align="center" prop="bankName" />
<el-table-column label="银行账号" align="center" prop="bankAccount" />
<el-table-column label="单位地址" align="center" prop="address" />
<el-table-column label="联系电话" align="center" prop="phone" />
<el-table-column label="联系邮箱" align="center" prop="email" />
<el-table-column label="微信号" align="center" prop="wechat" />
<el-table-column label="发票类型" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.invoice_type" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="发票类别" align="center" prop="category">
<template slot-scope="scope">
<dict-tag :options="dict.type.invoice_user_type" :value="scope.row.category"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="修改时间" align="center" prop="updatedAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:info:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:info:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改发票信息对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="维护人员ID" prop="uid">
<el-input v-model="form.uid" placeholder="请输入维护人员ID" />
</el-form-item>
<el-form-item label="发票抬头" prop="invoiceTitle">
<el-input v-model="form.invoiceTitle" placeholder="请输入发票抬头" />
</el-form-item>
<el-form-item label="纳税人识别号" prop="taxNumber">
<el-input v-model="form.taxNumber" placeholder="请输入纳税人识别号" />
</el-form-item>
<el-form-item label="开户银行" prop="bankName">
<el-input v-model="form.bankName" placeholder="请输入开户银行" />
</el-form-item>
<el-form-item label="银行账号" prop="bankAccount">
<el-input v-model="form.bankAccount" placeholder="请输入银行账号" />
</el-form-item>
<el-form-item label="单位地址" prop="address">
<el-input v-model="form.address" placeholder="请输入单位地址" />
</el-form-item>
<el-form-item label="联系电话" prop="phone">
<el-input v-model="form.phone" placeholder="请输入联系电话" />
</el-form-item>
<el-form-item label="联系邮箱" prop="email">
<el-input v-model="form.email" placeholder="请输入联系邮箱" />
</el-form-item>
<el-form-item label="微信号" prop="wechat">
<el-input v-model="form.wechat" placeholder="请输入微信号" />
</el-form-item>
<el-form-item label="发票类型" prop="type">
<el-select v-model="form.type" placeholder="请选择发票类型">
<el-option
v-for="dict in dict.type.invoice_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="发票类别" prop="category">
<el-input v-model="form.category" placeholder="请输入发票类别" />
</el-form-item>
<el-form-item label="创建时间" prop="createdAt">
<el-date-picker clearable
v-model="form.createdAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="修改时间" prop="updatedAt">
<el-date-picker clearable
v-model="form.updatedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择修改时间">
</el-date-picker>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/info"
export default {
name: "Info",
dicts: ['invoice_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
infoList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
uid: null,
invoiceTitle: null,
taxNumber: null,
bankName: null,
bankAccount: null,
address: null,
phone: null,
email: null,
wechat: null,
type: null,
category: null,
},
//
form: {},
//
rules: {
}
}
},
created() {
this.getList()
},
methods: {
/** 查询发票信息列表 */
getList() {
this.loading = true
listInfo(this.queryParams).then(response => {
this.infoList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
uid: null,
invoiceTitle: null,
taxNumber: null,
bankName: null,
bankAccount: null,
address: null,
phone: null,
email: null,
wechat: null,
type: null,
category: null,
createdAt: null,
updatedAt: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加发票信息"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getInfo(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改发票信息"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateInfo(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addInfo(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除发票信息编号为"' + ids + '"的数据项?').then(function() {
return delInfo(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/info/export', {
...this.queryParams
}, `info_${new Date().getTime()}.xlsx`)
}
}
}
</script>

View File

@ -0,0 +1,429 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="操作时间" prop="dotime">
<el-date-picker clearable
v-model="queryParams.dotime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择操作时间">
</el-date-picker>
</el-form-item>
<el-form-item label="订单金额" prop="ordermoney">
<el-input
v-model="queryParams.ordermoney"
placeholder="请输入订单金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="金额" prop="money">
<el-input
v-model="queryParams.money"
placeholder="请输入金额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="数据类别 1收入 2支出" prop="ordertype">
<el-select v-model="queryParams.ordertype" placeholder="请选择数据类别 1收入 2支出" clearable>
<el-option
v-for="dict in dict.type.benefit_points_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="用户id" prop="uid">
<el-input
v-model="queryParams.uid"
placeholder="请输入用户id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="操作前用户余额" prop="beformoney">
<el-input
v-model="queryParams.beformoney"
placeholder="请输入操作前用户余额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="操作后用户余额" prop="aftremoney">
<el-input
v-model="queryParams.aftremoney"
placeholder="请输入操作后用户余额"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="创建时间" prop="createdAt">
<el-date-picker clearable
v-model="queryParams.createdAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="修改时间" prop="updatedAt">
<el-date-picker clearable
v-model="queryParams.updatedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择修改时间">
</el-date-picker>
</el-form-item>
<el-form-item label="对应订单 id" prop="orderid">
<el-input
v-model="queryParams.orderid"
placeholder="请输入对应订单 id"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备注说明" prop="reamk">
<el-input
v-model="queryParams.reamk"
placeholder="请输入备注说明"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:points:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:points:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:points:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:points:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="pointsList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" />
<el-table-column label="类别 1服务金 2消费金" align="center" prop="type" />
<el-table-column label="操作时间" align="center" prop="dotime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.dotime, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="订单金额" align="center" prop="ordermoney" />
<el-table-column label="金额" align="center" prop="money" />
<el-table-column label="数据类别 1收入 2支出" align="center" prop="ordertype">
<template slot-scope="scope">
<dict-tag :options="dict.type.benefit_points_type" :value="scope.row.ordertype"/>
</template>
</el-table-column>
<el-table-column label="用户id" align="center" prop="uid" />
<el-table-column label="操作前用户余额" align="center" prop="beformoney" />
<el-table-column label="操作后用户余额" align="center" prop="aftremoney" />
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="修改时间" align="center" prop="updatedAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="对应订单 id" align="center" prop="orderid" />
<el-table-column label="备注说明" align="center" prop="reamk" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:points:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:points:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改购物消费福利金对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="操作时间" prop="dotime">
<el-date-picker clearable
v-model="form.dotime"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择操作时间">
</el-date-picker>
</el-form-item>
<el-form-item label="订单金额" prop="ordermoney">
<el-input v-model="form.ordermoney" placeholder="请输入订单金额" />
</el-form-item>
<el-form-item label="金额" prop="money">
<el-input v-model="form.money" placeholder="请输入金额" />
</el-form-item>
<el-form-item label="数据类别 1收入 2支出" prop="ordertype">
<el-select v-model="form.ordertype" placeholder="请选择数据类别 1收入 2支出">
<el-option
v-for="dict in dict.type.benefit_points_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
<el-form-item label="用户id" prop="uid">
<el-input v-model="form.uid" placeholder="请输入用户id" />
</el-form-item>
<el-form-item label="操作前用户余额" prop="beformoney">
<el-input v-model="form.beformoney" placeholder="请输入操作前用户余额" />
</el-form-item>
<el-form-item label="操作后用户余额" prop="aftremoney">
<el-input v-model="form.aftremoney" placeholder="请输入操作后用户余额" />
</el-form-item>
<el-form-item label="创建时间" prop="createdAt">
<el-date-picker clearable
v-model="form.createdAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择创建时间">
</el-date-picker>
</el-form-item>
<el-form-item label="修改时间" prop="updatedAt">
<el-date-picker clearable
v-model="form.updatedAt"
type="date"
value-format="yyyy-MM-dd"
placeholder="请选择修改时间">
</el-date-picker>
</el-form-item>
<el-form-item label="对应订单 id" prop="orderid">
<el-input v-model="form.orderid" placeholder="请输入对应订单 id" />
</el-form-item>
<el-form-item label="备注说明" prop="reamk">
<el-input v-model="form.reamk" placeholder="请输入备注说明" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listPoints, getPoints, delPoints, addPoints, updatePoints } from "@/api/system/points"
export default {
name: "Points",
dicts: ['benefit_points_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
pointsList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
type: null,
dotime: null,
ordermoney: null,
money: null,
ordertype: null,
uid: null,
beformoney: null,
aftremoney: null,
createdAt: null,
updatedAt: null,
orderid: null,
reamk: null
},
//
form: {},
//
rules: {
}
}
},
created() {
this.getList()
},
methods: {
/** 查询购物消费福利金列表 */
getList() {
this.loading = true
listPoints(this.queryParams).then(response => {
this.pointsList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
type: null,
dotime: null,
ordermoney: null,
money: null,
ordertype: null,
uid: null,
beformoney: null,
aftremoney: null,
createdAt: null,
updatedAt: null,
orderid: null,
reamk: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
this.open = true
this.title = "添加购物消费福利金"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getPoints(id).then(response => {
this.form = response.data
this.open = true
this.title = "修改购物消费福利金"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updatePoints(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addPoints(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除购物消费福利金编号为"' + ids + '"的数据项?').then(function() {
return delPoints(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/points/export', {
...this.queryParams
}, `points_${new Date().getTime()}.xlsx`)
}
}
}
</script>

View File

@ -0,0 +1,368 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="类目说明" prop="rechargename">
<el-input
v-model="queryParams.rechargename"
placeholder="请输入充值说明"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="备注" prop="reamk">
<el-input
v-model="queryParams.reamk"
placeholder="请输入备注"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable>
<el-option
v-for="dict in dict.type.member_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item label="类别" prop="type">
<el-select v-model="queryParams.type" placeholder="请选择类别" clearable>
<el-option
v-for="dict in dict.type.member_type"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
v-hasPermi="['system:program:add']"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
v-hasPermi="['system:program:edit']"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
v-hasPermi="['system:program:remove']"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
v-hasPermi="['system:program:export']"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="programList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键id" align="center" prop="id" />
<el-table-column label="充值说明" align="center" prop="rechargename" />
<el-table-column label="充值金额" align="center" prop="money" />
<el-table-column label="优惠后金额" align="center" prop="discount" />
<el-table-column label="备注" align="center" prop="reamk" />
<el-table-column label="状态" align="center" prop="status">
<template slot-scope="scope">
<dict-tag :options="dict.type.member_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="创建时间" align="center" prop="createdAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createdAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="修改时间" align="center" prop="updatedAt" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.updatedAt, '{y}-{m}-{d}') }}</span>
</template>
</el-table-column>
<el-table-column label="类别" align="center" prop="type">
<template slot-scope="scope">
<dict-tag :options="dict.type.member_type" :value="scope.row.type"/>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
v-hasPermi="['system:program:edit']"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
v-hasPermi="['system:program:remove']"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改充值类目对话框 -->
<el-dialog :title="title" :visible.sync="open" width="30%" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="类目说明" prop="rechargename">
<el-input v-model="form.rechargename" placeholder="请输入类目说明" />
</el-form-item>
<el-form-item label="设定金额" prop="money">
<el-input-number v-model="form.money" :min="0" :precision="2" :step="0.01" style="width: 100%" placeholder="请输入设定金额" />
</el-form-item>
<el-form-item label="优惠后金额" prop="discount">
<el-input-number v-model="form.discount" :min="0" :precision="2" :step="0.01" style="width: 100%" placeholder="请输入优惠后金额" />
</el-form-item>
<el-form-item label="备注" prop="reamk">
<el-input v-model="form.reamk" placeholder="请输入备注" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio
v-for="dict in dict.type.member_status"
:key="dict.value"
:label="parseInt(dict.value)"
>{{dict.label}}</el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="类别" prop="type">
<el-select v-model="form.type" placeholder="请选择类别">
<el-option
v-for="dict in dict.type.member_type"
:key="dict.value"
:label="dict.label"
:value="parseInt(dict.value)"
></el-option>
</el-select>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listProgram, getProgram, delProgram, addProgram, updateProgram } from "@/api/system/program"
export default {
name: "Program",
dicts: ['member_status', 'member_type'],
data() {
return {
//
loading: true,
//
ids: [],
//
single: true,
//
multiple: true,
//
showSearch: true,
//
total: 0,
//
programList: [],
//
title: "",
//
open: false,
//
queryParams: {
pageNum: 1,
pageSize: 10,
rechargename: null,
money: null,
discount: null,
reamk: null,
status: null,
createdAt: null,
updatedAt: null,
deletedAt: null,
type: null
},
//
form: {},
//
rules: {
rechargename: [
{ required: true, message: '类目说明不能为空', trigger: 'blur' }
],
money: [
{ required: true, message: '设定金额不能为空', trigger: 'blur' }
],
discount: [
{ required: true, message: '优惠后金额不能为空', trigger: 'blur' }
],
type: [
{ required: true, message: '类别不能为空', trigger: 'change' }
]
}
}
},
created() {
this.getList()
},
methods: {
/** 查询充值类目列表 */
getList() {
this.loading = true
listProgram(this.queryParams).then(response => {
this.programList = response.rows
this.total = response.total
this.loading = false
})
},
//
cancel() {
this.open = false
this.reset()
},
//
reset() {
this.form = {
id: null,
rechargename: null,
money: null,
discount: null,
reamk: null,
status: null,
createdAt: null,
updatedAt: null,
deletedAt: null,
type: null
}
this.resetForm("form")
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1
this.getList()
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm")
this.handleQuery()
},
//
handleSelectionChange(selection) {
this.ids = selection.map(item => item.id)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset()
// ""
if (this.dict && this.dict.type && this.dict.type.member_status && this.dict.type.member_status.length > 0) {
this.form.status = parseInt(this.dict.type.member_status[0].value)
} else {
this.form.status = 1
}
this.open = true
this.title = "添加充值类目"
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset()
const id = row.id || this.ids
getProgram(id).then(response => {
this.form = response.data
//
if (!this.form.status && this.dict && this.dict.type && this.dict.type.member_status && this.dict.type.member_status.length > 0) {
this.form.status = parseInt(this.dict.type.member_status[0].value)
}
this.open = true
this.title = "修改充值类目"
})
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.id != null) {
updateProgram(this.form).then(response => {
this.$modal.msgSuccess("修改成功")
this.open = false
this.getList()
})
} else {
addProgram(this.form).then(response => {
this.$modal.msgSuccess("新增成功")
this.open = false
this.getList()
})
}
}
})
},
/** 删除按钮操作 */
handleDelete(row) {
const ids = row.id || this.ids
this.$modal.confirm('是否确认删除充值类目编号为"' + ids + '"的数据项?').then(function() {
return delProgram(ids)
}).then(() => {
this.getList()
this.$modal.msgSuccess("删除成功")
}).catch(() => {})
},
/** 导出按钮操作 */
handleExport() {
this.download('system/program/export', {
...this.queryParams
}, `program_${new Date().getTime()}.xlsx`)
}
}
}
</script>