结算记录
This commit is contained in:
@ -0,0 +1,148 @@
|
||||
package com.greenorange.promotion.controller.fundsChange;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.greenorange.promotion.annotation.RequiresPermission;
|
||||
import com.greenorange.promotion.annotation.SysLog;
|
||||
import com.greenorange.promotion.common.BaseResponse;
|
||||
import com.greenorange.promotion.common.ErrorCode;
|
||||
import com.greenorange.promotion.common.ResultUtils;
|
||||
import com.greenorange.promotion.constant.UserConstant;
|
||||
import com.greenorange.promotion.exception.ThrowUtils;
|
||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
||||
import com.greenorange.promotion.model.dto.fundsChange.FundsChangeAddRequest;
|
||||
import com.greenorange.promotion.model.dto.fundsChange.FundsChangeQueryRequest;
|
||||
import com.greenorange.promotion.model.dto.fundsChange.FundsChangeUpdateRequest;
|
||||
import com.greenorange.promotion.model.entity.FundsChange;
|
||||
import com.greenorange.promotion.model.vo.fundsChange.FundsChangeVO;
|
||||
import com.greenorange.promotion.service.common.CommonService;
|
||||
import com.greenorange.promotion.service.settle.FundsChangeService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 资金变动记录 控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("fundsChange")
|
||||
@Slf4j
|
||||
@Tag(name = "资金变动记录管理")
|
||||
public class FundsChangeController {
|
||||
|
||||
@Resource
|
||||
private FundsChangeService fundsChangeService;
|
||||
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
/**
|
||||
* web端管理员添加资金变动记录
|
||||
* @param fundsChangeAddRequest 资金变动记录添加请求体
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
@PostMapping("add")
|
||||
@Operation(summary = "web端管理员添加资金变动记录", description = "参数:资金变动记录添加请求体,权限:管理员,方法名:addFundsChange")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "资金变动记录管理", content = "web端管理员添加资金变动记录")
|
||||
public BaseResponse<Boolean> addFundsChange(@Valid @RequestBody FundsChangeAddRequest fundsChangeAddRequest) {
|
||||
FundsChange fundsChange = commonService.copyProperties(fundsChangeAddRequest, FundsChange.class);
|
||||
fundsChangeService.save(fundsChange);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id修改资金变动记录信息
|
||||
* @param fundsChangeUpdateRequest 资金变动记录更新请求体
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@PostMapping("update")
|
||||
@Operation(summary = "web端管理员更新资金变动记录", description = "参数:资金变动记录更新请求体,权限:管理员,方法名:updateFundsChange")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "资金变动记录管理", content = "web端管理员根据id修改资金变动记录信息")
|
||||
public BaseResponse<Boolean> updateFundsChange(@Valid @RequestBody FundsChangeUpdateRequest fundsChangeUpdateRequest) {
|
||||
FundsChange fundsChange = commonService.copyProperties(fundsChangeUpdateRequest, FundsChange.class);
|
||||
fundsChangeService.updateById(fundsChange);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id删除资金变动记录
|
||||
* @param commonRequest 资金变动记录删除请求体
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@PostMapping("delete")
|
||||
@Operation(summary = "web端管理员根据id删除资金变动记录", description = "参数:资金变动记录删除请求体,权限:管理员,方法名:delFundsChange")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "资金变动记录管理", content = "web端管理员根据id删除资金变动记录")
|
||||
public BaseResponse<Boolean> delFundsChange(@Valid @RequestBody CommonRequest commonRequest) {
|
||||
Long id = commonRequest.getId();
|
||||
fundsChangeService.removeById(id);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员批量删除资金变动记录
|
||||
* @param commonBatchRequest 资金变动记录批量删除请求体
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@PostMapping("delBatch")
|
||||
@Operation(summary = "web端管理员批量删除资金变动记录", description = "参数:资金变动记录批量删除请求体,权限:管理员,方法名:delBatchFundsChange")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "资金变动记录管理", content = "web端管理员批量删除资金变动记录")
|
||||
public BaseResponse<Boolean> delBatchFundsChange(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
||||
List<Long> ids = commonBatchRequest.getIds();
|
||||
fundsChangeService.removeByIds(ids);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id查询资金变动记录
|
||||
* @param commonRequest 资金变动记录查询请求体
|
||||
* @return 资金变动记录信息
|
||||
*/
|
||||
@PostMapping("queryById")
|
||||
@Operation(summary = "web端管理员根据id查询资金变动记录", description = "参数:资金变动记录查询请求体,权限:管理员,方法名:queryFundsChangeById")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "资金变动记录管理", content = "web端管理员根据id查询资金变动记录")
|
||||
public BaseResponse<FundsChangeVO> queryFundsChangeById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||
Long id = commonRequest.getId();
|
||||
FundsChange fundsChange = fundsChangeService.getById(id);
|
||||
ThrowUtils.throwIf(fundsChange == null, ErrorCode.OPERATION_ERROR, "当前资金变动记录不存在");
|
||||
FundsChangeVO fundsChangeVO = commonService.copyProperties(fundsChange, FundsChangeVO.class);
|
||||
return ResultUtils.success(fundsChangeVO);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Web端管理员分页查询资金变动记录
|
||||
// * @param fundsChangeQueryRequest 资金变动记录查询请求体
|
||||
// * @return 资金变动记录列表
|
||||
// */
|
||||
// @PostMapping("page")
|
||||
// @Operation(summary = "Web端管理员分页查询资金变动记录", description = "参数:资金变动记录查询请求体,权限:管理员,方法名:listFundsChangeByPage")
|
||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
// @SysLog(title = "资金变动记录管理", content = "Web端管理员分页查询资金变动记录")
|
||||
// public BaseResponse<Page<FundsChangeVO>> listFundsChangeByPage(@Valid @RequestBody FundsChangeQueryRequest fundsChangeQueryRequest) {
|
||||
// long current = fundsChangeQueryRequest.getCurrent();
|
||||
// long pageSize = fundsChangeQueryRequest.getPageSize();
|
||||
// QueryWrapper<FundsChange> queryWrapper = fundsChangeService.getQueryWrapper(fundsChangeQueryRequest);
|
||||
// Page<FundsChange> page = fundsChangeService.page(new Page<>(current, pageSize), queryWrapper);
|
||||
// List<FundsChange> fundsChangeList = page.getRecords();
|
||||
// List<FundsChangeVO> fundsChangeVOList = commonService.convertList(fundsChangeList, FundsChangeVO.class);
|
||||
// Page<FundsChangeVO> voPage = new Page<>(current, pageSize);
|
||||
// voPage.setRecords(fundsChangeVOList);
|
||||
// voPage.setPages(page.getPages());
|
||||
// voPage.setTotal(page.getTotal());
|
||||
// return ResultUtils.success(voPage);
|
||||
// }
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
package com.greenorange.promotion.controller.projectSettlement;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.greenorange.promotion.annotation.RequiresPermission;
|
||||
import com.greenorange.promotion.annotation.SysLog;
|
||||
import com.greenorange.promotion.common.BaseResponse;
|
||||
import com.greenorange.promotion.common.ErrorCode;
|
||||
import com.greenorange.promotion.common.ResultUtils;
|
||||
import com.greenorange.promotion.constant.UserConstant;
|
||||
import com.greenorange.promotion.exception.ThrowUtils;
|
||||
import com.greenorange.promotion.model.dto.CommonBatchRequest;
|
||||
import com.greenorange.promotion.model.dto.projectSettlement.ProjectSettlementAddRequest;
|
||||
import com.greenorange.promotion.model.dto.projectSettlement.ProjectSettlementQueryRequest;
|
||||
import com.greenorange.promotion.model.dto.projectSettlement.ProjectSettlementUpdateRequest;
|
||||
import com.greenorange.promotion.model.entity.ProjectSettlement;
|
||||
import com.greenorange.promotion.model.vo.projectSettlement.ProjectSettlementVO;
|
||||
import com.greenorange.promotion.service.common.CommonService;
|
||||
import com.greenorange.promotion.service.settle.ProjectSettlementService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.annotation.Resource;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.greenorange.promotion.model.dto.CommonRequest;
|
||||
import jakarta.validation.Valid;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 项目结算记录 控制器
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("projectSettlement")
|
||||
@Slf4j
|
||||
@Tag(name = "项目结算记录管理")
|
||||
public class ProjectSettlementController {
|
||||
|
||||
@Resource
|
||||
private ProjectSettlementService projectSettlementService;
|
||||
|
||||
@Resource
|
||||
private CommonService commonService;
|
||||
|
||||
/**
|
||||
* web端管理员添加项目结算记录
|
||||
* @param projectSettlementAddRequest 项目结算记录添加请求体
|
||||
* @return 是否添加成功
|
||||
*/
|
||||
@PostMapping("add")
|
||||
@Operation(summary = "web端管理员添加项目结算记录", description = "参数:项目结算记录添加请求体,权限:管理员,方法名:addProjectSettlement")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "项目结算记录管理", content = "web端管理员添加项目结算记录")
|
||||
public BaseResponse<Boolean> addProjectSettlement(@Valid @RequestBody ProjectSettlementAddRequest projectSettlementAddRequest) {
|
||||
ProjectSettlement projectSettlement = commonService.copyProperties(projectSettlementAddRequest, ProjectSettlement.class);
|
||||
projectSettlementService.save(projectSettlement);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id修改项目结算记录信息
|
||||
* @param projectSettlementUpdateRequest 项目结算记录更新请求体
|
||||
* @return 是否更新成功
|
||||
*/
|
||||
@PostMapping("update")
|
||||
@Operation(summary = "web端管理员更新项目结算记录", description = "参数:项目结算记录更新请求体,权限:管理员,方法名:updateProjectSettlement")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "项目结算记录管理", content = "web端管理员根据id修改项目结算记录信息")
|
||||
public BaseResponse<Boolean> updateProjectSettlement(@Valid @RequestBody ProjectSettlementUpdateRequest projectSettlementUpdateRequest) {
|
||||
ProjectSettlement projectSettlement = commonService.copyProperties(projectSettlementUpdateRequest, ProjectSettlement.class);
|
||||
projectSettlementService.updateById(projectSettlement);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id删除项目结算记录
|
||||
* @param commonRequest 项目结算记录删除请求体
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@PostMapping("delete")
|
||||
@Operation(summary = "web端管理员根据id删除项目结算记录", description = "参数:项目结算记录删除请求体,权限:管理员,方法名:delProjectSettlement")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "项目结算记录管理", content = "web端管理员根据id删除项目结算记录")
|
||||
public BaseResponse<Boolean> delProjectSettlement(@Valid @RequestBody CommonRequest commonRequest) {
|
||||
Long id = commonRequest.getId();
|
||||
projectSettlementService.removeById(id);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员批量删除项目结算记录
|
||||
* @param commonBatchRequest 项目结算记录批量删除请求体
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@PostMapping("delBatch")
|
||||
@Operation(summary = "web端管理员批量删除项目结算记录", description = "参数:项目结算记录批量删除请求体,权限:管理员,方法名:delBatchProjectSettlement")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "项目结算记录管理", content = "web端管理员批量删除项目结算记录")
|
||||
public BaseResponse<Boolean> delBatchProjectSettlement(@Valid @RequestBody CommonBatchRequest commonBatchRequest) {
|
||||
List<Long> ids = commonBatchRequest.getIds();
|
||||
projectSettlementService.removeByIds(ids);
|
||||
return ResultUtils.success(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* web端管理员根据id查询项目结算记录
|
||||
* @param commonRequest 项目结算记录查询请求体
|
||||
* @return 项目结算记录信息
|
||||
*/
|
||||
@PostMapping("queryById")
|
||||
@Operation(summary = "web端管理员根据id查询项目结算记录", description = "参数:项目结算记录查询请求体,权限:管理员,方法名:queryProjectSettlementById")
|
||||
@RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
@SysLog(title = "项目结算记录管理", content = "web端管理员根据id查询项目结算记录")
|
||||
public BaseResponse<ProjectSettlementVO> queryProjectSettlementById(@Valid @RequestBody CommonRequest commonRequest) {
|
||||
Long id = commonRequest.getId();
|
||||
ProjectSettlement projectSettlement = projectSettlementService.getById(id);
|
||||
ThrowUtils.throwIf(projectSettlement == null, ErrorCode.OPERATION_ERROR, "当前项目结算记录不存在");
|
||||
ProjectSettlementVO projectSettlementVO = commonService.copyProperties(projectSettlement, ProjectSettlementVO.class);
|
||||
return ResultUtils.success(projectSettlementVO);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * Web端管理员分页查询项目结算记录
|
||||
// * @param projectSettlementQueryRequest 项目结算记录查询请求体
|
||||
// * @return 项目结算记录列表
|
||||
// */
|
||||
// @PostMapping("page")
|
||||
// @Operation(summary = "Web端管理员分页查询项目结算记录", description = "参数:项目结算记录查询请求体,权限:管理员,方法名:listProjectSettlementByPage")
|
||||
// @RequiresPermission(mustRole = UserConstant.ADMIN_ROLE)
|
||||
// @SysLog(title = "项目结算记录管理", content = "Web端管理员分页查询项目结算记录")
|
||||
// public BaseResponse<Page<ProjectSettlementVO>> listProjectSettlementByPage(@Valid @RequestBody ProjectSettlementQueryRequest projectSettlementQueryRequest) {
|
||||
// long current = projectSettlementQueryRequest.getCurrent();
|
||||
// long pageSize = projectSettlementQueryRequest.getPageSize();
|
||||
// QueryWrapper<ProjectSettlement> queryWrapper = projectSettlementService.getQueryWrapper(projectSettlementQueryRequest);
|
||||
// Page<ProjectSettlement> page = projectSettlementService.page(new Page<>(current, pageSize), queryWrapper);
|
||||
// List<ProjectSettlement> projectSettlementList = page.getRecords();
|
||||
// List<ProjectSettlementVO> projectSettlementVOList = commonService.convertList(projectSettlementList, ProjectSettlementVO.class);
|
||||
// Page<ProjectSettlementVO> voPage = new Page<>(current, pageSize);
|
||||
// voPage.setRecords(projectSettlementVOList);
|
||||
// voPage.setPages(page.getPages());
|
||||
// voPage.setTotal(page.getTotal());
|
||||
// return ResultUtils.success(voPage);
|
||||
// }
|
||||
}
|
Reference in New Issue
Block a user