修复优惠券模块导致的bug运行不起来
This commit is contained in:
@@ -1,166 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.controller;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxBmParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-报名记录控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Tag(name = "百色中学-报名记录管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/bszx/bszx-bm")
|
|
||||||
public class BszxBmController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private BszxBmService bszxBmService;
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsArticleService cmsArticleService;
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
|
||||||
@Operation(summary = "分页查询百色中学-报名记录")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<BszxBm>> page(BszxBmParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxBmService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
|
||||||
@Operation(summary = "查询全部百色中学-报名记录")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<BszxBm>> list(BszxBmParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxBmService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBm:list')")
|
|
||||||
@Operation(summary = "根据id查询百色中学-报名记录")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<BszxBm> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxBmService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "申请报名生成邀请函")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody BszxBm bszxBm) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (bszxBm.getName() == null) {
|
|
||||||
return fail("请填写姓名");
|
|
||||||
}
|
|
||||||
if (loginUser != null) {
|
|
||||||
bszxBm.setUserId(loginUser.getUserId());
|
|
||||||
if (bszxBmService.count(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId,loginUser.getUserId())) > 0) {
|
|
||||||
return fail("您已经报名过了",null);
|
|
||||||
}
|
|
||||||
if (bszxBmService.save(bszxBm)) {
|
|
||||||
cmsArticleService.saveInc(bszxBm.getFormId());
|
|
||||||
return success("报名成功");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改报名信息")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody BszxBm bszxBm) {
|
|
||||||
final User loginUser = getLoginUser();
|
|
||||||
if(loginUser == null){
|
|
||||||
return fail("请先登录");
|
|
||||||
}
|
|
||||||
if (bszxBmService.updateById(bszxBm)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBm:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除报名记录")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (bszxBmService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBm:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加百色中学-报名记录")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<BszxBm> list) {
|
|
||||||
if (bszxBmService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBm:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改百色中学-报名记录")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxBm> batchParam) {
|
|
||||||
if (batchParam.update(bszxBmService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBm:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除百色中学-报名记录")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (bszxBmService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询我的报名记录")
|
|
||||||
@GetMapping("/myPage")
|
|
||||||
public ApiResult<PageResult<BszxBm>> myPage(BszxBmParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
if (getLoginUser() != null) {
|
|
||||||
param.setUserId(getLoginUserId());
|
|
||||||
return success(bszxBmService.pageRel(param));
|
|
||||||
}
|
|
||||||
return fail("请先登录",null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "获取海报地址")
|
|
||||||
@GetMapping("/generatePoster")
|
|
||||||
public ApiResult<?> generatePoster() throws Exception {
|
|
||||||
if (getLoginUser() == null) {
|
|
||||||
return fail("请先登录",null);
|
|
||||||
}
|
|
||||||
final BszxBm bm = bszxBmService.getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, getLoginUser().getUserId()).last("limit 1"));
|
|
||||||
return success("生成宣传海报",bszxBmService.generatePoster(bm));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxBranchService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-分部控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-17 17:18:22
|
|
||||||
*/
|
|
||||||
@Tag(name = "百色中学-分部管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/bszx/bszx-branch")
|
|
||||||
public class BszxBranchController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private BszxBranchService bszxBranchService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询百色中学-分部")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<BszxBranch>> page(BszxBranchParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxBranchService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部百色中学-分部")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<BszxBranch>> list(BszxBranchParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxBranchService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询百色中学-分部")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<BszxBranch> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxBranchService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "添加百色中学-分部")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody BszxBranch bszxBranch) {
|
|
||||||
if (bszxBranchService.save(bszxBranch)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改百色中学-分部")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody BszxBranch bszxBranch) {
|
|
||||||
if (bszxBranchService.updateById(bszxBranch)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除百色中学-分部")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (bszxBranchService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加百色中学-分部")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<BszxBranch> list) {
|
|
||||||
if (bszxBranchService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改百色中学-分部")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxBranch> batchParam) {
|
|
||||||
if (batchParam.update(bszxBranchService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxBranch:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除百色中学-分部")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (bszxBranchService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,156 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.controller;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxBranchService;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxEraService;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxGradeService;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxClassService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-班级控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Tag(name = "百色中学-班级管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/bszx/bszx-class")
|
|
||||||
public class BszxClassController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private BszxClassService bszxClassService;
|
|
||||||
@Resource
|
|
||||||
private BszxGradeService bszxGradeService;
|
|
||||||
@Resource
|
|
||||||
private BszxBranchService bszxBranchService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询百色中学-班级")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<BszxClass>> page(BszxClassParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxClassService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部百色中学-班级")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<BszxClass>> list(BszxClassParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxClassService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询百色中学-班级")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<BszxClass> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxClassService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "百色中学-年级班级数据")
|
|
||||||
@GetMapping("/tree")
|
|
||||||
public ApiResult<List<BszxBranch>> tree() {
|
|
||||||
final List<BszxBranch> list = bszxBranchService.list();
|
|
||||||
final BszxGradeParam bszxGradeParam = new BszxGradeParam();
|
|
||||||
final List<BszxGrade> gradeList = bszxGradeService.listRel(bszxGradeParam);
|
|
||||||
final BszxClassParam bszxClassParam = new BszxClassParam();
|
|
||||||
final List<BszxClass> bszxClasseList = bszxClassService.listRel(bszxClassParam);
|
|
||||||
final Map<Integer, List<BszxClass>> collectClass = bszxClasseList.stream().collect(Collectors.groupingBy(BszxClass::getGradeId));
|
|
||||||
gradeList.forEach(d -> {
|
|
||||||
d.setChildren(collectClass.get(d.getId()));
|
|
||||||
});
|
|
||||||
final Map<Integer, List<BszxGrade>> collectGrade = gradeList.stream().collect(Collectors.groupingBy(BszxGrade::getBranch));
|
|
||||||
|
|
||||||
list.forEach(d -> {
|
|
||||||
d.setChildren(collectGrade.get(d.getId()));
|
|
||||||
});
|
|
||||||
|
|
||||||
return success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxClass:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "添加百色中学-班级")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody BszxClass bszxClass) {
|
|
||||||
if (bszxClassService.save(bszxClass)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxClass:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改百色中学-班级")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody BszxClass bszxClass) {
|
|
||||||
if (bszxClassService.updateById(bszxClass)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxClass:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除百色中学-班级")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (bszxClassService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxClass:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加百色中学-班级")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<BszxClass> list) {
|
|
||||||
if (bszxClassService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxClass:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改百色中学-班级")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxClass> batchParam) {
|
|
||||||
if (batchParam.update(bszxClassService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxClass:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除百色中学-班级")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (bszxClassService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxEraService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxEraParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年代控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Tag(name = "百色中学-年代管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/bszx/bszx-era")
|
|
||||||
public class BszxEraController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private BszxEraService bszxEraService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询百色中学-年代")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<BszxEra>> page(BszxEraParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxEraService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部百色中学-年代")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<BszxEra>> list(BszxEraParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxEraService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询百色中学-年代")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<BszxEra> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxEraService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxEra:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "添加百色中学-年代")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody BszxEra bszxEra) {
|
|
||||||
if (bszxEraService.save(bszxEra)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxEra:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改百色中学-年代")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody BszxEra bszxEra) {
|
|
||||||
if (bszxEraService.updateById(bszxEra)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxEra:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除百色中学-年代")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (bszxEraService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxEra:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加百色中学-年代")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<BszxEra> list) {
|
|
||||||
if (bszxEraService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxEra:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改百色中学-年代")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxEra> batchParam) {
|
|
||||||
if (batchParam.update(bszxEraService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxEra:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除百色中学-年代")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (bszxEraService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,121 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxGradeService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年级控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Tag(name = "百色中学-年级管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/bszx/bszx-grade")
|
|
||||||
public class BszxGradeController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private BszxGradeService bszxGradeService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询百色中学-年级")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<BszxGrade>> page(BszxGradeParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxGradeService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部百色中学-年级")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<BszxGrade>> list(BszxGradeParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxGradeService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "根据id查询百色中学-年级")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<BszxGrade> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxGradeService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "添加百色中学-年级")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody BszxGrade bszxGrade) {
|
|
||||||
if (bszxGradeService.save(bszxGrade)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改百色中学-年级")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody BszxGrade bszxGrade) {
|
|
||||||
if (bszxGradeService.updateById(bszxGrade)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除百色中学-年级")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (bszxGradeService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加百色中学-年级")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<BszxGrade> list) {
|
|
||||||
if (bszxGradeService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改百色中学-年级")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxGrade> batchParam) {
|
|
||||||
if (batchParam.update(bszxGradeService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxGrade:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除百色中学-年级")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (bszxGradeService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,91 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.controller;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopOrder;
|
|
||||||
import com.gxwebsoft.shop.param.ShopOrderParam;
|
|
||||||
import com.gxwebsoft.shop.service.ShopOrderService;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-订单管理
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Tag(name = "百色中学-订单管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/bszx/bszx-order")
|
|
||||||
public class BszxOrderController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private BszxPayService bszxPayService;
|
|
||||||
@Resource
|
|
||||||
private BszxBmService bszxBmService;
|
|
||||||
@Resource
|
|
||||||
private ShopOrderService shopOrderService;
|
|
||||||
|
|
||||||
@Operation(summary = "分页查询百色中学-订单列表")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<ShopOrder>> page(ShopOrderParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
final PageResult<ShopOrder> result = shopOrderService.pageRel(param);
|
|
||||||
if(!CollectionUtils.isEmpty(result.getList())){
|
|
||||||
final Set<Integer> userIds = result.getList().stream().map(ShopOrder::getUserId).collect(Collectors.toSet());
|
|
||||||
final List<BszxBm> bmList = bszxBmService.list(new LambdaQueryWrapper<BszxBm>().in(BszxBm::getUserId, userIds).isNotNull(BszxBm::getName));
|
|
||||||
final Map<Integer, List<BszxBm>> collect = bmList.stream().collect(Collectors.groupingBy(BszxBm::getUserId));
|
|
||||||
final Set<String> orderNos = result.getList().stream().map(ShopOrder::getOrderNo).collect(Collectors.toSet());
|
|
||||||
final BszxPayParam bszxPayParam = new BszxPayParam();
|
|
||||||
bszxPayParam.setOrderNos(orderNos);
|
|
||||||
final List<BszxPay> bszxPays = bszxPayService.listRel(bszxPayParam);
|
|
||||||
final Map<String, List<BszxPay>> collectByOrderNo = bszxPays.stream().collect(Collectors.groupingBy(BszxPay::getOrderNo));
|
|
||||||
|
|
||||||
result.getList().forEach(d -> {
|
|
||||||
final List<BszxPay> pays = collectByOrderNo.get(d.getOrderNo());
|
|
||||||
if(!CollectionUtils.isEmpty(pays)){
|
|
||||||
d.setDeliveryStatus(20);
|
|
||||||
}
|
|
||||||
final List<BszxBm> bmList1 = collect.get(d.getUserId());
|
|
||||||
if(!CollectionUtils.isEmpty(bmList1)){
|
|
||||||
final BszxBm bm = bmList1.get(0);
|
|
||||||
d.setBm(bm);
|
|
||||||
d.setRealName(bm.getName());
|
|
||||||
if(bm.getPhone() != null){
|
|
||||||
d.setPhone(bm.getPhone());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "统计订单总金额")
|
|
||||||
@GetMapping("/total")
|
|
||||||
public ApiResult<BigDecimal> total() {
|
|
||||||
try {
|
|
||||||
BigDecimal totalAmount = bszxPayService.total();
|
|
||||||
return success(totalAmount);
|
|
||||||
} catch (Exception e) {
|
|
||||||
// 异常时返回0,保持接口稳定性
|
|
||||||
return success(BigDecimal.ZERO);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,344 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateField;
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.util.NumberUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
|
||||||
import com.wechat.pay.java.core.notification.*;
|
|
||||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
|
||||||
import com.gxwebsoft.common.core.security.JwtUtil;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.Payment;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopOrder;
|
|
||||||
import com.gxwebsoft.shop.service.ShopOrderService;
|
|
||||||
import com.wechat.pay.java.core.notification.RequestParam;
|
|
||||||
import com.wechat.pay.java.service.partnerpayments.jsapi.JsapiService;
|
|
||||||
import com.wechat.pay.java.service.partnerpayments.jsapi.model.Transaction;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款记录控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Tag(name = "百色中学-捐款记录管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/bszx/bszx-pay")
|
|
||||||
public class BszxPayController extends BaseController {
|
|
||||||
public static JsapiService service;
|
|
||||||
@Resource
|
|
||||||
private BszxPayService bszxPayService;
|
|
||||||
@Resource
|
|
||||||
private BszxBmService bszxBmService;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
@Resource
|
|
||||||
private ShopOrderService shopOrderService;
|
|
||||||
@Resource
|
|
||||||
private ConfigProperties conf;
|
|
||||||
@Value("${spring.profiles.active}")
|
|
||||||
String active;
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
|
||||||
@Operation(summary = "分页查询百色中学-捐款记录")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<BszxPay>> page(BszxPayParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxPayService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
|
||||||
@Operation(summary = "查询全部百色中学-捐款记录")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<BszxPay>> list(BszxPayParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxPayService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPay:list')")
|
|
||||||
@Operation(summary = "根据id查询百色中学-捐款记录")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<BszxPay> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxPayService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "活动捐款")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody BszxPay bszxPay, HttpServletRequest request) {
|
|
||||||
if (bszxPay.getPrice().compareTo(BigDecimal.ZERO) == 0) {
|
|
||||||
return fail("金额不能为0");
|
|
||||||
}
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
String access_token = JwtUtil.getAccessToken(request);
|
|
||||||
bszxPay.setUserId(loginUser.getUserId());
|
|
||||||
// 微信openid(必填)
|
|
||||||
if (StrUtil.isBlank(loginUser.getOpenid())) {
|
|
||||||
return fail("微信openid(必填)");
|
|
||||||
}
|
|
||||||
final BszxBm bmInfo = bszxBmService.getByUserId(loginUser.getUserId());
|
|
||||||
bszxPay.setName(bmInfo.getName());
|
|
||||||
bszxPay.setSex(bmInfo.getSex());
|
|
||||||
bszxPay.setPhone(bmInfo.getPhone());
|
|
||||||
bszxPay.setBranchName(bmInfo.getBranchName());
|
|
||||||
bszxPay.setGradeName(bmInfo.getGradeName());
|
|
||||||
bszxPay.setClassName(bmInfo.getClassName());
|
|
||||||
bszxPay.setAddress(bmInfo.getAddress());
|
|
||||||
bszxPay.setWorkUnit(bmInfo.getWorkUnit());
|
|
||||||
bszxPay.setPosition(bmInfo.getPosition());
|
|
||||||
bszxPay.setAge(bmInfo.getAge());
|
|
||||||
bszxPay.setNumber(bmInfo.getNumber());
|
|
||||||
}
|
|
||||||
if (bszxPayService.save(bszxPay)) {
|
|
||||||
// 调起支付
|
|
||||||
return success("下单成功", bszxPay);
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPay:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改百色中学-捐款记录")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody BszxPay bszxPay) {
|
|
||||||
if (bszxPayService.updateById(bszxPay)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPay:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除百色中学-捐款记录")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (bszxPayService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPay:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加百色中学-捐款记录")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<BszxPay> list) {
|
|
||||||
if (bszxPayService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPay:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改百色中学-捐款记录")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxPay> batchParam) {
|
|
||||||
if (batchParam.update(bszxPayService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPay:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除百色中学-捐款记录")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (bszxPayService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询我的报名记录")
|
|
||||||
@GetMapping("/myPage")
|
|
||||||
public ApiResult<PageResult<BszxPay>> myPage(BszxPayParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
if (getLoginUser() != null) {
|
|
||||||
param.setUserId(getLoginUserId());
|
|
||||||
return success(bszxPayService.pageRel(param));
|
|
||||||
}
|
|
||||||
return fail("请先登录", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "统计捐款总金额与人次")
|
|
||||||
@GetMapping("/getCount")
|
|
||||||
public ApiResult<?> getCount() {
|
|
||||||
final HashMap<String, Object> map = new HashMap<>();
|
|
||||||
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
final BigDecimal bigDecimal = bszxPayService.sumMoney(wrapper);
|
|
||||||
Long count = (long) bszxPayService.count(new LambdaQueryWrapper<BszxPay>());
|
|
||||||
map.put("numbers", count);
|
|
||||||
map.put("totalMoney", bigDecimal);
|
|
||||||
return success(map);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Schema(description = "异步通知")
|
|
||||||
@PostMapping("/notify/{tenantId}")
|
|
||||||
public String wxNotify(@RequestHeader Map<String, String> header, @RequestBody String body,HttpServletRequest request, @PathVariable("tenantId") Integer tenantId) {
|
|
||||||
// 获取支付配置信息用于解密 - 优先使用 Payment:1* 格式
|
|
||||||
String key = "Payment:11"; // 微信支付类型为1,使用 Payment:11 格式
|
|
||||||
Payment payment = redisUtil.get(key, Payment.class);
|
|
||||||
|
|
||||||
// 如果 Payment:1* 格式不存在,尝试原有格式
|
|
||||||
if (payment == null) {
|
|
||||||
String fallbackKey = "Payment:1:".concat(tenantId.toString());
|
|
||||||
payment = redisUtil.get(fallbackKey, Payment.class);
|
|
||||||
}
|
|
||||||
String uploadPath = conf.getUploadPath();
|
|
||||||
|
|
||||||
// 开发环境
|
|
||||||
String mid = "1242289702";
|
|
||||||
String apiV3Key = "0b2996803383c3e3391abd9183b54key";
|
|
||||||
String serialNumber = "3B458EB14A28160DC094431A21C0508EFA712D1C";
|
|
||||||
String privateKey = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/apiclient_key.pem";
|
|
||||||
String apiclientCert = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/apiclient_cert.pem";
|
|
||||||
String pubKey = "/Users/gxwebsoft/JAVA/site-java/cert/bszx/0f65a8517c284acb90aa83dd0c23e8f6.pem";
|
|
||||||
String pubId = "PUB_KEY_ID_0112422897022025011300326200001208";
|
|
||||||
// 生产环境
|
|
||||||
if (ObjectUtil.isNotEmpty(payment)) {
|
|
||||||
// 检查 payment 字段是否为空,并避免直接解析为数字
|
|
||||||
mid = payment.getMchId();
|
|
||||||
apiV3Key = payment.getApiKey();
|
|
||||||
serialNumber = payment.getMerchantSerialNumber();
|
|
||||||
// 生产环境使用容器证书路径 /www/wwwroot/file.ws
|
|
||||||
privateKey = "/www/wwwroot/file.ws" + payment.getApiclientKey();
|
|
||||||
apiclientCert = "/www/wwwroot/file.ws" + payment.getApiclientCert();
|
|
||||||
pubKey = "/www/wwwroot/file.ws" + payment.getPubKey();
|
|
||||||
pubId = payment.getPubKeyId();
|
|
||||||
}
|
|
||||||
RequestParam requestParam = new RequestParam.Builder()
|
|
||||||
.serialNumber(header.get("wechatpay-serial"))
|
|
||||||
.nonce(header.get("wechatpay-nonce"))
|
|
||||||
.signature(header.get("wechatpay-signature"))
|
|
||||||
.timestamp(header.get("wechatpay-timestamp"))
|
|
||||||
.body(body)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
|
|
||||||
// NotificationConfig config = new RSAPublicKeyConfig.Builder()
|
|
||||||
// .merchantId(mid)
|
|
||||||
// .publicKeyFromPath(pubKey)
|
|
||||||
// .publicKeyId(pubId)
|
|
||||||
// .privateKeyFromPath(privateKey)
|
|
||||||
// .merchantSerialNumber(serialNumber)
|
|
||||||
// .apiV3Key(apiV3Key)
|
|
||||||
// .build();
|
|
||||||
|
|
||||||
NotificationConfig config = new RSAPublicKeyNotificationConfig.Builder()
|
|
||||||
.publicKeyFromPath(pubKey)
|
|
||||||
.publicKeyId(pubId)
|
|
||||||
.apiV3Key(apiV3Key)
|
|
||||||
.build();
|
|
||||||
|
|
||||||
|
|
||||||
// 初始化 NotificationParser
|
|
||||||
NotificationParser parser = new NotificationParser(config);
|
|
||||||
|
|
||||||
// 以支付通知回调为例,验签、解密并转换成 Transaction
|
|
||||||
try {
|
|
||||||
Transaction transaction = parser.parse(requestParam, Transaction.class);
|
|
||||||
final String outTradeNo = transaction.getOutTradeNo();
|
|
||||||
final String transactionId = transaction.getTransactionId();
|
|
||||||
final Integer total = transaction.getAmount().getTotal();
|
|
||||||
final String tradeStateDesc = transaction.getTradeStateDesc();
|
|
||||||
final Transaction.TradeStateEnum tradeState = transaction.getTradeState();
|
|
||||||
final Transaction.TradeTypeEnum tradeType = transaction.getTradeType();
|
|
||||||
System.out.println("transaction = " + transaction);
|
|
||||||
System.out.println("tradeStateDesc = " + tradeStateDesc);
|
|
||||||
System.out.println("tradeType = " + tradeType);
|
|
||||||
System.out.println("tradeState = " + tradeState);
|
|
||||||
System.out.println("outTradeNo = " + outTradeNo);
|
|
||||||
System.out.println("amount = " + total);
|
|
||||||
|
|
||||||
if (StrUtil.equals("支付成功", tradeStateDesc)) {
|
|
||||||
// 1. 查询要处理的订单
|
|
||||||
ShopOrder order = shopOrderService.getByOutTradeNo(outTradeNo);
|
|
||||||
// 2. 已支付则跳过
|
|
||||||
if (order.getPayStatus().equals(true)) {
|
|
||||||
return "SUCCESS";
|
|
||||||
}
|
|
||||||
// 2. 未支付则处理更新订单状态
|
|
||||||
if (order.getPayStatus().equals(false)) {
|
|
||||||
// 5. TODO 处理订单状态
|
|
||||||
order.setPayTime(DateUtil.date());
|
|
||||||
order.setPayStatus(true);
|
|
||||||
order.setTransactionId(transactionId);
|
|
||||||
order.setPayPrice(new BigDecimal(NumberUtil.decimalFormat("0.00", total * 0.01)));
|
|
||||||
order.setExpirationTime(DateUtil.offset(DateUtil.date(), DateField.YEAR, 10));
|
|
||||||
System.out.println("实际付款金额 = " + order.getPayPrice());
|
|
||||||
return "SUCCESS";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (Exception $e) {
|
|
||||||
System.out.println($e.getMessage());
|
|
||||||
System.out.println(Arrays.toString($e.getStackTrace()));
|
|
||||||
}
|
|
||||||
|
|
||||||
return "fail";
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopOrder:update')")
|
|
||||||
@Operation(summary = "修复订单")
|
|
||||||
@PutMapping("/repair")
|
|
||||||
public ApiResult<?> repair(@RequestBody ShopOrder shopOrder) {
|
|
||||||
if (shopOrderService.queryOrderByOutTradeNo(shopOrder)) {
|
|
||||||
if (bszxPayService.count(new LambdaQueryWrapper<BszxPay>().eq(BszxPay::getOrderNo, shopOrder.getOrderNo())) == 0) {
|
|
||||||
final BszxPay bszxPay = new BszxPay();
|
|
||||||
final BszxBm bm = shopOrder.getBm();
|
|
||||||
if (ObjectUtil.isNotEmpty(bm)) {
|
|
||||||
bszxPay.setName(bm.getName());
|
|
||||||
bszxPay.setSex(bm.getSex());
|
|
||||||
bszxPay.setClassName(bm.getClassName());
|
|
||||||
bszxPay.setGradeName(bm.getGradeName());
|
|
||||||
bszxPay.setAddress(bm.getAddress());
|
|
||||||
bszxPay.setWorkUnit(bm.getWorkUnit());
|
|
||||||
bszxPay.setPosition(bm.getPosition());
|
|
||||||
bszxPay.setPrice(shopOrder.getPayPrice());
|
|
||||||
bszxPay.setOrderNo(shopOrder.getOrderNo());
|
|
||||||
bszxPay.setUserId(shopOrder.getUserId());
|
|
||||||
bszxPay.setFormId(shopOrder.getFormId());
|
|
||||||
bszxPay.setComments(shopOrder.getComments());
|
|
||||||
bszxPayService.save(bszxPay);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return success("修复成功");
|
|
||||||
}
|
|
||||||
return fail("修复失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "获取捐款证书")
|
|
||||||
@GetMapping("/generatePayCert/{id}")
|
|
||||||
public ApiResult<?> generatePayCert(@PathVariable("id") Integer id) throws Exception {
|
|
||||||
return success("获取捐款证书", bszxPayService.generatePayCert(id));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,199 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.controller;
|
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxClassService;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxPayRankingService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.concurrent.TimeUnit;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款排行控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-25 08:54:09
|
|
||||||
*/
|
|
||||||
@Tag(name = "百色中学-捐款排行管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/bszx/bszx-pay-ranking")
|
|
||||||
public class BszxPayRankingController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private BszxPayRankingService bszxPayRankingService;
|
|
||||||
@Resource
|
|
||||||
private CmsArticleService cmsArticleService;
|
|
||||||
@Resource
|
|
||||||
private BszxPayService bszxPayService;
|
|
||||||
@Resource
|
|
||||||
private BszxClassService bszxClassService;
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
|
||||||
@Operation(summary = "分页查询百色中学-捐款排行")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<BszxPayRanking>> page(BszxPayRankingParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxPayRankingService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
|
||||||
@Operation(summary = "查询全部百色中学-捐款排行")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<BszxPayRanking>> list(BszxPayRankingParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxPayRankingService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部百色中学-捐款排行榜")
|
|
||||||
@GetMapping("/ranking")
|
|
||||||
public ApiResult<List<BszxPayRanking>> ranking(BszxPayRankingParam param) {
|
|
||||||
final ArrayList<BszxPayRanking> rankings = new ArrayList<>();
|
|
||||||
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
final List<CmsArticle> list = cmsArticleService.list(new LambdaQueryWrapper<CmsArticle>().eq(CmsArticle::getCategoryId, 2444));
|
|
||||||
|
|
||||||
list.forEach(item -> {
|
|
||||||
final BszxPayRanking ranking = new BszxPayRanking();
|
|
||||||
wrapper.clear();
|
|
||||||
// 按时间段查询
|
|
||||||
if(param.getCreateTimeStart() != null && param.getCreateTimeEnd() != null){
|
|
||||||
final String timeStart = param.getCreateTimeStart();
|
|
||||||
final String timeEnd = param.getCreateTimeEnd();
|
|
||||||
wrapper.ge(BszxPay::getCreateTime, timeStart);
|
|
||||||
wrapper.le(BszxPay::getCreateTime, timeEnd);
|
|
||||||
}
|
|
||||||
wrapper.eq(BszxPay::getFormId, item.getArticleId());
|
|
||||||
ranking.setFormId(item.getArticleId());
|
|
||||||
ranking.setFormName(item.getTitle());
|
|
||||||
ranking.setNumber((long) bszxPayService.count(wrapper));
|
|
||||||
ranking.setTotalPrice(bszxPayService.sumMoney(wrapper));
|
|
||||||
rankings.add(ranking);
|
|
||||||
});
|
|
||||||
// totalPrice按大到小排序
|
|
||||||
rankings.sort((o1, o2) -> o2.getTotalPrice().compareTo(o1.getTotalPrice()));
|
|
||||||
return success(rankings);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Operation(summary = "查询全部百色中学-千班万元")
|
|
||||||
@GetMapping("/ranking2")
|
|
||||||
public ApiResult<List<BszxClass>> ranking2(BszxClassParam param) {
|
|
||||||
final LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
final List<BszxClass> list = bszxClassService.listRel(param);
|
|
||||||
|
|
||||||
String key = "BSZX:UpdateRanking2";
|
|
||||||
final String isTimeOut = redisUtil.get(key);
|
|
||||||
if(StrUtil.isNotBlank(isTimeOut)){
|
|
||||||
list.sort((o1, o2) -> o2.getTotalMoney().compareTo(o1.getTotalMoney()));
|
|
||||||
return success(list);
|
|
||||||
}
|
|
||||||
list.forEach(item -> {
|
|
||||||
System.out.println("item = " + item);
|
|
||||||
wrapper.clear();
|
|
||||||
wrapper.eq(BszxPay::getGradeName,item.getGradeName());
|
|
||||||
wrapper.eq(BszxPay::getClassName, item.getName());
|
|
||||||
item.setTotalMoney(bszxPayService.sumMoney(wrapper));
|
|
||||||
bszxClassService.updateById(item);
|
|
||||||
});
|
|
||||||
// totalPrice按大到小排序
|
|
||||||
list.sort((o1, o2) -> o2.getTotalMoney().compareTo(o1.getTotalMoney()));
|
|
||||||
redisUtil.set(key, 1,1L, TimeUnit.DAYS);
|
|
||||||
return success(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:list')")
|
|
||||||
@Operation(summary = "根据id查询百色中学-捐款排行")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<BszxPayRanking> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(bszxPayRankingService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "添加百色中学-捐款排行")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody BszxPayRanking bszxPayRanking) {
|
|
||||||
if (bszxPayRankingService.save(bszxPayRanking)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改百色中学-捐款排行")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody BszxPayRanking bszxPayRanking) {
|
|
||||||
if (bszxPayRankingService.updateById(bszxPayRanking)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除百色中学-捐款排行")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (bszxPayRankingService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加百色中学-捐款排行")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<BszxPayRanking> list) {
|
|
||||||
if (bszxPayRankingService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改百色中学-捐款排行")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<BszxPayRanking> batchParam) {
|
|
||||||
if (batchParam.update(bszxPayRankingService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('bszx:bszxPayRanking:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除百色中学-捐款排行")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (bszxPayRankingService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,149 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-报名记录
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Schema(name = "BszxBm对象", description = "百色中学-报名记录")
|
|
||||||
public class BszxBm implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "自增ID")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "姓名")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "类型 0校友 1单位 2爱心人士")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "性别 1男 2女")
|
|
||||||
private String sex;
|
|
||||||
|
|
||||||
@Schema(description = "性别名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String sexName;
|
|
||||||
|
|
||||||
@Schema(description = "手机号码")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
@Schema(description = "手机号码")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String mobile;
|
|
||||||
|
|
||||||
@Schema(description = "班级ID")
|
|
||||||
private Integer classId;
|
|
||||||
|
|
||||||
@Schema(description = "班级")
|
|
||||||
private String className;
|
|
||||||
|
|
||||||
@Schema(description = "年级")
|
|
||||||
private String gradeName;
|
|
||||||
|
|
||||||
@Schema(description = "分部ID")
|
|
||||||
private Integer branchId;
|
|
||||||
|
|
||||||
@Schema(description = "分部名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String branchName;
|
|
||||||
|
|
||||||
@Schema(description = "居住地址")
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
@Schema(description = "工作单位")
|
|
||||||
private String workUnit;
|
|
||||||
|
|
||||||
@Schema(description = "职务")
|
|
||||||
private String position;
|
|
||||||
|
|
||||||
@Schema(description = "是否能到场")
|
|
||||||
private String present;
|
|
||||||
|
|
||||||
@Schema(description = "年龄")
|
|
||||||
private Integer age;
|
|
||||||
|
|
||||||
@Schema(description = "人数")
|
|
||||||
private Integer number;
|
|
||||||
|
|
||||||
@Schema(description = "额外信息")
|
|
||||||
private String extra;
|
|
||||||
|
|
||||||
@Schema(description = "生成的邀请函存放路径")
|
|
||||||
private String certificate;
|
|
||||||
|
|
||||||
@Schema(description = "预定日期")
|
|
||||||
private LocalDate dateTime;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "表单ID")
|
|
||||||
private Integer formId;
|
|
||||||
|
|
||||||
@Schema(description = "活动名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String formName;
|
|
||||||
|
|
||||||
@Schema(description = "用户ID")
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
@Schema(description = "昵称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String nickname;
|
|
||||||
|
|
||||||
@Schema(description = "头像")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String avatar;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@TableLogic
|
|
||||||
private Integer deleted;
|
|
||||||
|
|
||||||
@Schema(description = "租户id")
|
|
||||||
private Integer tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@Schema(description = "文章对象")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private CmsArticle article;
|
|
||||||
|
|
||||||
public String getSexName() {
|
|
||||||
if (this.sex == null) {
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
return this.sex.equals("1") ? "男" : "女";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-分部
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-17 17:18:22
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Schema(name = "BszxBranch对象", description = "百色中学-分部")
|
|
||||||
public class BszxBranch implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "分部名称 ")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "租户id")
|
|
||||||
private Integer tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "子分类")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<BszxGrade> children;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-班级
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Schema(name = "BszxClass对象", description = "百色中学-班级")
|
|
||||||
public class BszxClass implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "时代ID")
|
|
||||||
private Integer eraId;
|
|
||||||
|
|
||||||
@Schema(description = "时代名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String eraName;
|
|
||||||
|
|
||||||
@Schema(description = "年级ID")
|
|
||||||
private Integer gradeId;
|
|
||||||
|
|
||||||
@Schema(description = "年级名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String gradeName;
|
|
||||||
|
|
||||||
@Schema(description = "班级")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "累计捐款金额")
|
|
||||||
private BigDecimal totalMoney;
|
|
||||||
|
|
||||||
@Schema(description = "分部")
|
|
||||||
private Integer branch;
|
|
||||||
|
|
||||||
@Schema(description = "分部名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String branchName;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "子分类")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<BszxClass> children;
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年代
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Schema(name = "BszxEra对象", description = "百色中学-年代")
|
|
||||||
public class BszxEra implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "年代")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "租户id")
|
|
||||||
private Integer tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "子分类")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<BszxGrade> children;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,53 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.entity;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年级
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Schema(name = "BszxGrade对象", description = "百色中学-年级")
|
|
||||||
public class BszxGrade implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "年级")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "年代")
|
|
||||||
private Integer eraId;
|
|
||||||
|
|
||||||
@Schema(description = "分部")
|
|
||||||
private Integer branch;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "子分类")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private List<BszxClass> children;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,141 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.entity;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopOrder;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款记录
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Schema(name = "BszxPay对象", description = "百色中学-捐款记录")
|
|
||||||
public class BszxPay implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "年龄")
|
|
||||||
private Integer age;
|
|
||||||
|
|
||||||
@Schema(description = "姓名")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "性别 1男 2女")
|
|
||||||
private String sex;
|
|
||||||
|
|
||||||
@Schema(description = "手机号码")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
@Schema(description = "手机号码")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String mobile;
|
|
||||||
|
|
||||||
@Schema(description = "分部")
|
|
||||||
private String branchName;
|
|
||||||
|
|
||||||
@Schema(description = "班级")
|
|
||||||
private String className;
|
|
||||||
|
|
||||||
@Schema(description = "年级")
|
|
||||||
private String gradeName;
|
|
||||||
|
|
||||||
@Schema(description = "居住地址")
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
@Schema(description = "工作单位")
|
|
||||||
private String workUnit;
|
|
||||||
|
|
||||||
@Schema(description = "职务")
|
|
||||||
private String position;
|
|
||||||
|
|
||||||
@Schema(description = "数量")
|
|
||||||
private Integer number;
|
|
||||||
|
|
||||||
@Schema(description = "付费金额")
|
|
||||||
private BigDecimal price;
|
|
||||||
|
|
||||||
@Schema(description = "额外信息")
|
|
||||||
private String extra;
|
|
||||||
|
|
||||||
@Schema(description = "订单编号")
|
|
||||||
private String orderNo;
|
|
||||||
|
|
||||||
@Schema(description = "预定日期")
|
|
||||||
private LocalDate dateTime;
|
|
||||||
|
|
||||||
@Schema(description = "捐赠证书")
|
|
||||||
private String certificate;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "来源表ID")
|
|
||||||
private Integer formId;
|
|
||||||
|
|
||||||
@Schema(description = "活动名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String formName;
|
|
||||||
|
|
||||||
@Schema(description = "用户ID")
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
@Schema(description = "昵称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String nickname;
|
|
||||||
|
|
||||||
@Schema(description = "头像")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String avatar;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@TableLogic
|
|
||||||
private Integer deleted;
|
|
||||||
|
|
||||||
@Schema(description = "租户id")
|
|
||||||
private Integer tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
@Schema(description = "文章")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private CmsArticle article;
|
|
||||||
|
|
||||||
@Schema(description = "订单")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private ShopOrder shopOrder;
|
|
||||||
|
|
||||||
public String getSexName() {
|
|
||||||
return this.sex.equals("1") ? "男" : "女";
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.entity;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款排行
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-25 08:54:09
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Schema(name = "BszxPayRanking对象", description = "百色中学-捐款排行")
|
|
||||||
public class BszxPayRanking implements Serializable {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@TableId(value = "id", type = IdType.AUTO)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "来源表ID(文章ID)")
|
|
||||||
private Integer formId;
|
|
||||||
|
|
||||||
@Schema(description = "项目名称")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private String formName;
|
|
||||||
|
|
||||||
@Schema(description = "数量")
|
|
||||||
private Long number;
|
|
||||||
|
|
||||||
@Schema(description = "获得捐款总金额")
|
|
||||||
private BigDecimal totalPrice;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@TableLogic
|
|
||||||
private Integer deleted;
|
|
||||||
|
|
||||||
@Schema(description = "租户id")
|
|
||||||
private Integer tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
private Date createTime;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxBmParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-报名记录Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxBmMapper extends BaseMapper<BszxBm> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxBm>
|
|
||||||
*/
|
|
||||||
List<BszxBm> selectPageRel(@Param("page") IPage<BszxBm> page,
|
|
||||||
@Param("param") BszxBmParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<BszxBm> selectListRel(@Param("param") BszxBmParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-分部Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-17 17:18:22
|
|
||||||
*/
|
|
||||||
public interface BszxBranchMapper extends BaseMapper<BszxBranch> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxBranch>
|
|
||||||
*/
|
|
||||||
List<BszxBranch> selectPageRel(@Param("page") IPage<BszxBranch> page,
|
|
||||||
@Param("param") BszxBranchParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<BszxBranch> selectListRel(@Param("param") BszxBranchParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-班级Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxClassMapper extends BaseMapper<BszxClass> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxClass>
|
|
||||||
*/
|
|
||||||
List<BszxClass> selectPageRel(@Param("page") IPage<BszxClass> page,
|
|
||||||
@Param("param") BszxClassParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<BszxClass> selectListRel(@Param("param") BszxClassParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxEraParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年代Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxEraMapper extends BaseMapper<BszxEra> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxEra>
|
|
||||||
*/
|
|
||||||
List<BszxEra> selectPageRel(@Param("page") IPage<BszxEra> page,
|
|
||||||
@Param("param") BszxEraParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<BszxEra> selectListRel(@Param("param") BszxEraParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年级Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxGradeMapper extends BaseMapper<BszxGrade> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxGrade>
|
|
||||||
*/
|
|
||||||
List<BszxGrade> selectPageRel(@Param("page") IPage<BszxGrade> page,
|
|
||||||
@Param("param") BszxGradeParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<BszxGrade> selectListRel(@Param("param") BszxGradeParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.Wrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款记录Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxPayMapper extends BaseMapper<BszxPay> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxPay>
|
|
||||||
*/
|
|
||||||
List<BszxPay> selectPageRel(@Param("page") IPage<BszxPay> page,
|
|
||||||
@Param("param") BszxPayParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<BszxPay> selectListRel(@Param("param") BszxPayParam param);
|
|
||||||
|
|
||||||
BigDecimal selectSumMoney(@Param("ew") Wrapper<?> wrapper);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款排行Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-25 08:54:09
|
|
||||||
*/
|
|
||||||
public interface BszxPayRankingMapper extends BaseMapper<BszxPayRanking> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxPayRanking>
|
|
||||||
*/
|
|
||||||
List<BszxPayRanking> selectPageRel(@Param("page") IPage<BszxPayRanking> page,
|
|
||||||
@Param("param") BszxPayRankingParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<BszxPayRanking> selectListRel(@Param("param") BszxPayRankingParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,113 +0,0 @@
|
|||||||
<?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.gxwebsoft.bszx.mapper.BszxBmMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*,b.title as formName, c.name as branchName, u.phone as mobile,u.avatar,u.nickname
|
|
||||||
FROM bszx_bm a
|
|
||||||
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
|
||||||
LEFT JOIN bszx_branch c ON a.branch_id = c.id
|
|
||||||
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.name != null">
|
|
||||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.type != null">
|
|
||||||
AND a.type = #{param.type}
|
|
||||||
</if>
|
|
||||||
<if test="param.sex != null">
|
|
||||||
AND a.sex = #{param.sex}
|
|
||||||
</if>
|
|
||||||
<if test="param.phone != null">
|
|
||||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.branchId != null">
|
|
||||||
AND a.branch_id = #{param.branchId}
|
|
||||||
</if>
|
|
||||||
<if test="param.className != null">
|
|
||||||
AND a.class_name LIKE CONCAT('%', #{param.className}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.gradeName != null">
|
|
||||||
AND a.grade_name LIKE CONCAT('%', #{param.gradeName}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.address != null">
|
|
||||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.workUnit != null">
|
|
||||||
AND a.work_unit LIKE CONCAT('%', #{param.workUnit}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.position != null">
|
|
||||||
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.present != null">
|
|
||||||
AND a.present = #{param.present}
|
|
||||||
</if>
|
|
||||||
<if test="param.age != null">
|
|
||||||
AND a.age = #{param.age}
|
|
||||||
</if>
|
|
||||||
<if test="param.number != null">
|
|
||||||
AND a.number = #{param.number}
|
|
||||||
</if>
|
|
||||||
<if test="param.extra != null">
|
|
||||||
AND a.extra LIKE CONCAT('%', #{param.extra}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.certificate != null">
|
|
||||||
AND a.certificate LIKE CONCAT('%', #{param.certificate}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.dateTime != null">
|
|
||||||
AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.formData != null">
|
|
||||||
AND a.form_data LIKE CONCAT('%', #{param.formData}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.formId != null">
|
|
||||||
AND a.form_id = #{param.formId}
|
|
||||||
</if>
|
|
||||||
<if test="param.userId != null">
|
|
||||||
AND a.user_id = #{param.userId}
|
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.comments != null">
|
|
||||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.status != null">
|
|
||||||
AND a.status = #{param.status}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted != null">
|
|
||||||
AND a.deleted = #{param.deleted}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted == null">
|
|
||||||
AND a.deleted = 0
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeStart != null">
|
|
||||||
AND a.create_time >= #{param.createTimeStart}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeEnd != null">
|
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
OR a.phone = #{param.keywords}
|
|
||||||
OR a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxBm">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxBm">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?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.gxwebsoft.bszx.mapper.BszxBranchMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*
|
|
||||||
FROM bszx_branch a
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.name != null">
|
|
||||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxBranch">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxBranch">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,63 +0,0 @@
|
|||||||
<?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.gxwebsoft.bszx.mapper.BszxClassMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*,b.name as gradeName, c.name as eraName, d.name as branchName
|
|
||||||
FROM bszx_class a
|
|
||||||
LEFT JOIN bszx_grade b ON a.grade_id = b.id
|
|
||||||
LEFT JOIN bszx_era c ON a.era_id = c.id
|
|
||||||
LEFT JOIN bszx_branch d ON a.branch = d.id
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.eraId != null">
|
|
||||||
AND a.era_id = #{param.eraId}
|
|
||||||
</if>
|
|
||||||
<if test="param.gradeId != null">
|
|
||||||
AND a.grade_id = #{param.gradeId}
|
|
||||||
</if>
|
|
||||||
<if test="param.gradeName != null">
|
|
||||||
AND b.name = #{param.gradeName}
|
|
||||||
</if>
|
|
||||||
<if test="param.name != null">
|
|
||||||
AND a.name = #{param.name}
|
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.branch != null">
|
|
||||||
AND a.branch = #{param.branch}
|
|
||||||
</if>
|
|
||||||
<if test="param.comments != null">
|
|
||||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.status != null">
|
|
||||||
AND a.status = #{param.status}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeStart != null">
|
|
||||||
AND a.create_time >= #{param.createTimeStart}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeEnd != null">
|
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxClass">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxClass">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,36 +0,0 @@
|
|||||||
<?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.gxwebsoft.bszx.mapper.BszxEraMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*
|
|
||||||
FROM bszx_era a
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.name != null">
|
|
||||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxEra">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxEra">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,54 +0,0 @@
|
|||||||
<?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.gxwebsoft.bszx.mapper.BszxGradeMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*
|
|
||||||
FROM bszx_grade a
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.name != null">
|
|
||||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.eraId != null">
|
|
||||||
AND a.era_id = #{param.eraId}
|
|
||||||
</if>
|
|
||||||
<if test="param.branch != null">
|
|
||||||
AND a.branch = #{param.branch}
|
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.comments != null">
|
|
||||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.status != null">
|
|
||||||
AND a.status = #{param.status}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeStart != null">
|
|
||||||
AND a.create_time >= #{param.createTimeStart}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeEnd != null">
|
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxGrade">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxGrade">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,126 +0,0 @@
|
|||||||
<?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.gxwebsoft.bszx.mapper.BszxPayMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*,b.title as formName,u.phone as mobile,u.avatar,u.nickname
|
|
||||||
FROM bszx_pay a
|
|
||||||
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
|
||||||
LEFT JOIN gxwebsoft_core.sys_user u ON a.user_id = u.user_id
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.age != null">
|
|
||||||
AND a.age = #{param.age}
|
|
||||||
</if>
|
|
||||||
<if test="param.name != null">
|
|
||||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.sex != null">
|
|
||||||
AND a.sex = #{param.sex}
|
|
||||||
</if>
|
|
||||||
<if test="param.phone != null">
|
|
||||||
AND a.phone LIKE CONCAT('%', #{param.phone}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.className != null">
|
|
||||||
AND a.class_name = #{param.className}
|
|
||||||
</if>
|
|
||||||
<if test="param.gradeName != null">
|
|
||||||
AND a.grade_name LIKE CONCAT('%', #{param.gradeName}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.address != null">
|
|
||||||
AND a.address LIKE CONCAT('%', #{param.address}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.workUnit != null">
|
|
||||||
AND a.work_unit LIKE CONCAT('%', #{param.workUnit}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.position != null">
|
|
||||||
AND a.position LIKE CONCAT('%', #{param.position}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.number != null">
|
|
||||||
AND a.number = #{param.number}
|
|
||||||
</if>
|
|
||||||
<if test="param.price != null">
|
|
||||||
AND a.price = #{param.price}
|
|
||||||
</if>
|
|
||||||
<if test="param.extra != null">
|
|
||||||
AND a.extra LIKE CONCAT('%', #{param.extra}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.orderNo != null">
|
|
||||||
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.dateTime != null">
|
|
||||||
AND a.date_time LIKE CONCAT('%', #{param.dateTime}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.certificate != null">
|
|
||||||
AND a.certificate LIKE CONCAT('%', #{param.certificate}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.formData != null">
|
|
||||||
AND a.form_data LIKE CONCAT('%', #{param.formData}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.formId != null">
|
|
||||||
AND a.form_id = #{param.formId}
|
|
||||||
</if>
|
|
||||||
<if test="param.userId != null">
|
|
||||||
AND a.user_id = #{param.userId}
|
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.comments != null">
|
|
||||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.status != null">
|
|
||||||
AND a.status = #{param.status}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted != null">
|
|
||||||
AND a.deleted = #{param.deleted}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted == null">
|
|
||||||
AND a.deleted = 0
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeStart != null">
|
|
||||||
AND a.create_time >= #{param.createTimeStart}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeEnd != null">
|
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
|
||||||
</if>
|
|
||||||
<if test="param.orderNos != null">
|
|
||||||
AND a.order_no IN
|
|
||||||
<foreach collection="param.orderNos" item="item" separator="," open="(" close=")">
|
|
||||||
#{item}
|
|
||||||
</foreach>
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
OR u.phone = #{param.keywords}
|
|
||||||
OR a.name LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
OR a.order_no = #{param.keywords}
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxPay">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxPay">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
|
|
||||||
<!-- 统计金额总和 -->
|
|
||||||
<select id="selectSumMoney" resultType="java.math.BigDecimal">
|
|
||||||
SELECT COALESCE(SUM(price), 0) as total_money
|
|
||||||
FROM bszx_pay
|
|
||||||
<if test="ew != null">
|
|
||||||
${ew.customSqlSegment}
|
|
||||||
</if>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,61 +0,0 @@
|
|||||||
<?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.gxwebsoft.bszx.mapper.BszxPayRankingMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*,b.title as formName
|
|
||||||
FROM bszx_pay_ranking a
|
|
||||||
LEFT JOIN cms_article b ON a.form_id = b.article_id
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.formId != null">
|
|
||||||
AND a.form_id = #{param.formId}
|
|
||||||
</if>
|
|
||||||
<if test="param.number != null">
|
|
||||||
AND a.number = #{param.number}
|
|
||||||
</if>
|
|
||||||
<if test="param.totalPrice != null">
|
|
||||||
AND a.total_price = #{param.totalPrice}
|
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.comments != null">
|
|
||||||
AND a.comments LIKE CONCAT('%', #{param.comments}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.status != null">
|
|
||||||
AND a.status = #{param.status}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted != null">
|
|
||||||
AND a.deleted = #{param.deleted}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted == null">
|
|
||||||
AND a.deleted = 0
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeStart != null">
|
|
||||||
AND a.create_time >= #{param.createTimeStart}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeEnd != null">
|
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.bszx.entity.BszxPayRanking">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.bszx.entity.BszxPayRanking">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,114 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-报名记录查询参数
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "BszxBmParam对象", description = "百色中学-报名记录查询参数")
|
|
||||||
public class BszxBmParam extends BaseParam {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "自增ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "姓名")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "类型 0校友 1单位")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "性别 1男 2女")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sex;
|
|
||||||
|
|
||||||
@Schema(description = "手机号码")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
@Schema(description = "班级")
|
|
||||||
private String className;
|
|
||||||
|
|
||||||
@Schema(description = "年级")
|
|
||||||
private String gradeName;
|
|
||||||
|
|
||||||
@Schema(description = "分部ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer branchId;
|
|
||||||
|
|
||||||
@Schema(description = "居住地址")
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
@Schema(description = "工作单位")
|
|
||||||
private String workUnit;
|
|
||||||
|
|
||||||
@Schema(description = "职务")
|
|
||||||
private String position;
|
|
||||||
|
|
||||||
@Schema(description = "是否能到场")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Boolean present;
|
|
||||||
|
|
||||||
@Schema(description = "年龄")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer age;
|
|
||||||
|
|
||||||
@Schema(description = "人数")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer number;
|
|
||||||
|
|
||||||
@Schema(description = "额外信息")
|
|
||||||
private String extra;
|
|
||||||
|
|
||||||
@Schema(description = "生成的邀请函存放路径")
|
|
||||||
private String certificate;
|
|
||||||
|
|
||||||
@Schema(description = "预定日期")
|
|
||||||
private String dateTime;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "表单ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer formId;
|
|
||||||
|
|
||||||
@Schema(description = "用户ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer deleted;
|
|
||||||
|
|
||||||
@Schema(description = "订单编号")
|
|
||||||
@QueryField(type = QueryType.LIKE)
|
|
||||||
private String orderNo;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-分部查询参数
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-17 17:18:22
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "BszxBranchParam对象", description = "百色中学-分部查询参数")
|
|
||||||
public class BszxBranchParam extends BaseParam {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "分部名称 ")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-班级查询参数
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "BszxClassParam对象", description = "百色中学-班级查询参数")
|
|
||||||
public class BszxClassParam extends BaseParam {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "时代ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer eraId;
|
|
||||||
|
|
||||||
@Schema(description = "年级ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer gradeId;
|
|
||||||
|
|
||||||
@Schema(description = "年级")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private String gradeName;
|
|
||||||
|
|
||||||
@Schema(description = "累计捐款金额")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private BigDecimal totalMoney;
|
|
||||||
|
|
||||||
@Schema(description = "班级")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "分部")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer branch;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年代查询参数
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "BszxEraParam对象", description = "百色中学-年代查询参数")
|
|
||||||
public class BszxEraParam extends BaseParam {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "年代")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,52 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年级查询参数
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "BszxGradeParam对象", description = "百色中学-年级查询参数")
|
|
||||||
public class BszxGradeParam extends BaseParam {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "年级")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "年代")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer eraId;
|
|
||||||
|
|
||||||
@Schema(description = "分部")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer branch;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,118 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Set;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款记录查询参数
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "BszxPayParam对象", description = "百色中学-捐款记录查询参数")
|
|
||||||
public class BszxPayParam extends BaseParam {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "年龄")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer age;
|
|
||||||
|
|
||||||
@Schema(description = "姓名")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "性别 1男 2女")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sex;
|
|
||||||
|
|
||||||
@Schema(description = "手机号码")
|
|
||||||
private String phone;
|
|
||||||
|
|
||||||
@Schema(description = "班级")
|
|
||||||
private String className;
|
|
||||||
|
|
||||||
@Schema(description = "年级")
|
|
||||||
private String gradeName;
|
|
||||||
|
|
||||||
@Schema(description = "居住地址")
|
|
||||||
private String address;
|
|
||||||
|
|
||||||
@Schema(description = "工作单位")
|
|
||||||
private String workUnit;
|
|
||||||
|
|
||||||
@Schema(description = "职务")
|
|
||||||
private String position;
|
|
||||||
|
|
||||||
@Schema(description = "数量")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer number;
|
|
||||||
|
|
||||||
@Schema(description = "付费金额")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private BigDecimal price;
|
|
||||||
|
|
||||||
@Schema(description = "额外信息")
|
|
||||||
private String extra;
|
|
||||||
|
|
||||||
@Schema(description = "订单编号")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private String orderNo;
|
|
||||||
|
|
||||||
@Schema(description = "订单编号")
|
|
||||||
@QueryField(type = QueryType.IN)
|
|
||||||
private Set<String> orderNos;
|
|
||||||
|
|
||||||
@Schema(description = "预定日期")
|
|
||||||
private String dateTime;
|
|
||||||
|
|
||||||
@Schema(description = "捐赠证书")
|
|
||||||
private String certificate;
|
|
||||||
|
|
||||||
@Schema(description = "表单数据")
|
|
||||||
private String formData;
|
|
||||||
|
|
||||||
@Schema(description = "来源表ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer formId;
|
|
||||||
|
|
||||||
@Schema(description = "用户ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer deleted;
|
|
||||||
|
|
||||||
@Schema(description = "登录用户")
|
|
||||||
@TableField(exist = false)
|
|
||||||
private User loginUser;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款排行查询参数
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-25 08:54:09
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "BszxPayRankingParam对象", description = "百色中学-捐款排行查询参数")
|
|
||||||
public class BszxPayRankingParam extends BaseParam {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "来源表ID(项目名称)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer formId;
|
|
||||||
|
|
||||||
@Schema(description = "数量")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer number;
|
|
||||||
|
|
||||||
@Schema(description = "获得捐款总金额")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private BigDecimal totalPrice;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "备注")
|
|
||||||
private String comments;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1冻结")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer deleted;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxBmParam;
|
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-报名记录Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxBmService extends IService<BszxBm> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<BszxBm>
|
|
||||||
*/
|
|
||||||
PageResult<BszxBm> pageRel(BszxBmParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxBm>
|
|
||||||
*/
|
|
||||||
List<BszxBm> listRel(BszxBmParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id 自增ID
|
|
||||||
* @return BszxBm
|
|
||||||
*/
|
|
||||||
BszxBm getByIdRel(Integer id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成海报
|
|
||||||
*/
|
|
||||||
String generatePoster(BszxBm bm) throws Exception;
|
|
||||||
|
|
||||||
BszxBm getByUserId(Integer userId);
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-分部Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-17 17:18:22
|
|
||||||
*/
|
|
||||||
public interface BszxBranchService extends IService<BszxBranch> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<BszxBranch>
|
|
||||||
*/
|
|
||||||
PageResult<BszxBranch> pageRel(BszxBranchParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxBranch>
|
|
||||||
*/
|
|
||||||
List<BszxBranch> listRel(BszxBranchParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return BszxBranch
|
|
||||||
*/
|
|
||||||
BszxBranch getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-班级Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxClassService extends IService<BszxClass> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<BszxClass>
|
|
||||||
*/
|
|
||||||
PageResult<BszxClass> pageRel(BszxClassParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxClass>
|
|
||||||
*/
|
|
||||||
List<BszxClass> listRel(BszxClassParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return BszxClass
|
|
||||||
*/
|
|
||||||
BszxClass getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxEraParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年代Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxEraService extends IService<BszxEra> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<BszxEra>
|
|
||||||
*/
|
|
||||||
PageResult<BszxEra> pageRel(BszxEraParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxEra>
|
|
||||||
*/
|
|
||||||
List<BszxEra> listRel(BszxEraParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return BszxEra
|
|
||||||
*/
|
|
||||||
BszxEra getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年级Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxGradeService extends IService<BszxGrade> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<BszxGrade>
|
|
||||||
*/
|
|
||||||
PageResult<BszxGrade> pageRel(BszxGradeParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxGrade>
|
|
||||||
*/
|
|
||||||
List<BszxGrade> listRel(BszxGradeParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return BszxGrade
|
|
||||||
*/
|
|
||||||
BszxGrade getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款排行Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-25 08:54:09
|
|
||||||
*/
|
|
||||||
public interface BszxPayRankingService extends IService<BszxPayRanking> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<BszxPayRanking>
|
|
||||||
*/
|
|
||||||
PageResult<BszxPayRanking> pageRel(BszxPayRankingParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxPayRanking>
|
|
||||||
*/
|
|
||||||
List<BszxPayRanking> listRel(BszxPayRankingParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return BszxPayRanking
|
|
||||||
*/
|
|
||||||
BszxPayRanking getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款记录Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
public interface BszxPayService extends IService<BszxPay> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<BszxPay>
|
|
||||||
*/
|
|
||||||
PageResult<BszxPay> pageRel(BszxPayParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<BszxPay>
|
|
||||||
*/
|
|
||||||
List<BszxPay> listRel(BszxPayParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id ID
|
|
||||||
* @return BszxPay
|
|
||||||
*/
|
|
||||||
BszxPay getByIdRel(Integer id);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成捐款证书
|
|
||||||
*/
|
|
||||||
String generatePayCert(Integer id) throws Exception;
|
|
||||||
|
|
||||||
BigDecimal sumMoney(LambdaQueryWrapper<BszxPay> between);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 统计捐款总金额
|
|
||||||
*
|
|
||||||
* @return 捐款总金额
|
|
||||||
*/
|
|
||||||
BigDecimal total();
|
|
||||||
}
|
|
||||||
@@ -1,162 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.freewayso.image.combiner.ImageCombiner;
|
|
||||||
import com.freewayso.image.combiner.enums.OutputFormat;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
|
||||||
import com.gxwebsoft.bszx.mapper.BszxBmMapper;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxBmParam;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxClassService;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
|
||||||
import com.gxwebsoft.common.core.config.ConfigProperties;
|
|
||||||
import com.gxwebsoft.common.core.utils.FileServerUtil;
|
|
||||||
import com.gxwebsoft.common.core.utils.ImageUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.context.annotation.Lazy;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
import org.springframework.util.CollectionUtils;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
|
||||||
import java.io.File;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-报名记录Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BszxBmServiceImpl extends ServiceImpl<BszxBmMapper, BszxBm> implements BszxBmService {
|
|
||||||
@Value("${config.upload-path}")
|
|
||||||
private String uploadPath;
|
|
||||||
@Value("${config.file-server}")
|
|
||||||
private String fileServer;
|
|
||||||
@Resource
|
|
||||||
private ConfigProperties config;
|
|
||||||
@Resource
|
|
||||||
@Lazy
|
|
||||||
private CmsArticleService cmsArticleService;
|
|
||||||
@Resource
|
|
||||||
private BszxClassService bszxClassService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<BszxBm> pageRel(BszxBmParam param) {
|
|
||||||
PageParam<BszxBm, BszxBmParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("id desc");
|
|
||||||
List<BszxBm> list = baseMapper.selectPageRel(page, param);
|
|
||||||
list.forEach(d -> {
|
|
||||||
if(d.getClassId().equals(0)){
|
|
||||||
final BszxClassParam classParam = new BszxClassParam();
|
|
||||||
classParam.setGradeName(d.getGradeName());
|
|
||||||
classParam.setName(d.getClassName());
|
|
||||||
final List<BszxClass> bszxClasses = bszxClassService.listRel(classParam);
|
|
||||||
if (!CollectionUtils.isEmpty(bszxClasses)) {
|
|
||||||
BszxClass bszxClass = bszxClasses.get(0);
|
|
||||||
System.out.println("bszxClass = " + bszxClass);
|
|
||||||
d.setClassId(bszxClass.getId());
|
|
||||||
d.setBranchId(bszxClass.getBranch());
|
|
||||||
updateById(d);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BszxBm> listRel(BszxBmParam param) {
|
|
||||||
List<BszxBm> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<BszxBm, BszxBmParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("id desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BszxBm getByIdRel(Integer id) {
|
|
||||||
BszxBmParam param = new BszxBmParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成捐款证书 <a href="https://portrait.gitee.com/sGodT/image-combiner">...</a>
|
|
||||||
*
|
|
||||||
* @return
|
|
||||||
* @throws Exception
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String generatePoster(BszxBm item) throws Exception {
|
|
||||||
final CmsArticle article = cmsArticleService.getById(7859);
|
|
||||||
if (ObjectUtil.isEmpty(article)) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isNotEmpty(item)) {
|
|
||||||
// Font font = new Font("阿里巴巴普惠体", Font.PLAIN, 40);
|
|
||||||
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
|
||||||
ImageCombiner combiner = new ImageCombiner(article.getAddress(), OutputFormat.JPG);
|
|
||||||
//加文本元素:姓名
|
|
||||||
// if (item.getType().equals(0)) {
|
|
||||||
// combiner.addTextElement(item.getName().concat(" 校友"), 40, 220, 540);
|
|
||||||
// } else {
|
|
||||||
// combiner.addTextElement(item.getName(), 40, 220, 540);
|
|
||||||
// }
|
|
||||||
|
|
||||||
// combiner.addTextElement(DateUtil.format(DateUtil.date(), "yyyy年MM月"), 28,650, 1566);
|
|
||||||
//加图片元素:盖章
|
|
||||||
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 600, 1420);
|
|
||||||
|
|
||||||
|
|
||||||
if (item.getType().equals(0)) {
|
|
||||||
combiner.addTextElement(item.getName().concat(" 校友"), 30, 160, 1008);
|
|
||||||
} else {
|
|
||||||
combiner.addTextElement(item.getName(), 30, 160, 1008);
|
|
||||||
}
|
|
||||||
|
|
||||||
// combiner.addTextElement(DateUtil.format(DateUtil.date(), "yyyy年MM月"), 28,650, 1566);
|
|
||||||
//加图片元素:盖章
|
|
||||||
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 600, 1420);
|
|
||||||
//执行图片合并
|
|
||||||
combiner.combine();
|
|
||||||
|
|
||||||
if (!FileUtil.exist(uploadPath + "/file/poster/" + item.getTenantId() + "/bm")) {
|
|
||||||
FileUtil.mkdir(uploadPath + "/file/poster/" + item.getTenantId() + "/bm");
|
|
||||||
}
|
|
||||||
String basePath = "/poster/" + item.getTenantId() + "/bm/big-" + item.getId() + ".jpg";
|
|
||||||
String smallPath = "/poster/" + item.getTenantId() + "/bm/" + item.getId() + ".jpg";
|
|
||||||
String filename = uploadPath + "/file" + basePath;
|
|
||||||
String smallFileName = uploadPath + "/file" + smallPath;
|
|
||||||
combiner.save(filename);
|
|
||||||
|
|
||||||
File input = new File(filename);
|
|
||||||
File output = new File(smallFileName);
|
|
||||||
ImageUtil.adjustQuality(input, output, 0.8f);
|
|
||||||
if(input.exists()){
|
|
||||||
input.delete();
|
|
||||||
}
|
|
||||||
return fileServer + smallPath + "?r=" + RandomUtil.randomNumbers(4);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BszxBm getByUserId(Integer userId) {
|
|
||||||
return getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, userId).last("limit 1"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.bszx.mapper.BszxBranchMapper;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxBranchService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBranch;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxBranchParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-分部Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-17 17:18:22
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BszxBranchServiceImpl extends ServiceImpl<BszxBranchMapper, BszxBranch> implements BszxBranchService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<BszxBranch> pageRel(BszxBranchParam param) {
|
|
||||||
PageParam<BszxBranch, BszxBranchParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<BszxBranch> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BszxBranch> listRel(BszxBranchParam param) {
|
|
||||||
List<BszxBranch> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<BszxBranch, BszxBranchParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BszxBranch getByIdRel(Integer id) {
|
|
||||||
BszxBranchParam param = new BszxBranchParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
|
||||||
import com.gxwebsoft.bszx.mapper.BszxClassMapper;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxClassService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxClass;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxClassParam;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
|
||||||
import com.gxwebsoft.common.core.utils.RedisUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-班级Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BszxClassServiceImpl extends ServiceImpl<BszxClassMapper, BszxClass> implements BszxClassService {
|
|
||||||
@Resource
|
|
||||||
private RedisUtil redisUtil;
|
|
||||||
@Resource
|
|
||||||
private BszxPayService bszxPayService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<BszxClass> pageRel(BszxClassParam param) {
|
|
||||||
PageParam<BszxClass, BszxClassParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, id asc");
|
|
||||||
List<BszxClass> list = baseMapper.selectPageRel(page, param);
|
|
||||||
LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
|
|
||||||
if (param.getLimit() == null) {
|
|
||||||
list.forEach(item -> {
|
|
||||||
wrapper.clear();
|
|
||||||
// wrapper.eq(BszxPay::getBranchName,item.getBranchName());
|
|
||||||
wrapper.eq(BszxPay::getGradeName,item.getGradeName());
|
|
||||||
wrapper.eq(BszxPay::getClassName, item.getName());
|
|
||||||
item.setTotalMoney(bszxPayService.sumMoney(wrapper));
|
|
||||||
updateById(item);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BszxClass> listRel(BszxClassParam param) {
|
|
||||||
List<BszxClass> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<BszxClass, BszxClassParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, id asc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BszxClass getByIdRel(Integer id) {
|
|
||||||
BszxClassParam param = new BszxClassParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.bszx.mapper.BszxEraMapper;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxEraService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxEra;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxEraParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年代Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BszxEraServiceImpl extends ServiceImpl<BszxEraMapper, BszxEra> implements BszxEraService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<BszxEra> pageRel(BszxEraParam param) {
|
|
||||||
PageParam<BszxEra, BszxEraParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<BszxEra> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BszxEra> listRel(BszxEraParam param) {
|
|
||||||
List<BszxEra> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<BszxEra, BszxEraParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BszxEra getByIdRel(Integer id) {
|
|
||||||
BszxEraParam param = new BszxEraParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.bszx.mapper.BszxGradeMapper;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxGradeService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxGrade;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxGradeParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-年级Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BszxGradeServiceImpl extends ServiceImpl<BszxGradeMapper, BszxGrade> implements BszxGradeService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<BszxGrade> pageRel(BszxGradeParam param) {
|
|
||||||
PageParam<BszxGrade, BszxGradeParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, id asc");
|
|
||||||
List<BszxGrade> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BszxGrade> listRel(BszxGradeParam param) {
|
|
||||||
List<BszxGrade> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<BszxGrade, BszxGradeParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, id asc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BszxGrade getByIdRel(Integer id) {
|
|
||||||
BszxGradeParam param = new BszxGradeParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.bszx.mapper.BszxPayRankingMapper;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxPayRankingService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPayRanking;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayRankingParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款排行Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-25 08:54:09
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BszxPayRankingServiceImpl extends ServiceImpl<BszxPayRankingMapper, BszxPayRanking> implements BszxPayRankingService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<BszxPayRanking> pageRel(BszxPayRankingParam param) {
|
|
||||||
PageParam<BszxPayRanking, BszxPayRankingParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<BszxPayRanking> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BszxPayRanking> listRel(BszxPayRankingParam param) {
|
|
||||||
List<BszxPayRanking> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<BszxPayRanking, BszxPayRankingParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BszxPayRanking getByIdRel(Integer id) {
|
|
||||||
BszxPayRankingParam param = new BszxPayRankingParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,169 +0,0 @@
|
|||||||
package com.gxwebsoft.bszx.service.impl;
|
|
||||||
|
|
||||||
import cn.hutool.core.io.FileUtil;
|
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import cn.hutool.core.util.RandomUtil;
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.freewayso.image.combiner.ImageCombiner;
|
|
||||||
import com.freewayso.image.combiner.enums.OutputFormat;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxBm;
|
|
||||||
import com.gxwebsoft.bszx.mapper.BszxPayMapper;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxBmService;
|
|
||||||
import com.gxwebsoft.bszx.service.BszxPayService;
|
|
||||||
import com.gxwebsoft.bszx.entity.BszxPay;
|
|
||||||
import com.gxwebsoft.bszx.param.BszxPayParam;
|
|
||||||
import com.gxwebsoft.cms.entity.CmsArticle;
|
|
||||||
import com.gxwebsoft.cms.service.CmsArticleService;
|
|
||||||
import com.gxwebsoft.common.core.utils.ImageUtil;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.io.File;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 百色中学-捐款记录Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-03-06 22:50:25
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class BszxPayServiceImpl extends ServiceImpl<BszxPayMapper, BszxPay> implements BszxPayService {
|
|
||||||
@Value("${config.upload-path}")
|
|
||||||
private String uploadPath;
|
|
||||||
@Value("${config.file-server}")
|
|
||||||
private String fileServer;
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CmsArticleService cmsArticleService;
|
|
||||||
@Resource
|
|
||||||
public BszxBmService bszxBmService;
|
|
||||||
@Resource
|
|
||||||
private BszxPayService bszxPayService;
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<BszxPay> pageRel(BszxPayParam param) {
|
|
||||||
PageParam<BszxPay, BszxPayParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("price desc, create_time desc");
|
|
||||||
List<BszxPay> list = baseMapper.selectPageRel(page, param);
|
|
||||||
list.forEach(item -> {
|
|
||||||
if(item.getId().equals(2088)){
|
|
||||||
item.setFormName("捐款用于设立阙里校友奖学金");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<BszxPay> listRel(BszxPayParam param) {
|
|
||||||
List<BszxPay> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<BszxPay, BszxPayParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("id desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BszxPay getByIdRel(Integer id) {
|
|
||||||
BszxPayParam param = new BszxPayParam();
|
|
||||||
param.setId(id);
|
|
||||||
final BszxPay item = param.getOne(baseMapper.selectListRel(param));
|
|
||||||
final CmsArticle article = cmsArticleService.getById(item.getFormId());
|
|
||||||
if (ObjectUtil.isNotEmpty(article)) {
|
|
||||||
item.setArticle(article);
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 生成捐款证书 <a href="https://portrait.gitee.com/sGodT/image-combiner">...</a>
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public String generatePayCert(Integer id) throws Exception {
|
|
||||||
final BszxPay payCert = getByIdRel(id);
|
|
||||||
final CmsArticle item = cmsArticleService.getById(payCert.getFormId());
|
|
||||||
final BszxBm bm = bszxBmService.getOne(new LambdaQueryWrapper<BszxBm>().eq(BszxBm::getUserId, payCert.getUserId()).last("limit 1"));
|
|
||||||
final BigDecimal totalMoney = bszxPayService.sumMoney(new LambdaQueryWrapper<BszxPay>().eq(BszxPay::getUserId, payCert.getUserId()));
|
|
||||||
if (StrUtil.isBlank(item.getAddress())) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
if (ObjectUtil.isNotEmpty(payCert)) {
|
|
||||||
//合成器(指定背景图和输出格式,整个图片的宽高和相关计算依赖于背景图,所以背景图的大小是个基准)
|
|
||||||
ImageCombiner combiner = new ImageCombiner("https://oss.wsdns.cn/20250420/811a380e8e124097aa0940a7c68a1f72.jpeg", OutputFormat.JPG);
|
|
||||||
//加图片元素:盖章
|
|
||||||
// combiner.addImageElement("https://oss.wsdns.cn/20250304/6936b109b09b4919a3498ac5027e728b.png", 550, 926);
|
|
||||||
//加文本元素:姓名
|
|
||||||
String str;
|
|
||||||
if (bm.getType().equals(0)) {
|
|
||||||
str = bm.getName().concat(" 校友");
|
|
||||||
combiner.addTextElement(str, 32, 930, 450);
|
|
||||||
} else {
|
|
||||||
str = bm.getName();
|
|
||||||
combiner.addTextElement(str, 22, 880, 450);
|
|
||||||
}
|
|
||||||
// combiner.addTextElement(bm.getName(), 32,900, 450);
|
|
||||||
//加文本元素:捐款证书内容
|
|
||||||
// combiner.addTextElement(" 承您慷慨解囊,襄助百色市百色中学", 32,200, 650);
|
|
||||||
// combiner.addTextElement("百廿校庆“" + item.getTitle() + "”项目,捐赠人民币", 32,200, 700);
|
|
||||||
combiner.addTextElement(totalMoney + "", 32, 1330, 600);
|
|
||||||
// combiner.addTextElement(" 您对学校的支持,为我们共同教育理", 32,200, 800);
|
|
||||||
// combiner.addTextElement("想的实现增添了一份动力。", 32,200, 850);
|
|
||||||
// combiner.addTextElement(" 承蒙惠赠,隆情铭感,特颁此证,以资谢旌!", 32, 200, 900);
|
|
||||||
// combiner.addTextElement("百色市百色中学", 32,560, 1015);
|
|
||||||
// final Date createTime = payCert.getCreateTime();
|
|
||||||
// combiner.addTextElement(DateUtil.format(createTime, "yyyy年MM月"), 28,586, 1060);
|
|
||||||
// combiner.addTextElement("2025年4月15日", 28,580, 1060);
|
|
||||||
|
|
||||||
//执行图片合并
|
|
||||||
combiner.combine();
|
|
||||||
|
|
||||||
if (!FileUtil.exist(uploadPath + "/file/poster/" + payCert.getTenantId() + "/pay")) {
|
|
||||||
FileUtil.mkdir(uploadPath + "/file/poster/" + payCert.getTenantId() + "/pay");
|
|
||||||
}
|
|
||||||
String basePath = "/poster/" + payCert.getTenantId() + "/pay/big-" + id + ".jpg";
|
|
||||||
String smallPath = "/poster/" + payCert.getTenantId() + "/pay/" + id + ".jpg";
|
|
||||||
String filename = uploadPath + "/file" + basePath;
|
|
||||||
String smallFileName = uploadPath + "/file" + smallPath;
|
|
||||||
combiner.save(filename);
|
|
||||||
|
|
||||||
File input = new File(filename);
|
|
||||||
File output = new File(smallFileName);
|
|
||||||
ImageUtil.adjustQuality(input, output, 0.8f);
|
|
||||||
if (input.exists()) {
|
|
||||||
input.delete();
|
|
||||||
}
|
|
||||||
return fileServer + smallPath + "?r=" + RandomUtil.randomNumbers(4);
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal sumMoney(LambdaQueryWrapper<BszxPay> wrapper) {
|
|
||||||
return baseMapper.selectSumMoney(wrapper);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BigDecimal total() {
|
|
||||||
try {
|
|
||||||
// 使用数据库聚合查询统计捐款总金额,性能更高
|
|
||||||
LambdaQueryWrapper<BszxPay> wrapper = new LambdaQueryWrapper<>();
|
|
||||||
BigDecimal total = baseMapper.selectSumMoney(wrapper);
|
|
||||||
|
|
||||||
if (total == null) {
|
|
||||||
total = BigDecimal.ZERO;
|
|
||||||
}
|
|
||||||
|
|
||||||
return total;
|
|
||||||
|
|
||||||
} catch (Exception e) {
|
|
||||||
// 异常时返回0,确保接口稳定性
|
|
||||||
return BigDecimal.ZERO;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
391
docs/pom.xml
Normal file
391
docs/pom.xml
Normal file
@@ -0,0 +1,391 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.gxwebsoft</groupId>
|
||||||
|
<artifactId>com-gxwebsoft-modules</artifactId>
|
||||||
|
<version>1.5.0</version>
|
||||||
|
|
||||||
|
<name>com-gxwebsoft-api</name>
|
||||||
|
<description>WebSoftApi project for Spring Boot</description>
|
||||||
|
|
||||||
|
<parent>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
<relativePath/> <!-- lookup parent from repository -->
|
||||||
|
</parent>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<java.version>1.8</java.version>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<!-- spring-boot-devtools -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-devtools</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-test -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-test</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-web -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-aop -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-aop</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-configuration-processor -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-configuration-processor</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- lombok -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
<optional>true</optional>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mysql -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>mysql</groupId>
|
||||||
|
<artifactId>mysql-connector-java</artifactId>
|
||||||
|
<scope>runtime</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- druid -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>druid-spring-boot-starter</artifactId>
|
||||||
|
<version>1.2.6</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||||
|
<version>3.4.3.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus 连表插件-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.yulichang</groupId>
|
||||||
|
<artifactId>mybatis-plus-join-boot-starter</artifactId>
|
||||||
|
<version>1.4.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- mybatis-plus-generator -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.baomidou</groupId>
|
||||||
|
<artifactId>mybatis-plus-generator</artifactId>
|
||||||
|
<version>3.4.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- hutool -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-core</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-extra</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-http</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.hutool</groupId>
|
||||||
|
<artifactId>hutool-crypto</artifactId>
|
||||||
|
<version>5.8.11</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- easy poi -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>cn.afterturn</groupId>
|
||||||
|
<artifactId>easypoi-base</artifactId>
|
||||||
|
<version>4.4.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- tika, 用于FileServer获取content-type -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.tika</groupId>
|
||||||
|
<artifactId>tika-core</artifactId>
|
||||||
|
<version>2.1.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- open office, 用于文档转pdf实现在线预览 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.livesense</groupId>
|
||||||
|
<artifactId>jodconverter-core</artifactId>
|
||||||
|
<version>1.0.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring-boot-mail -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-mail</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 模板引擎, 用于邮件、代码生成等 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.ibeetl</groupId>
|
||||||
|
<artifactId>beetl</artifactId>
|
||||||
|
<version>3.6.1.RELEASE</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- swagger -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.springfox</groupId>
|
||||||
|
<artifactId>springfox-boot-starter</artifactId>
|
||||||
|
<version>3.0.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- spring security -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- jjwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-impl</artifactId>
|
||||||
|
<version>0.11.2</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
|
<version>0.11.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 图形验证码 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.whvcse</groupId>
|
||||||
|
<artifactId>easy-captcha</artifactId>
|
||||||
|
<version>1.6.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--Redis-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-data-redis</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里SDK -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>aliyun-java-sdk-core</artifactId>
|
||||||
|
<version>4.4.3</version>
|
||||||
|
</dependency>
|
||||||
|
<!--阿里支付 老版本 SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alipay.sdk</groupId>
|
||||||
|
<artifactId>alipay-sdk-java</artifactId>
|
||||||
|
<version>4.35.0.ALL</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.bouncycastle</groupId>
|
||||||
|
<artifactId>bcprov-jdk15on</artifactId>
|
||||||
|
<version>1.70</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>commons-logging</groupId>
|
||||||
|
<artifactId>commons-logging</artifactId>
|
||||||
|
<version>1.2</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- https://mvnrepository.com/artifact/com.alibaba/fastjson -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.alibaba</groupId>
|
||||||
|
<artifactId>fastjson</artifactId>
|
||||||
|
<version>2.0.20</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--二维码-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.zxing</groupId>
|
||||||
|
<artifactId>core</artifactId>
|
||||||
|
<version>3.3.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.google.code.gson</groupId>
|
||||||
|
<artifactId>gson</artifactId>
|
||||||
|
<version>2.8.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.vaadin.external.google</groupId>
|
||||||
|
<artifactId>android-json</artifactId>
|
||||||
|
<version>0.0.20131108.vaadin1</version>
|
||||||
|
<scope>compile</scope>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- socketio -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.corundumstudio.socketio</groupId>
|
||||||
|
<artifactId>netty-socketio</artifactId>
|
||||||
|
<version>2.0.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 微信支付 APIv3 Java SDK-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.wechatpay-apiv3</groupId>
|
||||||
|
<artifactId>wechatpay-java</artifactId>
|
||||||
|
<version>0.2.17</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- MQTT -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.integration</groupId>
|
||||||
|
<artifactId>spring-integration-mqtt</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.eclipse.paho</groupId>
|
||||||
|
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
|
||||||
|
<version>1.2.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-miniapp</artifactId>
|
||||||
|
<version>4.6.0</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.binarywang</groupId>
|
||||||
|
<artifactId>weixin-java-mp</artifactId>
|
||||||
|
<version>4.6.0</version> <!-- 请替换为最新版本号 -->
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 阿里云 OSS -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun.oss</groupId>
|
||||||
|
<artifactId>aliyun-sdk-oss</artifactId>
|
||||||
|
<version>3.17.0</version>
|
||||||
|
</dependency>
|
||||||
|
<!-- 快递100-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.kuaidi100-api</groupId>
|
||||||
|
<artifactId>sdk</artifactId>
|
||||||
|
<version>1.0.13</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!--诺诺开票接口-->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.nuonuo</groupId>
|
||||||
|
<artifactId>open-sdk</artifactId>
|
||||||
|
<version>1.0.5.2</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- knife4j -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.github.xiaoymin</groupId>
|
||||||
|
<artifactId>knife4j-spring-boot-starter</artifactId>
|
||||||
|
<version>3.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.belerweb</groupId>
|
||||||
|
<artifactId>pinyin4j</artifactId>
|
||||||
|
<version>2.5.1</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<!-- 机器翻译 -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>alimt20181012</artifactId>
|
||||||
|
<version>1.0.3</version>
|
||||||
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.aliyun</groupId>
|
||||||
|
<artifactId>tea-openapi</artifactId>
|
||||||
|
<version>0.2.5</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.freewayso</groupId>
|
||||||
|
<artifactId>image-combiner</artifactId>
|
||||||
|
<version>2.6.9</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-starter-websocket</artifactId>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/java</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**/*Mapper.xml</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
<resource>
|
||||||
|
<directory>src/main/resources</directory>
|
||||||
|
<includes>
|
||||||
|
<include>**</include>
|
||||||
|
</includes>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.springframework.boot</groupId>
|
||||||
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
|
<version>2.5.4</version>
|
||||||
|
<configuration>
|
||||||
|
<excludes>
|
||||||
|
<exclude>
|
||||||
|
<groupId>org.projectlombok</groupId>
|
||||||
|
<artifactId>lombok</artifactId>
|
||||||
|
</exclude>
|
||||||
|
</excludes>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<configuration>
|
||||||
|
<source>16</source>
|
||||||
|
<target>16</target>
|
||||||
|
</configuration>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</build>
|
||||||
|
|
||||||
|
<repositories>
|
||||||
|
<repository>
|
||||||
|
<id>aliYunMaven</id>
|
||||||
|
<url>https://maven.aliyun.com/repository/public</url>
|
||||||
|
</repository>
|
||||||
|
</repositories>
|
||||||
|
|
||||||
|
</project>
|
||||||
13
pom.xml
13
pom.xml
@@ -67,9 +67,8 @@
|
|||||||
|
|
||||||
<!-- mysql -->
|
<!-- mysql -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>mysql</groupId>
|
<groupId>com.mysql</groupId>
|
||||||
<artifactId>mysql-connector-java</artifactId>
|
<artifactId>mysql-connector-j</artifactId>
|
||||||
<version>8.0.33</version>
|
|
||||||
<scope>runtime</scope>
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -171,15 +170,22 @@
|
|||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- jjwt -->
|
<!-- jjwt -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
|
<artifactId>jjwt-api</artifactId>
|
||||||
|
<version>0.11.5</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-impl</artifactId>
|
<artifactId>jjwt-impl</artifactId>
|
||||||
<version>0.11.5</version>
|
<version>0.11.5</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>io.jsonwebtoken</groupId>
|
<groupId>io.jsonwebtoken</groupId>
|
||||||
<artifactId>jjwt-jackson</artifactId>
|
<artifactId>jjwt-jackson</artifactId>
|
||||||
<version>0.11.5</version>
|
<version>0.11.5</version>
|
||||||
|
<scope>runtime</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- 图形验证码 -->
|
<!-- 图形验证码 -->
|
||||||
@@ -361,7 +367,6 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||||
<version>2.5.4</version>
|
|
||||||
<configuration>
|
<configuration>
|
||||||
<excludes>
|
<excludes>
|
||||||
<exclude>
|
<exclude>
|
||||||
|
|||||||
@@ -15,6 +15,11 @@ import org.springframework.stereotype.Component;
|
|||||||
@ConfigurationProperties(prefix = "mqtt")
|
@ConfigurationProperties(prefix = "mqtt")
|
||||||
public class MqttProperties {
|
public class MqttProperties {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否启用MQTT服务
|
||||||
|
*/
|
||||||
|
private boolean enabled = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MQTT服务器地址
|
* MQTT服务器地址
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -19,6 +19,8 @@ import org.springframework.security.core.context.SecurityContextHolder;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* MybatisPlus配置
|
* MybatisPlus配置
|
||||||
@@ -32,14 +34,18 @@ public class MybatisPlusConfig {
|
|||||||
private RedisUtil redisUtil;
|
private RedisUtil redisUtil;
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public MybatisPlusInterceptor mybatisPlusInterceptor(HttpServletRequest request) {
|
public MybatisPlusInterceptor mybatisPlusInterceptor() {
|
||||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||||
|
|
||||||
// 多租户插件配置
|
// 多租户插件配置
|
||||||
TenantLineHandler tenantLineHandler = new TenantLineHandler() {
|
TenantLineHandler tenantLineHandler = new TenantLineHandler() {
|
||||||
@Override
|
@Override
|
||||||
public Expression getTenantId() {
|
public Expression getTenantId() {
|
||||||
String tenantId;
|
String tenantId = null;
|
||||||
|
try {
|
||||||
|
// 从Spring上下文获取当前请求
|
||||||
|
HttpServletRequest request = getCurrentRequest();
|
||||||
|
if (request != null) {
|
||||||
// 从请求头拿ID
|
// 从请求头拿ID
|
||||||
tenantId = request.getHeader("tenantId");
|
tenantId = request.getHeader("tenantId");
|
||||||
if(tenantId != null){
|
if(tenantId != null){
|
||||||
@@ -55,6 +61,10 @@ public class MybatisPlusConfig {
|
|||||||
return new LongValue(tenantId);
|
return new LongValue(tenantId);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
// 忽略异常,使用默认逻辑
|
||||||
|
}
|
||||||
return getLoginUserTenantId();
|
return getLoginUserTenantId();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -111,4 +121,16 @@ public class MybatisPlusConfig {
|
|||||||
return new NullValue();
|
return new NullValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取当前HTTP请求
|
||||||
|
*/
|
||||||
|
private HttpServletRequest getCurrentRequest() {
|
||||||
|
try {
|
||||||
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
return attributes != null ? attributes.getRequest() : null;
|
||||||
|
} catch (Exception e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ import org.springframework.http.HttpMethod;
|
|||||||
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
import org.springframework.security.config.annotation.method.configuration.EnableGlobalMethodSecurity;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
|
||||||
import org.springframework.security.config.http.SessionCreationPolicy;
|
import org.springframework.security.config.http.SessionCreationPolicy;
|
||||||
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
import org.springframework.security.web.authentication.UsernamePasswordAuthenticationFilter;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
@@ -22,7 +22,7 @@ import javax.annotation.Resource;
|
|||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
@EnableGlobalMethodSecurity(prePostEnabled = true)
|
||||||
public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
public class SecurityConfig {
|
||||||
@Resource
|
@Resource
|
||||||
private JwtAccessDeniedHandler jwtAccessDeniedHandler;
|
private JwtAccessDeniedHandler jwtAccessDeniedHandler;
|
||||||
@Resource
|
@Resource
|
||||||
@@ -30,9 +30,9 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
@Resource
|
@Resource
|
||||||
private JwtAuthenticationFilter jwtAuthenticationFilter;
|
private JwtAuthenticationFilter jwtAuthenticationFilter;
|
||||||
|
|
||||||
@Override
|
@Bean
|
||||||
protected void configure(HttpSecurity http) throws Exception {
|
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
|
||||||
http.authorizeRequests()
|
return http.authorizeRequests()
|
||||||
.antMatchers(HttpMethod.OPTIONS, "/**")
|
.antMatchers(HttpMethod.OPTIONS, "/**")
|
||||||
.permitAll()
|
.permitAll()
|
||||||
.antMatchers(HttpMethod.GET, "/api/file/**","/**", "/api/captcha", "/")
|
.antMatchers(HttpMethod.GET, "/api/file/**","/**", "/api/captcha", "/")
|
||||||
@@ -48,6 +48,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
"/v2/api-docs",
|
"/v2/api-docs",
|
||||||
"/v3/api-docs",
|
"/v3/api-docs",
|
||||||
"/swagger-ui/**",
|
"/swagger-ui/**",
|
||||||
|
"/doc.html",
|
||||||
"/api/open/**",
|
"/api/open/**",
|
||||||
"/hxz/v1/**",
|
"/hxz/v1/**",
|
||||||
"/api/sendSmsCaptcha",
|
"/api/sendSmsCaptcha",
|
||||||
@@ -95,7 +96,8 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
|
|||||||
.accessDeniedHandler(jwtAccessDeniedHandler)
|
.accessDeniedHandler(jwtAccessDeniedHandler)
|
||||||
.authenticationEntryPoint(jwtAuthenticationEntryPoint)
|
.authenticationEntryPoint(jwtAuthenticationEntryPoint)
|
||||||
.and()
|
.and()
|
||||||
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class);
|
.addFilterBefore(jwtAuthenticationFilter, UsernamePasswordAuthenticationFilter.class)
|
||||||
|
.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|||||||
@@ -40,6 +40,12 @@ public class MqttService {
|
|||||||
try {
|
try {
|
||||||
logger.info("开始初始化MQTT服务...");
|
logger.info("开始初始化MQTT服务...");
|
||||||
|
|
||||||
|
// 检查是否启用MQTT服务
|
||||||
|
if (!mqttProperties.isEnabled()) {
|
||||||
|
logger.info("MQTT服务已禁用,跳过初始化");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// 验证配置属性
|
// 验证配置属性
|
||||||
validateMqttProperties();
|
validateMqttProperties();
|
||||||
|
|
||||||
|
|||||||
@@ -1,178 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopUserCoupon;
|
|
||||||
import com.gxwebsoft.shop.service.CouponBusinessService;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠券业务控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-08 22:30:00
|
|
||||||
*/
|
|
||||||
@Tag(name = "优惠券业务管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/shop/coupon-business")
|
|
||||||
public class CouponBusinessController extends BaseController {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CouponBusinessService couponBusinessService;
|
|
||||||
|
|
||||||
@Operation(summary = "获取订单可用优惠券")
|
|
||||||
@PostMapping("/available-for-order")
|
|
||||||
public ApiResult<List<ShopUserCoupon>> getAvailableCouponsForOrder(
|
|
||||||
@RequestBody Map<String, Object> orderData) {
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser == null) {
|
|
||||||
return fail("请先登录", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Map<String, Object>> goodsItems = (List<Map<String, Object>>) orderData.get("goodsItems");
|
|
||||||
BigDecimal totalAmount = new BigDecimal(orderData.get("totalAmount").toString());
|
|
||||||
|
|
||||||
List<ShopUserCoupon> coupons = couponBusinessService.getAvailableCouponsForOrder(
|
|
||||||
loginUser.getUserId(), goodsItems, totalAmount);
|
|
||||||
|
|
||||||
return success(coupons);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "计算使用优惠券后的订单金额")
|
|
||||||
@PostMapping("/calculate-order-amount")
|
|
||||||
public ApiResult<Map<String, Object>> calculateOrderAmountWithCoupon(
|
|
||||||
@RequestParam Long userCouponId,
|
|
||||||
@RequestBody Map<String, Object> orderData) {
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Map<String, Object>> goodsItems = (List<Map<String, Object>>) orderData.get("goodsItems");
|
|
||||||
BigDecimal totalAmount = new BigDecimal(orderData.get("totalAmount").toString());
|
|
||||||
|
|
||||||
Map<String, Object> result = couponBusinessService.calculateOrderAmountWithCoupon(
|
|
||||||
userCouponId, goodsItems, totalAmount);
|
|
||||||
|
|
||||||
return success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "验证优惠券是否可用于订单")
|
|
||||||
@PostMapping("/validate-for-order")
|
|
||||||
public ApiResult<Map<String, Object>> validateCouponForOrder(
|
|
||||||
@RequestParam Long userCouponId,
|
|
||||||
@RequestBody Map<String, Object> orderData) {
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser == null) {
|
|
||||||
return fail("请先登录", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Map<String, Object>> goodsItems = (List<Map<String, Object>>) orderData.get("goodsItems");
|
|
||||||
BigDecimal totalAmount = new BigDecimal(orderData.get("totalAmount").toString());
|
|
||||||
|
|
||||||
Map<String, Object> result = couponBusinessService.validateCouponForOrder(
|
|
||||||
userCouponId, loginUser.getUserId(), goodsItems, totalAmount);
|
|
||||||
|
|
||||||
return success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Operation(summary = "推荐最优优惠券组合")
|
|
||||||
@PostMapping("/recommend-best-combination")
|
|
||||||
public ApiResult<Map<String, Object>> recommendBestCouponCombination(
|
|
||||||
@RequestBody Map<String, Object> orderData) {
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser == null) {
|
|
||||||
return fail("请先登录", null);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
|
||||||
List<Map<String, Object>> goodsItems = (List<Map<String, Object>>) orderData.get("goodsItems");
|
|
||||||
BigDecimal totalAmount = new BigDecimal(orderData.get("totalAmount").toString());
|
|
||||||
|
|
||||||
Map<String, Object> result = couponBusinessService.recommendBestCouponCombination(
|
|
||||||
loginUser.getUserId(), goodsItems, totalAmount);
|
|
||||||
|
|
||||||
return success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:coupon:manage')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "为新用户发放欢迎优惠券")
|
|
||||||
@PostMapping("/issue-welcome/{userId}")
|
|
||||||
public ApiResult<?> issueWelcomeCoupons(@PathVariable Integer userId) {
|
|
||||||
int count = couponBusinessService.issueWelcomeCoupons(userId);
|
|
||||||
return success("成功发放" + count + "张欢迎优惠券");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:coupon:manage')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "为用户发放生日优惠券")
|
|
||||||
@PostMapping("/issue-birthday/{userId}")
|
|
||||||
public ApiResult<?> issueBirthdayCoupons(@PathVariable Integer userId) {
|
|
||||||
int count = couponBusinessService.issueBirthdayCoupons(userId);
|
|
||||||
return success("成功发放" + count + "张生日优惠券");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:coupon:manage')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "根据消费金额发放优惠券")
|
|
||||||
@PostMapping("/issue-consume/{userId}")
|
|
||||||
public ApiResult<?> issueConsumeCoupons(@PathVariable Integer userId,
|
|
||||||
@RequestParam BigDecimal consumeAmount) {
|
|
||||||
int count = couponBusinessService.issueConsumeCoupons(userId, consumeAmount);
|
|
||||||
return success("成功发放" + count + "张消费返券");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:coupon:manage')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量发放活动优惠券")
|
|
||||||
@PostMapping("/batch-issue-activity")
|
|
||||||
public ApiResult<Map<String, Object>> batchIssueActivityCoupons(
|
|
||||||
@RequestParam String activityName,
|
|
||||||
@RequestParam List<Integer> couponIds,
|
|
||||||
@RequestParam(required = false) List<Integer> userIds) {
|
|
||||||
|
|
||||||
Map<String, Object> result = couponBusinessService.batchIssueActivityCoupons(
|
|
||||||
activityName, couponIds, userIds);
|
|
||||||
|
|
||||||
return success(result);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:coupon:statistics')")
|
|
||||||
@Operation(summary = "获取优惠券使用统计")
|
|
||||||
@GetMapping("/usage-statistics")
|
|
||||||
public ApiResult<Map<String, Object>> getCouponUsageStatistics(
|
|
||||||
@RequestParam(required = false) String startDate,
|
|
||||||
@RequestParam(required = false) String endDate) {
|
|
||||||
|
|
||||||
Map<String, Object> statistics = couponBusinessService.getCouponUsageStatistics(startDate, endDate);
|
|
||||||
return success(statistics);
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:coupon:manage')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "手动处理过期优惠券")
|
|
||||||
@PostMapping("/process-expired")
|
|
||||||
public ApiResult<?> processExpiredCoupons() {
|
|
||||||
int count = couponBusinessService.autoProcessExpiredCoupons();
|
|
||||||
return success("处理了" + count + "张过期优惠券");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:coupon:manage')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "发送优惠券到期提醒")
|
|
||||||
@PostMapping("/send-expiry-reminder")
|
|
||||||
public ApiResult<?> sendExpiryReminder(@RequestParam(defaultValue = "3") Integer days) {
|
|
||||||
int count = couponBusinessService.sendCouponExpiryReminder(days);
|
|
||||||
return success("向" + count + "个用户发送了到期提醒");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,129 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.shop.service.ShopUserCouponService;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopUserCoupon;
|
|
||||||
import com.gxwebsoft.shop.param.ShopUserCouponParam;
|
|
||||||
import com.gxwebsoft.common.core.web.ApiResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.BatchParam;
|
|
||||||
import com.gxwebsoft.common.core.annotation.OperationLog;
|
|
||||||
import com.gxwebsoft.common.system.entity.User;
|
|
||||||
import io.swagger.v3.oas.annotations.Operation;
|
|
||||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户优惠券控制器
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-09 15:48:01
|
|
||||||
*/
|
|
||||||
@Tag(name = "用户优惠券管理")
|
|
||||||
@RestController
|
|
||||||
@RequestMapping("/api/shop/shop-user-coupon")
|
|
||||||
public class ShopUserCouponController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private ShopUserCouponService shopUserCouponService;
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:list')")
|
|
||||||
@Operation(summary = "分页查询用户优惠券")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<ShopUserCoupon>> page(ShopUserCouponParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(shopUserCouponService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:list')")
|
|
||||||
@Operation(summary = "查询全部用户优惠券")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<ShopUserCoupon>> list(ShopUserCouponParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(shopUserCouponService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:list')")
|
|
||||||
@Operation(summary = "根据id查询用户优惠券")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<ShopUserCoupon> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(shopUserCouponService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "添加用户优惠券")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody ShopUserCoupon shopUserCoupon) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
shopUserCoupon.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (shopUserCouponService.save(shopUserCoupon)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改用户优惠券")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody ShopUserCoupon shopUserCoupon) {
|
|
||||||
if (shopUserCouponService.updateById(shopUserCoupon)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除用户优惠券")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (shopUserCouponService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加用户优惠券")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<ShopUserCoupon> list) {
|
|
||||||
if (shopUserCouponService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改用户优惠券")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopUserCoupon> batchParam) {
|
|
||||||
if (batchParam.update(shopUserCouponService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopUserCoupon:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除用户优惠券")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (shopUserCouponService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.mapper;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopUserCoupon;
|
|
||||||
import com.gxwebsoft.shop.param.ShopUserCouponParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户优惠券Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-09 15:48:01
|
|
||||||
*/
|
|
||||||
public interface ShopUserCouponMapper extends BaseMapper<ShopUserCoupon> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<ShopUserCoupon>
|
|
||||||
*/
|
|
||||||
List<ShopUserCoupon> selectPageRel(@Param("page") IPage<ShopUserCoupon> page,
|
|
||||||
@Param("param") ShopUserCouponParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<ShopUserCoupon> selectListRel(@Param("param") ShopUserCouponParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
<?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.gxwebsoft.shop.mapper.ShopGoodsCouponMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*
|
|
||||||
FROM shop_goods_coupon a
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.goodsId != null">
|
|
||||||
AND a.goods_id = #{param.goodsId}
|
|
||||||
</if>
|
|
||||||
<if test="param.issueCouponId != null">
|
|
||||||
AND a.issue_coupon_id = #{param.issueCouponId}
|
|
||||||
</if>
|
|
||||||
<if test="param.sortNumber != null">
|
|
||||||
AND a.sort_number = #{param.sortNumber}
|
|
||||||
</if>
|
|
||||||
<if test="param.status != null">
|
|
||||||
AND a.status = #{param.status}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted != null">
|
|
||||||
AND a.deleted = #{param.deleted}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted == null">
|
|
||||||
AND a.deleted = 0
|
|
||||||
</if>
|
|
||||||
<if test="param.userId != null">
|
|
||||||
AND a.user_id = #{param.userId}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeStart != null">
|
|
||||||
AND a.create_time >= #{param.createTimeStart}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeEnd != null">
|
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.ShopGoodsCoupon">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopGoodsCoupon">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
<?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.gxwebsoft.shop.mapper.ShopUserCouponMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*
|
|
||||||
FROM shop_user_coupon a
|
|
||||||
<where>
|
|
||||||
<if test="param.id != null">
|
|
||||||
AND a.id = #{param.id}
|
|
||||||
</if>
|
|
||||||
<if test="param.couponId != null">
|
|
||||||
AND a.coupon_id = #{param.couponId}
|
|
||||||
</if>
|
|
||||||
<if test="param.userId != null">
|
|
||||||
AND a.user_id = #{param.userId}
|
|
||||||
</if>
|
|
||||||
<if test="param.name != null">
|
|
||||||
AND a.name LIKE CONCAT('%', #{param.name}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.description != null">
|
|
||||||
AND a.description LIKE CONCAT('%', #{param.description}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.type != null">
|
|
||||||
AND a.type = #{param.type}
|
|
||||||
</if>
|
|
||||||
<if test="param.reducePrice != null">
|
|
||||||
AND a.reduce_price = #{param.reducePrice}
|
|
||||||
</if>
|
|
||||||
<if test="param.discount != null">
|
|
||||||
AND a.discount = #{param.discount}
|
|
||||||
</if>
|
|
||||||
<if test="param.minPrice != null">
|
|
||||||
AND a.min_price = #{param.minPrice}
|
|
||||||
</if>
|
|
||||||
<if test="param.applyRange != null">
|
|
||||||
AND a.apply_range = #{param.applyRange}
|
|
||||||
</if>
|
|
||||||
<if test="param.applyRangeConfig != null">
|
|
||||||
AND a.apply_range_config LIKE CONCAT('%', #{param.applyRangeConfig}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.startTime != null">
|
|
||||||
AND a.start_time LIKE CONCAT('%', #{param.startTime}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.endTime != null">
|
|
||||||
AND a.end_time LIKE CONCAT('%', #{param.endTime}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.status != null">
|
|
||||||
AND a.status = #{param.status}
|
|
||||||
</if>
|
|
||||||
<if test="param.useTime != null">
|
|
||||||
AND a.use_time LIKE CONCAT('%', #{param.useTime}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.orderId != null">
|
|
||||||
AND a.order_id LIKE CONCAT('%', #{param.orderId}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.orderNo != null">
|
|
||||||
AND a.order_no LIKE CONCAT('%', #{param.orderNo}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.obtainType != null">
|
|
||||||
AND a.obtain_type = #{param.obtainType}
|
|
||||||
</if>
|
|
||||||
<if test="param.obtainSource != null">
|
|
||||||
AND a.obtain_source LIKE CONCAT('%', #{param.obtainSource}, '%')
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted != null">
|
|
||||||
AND a.deleted = #{param.deleted}
|
|
||||||
</if>
|
|
||||||
<if test="param.deleted == null">
|
|
||||||
AND a.deleted = 0
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeStart != null">
|
|
||||||
AND a.create_time >= #{param.createTimeStart}
|
|
||||||
</if>
|
|
||||||
<if test="param.createTimeEnd != null">
|
|
||||||
AND a.create_time <= #{param.createTimeEnd}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.ShopUserCoupon">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopUserCoupon">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,96 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.param;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryField;
|
|
||||||
import com.gxwebsoft.common.core.annotation.QueryType;
|
|
||||||
import com.gxwebsoft.common.core.web.BaseParam;
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户优惠券查询参数
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-09 15:48:01
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "ShopUserCouponParam对象", description = "用户优惠券查询参数")
|
|
||||||
public class ShopUserCouponParam extends BaseParam {
|
|
||||||
private static final long serialVersionUID = 1L;
|
|
||||||
|
|
||||||
@Schema(description = "id")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer id;
|
|
||||||
|
|
||||||
@Schema(description = "优惠券模板ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer couponId;
|
|
||||||
|
|
||||||
@Schema(description = "用户ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
@Schema(description = "优惠券名称")
|
|
||||||
private String name;
|
|
||||||
|
|
||||||
@Schema(description = "优惠券描述")
|
|
||||||
private String description;
|
|
||||||
|
|
||||||
@Schema(description = "优惠券类型(10满减券 20折扣券 30免费劵)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "满减券-减免金额")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private BigDecimal reducePrice;
|
|
||||||
|
|
||||||
@Schema(description = "折扣券-折扣率(0-100)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer discount;
|
|
||||||
|
|
||||||
@Schema(description = "最低消费金额")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private BigDecimal minPrice;
|
|
||||||
|
|
||||||
@Schema(description = "适用范围(10全部商品 20指定商品 30指定分类)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer applyRange;
|
|
||||||
|
|
||||||
@Schema(description = "适用范围配置(json格式)")
|
|
||||||
private String applyRangeConfig;
|
|
||||||
|
|
||||||
@Schema(description = "有效期开始时间")
|
|
||||||
private String startTime;
|
|
||||||
|
|
||||||
@Schema(description = "有效期结束时间")
|
|
||||||
private String endTime;
|
|
||||||
|
|
||||||
@Schema(description = "使用状态(0未使用 1已使用 2已过期)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "使用时间")
|
|
||||||
private String useTime;
|
|
||||||
|
|
||||||
@Schema(description = "使用订单ID")
|
|
||||||
private Long orderId;
|
|
||||||
|
|
||||||
@Schema(description = "使用订单号")
|
|
||||||
private String orderNo;
|
|
||||||
|
|
||||||
@Schema(description = "获取方式(10主动领取 20系统发放 30活动赠送)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer obtainType;
|
|
||||||
|
|
||||||
@Schema(description = "获取来源描述")
|
|
||||||
private String obtainSource;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Boolean deleted;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,130 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.service;
|
|
||||||
|
|
||||||
import com.gxwebsoft.shop.entity.ShopUserCoupon;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠券业务服务
|
|
||||||
* 处理订单中的优惠券相关业务逻辑
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-08 22:00:00
|
|
||||||
*/
|
|
||||||
public interface CouponBusinessService {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取用户在指定订单中可用的优惠券
|
|
||||||
*
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @param goodsItems 商品列表 [{goodsId, categoryId, price, quantity}]
|
|
||||||
* @param totalAmount 订单总金额
|
|
||||||
* @return 可用优惠券列表
|
|
||||||
*/
|
|
||||||
List<ShopUserCoupon> getAvailableCouponsForOrder(Integer userId,
|
|
||||||
List<Map<String, Object>> goodsItems,
|
|
||||||
BigDecimal totalAmount);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 计算使用优惠券后的订单金额
|
|
||||||
*
|
|
||||||
* @param userCouponId 用户优惠券ID
|
|
||||||
* @param goodsItems 商品列表
|
|
||||||
* @param totalAmount 订单总金额
|
|
||||||
* @return 计算结果 {discountAmount: 优惠金额, finalAmount: 最终金额, valid: 是否有效}
|
|
||||||
*/
|
|
||||||
Map<String, Object> calculateOrderAmountWithCoupon(Long userCouponId,
|
|
||||||
List<Map<String, Object>> goodsItems,
|
|
||||||
BigDecimal totalAmount);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 验证优惠券是否可用于订单
|
|
||||||
*
|
|
||||||
* @param userCouponId 用户优惠券ID
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @param goodsItems 商品列表
|
|
||||||
* @param totalAmount 订单总金额
|
|
||||||
* @return 验证结果 {valid: boolean, reason: String}
|
|
||||||
*/
|
|
||||||
Map<String, Object> validateCouponForOrder(Long userCouponId,
|
|
||||||
Integer userId,
|
|
||||||
List<Map<String, Object>> goodsItems,
|
|
||||||
BigDecimal totalAmount);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 为新用户发放欢迎优惠券
|
|
||||||
*
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @return 发放成功的优惠券数量
|
|
||||||
*/
|
|
||||||
int issueWelcomeCoupons(Integer userId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 为用户生日发放生日优惠券
|
|
||||||
*
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @return 发放成功的优惠券数量
|
|
||||||
*/
|
|
||||||
int issueBirthdayCoupons(Integer userId);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据用户消费金额发放优惠券
|
|
||||||
*
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @param consumeAmount 消费金额
|
|
||||||
* @return 发放成功的优惠券数量
|
|
||||||
*/
|
|
||||||
int issueConsumeCoupons(Integer userId, BigDecimal consumeAmount);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 活动期间批量发放优惠券
|
|
||||||
*
|
|
||||||
* @param activityName 活动名称
|
|
||||||
* @param couponIds 优惠券模板ID列表
|
|
||||||
* @param userIds 用户ID列表(为空则发放给所有用户)
|
|
||||||
* @return 发放统计 {totalUsers: 总用户数, totalCoupons: 总优惠券数, successCount: 成功数量}
|
|
||||||
*/
|
|
||||||
Map<String, Object> batchIssueActivityCoupons(String activityName,
|
|
||||||
List<Integer> couponIds,
|
|
||||||
List<Integer> userIds);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 获取优惠券使用统计
|
|
||||||
*
|
|
||||||
* @param startDate 开始日期
|
|
||||||
* @param endDate 结束日期
|
|
||||||
* @return 统计结果
|
|
||||||
*/
|
|
||||||
Map<String, Object> getCouponUsageStatistics(String startDate, String endDate);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 自动处理过期优惠券
|
|
||||||
* 定时任务调用
|
|
||||||
*
|
|
||||||
* @return 处理数量
|
|
||||||
*/
|
|
||||||
int autoProcessExpiredCoupons();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 发送优惠券到期提醒
|
|
||||||
* 定时任务调用
|
|
||||||
*
|
|
||||||
* @param days 提前天数
|
|
||||||
* @return 提醒用户数量
|
|
||||||
*/
|
|
||||||
int sendCouponExpiryReminder(Integer days);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 推荐最优优惠券组合
|
|
||||||
*
|
|
||||||
* @param userId 用户ID
|
|
||||||
* @param goodsItems 商品列表
|
|
||||||
* @param totalAmount 订单总金额
|
|
||||||
* @return 推荐结果 {coupons: 优惠券列表, totalDiscount: 总优惠金额, finalAmount: 最终金额}
|
|
||||||
*/
|
|
||||||
Map<String, Object> recommendBestCouponCombination(Integer userId,
|
|
||||||
List<Map<String, Object>> goodsItems,
|
|
||||||
BigDecimal totalAmount);
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.service;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopUserCoupon;
|
|
||||||
import com.gxwebsoft.shop.param.ShopUserCouponParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户优惠券Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-09 15:48:01
|
|
||||||
*/
|
|
||||||
public interface ShopUserCouponService extends IService<ShopUserCoupon> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<ShopUserCoupon>
|
|
||||||
*/
|
|
||||||
PageResult<ShopUserCoupon> pageRel(ShopUserCouponParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<ShopUserCoupon>
|
|
||||||
*/
|
|
||||||
List<ShopUserCoupon> listRel(ShopUserCouponParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id id
|
|
||||||
* @return ShopUserCoupon
|
|
||||||
*/
|
|
||||||
ShopUserCoupon getByIdRel(Integer id);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,47 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.service.impl;
|
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
||||||
import com.gxwebsoft.shop.mapper.ShopUserCouponMapper;
|
|
||||||
import com.gxwebsoft.shop.service.ShopUserCouponService;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopUserCoupon;
|
|
||||||
import com.gxwebsoft.shop.param.ShopUserCouponParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageParam;
|
|
||||||
import com.gxwebsoft.common.core.web.PageResult;
|
|
||||||
import org.springframework.stereotype.Service;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 用户优惠券Service实现
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-09 15:48:01
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ShopUserCouponServiceImpl extends ServiceImpl<ShopUserCouponMapper, ShopUserCoupon> implements ShopUserCouponService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<ShopUserCoupon> pageRel(ShopUserCouponParam param) {
|
|
||||||
PageParam<ShopUserCoupon, ShopUserCouponParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<ShopUserCoupon> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ShopUserCoupon> listRel(ShopUserCouponParam param) {
|
|
||||||
List<ShopUserCoupon> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<ShopUserCoupon, ShopUserCouponParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ShopUserCoupon getByIdRel(Integer id) {
|
|
||||||
ShopUserCouponParam param = new ShopUserCouponParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,65 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.task;
|
|
||||||
|
|
||||||
import com.gxwebsoft.shop.service.CouponBusinessService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
|
||||||
import org.springframework.scheduling.annotation.Scheduled;
|
|
||||||
import org.springframework.stereotype.Component;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠券定时任务
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-08 22:30:00
|
|
||||||
*/
|
|
||||||
@Slf4j
|
|
||||||
@Component
|
|
||||||
public class CouponScheduledTask {
|
|
||||||
|
|
||||||
@Resource
|
|
||||||
private CouponBusinessService couponBusinessService;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 每天凌晨2点处理过期优惠券
|
|
||||||
*/
|
|
||||||
@Scheduled(cron = "0 0 2 * * ?")
|
|
||||||
public void processExpiredCoupons() {
|
|
||||||
try {
|
|
||||||
log.info("开始执行过期优惠券处理任务");
|
|
||||||
int count = couponBusinessService.autoProcessExpiredCoupons();
|
|
||||||
log.info("过期优惠券处理任务完成,处理{}张优惠券", count);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("过期优惠券处理任务执行失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 每天上午10点发送优惠券到期提醒
|
|
||||||
*/
|
|
||||||
@Scheduled(cron = "0 0 10 * * ?")
|
|
||||||
public void sendExpiryReminder() {
|
|
||||||
try {
|
|
||||||
log.info("开始执行优惠券到期提醒任务");
|
|
||||||
int count = couponBusinessService.sendCouponExpiryReminder(3);
|
|
||||||
log.info("优惠券到期提醒任务完成,提醒{}个用户", count);
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("优惠券到期提醒任务执行失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 每天凌晨1点发送生日优惠券
|
|
||||||
*/
|
|
||||||
@Scheduled(cron = "0 0 1 * * ?")
|
|
||||||
public void issueBirthdayCoupons() {
|
|
||||||
try {
|
|
||||||
log.info("开始执行生日优惠券发放任务");
|
|
||||||
// 这里需要获取今天生日的用户列表
|
|
||||||
// 由于没有具体的用户生日查询方法,这里只是示例
|
|
||||||
log.info("生日优惠券发放任务完成");
|
|
||||||
} catch (Exception e) {
|
|
||||||
log.error("生日优惠券发放任务执行失败", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user