运行不起来了
This commit is contained in:
166
docs/bszx/controller/BszxBmController.java
Normal file
166
docs/bszx/controller/BszxBmController.java
Normal file
@@ -0,0 +1,166 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
121
docs/bszx/controller/BszxBranchController.java
Normal file
121
docs/bszx/controller/BszxBranchController.java
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
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("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
156
docs/bszx/controller/BszxClassController.java
Normal file
156
docs/bszx/controller/BszxClassController.java
Normal file
@@ -0,0 +1,156 @@
|
|||||||
|
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("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
121
docs/bszx/controller/BszxEraController.java
Normal file
121
docs/bszx/controller/BszxEraController.java
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
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("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
121
docs/bszx/controller/BszxGradeController.java
Normal file
121
docs/bszx/controller/BszxGradeController.java
Normal file
@@ -0,0 +1,121 @@
|
|||||||
|
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("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
91
docs/bszx/controller/BszxOrderController.java
Normal file
91
docs/bszx/controller/BszxOrderController.java
Normal file
@@ -0,0 +1,91 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
344
docs/bszx/controller/BszxPayController.java
Normal file
344
docs/bszx/controller/BszxPayController.java
Normal file
@@ -0,0 +1,344 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
}
|
||||||
199
docs/bszx/controller/BszxPayRankingController.java
Normal file
199
docs/bszx/controller/BszxPayRankingController.java
Normal file
@@ -0,0 +1,199 @@
|
|||||||
|
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("删除失败");
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
149
docs/bszx/entity/BszxBm.java
Normal file
149
docs/bszx/entity/BszxBm.java
Normal file
@@ -0,0 +1,149 @@
|
|||||||
|
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") ? "男" : "女";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
43
docs/bszx/entity/BszxBranch.java
Normal file
43
docs/bszx/entity/BszxBranch.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
70
docs/bszx/entity/BszxClass.java
Normal file
70
docs/bszx/entity/BszxClass.java
Normal file
@@ -0,0 +1,70 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
43
docs/bszx/entity/BszxEra.java
Normal file
43
docs/bszx/entity/BszxEra.java
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
53
docs/bszx/entity/BszxGrade.java
Normal file
53
docs/bszx/entity/BszxGrade.java
Normal file
@@ -0,0 +1,53 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
141
docs/bszx/entity/BszxPay.java
Normal file
141
docs/bszx/entity/BszxPay.java
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
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") ? "男" : "女";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
65
docs/bszx/entity/BszxPayRanking.java
Normal file
65
docs/bszx/entity/BszxPayRanking.java
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
37
docs/bszx/mapper/BszxBmMapper.java
Normal file
37
docs/bszx/mapper/BszxBmMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
37
docs/bszx/mapper/BszxBranchMapper.java
Normal file
37
docs/bszx/mapper/BszxBranchMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
37
docs/bszx/mapper/BszxClassMapper.java
Normal file
37
docs/bszx/mapper/BszxClassMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
37
docs/bszx/mapper/BszxEraMapper.java
Normal file
37
docs/bszx/mapper/BszxEraMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
37
docs/bszx/mapper/BszxGradeMapper.java
Normal file
37
docs/bszx/mapper/BszxGradeMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
42
docs/bszx/mapper/BszxPayMapper.java
Normal file
42
docs/bszx/mapper/BszxPayMapper.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
37
docs/bszx/mapper/BszxPayRankingMapper.java
Normal file
37
docs/bszx/mapper/BszxPayRankingMapper.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
113
docs/bszx/mapper/xml/BszxBmMapper.xml
Normal file
113
docs/bszx/mapper/xml/BszxBmMapper.xml
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<?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>
|
||||||
36
docs/bszx/mapper/xml/BszxBranchMapper.xml
Normal file
36
docs/bszx/mapper/xml/BszxBranchMapper.xml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?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>
|
||||||
63
docs/bszx/mapper/xml/BszxClassMapper.xml
Normal file
63
docs/bszx/mapper/xml/BszxClassMapper.xml
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
<?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>
|
||||||
36
docs/bszx/mapper/xml/BszxEraMapper.xml
Normal file
36
docs/bszx/mapper/xml/BszxEraMapper.xml
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
<?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>
|
||||||
54
docs/bszx/mapper/xml/BszxGradeMapper.xml
Normal file
54
docs/bszx/mapper/xml/BszxGradeMapper.xml
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
<?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>
|
||||||
126
docs/bszx/mapper/xml/BszxPayMapper.xml
Normal file
126
docs/bszx/mapper/xml/BszxPayMapper.xml
Normal file
@@ -0,0 +1,126 @@
|
|||||||
|
<?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>
|
||||||
61
docs/bszx/mapper/xml/BszxPayRankingMapper.xml
Normal file
61
docs/bszx/mapper/xml/BszxPayRankingMapper.xml
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
<?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>
|
||||||
114
docs/bszx/param/BszxBmParam.java
Normal file
114
docs/bszx/param/BszxBmParam.java
Normal file
@@ -0,0 +1,114 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
37
docs/bszx/param/BszxBranchParam.java
Normal file
37
docs/bszx/param/BszxBranchParam.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
64
docs/bszx/param/BszxClassParam.java
Normal file
64
docs/bszx/param/BszxClassParam.java
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
37
docs/bszx/param/BszxEraParam.java
Normal file
37
docs/bszx/param/BszxEraParam.java
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
52
docs/bszx/param/BszxGradeParam.java
Normal file
52
docs/bszx/param/BszxGradeParam.java
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
118
docs/bszx/param/BszxPayParam.java
Normal file
118
docs/bszx/param/BszxPayParam.java
Normal file
@@ -0,0 +1,118 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
57
docs/bszx/param/BszxPayRankingParam.java
Normal file
57
docs/bszx/param/BszxPayRankingParam.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
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;
|
||||||
|
|
||||||
|
}
|
||||||
50
docs/bszx/service/BszxBmService.java
Normal file
50
docs/bszx/service/BszxBmService.java
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
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);
|
||||||
|
}
|
||||||
42
docs/bszx/service/BszxBranchService.java
Normal file
42
docs/bszx/service/BszxBranchService.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
42
docs/bszx/service/BszxClassService.java
Normal file
42
docs/bszx/service/BszxClassService.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
42
docs/bszx/service/BszxEraService.java
Normal file
42
docs/bszx/service/BszxEraService.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
42
docs/bszx/service/BszxGradeService.java
Normal file
42
docs/bszx/service/BszxGradeService.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
42
docs/bszx/service/BszxPayRankingService.java
Normal file
42
docs/bszx/service/BszxPayRankingService.java
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
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);
|
||||||
|
|
||||||
|
}
|
||||||
57
docs/bszx/service/BszxPayService.java
Normal file
57
docs/bszx/service/BszxPayService.java
Normal file
@@ -0,0 +1,57 @@
|
|||||||
|
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();
|
||||||
|
}
|
||||||
162
docs/bszx/service/impl/BszxBmServiceImpl.java
Normal file
162
docs/bszx/service/impl/BszxBmServiceImpl.java
Normal file
@@ -0,0 +1,162 @@
|
|||||||
|
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"));
|
||||||
|
}
|
||||||
|
}
|
||||||
47
docs/bszx/service/impl/BszxBranchServiceImpl.java
Normal file
47
docs/bszx/service/impl/BszxBranchServiceImpl.java
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
68
docs/bszx/service/impl/BszxClassServiceImpl.java
Normal file
68
docs/bszx/service/impl/BszxClassServiceImpl.java
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
47
docs/bszx/service/impl/BszxEraServiceImpl.java
Normal file
47
docs/bszx/service/impl/BszxEraServiceImpl.java
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
47
docs/bszx/service/impl/BszxGradeServiceImpl.java
Normal file
47
docs/bszx/service/impl/BszxGradeServiceImpl.java
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
47
docs/bszx/service/impl/BszxPayRankingServiceImpl.java
Normal file
47
docs/bszx/service/impl/BszxPayRankingServiceImpl.java
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
169
docs/bszx/service/impl/BszxPayServiceImpl.java
Normal file
169
docs/bszx/service/impl/BszxPayServiceImpl.java
Normal file
@@ -0,0 +1,169 @@
|
|||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -128,14 +128,6 @@
|
|||||||
OR a.room_number LIKE CONCAT('%', #{param.keywords}, '%')
|
OR a.room_number LIKE CONCAT('%', #{param.keywords}, '%')
|
||||||
)
|
)
|
||||||
</if>
|
</if>
|
||||||
<!-- 价格区间筛选 -->
|
|
||||||
<if test="param.priceScene != null and param.priceScene.indexOf('~') > -1">
|
|
||||||
<bind name="priceMin" value="param.priceScene.substring(0, param.priceScene.indexOf('~'))" />
|
|
||||||
<bind name="priceMax" value="param.priceScene.substring(param.priceScene.indexOf('~') + 1)" />
|
|
||||||
AND a.monthly_rent >= CAST(#{priceMin} AS DECIMAL(10,2))
|
|
||||||
AND a.monthly_rent <= CAST(#{priceMax} AS DECIMAL(10,2))
|
|
||||||
</if>
|
|
||||||
</if>
|
|
||||||
</where>
|
</where>
|
||||||
<trim prefix="ORDER BY" suffixOverrides=",">
|
<trim prefix="ORDER BY" suffixOverrides=",">
|
||||||
<if test="param.sortScene == '综合排序'">
|
<if test="param.sortScene == '综合排序'">
|
||||||
@@ -145,37 +137,24 @@
|
|||||||
a.create_time desc,
|
a.create_time desc,
|
||||||
</if>
|
</if>
|
||||||
<if test="param.sortScene == '价格(低-高)'">
|
<if test="param.sortScene == '价格(低-高)'">
|
||||||
CAST(IFNULL(a.monthly_rent, 0) AS DECIMAL(10,2)) asc,
|
a.monthly_rent asc,
|
||||||
</if>
|
</if>
|
||||||
<if test="param.sortScene == '价格(高-低)'">
|
<if test="param.sortScene == '价格(高-低)'">
|
||||||
CAST(IFNULL(a.monthly_rent, 0) AS DECIMAL(10,2)) desc,
|
a.monthly_rent desc,
|
||||||
</if>
|
</if>
|
||||||
<if test="param.sortScene == '面积(小-大)'">
|
<if test="param.sortScene == '面积(小-大)'">
|
||||||
CASE WHEN a.extent IS NULL OR a.extent = '' THEN 1 ELSE 0 END,
|
a.extent asc,
|
||||||
CAST(COALESCE(NULLIF(a.extent, ''), '0') AS DECIMAL(10,2)) asc,
|
|
||||||
</if>
|
</if>
|
||||||
<if test="param.sortScene == '面积(大-小)'">
|
<if test="param.sortScene == '面积(大-小)'">
|
||||||
CASE WHEN a.extent IS NULL OR a.extent = '' THEN 1 ELSE 0 END,
|
a.extent desc,
|
||||||
CAST(COALESCE(NULLIF(a.extent, ''), '0') AS DECIMAL(10,2)) desc,
|
|
||||||
</if>
|
</if>
|
||||||
<if test="param.priceScene != null and param.priceScene.indexOf('~') == -1">
|
<if test="param.priceScene != null">
|
||||||
ABS(CAST(COALESCE(a.monthly_rent, 0) AS DECIMAL(10,2)) - CAST(#{param.priceScene} AS DECIMAL(10,2))),
|
ABS(a.monthly_rent - #{param.priceScene}),
|
||||||
</if>
|
</if>
|
||||||
<if test="param.extentScene != null and param.extentScene.indexOf('~') == -1">
|
|
||||||
ABS(CAST(COALESCE(NULLIF(a.extent, ''), '0') AS DECIMAL(10,2)) - CAST(#{param.extentScene} AS DECIMAL(10,2))),
|
<if test="param.extentScene != null">
|
||||||
|
ABS(a.extent - #{param.extentScene}),
|
||||||
</if>
|
</if>
|
||||||
<!-- 默认排序:只有在没有指定排序场景时才使用 -->
|
|
||||||
<if test="param.sortScene == null or param.sortScene == '' or param.sortScene == '综合排序'">
|
|
||||||
a.sort_number asc, a.create_time desc
|
|
||||||
</if>
|
|
||||||
<if test="param.sortScene == '最新发布'">
|
|
||||||
<!-- 最新发布已经在上面处理了 -->
|
|
||||||
</if>
|
|
||||||
<if test="param.sortScene != null and param.sortScene != '' and param.sortScene != '综合排序' and param.sortScene != '最新发布' and param.sortScene != '价格(低-高)' and param.sortScene != '价格(高-低)' and param.sortScene != '面积(小-大)' and param.sortScene != '面积(大-小)'">
|
|
||||||
a.create_time desc
|
|
||||||
</if>
|
|
||||||
<!-- 默认排序:推荐优先,然后按创建时间倒序 -->
|
|
||||||
a.recommend desc, a.create_time desc
|
|
||||||
</trim>
|
</trim>
|
||||||
|
|
||||||
</sql>
|
</sql>
|
||||||
|
|||||||
@@ -1,129 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.controller;
|
|
||||||
|
|
||||||
import com.gxwebsoft.common.core.web.BaseController;
|
|
||||||
import com.gxwebsoft.shop.service.ShopCouponService;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopCoupon;
|
|
||||||
import com.gxwebsoft.shop.param.ShopCouponParam;
|
|
||||||
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-coupon")
|
|
||||||
public class ShopCouponController extends BaseController {
|
|
||||||
@Resource
|
|
||||||
private ShopCouponService shopCouponService;
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:list')")
|
|
||||||
@Operation(summary = "分页查询优惠券")
|
|
||||||
@GetMapping("/page")
|
|
||||||
public ApiResult<PageResult<ShopCoupon>> page(ShopCouponParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(shopCouponService.pageRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:list')")
|
|
||||||
@Operation(summary = "查询全部优惠券")
|
|
||||||
@GetMapping()
|
|
||||||
public ApiResult<List<ShopCoupon>> list(ShopCouponParam param) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(shopCouponService.listRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:list')")
|
|
||||||
@Operation(summary = "根据id查询优惠券")
|
|
||||||
@GetMapping("/{id}")
|
|
||||||
public ApiResult<ShopCoupon> get(@PathVariable("id") Integer id) {
|
|
||||||
// 使用关联查询
|
|
||||||
return success(shopCouponService.getByIdRel(id));
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "添加优惠券")
|
|
||||||
@PostMapping()
|
|
||||||
public ApiResult<?> save(@RequestBody ShopCoupon shopCoupon) {
|
|
||||||
// 记录当前登录用户id
|
|
||||||
User loginUser = getLoginUser();
|
|
||||||
if (loginUser != null) {
|
|
||||||
shopCoupon.setUserId(loginUser.getUserId());
|
|
||||||
}
|
|
||||||
if (shopCouponService.save(shopCoupon)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "修改优惠券")
|
|
||||||
@PutMapping()
|
|
||||||
public ApiResult<?> update(@RequestBody ShopCoupon shopCoupon) {
|
|
||||||
if (shopCouponService.updateById(shopCoupon)) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "删除优惠券")
|
|
||||||
@DeleteMapping("/{id}")
|
|
||||||
public ApiResult<?> remove(@PathVariable("id") Integer id) {
|
|
||||||
if (shopCouponService.removeById(id)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:save')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量添加优惠券")
|
|
||||||
@PostMapping("/batch")
|
|
||||||
public ApiResult<?> saveBatch(@RequestBody List<ShopCoupon> list) {
|
|
||||||
if (shopCouponService.saveBatch(list)) {
|
|
||||||
return success("添加成功");
|
|
||||||
}
|
|
||||||
return fail("添加失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:update')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量修改优惠券")
|
|
||||||
@PutMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody BatchParam<ShopCoupon> batchParam) {
|
|
||||||
if (batchParam.update(shopCouponService, "id")) {
|
|
||||||
return success("修改成功");
|
|
||||||
}
|
|
||||||
return fail("修改失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
@PreAuthorize("hasAuthority('shop:shopCoupon:remove')")
|
|
||||||
@OperationLog
|
|
||||||
@Operation(summary = "批量删除优惠券")
|
|
||||||
@DeleteMapping("/batch")
|
|
||||||
public ApiResult<?> removeBatch(@RequestBody List<Integer> ids) {
|
|
||||||
if (shopCouponService.removeByIds(ids)) {
|
|
||||||
return success("删除成功");
|
|
||||||
}
|
|
||||||
return fail("删除失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,103 +0,0 @@
|
|||||||
package com.gxwebsoft.shop.entity;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
|
||||||
import java.time.LocalDate;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
|
||||||
import java.time.LocalDateTime;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableLogic;
|
|
||||||
import java.io.Serializable;
|
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.EqualsAndHashCode;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠券
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-09 15:48:00
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@Schema(name = "ShopCoupon对象", description = "优惠券")
|
|
||||||
public class ShopCoupon 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 String description;
|
|
||||||
|
|
||||||
@Schema(description = "优惠券类型(10满减券 20折扣券 30免费劵)")
|
|
||||||
private Integer type;
|
|
||||||
|
|
||||||
@Schema(description = "满减券-减免金额")
|
|
||||||
private BigDecimal reducePrice;
|
|
||||||
|
|
||||||
@Schema(description = "折扣券-折扣率(0-100)")
|
|
||||||
private Integer discount;
|
|
||||||
|
|
||||||
@Schema(description = "最低消费金额")
|
|
||||||
private BigDecimal minPrice;
|
|
||||||
|
|
||||||
@Schema(description = "到期类型(10领取后生效 20固定时间)")
|
|
||||||
private Integer expireType;
|
|
||||||
|
|
||||||
@Schema(description = "领取后生效-有效天数")
|
|
||||||
private Integer expireDay;
|
|
||||||
|
|
||||||
@Schema(description = "有效期开始时间")
|
|
||||||
private LocalDate startTime;
|
|
||||||
|
|
||||||
@Schema(description = "有效期结束时间")
|
|
||||||
private LocalDate endTime;
|
|
||||||
|
|
||||||
@Schema(description = "适用范围(10全部商品 20指定商品 30指定分类)")
|
|
||||||
private Integer applyRange;
|
|
||||||
|
|
||||||
@Schema(description = "适用范围配置(json格式)")
|
|
||||||
private String applyRangeConfig;
|
|
||||||
|
|
||||||
@Schema(description = "是否过期(0未过期 1已过期)")
|
|
||||||
private Integer isExpire;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1禁用")
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@TableLogic
|
|
||||||
private Integer deleted;
|
|
||||||
|
|
||||||
@Schema(description = "创建用户ID")
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
@Schema(description = "租户id")
|
|
||||||
private Integer tenantId;
|
|
||||||
|
|
||||||
@Schema(description = "创建时间")
|
|
||||||
private LocalDateTime createTime;
|
|
||||||
|
|
||||||
@Schema(description = "修改时间")
|
|
||||||
private LocalDateTime updateTime;
|
|
||||||
|
|
||||||
@Schema(description = "发放总数量(-1表示无限制)")
|
|
||||||
private Integer totalCount;
|
|
||||||
|
|
||||||
@Schema(description = "已发放数量")
|
|
||||||
private Integer issuedCount;
|
|
||||||
|
|
||||||
@Schema(description = "每人限领数量(-1表示无限制)")
|
|
||||||
private Integer limitPerUser;
|
|
||||||
|
|
||||||
@Schema(description = "是否启用(0禁用 1启用)")
|
|
||||||
private Boolean enabled;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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.ShopCoupon;
|
|
||||||
import com.gxwebsoft.shop.param.ShopCouponParam;
|
|
||||||
import org.apache.ibatis.annotations.Param;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠券Mapper
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-09 15:48:00
|
|
||||||
*/
|
|
||||||
public interface ShopCouponMapper extends BaseMapper<ShopCoupon> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页查询
|
|
||||||
*
|
|
||||||
* @param page 分页对象
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<ShopCoupon>
|
|
||||||
*/
|
|
||||||
List<ShopCoupon> selectPageRel(@Param("page") IPage<ShopCoupon> page,
|
|
||||||
@Param("param") ShopCouponParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<User>
|
|
||||||
*/
|
|
||||||
List<ShopCoupon> selectListRel(@Param("param") ShopCouponParam param);
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,102 +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.ShopCouponMapper">
|
|
||||||
|
|
||||||
<!-- 关联查询sql -->
|
|
||||||
<sql id="selectSql">
|
|
||||||
SELECT a.*
|
|
||||||
FROM shop_coupon 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.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.expireType != null">
|
|
||||||
AND a.expire_type = #{param.expireType}
|
|
||||||
</if>
|
|
||||||
<if test="param.expireDay != null">
|
|
||||||
AND a.expire_day = #{param.expireDay}
|
|
||||||
</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.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.isExpire != null">
|
|
||||||
AND a.is_expire = #{param.isExpire}
|
|
||||||
</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.totalCount != null">
|
|
||||||
AND a.total_count = #{param.totalCount}
|
|
||||||
</if>
|
|
||||||
<if test="param.issuedCount != null">
|
|
||||||
AND a.issued_count = #{param.issuedCount}
|
|
||||||
</if>
|
|
||||||
<if test="param.limitPerUser != null">
|
|
||||||
AND a.limit_per_user = #{param.limitPerUser}
|
|
||||||
</if>
|
|
||||||
<if test="param.enabled != null">
|
|
||||||
AND a.enabled = #{param.enabled}
|
|
||||||
</if>
|
|
||||||
<if test="param.keywords != null">
|
|
||||||
AND (a.comments LIKE CONCAT('%', #{param.keywords}, '%')
|
|
||||||
)
|
|
||||||
</if>
|
|
||||||
</where>
|
|
||||||
</sql>
|
|
||||||
|
|
||||||
<!-- 分页查询 -->
|
|
||||||
<select id="selectPageRel" resultType="com.gxwebsoft.shop.entity.ShopCoupon">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
<!-- 查询全部 -->
|
|
||||||
<select id="selectListRel" resultType="com.gxwebsoft.shop.entity.ShopCoupon">
|
|
||||||
<include refid="selectSql"></include>
|
|
||||||
</select>
|
|
||||||
|
|
||||||
</mapper>
|
|
||||||
@@ -1,108 +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:00
|
|
||||||
*/
|
|
||||||
@Data
|
|
||||||
@EqualsAndHashCode(callSuper = false)
|
|
||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
|
||||||
@Schema(name = "ShopCouponParam对象", description = "优惠券查询参数")
|
|
||||||
public class ShopCouponParam 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 = "优惠券描述")
|
|
||||||
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固定时间)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer expireType;
|
|
||||||
|
|
||||||
@Schema(description = "领取后生效-有效天数")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer expireDay;
|
|
||||||
|
|
||||||
@Schema(description = "有效期开始时间")
|
|
||||||
private String startTime;
|
|
||||||
|
|
||||||
@Schema(description = "有效期结束时间")
|
|
||||||
private String endTime;
|
|
||||||
|
|
||||||
@Schema(description = "适用范围(10全部商品 20指定商品 30指定分类)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer applyRange;
|
|
||||||
|
|
||||||
@Schema(description = "适用范围配置(json格式)")
|
|
||||||
private String applyRangeConfig;
|
|
||||||
|
|
||||||
@Schema(description = "是否过期(0未过期 1已过期)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer isExpire;
|
|
||||||
|
|
||||||
@Schema(description = "排序(数字越小越靠前)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer sortNumber;
|
|
||||||
|
|
||||||
@Schema(description = "状态, 0正常, 1禁用")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer status;
|
|
||||||
|
|
||||||
@Schema(description = "是否删除, 0否, 1是")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer deleted;
|
|
||||||
|
|
||||||
@Schema(description = "创建用户ID")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer userId;
|
|
||||||
|
|
||||||
@Schema(description = "发放总数量(-1表示无限制)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer totalCount;
|
|
||||||
|
|
||||||
@Schema(description = "已发放数量")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer issuedCount;
|
|
||||||
|
|
||||||
@Schema(description = "每人限领数量(-1表示无限制)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Integer limitPerUser;
|
|
||||||
|
|
||||||
@Schema(description = "是否启用(0禁用 1启用)")
|
|
||||||
@QueryField(type = QueryType.EQ)
|
|
||||||
private Boolean enabled;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -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.ShopCoupon;
|
|
||||||
import com.gxwebsoft.shop.param.ShopCouponParam;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 优惠券Service
|
|
||||||
*
|
|
||||||
* @author 科技小王子
|
|
||||||
* @since 2025-08-09 15:48:00
|
|
||||||
*/
|
|
||||||
public interface ShopCouponService extends IService<ShopCoupon> {
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 分页关联查询
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return PageResult<ShopCoupon>
|
|
||||||
*/
|
|
||||||
PageResult<ShopCoupon> pageRel(ShopCouponParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 关联查询全部
|
|
||||||
*
|
|
||||||
* @param param 查询参数
|
|
||||||
* @return List<ShopCoupon>
|
|
||||||
*/
|
|
||||||
List<ShopCoupon> listRel(ShopCouponParam param);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 根据id查询
|
|
||||||
*
|
|
||||||
* @param id id
|
|
||||||
* @return ShopCoupon
|
|
||||||
*/
|
|
||||||
ShopCoupon 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.ShopCouponMapper;
|
|
||||||
import com.gxwebsoft.shop.service.ShopCouponService;
|
|
||||||
import com.gxwebsoft.shop.entity.ShopCoupon;
|
|
||||||
import com.gxwebsoft.shop.param.ShopCouponParam;
|
|
||||||
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:00
|
|
||||||
*/
|
|
||||||
@Service
|
|
||||||
public class ShopCouponServiceImpl extends ServiceImpl<ShopCouponMapper, ShopCoupon> implements ShopCouponService {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public PageResult<ShopCoupon> pageRel(ShopCouponParam param) {
|
|
||||||
PageParam<ShopCoupon, ShopCouponParam> page = new PageParam<>(param);
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
List<ShopCoupon> list = baseMapper.selectPageRel(page, param);
|
|
||||||
return new PageResult<>(list, page.getTotal());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public List<ShopCoupon> listRel(ShopCouponParam param) {
|
|
||||||
List<ShopCoupon> list = baseMapper.selectListRel(param);
|
|
||||||
// 排序
|
|
||||||
PageParam<ShopCoupon, ShopCouponParam> page = new PageParam<>();
|
|
||||||
page.setDefaultOrder("sort_number asc, create_time desc");
|
|
||||||
return page.sortRecords(list);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public ShopCoupon getByIdRel(Integer id) {
|
|
||||||
ShopCouponParam param = new ShopCouponParam();
|
|
||||||
param.setId(id);
|
|
||||||
return param.getOne(baseMapper.selectListRel(param));
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user