1.0.44 初始化回款阶段信息、合同回款阶段
parent
de99872347
commit
ca92e2e6ac
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.base.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.oa.base.domain.vo.BasePaymentStageVo;
|
||||
import org.dromara.oa.base.domain.bo.BasePaymentStageBo;
|
||||
import org.dromara.oa.base.service.IBasePaymentStageService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 回款阶段
|
||||
* 前端访问路由地址为:/oa/base/paymentStage
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-11
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/base/paymentStage")
|
||||
public class BasePaymentStageController extends BaseController {
|
||||
|
||||
private final IBasePaymentStageService basePaymentStageService;
|
||||
|
||||
/**
|
||||
* 查询回款阶段列表
|
||||
*/
|
||||
@SaCheckPermission("oa/base:paymentStage:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BasePaymentStageVo> list(BasePaymentStageBo bo, PageQuery pageQuery) {
|
||||
return basePaymentStageService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出回款阶段列表
|
||||
*/
|
||||
@SaCheckPermission("oa/base:paymentStage:export")
|
||||
@Log(title = "回款阶段", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BasePaymentStageBo bo, HttpServletResponse response) {
|
||||
List<BasePaymentStageVo> list = basePaymentStageService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "回款阶段", BasePaymentStageVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取回款阶段详细信息
|
||||
*
|
||||
* @param paymentStageId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/base:paymentStage:query")
|
||||
@GetMapping("/{paymentStageId}")
|
||||
public R<BasePaymentStageVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("paymentStageId") Long paymentStageId) {
|
||||
return R.ok(basePaymentStageService.queryById(paymentStageId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增回款阶段
|
||||
*/
|
||||
@SaCheckPermission("oa/base:paymentStage:add")
|
||||
@Log(title = "回款阶段", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BasePaymentStageBo bo) {
|
||||
return toAjax(basePaymentStageService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改回款阶段
|
||||
*/
|
||||
@SaCheckPermission("oa/base:paymentStage:edit")
|
||||
@Log(title = "回款阶段", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BasePaymentStageBo bo) {
|
||||
return toAjax(basePaymentStageService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除回款阶段
|
||||
*
|
||||
* @param paymentStageIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/base:paymentStage:remove")
|
||||
@Log(title = "回款阶段", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{paymentStageIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("paymentStageIds") Long[] paymentStageIds) {
|
||||
return toAjax(basePaymentStageService.deleteWithValidByIds(List.of(paymentStageIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询回款阶段列表
|
||||
*/
|
||||
@GetMapping("/getBasePaymentStageList")
|
||||
public R<List<BasePaymentStageVo>> getBasePaymentStageList(BasePaymentStageBo bo) {
|
||||
List<BasePaymentStageVo> list = basePaymentStageService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package org.dromara.oa.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.oa.base.domain.BasePaymentStage;
|
||||
import org.dromara.oa.base.domain.vo.BasePaymentStageVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 回款阶段Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-11
|
||||
*/
|
||||
public interface BasePaymentStageMapper extends BaseMapperPlus<BasePaymentStage, BasePaymentStageVo> {
|
||||
|
||||
/**
|
||||
* 查询回款阶段列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 条件
|
||||
* @return 回款阶段集合
|
||||
*/
|
||||
public Page<BasePaymentStageVo> selectCustomBasePaymentStageVoList(@Param("page") Page<BasePaymentStageVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<BasePaymentStage> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询回款阶段列表
|
||||
*
|
||||
* @param queryWrapper 条件
|
||||
* @return 回款阶段集合
|
||||
*/
|
||||
public List<BasePaymentStageVo> selectCustomBasePaymentStageVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<BasePaymentStage> queryWrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.oa.base.service;
|
||||
|
||||
import org.dromara.oa.base.domain.BasePaymentStage;
|
||||
import org.dromara.oa.base.domain.vo.BasePaymentStageVo;
|
||||
import org.dromara.oa.base.domain.bo.BasePaymentStageBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 回款阶段Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-11
|
||||
*/
|
||||
public interface IBasePaymentStageService {
|
||||
|
||||
/**
|
||||
* 查询回款阶段
|
||||
*
|
||||
* @param paymentStageId 主键
|
||||
* @return 回款阶段
|
||||
*/
|
||||
BasePaymentStageVo queryById(Long paymentStageId);
|
||||
|
||||
/**
|
||||
* 分页查询回款阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 回款阶段分页列表
|
||||
*/
|
||||
TableDataInfo<BasePaymentStageVo> queryPageList(BasePaymentStageBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的回款阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 回款阶段列表
|
||||
*/
|
||||
List<BasePaymentStageVo> queryList(BasePaymentStageBo bo);
|
||||
|
||||
/**
|
||||
* 新增回款阶段
|
||||
*
|
||||
* @param bo 回款阶段
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BasePaymentStageBo bo);
|
||||
|
||||
/**
|
||||
* 修改回款阶段
|
||||
*
|
||||
* @param bo 回款阶段
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BasePaymentStageBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除回款阶段信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,135 @@
|
||||
package org.dromara.oa.base.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.oa.base.domain.bo.BasePaymentStageBo;
|
||||
import org.dromara.oa.base.domain.vo.BasePaymentStageVo;
|
||||
import org.dromara.oa.base.domain.BasePaymentStage;
|
||||
import org.dromara.oa.base.mapper.BasePaymentStageMapper;
|
||||
import org.dromara.oa.base.service.IBasePaymentStageService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 回款阶段Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-11
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BasePaymentStageServiceImpl implements IBasePaymentStageService {
|
||||
|
||||
private final BasePaymentStageMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询回款阶段
|
||||
*
|
||||
* @param paymentStageId 主键
|
||||
* @return 回款阶段
|
||||
*/
|
||||
@Override
|
||||
public BasePaymentStageVo queryById(Long paymentStageId) {
|
||||
return baseMapper.selectVoById(paymentStageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询回款阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 回款阶段分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BasePaymentStageVo> queryPageList(BasePaymentStageBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<BasePaymentStage> lqw = buildQueryWrapper(bo);
|
||||
Page<BasePaymentStageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的回款阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 回款阶段列表
|
||||
*/
|
||||
@Override
|
||||
public List<BasePaymentStageVo> queryList(BasePaymentStageBo bo) {
|
||||
MPJLambdaWrapper<BasePaymentStage> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BasePaymentStage> buildQueryWrapper(BasePaymentStageBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BasePaymentStage> lqw = JoinWrappers.lambda(BasePaymentStage.class)
|
||||
.selectAll(BasePaymentStage.class)
|
||||
.eq(BasePaymentStage::getDelFlag, "0")
|
||||
.eq(StringUtils.isNotBlank(bo.getStageCode()), BasePaymentStage::getStageCode, bo.getStageCode())
|
||||
.like(StringUtils.isNotBlank(bo.getStageName()), BasePaymentStage::getStageName, bo.getStageName())
|
||||
.eq(StringUtils.isNotBlank(bo.getCollectionStage()), BasePaymentStage::getCollectionStage, bo.getCollectionStage())
|
||||
.eq(bo.getSortOrder() != null, BasePaymentStage::getSortOrder, bo.getSortOrder());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增回款阶段
|
||||
*
|
||||
* @param bo 回款阶段
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BasePaymentStageBo bo) {
|
||||
BasePaymentStage add = MapstructUtils.convert(bo, BasePaymentStage.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPaymentStageId(add.getPaymentStageId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改回款阶段
|
||||
*
|
||||
* @param bo 回款阶段
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BasePaymentStageBo bo) {
|
||||
BasePaymentStage update = MapstructUtils.convert(bo, BasePaymentStage.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BasePaymentStage entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除回款阶段信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.erp.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.oa.erp.domain.vo.ErpContractPaymentStageVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpContractPaymentStageBo;
|
||||
import org.dromara.oa.erp.service.IErpContractPaymentStageService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 合同回款阶段
|
||||
* 前端访问路由地址为:/oa/erp/contractPaymentStage
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-11
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/erp/contractPaymentStage")
|
||||
public class ErpContractPaymentStageController extends BaseController {
|
||||
|
||||
private final IErpContractPaymentStageService erpContractPaymentStageService;
|
||||
|
||||
/**
|
||||
* 查询合同回款阶段列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:contractPaymentStage:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<ErpContractPaymentStageVo> list(ErpContractPaymentStageBo bo, PageQuery pageQuery) {
|
||||
return erpContractPaymentStageService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出合同回款阶段列表
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:contractPaymentStage:export")
|
||||
@Log(title = "合同回款阶段", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(ErpContractPaymentStageBo bo, HttpServletResponse response) {
|
||||
List<ErpContractPaymentStageVo> list = erpContractPaymentStageService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "合同回款阶段", ErpContractPaymentStageVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取合同回款阶段详细信息
|
||||
*
|
||||
* @param contractStageId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:contractPaymentStage:query")
|
||||
@GetMapping("/{contractStageId}")
|
||||
public R<ErpContractPaymentStageVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("contractStageId") Long contractStageId) {
|
||||
return R.ok(erpContractPaymentStageService.queryById(contractStageId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同回款阶段
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:contractPaymentStage:add")
|
||||
@Log(title = "合同回款阶段", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpContractPaymentStageBo bo) {
|
||||
return toAjax(erpContractPaymentStageService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同回款阶段
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:contractPaymentStage:edit")
|
||||
@Log(title = "合同回款阶段", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpContractPaymentStageBo bo) {
|
||||
return toAjax(erpContractPaymentStageService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除合同回款阶段
|
||||
*
|
||||
* @param contractStageIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/erp:contractPaymentStage:remove")
|
||||
@Log(title = "合同回款阶段", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{contractStageIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("contractStageIds") Long[] contractStageIds) {
|
||||
return toAjax(erpContractPaymentStageService.deleteWithValidByIds(List.of(contractStageIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询合同回款阶段列表
|
||||
*/
|
||||
@GetMapping("/getErpContractPaymentStageList")
|
||||
public R<List<ErpContractPaymentStageVo>> getErpContractPaymentStageList(ErpContractPaymentStageBo bo) {
|
||||
List<ErpContractPaymentStageVo> list = erpContractPaymentStageService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package org.dromara.oa.erp.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.oa.erp.domain.ErpContractPaymentStage;
|
||||
import org.dromara.oa.erp.domain.vo.ErpContractPaymentStageVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 合同回款阶段Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-11
|
||||
*/
|
||||
public interface ErpContractPaymentStageMapper extends BaseMapperPlus<ErpContractPaymentStage, ErpContractPaymentStageVo> {
|
||||
|
||||
/**
|
||||
* 查询合同回款阶段列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 条件
|
||||
* @return 合同回款阶段集合
|
||||
*/
|
||||
public Page<ErpContractPaymentStageVo> selectCustomErpContractPaymentStageVoList(@Param("page") Page<ErpContractPaymentStageVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<ErpContractPaymentStage> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询合同回款阶段列表
|
||||
*
|
||||
* @param queryWrapper 条件
|
||||
* @return 合同回款阶段集合
|
||||
*/
|
||||
public List<ErpContractPaymentStageVo> selectCustomErpContractPaymentStageVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<ErpContractPaymentStage> queryWrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.oa.erp.service;
|
||||
|
||||
import org.dromara.oa.erp.domain.ErpContractPaymentStage;
|
||||
import org.dromara.oa.erp.domain.vo.ErpContractPaymentStageVo;
|
||||
import org.dromara.oa.erp.domain.bo.ErpContractPaymentStageBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 合同回款阶段Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-11
|
||||
*/
|
||||
public interface IErpContractPaymentStageService {
|
||||
|
||||
/**
|
||||
* 查询合同回款阶段
|
||||
*
|
||||
* @param contractStageId 主键
|
||||
* @return 合同回款阶段
|
||||
*/
|
||||
ErpContractPaymentStageVo queryById(Long contractStageId);
|
||||
|
||||
/**
|
||||
* 分页查询合同回款阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 合同回款阶段分页列表
|
||||
*/
|
||||
TableDataInfo<ErpContractPaymentStageVo> queryPageList(ErpContractPaymentStageBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的合同回款阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 合同回款阶段列表
|
||||
*/
|
||||
List<ErpContractPaymentStageVo> queryList(ErpContractPaymentStageBo bo);
|
||||
|
||||
/**
|
||||
* 新增合同回款阶段
|
||||
*
|
||||
* @param bo 合同回款阶段
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(ErpContractPaymentStageBo bo);
|
||||
|
||||
/**
|
||||
* 修改合同回款阶段
|
||||
*
|
||||
* @param bo 合同回款阶段
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(ErpContractPaymentStageBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除合同回款阶段信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,137 @@
|
||||
package org.dromara.oa.erp.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.oa.erp.domain.bo.ErpContractPaymentStageBo;
|
||||
import org.dromara.oa.erp.domain.vo.ErpContractPaymentStageVo;
|
||||
import org.dromara.oa.erp.domain.ErpContractPaymentStage;
|
||||
import org.dromara.oa.erp.mapper.ErpContractPaymentStageMapper;
|
||||
import org.dromara.oa.erp.service.IErpContractPaymentStageService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 合同回款阶段Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-12-11
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class ErpContractPaymentStageServiceImpl implements IErpContractPaymentStageService {
|
||||
|
||||
private final ErpContractPaymentStageMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询合同回款阶段
|
||||
*
|
||||
* @param contractStageId 主键
|
||||
* @return 合同回款阶段
|
||||
*/
|
||||
@Override
|
||||
public ErpContractPaymentStageVo queryById(Long contractStageId) {
|
||||
return baseMapper.selectVoById(contractStageId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询合同回款阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 合同回款阶段分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<ErpContractPaymentStageVo> queryPageList(ErpContractPaymentStageBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<ErpContractPaymentStage> lqw = buildQueryWrapper(bo);
|
||||
Page<ErpContractPaymentStageVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的合同回款阶段列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 合同回款阶段列表
|
||||
*/
|
||||
@Override
|
||||
public List<ErpContractPaymentStageVo> queryList(ErpContractPaymentStageBo bo) {
|
||||
MPJLambdaWrapper<ErpContractPaymentStage> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<ErpContractPaymentStage> buildQueryWrapper(ErpContractPaymentStageBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<ErpContractPaymentStage> lqw = JoinWrappers.lambda(ErpContractPaymentStage.class)
|
||||
.selectAll(ErpContractPaymentStage.class)
|
||||
.eq(ErpContractPaymentStage::getDelFlag, "0")
|
||||
.eq(bo.getContractId() != null, ErpContractPaymentStage::getContractId, bo.getContractId())
|
||||
.eq(bo.getPaymentStageId() != null, ErpContractPaymentStage::getPaymentStageId, bo.getPaymentStageId())
|
||||
.like(StringUtils.isNotBlank(bo.getStageName()), ErpContractPaymentStage::getStageName, bo.getStageName())
|
||||
.eq(StringUtils.isNotBlank(bo.getCollectionStage()), ErpContractPaymentStage::getCollectionStage, bo.getCollectionStage())
|
||||
.eq(bo.getPurchasePrice() != null, ErpContractPaymentStage::getPurchasePrice, bo.getPurchasePrice())
|
||||
.eq(bo.getSortOrder() != null, ErpContractPaymentStage::getSortOrder, bo.getSortOrder());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增合同回款阶段
|
||||
*
|
||||
* @param bo 合同回款阶段
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(ErpContractPaymentStageBo bo) {
|
||||
ErpContractPaymentStage add = MapstructUtils.convert(bo, ErpContractPaymentStage.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setContractStageId(add.getContractStageId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改合同回款阶段
|
||||
*
|
||||
* @param bo 合同回款阶段
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(ErpContractPaymentStageBo bo) {
|
||||
ErpContractPaymentStage update = MapstructUtils.convert(bo, ErpContractPaymentStage.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(ErpContractPaymentStage entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除合同回款阶段信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if (isValid) {
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,27 @@
|
||||
<?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="org.dromara.oa.base.mapper.BasePaymentStageMapper">
|
||||
<resultMap type="org.dromara.oa.base.domain.vo.BasePaymentStageVo" id="BasePaymentStageResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomBasePaymentStageVoList" resultMap="BasePaymentStageResult">
|
||||
select payment_stage_id,
|
||||
tenant_id,
|
||||
stage_code,
|
||||
stage_name,
|
||||
collection_stage,
|
||||
sort_order,
|
||||
remark,
|
||||
del_flag,
|
||||
create_dept,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from base_payment_stage t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,29 @@
|
||||
<?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="org.dromara.oa.erp.mapper.ErpContractPaymentStageMapper">
|
||||
<resultMap type="org.dromara.oa.erp.domain.vo.ErpContractPaymentStageVo" id="ErpContractPaymentStageResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomErpContractPaymentStageVoList" resultMap="ErpContractPaymentStageResult">
|
||||
select contract_stage_id,
|
||||
tenant_id,
|
||||
contract_id,
|
||||
payment_stage_id,
|
||||
stage_name,
|
||||
collection_stage,
|
||||
purchase_price,
|
||||
sort_order,
|
||||
remark,
|
||||
del_flag,
|
||||
create_dept,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from erp_contract_payment_stage t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue