1.0.9 初始化合同、合同物料

dev
yinq 4 months ago
parent 1cc34f544c
commit daa46b0671

@ -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.ErpContractInfoVo;
import org.dromara.oa.erp.domain.bo.ErpContractInfoBo;
import org.dromara.oa.erp.service.IErpContractInfoService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/oa/erp/contractInfo
*
* @author Yinq
* @date 2025-10-11
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/erp/contractInfo")
public class ErpContractInfoController extends BaseController {
private final IErpContractInfoService erpContractInfoService;
/**
*
*/
@SaCheckPermission("oa/erp:contractInfo:list")
@GetMapping("/list")
public TableDataInfo<ErpContractInfoVo> list(ErpContractInfoBo bo, PageQuery pageQuery) {
return erpContractInfoService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("oa/erp:contractInfo:export")
@Log(title = "合同信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ErpContractInfoBo bo, HttpServletResponse response) {
List<ErpContractInfoVo> list = erpContractInfoService.queryList(bo);
ExcelUtil.exportExcel(list, "合同信息", ErpContractInfoVo.class, response);
}
/**
*
*
* @param contractId
*/
@SaCheckPermission("oa/erp:contractInfo:query")
@GetMapping("/{contractId}")
public R<ErpContractInfoVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("contractId") Long contractId) {
return R.ok(erpContractInfoService.queryById(contractId));
}
/**
*
*/
@SaCheckPermission("oa/erp:contractInfo:add")
@Log(title = "合同信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpContractInfoBo bo) {
return toAjax(erpContractInfoService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("oa/erp:contractInfo:edit")
@Log(title = "合同信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpContractInfoBo bo) {
return toAjax(erpContractInfoService.updateByBo(bo));
}
/**
*
*
* @param contractIds
*/
@SaCheckPermission("oa/erp:contractInfo:remove")
@Log(title = "合同信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{contractIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable("contractIds") Long[] contractIds) {
return toAjax(erpContractInfoService.deleteWithValidByIds(List.of(contractIds), true));
}
/**
*
*/
@GetMapping("/getErpContractInfoList")
public R<List<ErpContractInfoVo>> getErpContractInfoList(ErpContractInfoBo bo) {
List<ErpContractInfoVo> list = erpContractInfoService.queryList(bo);
return R.ok(list);
}
}

@ -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.ErpContractMaterielVo;
import org.dromara.oa.erp.domain.bo.ErpContractMaterielBo;
import org.dromara.oa.erp.service.IErpContractMaterielService;
import org.dromara.common.mybatis.core.page.TableDataInfo;
/**
*
* 访:/oa/erp/contractMateriel
*
* @author Yinq
* @date 2025-10-11
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/erp/contractMateriel")
public class ErpContractMaterielController extends BaseController {
private final IErpContractMaterielService erpContractMaterielService;
/**
*
*/
@SaCheckPermission("oa/erp:contractMateriel:list")
@GetMapping("/list")
public TableDataInfo<ErpContractMaterielVo> list(ErpContractMaterielBo bo, PageQuery pageQuery) {
return erpContractMaterielService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("oa/erp:contractMateriel:export")
@Log(title = "合同物料信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(ErpContractMaterielBo bo, HttpServletResponse response) {
List<ErpContractMaterielVo> list = erpContractMaterielService.queryList(bo);
ExcelUtil.exportExcel(list, "合同物料信息", ErpContractMaterielVo.class, response);
}
/**
*
*
* @param contractMaterielId
*/
@SaCheckPermission("oa/erp:contractMateriel:query")
@GetMapping("/{contractMaterielId}")
public R<ErpContractMaterielVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("contractMaterielId") Long contractMaterielId) {
return R.ok(erpContractMaterielService.queryById(contractMaterielId));
}
/**
*
*/
@SaCheckPermission("oa/erp:contractMateriel:add")
@Log(title = "合同物料信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody ErpContractMaterielBo bo) {
return toAjax(erpContractMaterielService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("oa/erp:contractMateriel:edit")
@Log(title = "合同物料信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ErpContractMaterielBo bo) {
return toAjax(erpContractMaterielService.updateByBo(bo));
}
/**
*
*
* @param contractMaterielIds
*/
@SaCheckPermission("oa/erp:contractMateriel:remove")
@Log(title = "合同物料信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{contractMaterielIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable("contractMaterielIds") Long[] contractMaterielIds) {
return toAjax(erpContractMaterielService.deleteWithValidByIds(List.of(contractMaterielIds), true));
}
/**
*
*/
@GetMapping("/getErpContractMaterielList")
public R<List<ErpContractMaterielVo>> getErpContractMaterielList(ErpContractMaterielBo bo) {
List<ErpContractMaterielVo> list = erpContractMaterielService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,160 @@
package org.dromara.oa.erp.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import java.io.Serial;
/**
* erp_contract_info
*
* @author Yinq
* @date 2025-10-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("erp_contract_info")
public class ErpContractInfo extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@TableId(value = "contract_id", type = IdType.AUTO)
private Long contractId;
/**
* 1 2
*/
private String contractFlag;
/**
*
*/
private String contractCode;
/**
*
*/
private String contractName;
/**
* (1 2
*/
private String contractCategory;
/**
* (1 2
*/
private String contractType;
/**
* 1 2 3 4 5 6 7
*/
private String businessDirection;
/**
*
*/
private Long contractDeptId;
/**
*
*/
private Date contractDate;
/**
*
*/
private BigDecimal totalPrice;
/**
*
*/
private Long aCustomerId;
/**
*
*/
private String aRepresent;
/**
*
*/
private Date aDate;
/**
*
*/
private Long bCustomerId;
/**
*
*/
private String bRepresent;
/**
*
*/
private Date bDate;
/**
* (1 2 3)
*/
private String contractStatus;
/**
*
*/
private String flowStatus;
/**
* ID
*/
private Long templateId;
/**
* ID
*/
private String ossId;
/**
*
*/
private String paymentMethod;
/**
*
*/
private Long signatureAppendix;
/**
* ()
*/
private BigDecimal taxRate;
/**
*
*/
private String remark;
/**
* 1 0
*/
private String activeFlag;
/**
* 0 1
*/
@TableLogic
private String delFlag;
}

@ -0,0 +1,103 @@
package org.dromara.oa.erp.domain;
import org.dromara.common.tenant.core.TenantEntity;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.io.Serial;
/**
* erp_contract_materiel
*
* @author Yinq
* @date 2025-10-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("erp_contract_materiel")
public class ErpContractMateriel extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@TableId(value = "contract_materiel_id", type = IdType.AUTO)
private Long contractMaterielId;
/**
* ID
*/
private Long contractId;
/**
*
*/
private String productName;
/**
*
*/
private String specificationDescription;
/**
* ID
*/
private Long materielId;
/**
* ID
*/
private Long relationMaterielId;
/**
*
*/
private Long amount;
/**
* ID
*/
private Long unitId;
/**
*
*/
private BigDecimal beforePrice;
/**
*
*/
private BigDecimal taxRate;
/**
*
*/
private BigDecimal includingPrice;
/**
*
*/
private BigDecimal subtotal;
/**
*
*/
private String remark;
/**
* 1 0
*/
private String activeFlag;
/**
* 0 1
*/
@TableLogic
private String delFlag;
}

@ -0,0 +1,153 @@
package org.dromara.oa.erp.domain.bo;
import org.dromara.oa.erp.domain.ErpContractInfo;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* erp_contract_info
*
* @author Yinq
* @date 2025-10-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ErpContractInfo.class, reverseConvertGenerate = false)
public class ErpContractInfoBo extends BaseEntity {
/**
* ID
*/
@NotNull(message = "合同ID不能为空", groups = { EditGroup.class })
private Long contractId;
/**
* 1 2
*/
private String contractFlag;
/**
*
*/
private String contractCode;
/**
*
*/
private String contractName;
/**
* (1 2
*/
private String contractCategory;
/**
* (1 2
*/
private String contractType;
/**
* 1 2 3 4 5 6 7
*/
private String businessDirection;
/**
*
*/
private Long contractDeptId;
/**
*
*/
private Date contractDate;
/**
*
*/
private BigDecimal totalPrice;
/**
*
*/
private Long aCustomerId;
/**
*
*/
private String aRepresent;
/**
*
*/
private Date aDate;
/**
*
*/
private Long bCustomerId;
/**
*
*/
private String bRepresent;
/**
*
*/
private Date bDate;
/**
* (1 2 3)
*/
private String contractStatus;
/**
*
*/
private String flowStatus;
/**
* ID
*/
private Long templateId;
/**
* ID
*/
private String ossId;
/**
*
*/
private String paymentMethod;
/**
*
*/
private Long signatureAppendix;
/**
* ()
*/
private BigDecimal taxRate;
/**
*
*/
private String remark;
/**
* 1 0
*/
private String activeFlag;
}

@ -0,0 +1,95 @@
package org.dromara.oa.erp.domain.bo;
import org.dromara.oa.erp.domain.ErpContractMateriel;
import org.dromara.common.mybatis.core.domain.BaseEntity;
import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import lombok.EqualsAndHashCode;
import jakarta.validation.constraints.*;
import java.math.BigDecimal;
/**
* erp_contract_materiel
*
* @author Yinq
* @date 2025-10-11
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = ErpContractMateriel.class, reverseConvertGenerate = false)
public class ErpContractMaterielBo extends BaseEntity {
/**
* ID
*/
private Long contractMaterielId;
/**
* ID
*/
private Long contractId;
/**
*
*/
private String productName;
/**
*
*/
private String specificationDescription;
/**
* ID
*/
private Long materielId;
/**
* ID
*/
private Long relationMaterielId;
/**
*
*/
private Long amount;
/**
* ID
*/
private Long unitId;
/**
*
*/
private BigDecimal beforePrice;
/**
*
*/
private BigDecimal taxRate;
/**
*
*/
private BigDecimal includingPrice;
/**
*
*/
private BigDecimal subtotal;
/**
*
*/
private String remark;
/**
* 1 0
*/
private String activeFlag;
}

@ -0,0 +1,215 @@
package org.dromara.oa.erp.domain.vo;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.oa.erp.domain.ErpContractInfo;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* erp_contract_info
*
* @author Yinq
* @date 2025-10-11
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ErpContractInfo.class)
public class ErpContractInfoVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ExcelProperty(value = "合同ID")
private Long contractId;
/**
* 1 2
*/
@ExcelProperty(value = "有无合同", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "contract_flag")
private String contractFlag;
/**
*
*/
@ExcelProperty(value = "合同编号")
private String contractCode;
/**
*
*/
@ExcelProperty(value = "合同名称")
private String contractName;
/**
* (1 2
*/
@ExcelProperty(value = "合同大类(1市场项目 2备件销售", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "contract_category")
private String contractCategory;
/**
* (1 2
*/
@ExcelProperty(value = "合同类型(1对内 2对外", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "contract_type")
private String contractType;
/**
* 1 2 3 4 5 6 7
*/
@ExcelProperty(value = "业务方向", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "business_direction")
private String businessDirection;
/**
*
*/
@ExcelProperty(value = "部门")
private Long contractDeptId;
/**
*
*/
@ExcelProperty(value = "合同时间")
private Date contractDate;
/**
*
*/
@ExcelProperty(value = "合同总价")
private BigDecimal totalPrice;
/**
*
*/
@ExcelProperty(value = "甲方公司")
private Long aCustomerId;
/**
*
*/
@ExcelProperty(value = "甲方授权代表")
private String aRepresent;
/**
*
*/
@ExcelProperty(value = "甲方签字日期")
private Date aDate;
/**
*
*/
@ExcelProperty(value = "乙方公司")
private Long bCustomerId;
/**
*
*/
@ExcelProperty(value = "乙方授权代表")
private String bRepresent;
/**
*
*/
@ExcelProperty(value = "乙方签字日期")
private Date bDate;
/**
* (1 2 3)
*/
@ExcelProperty(value = "合同状态(1暂存 2审批中 3可用)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "contract_status")
private String contractStatus;
/**
*
*/
@ExcelProperty(value = "流程状态")
private String flowStatus;
/**
* ID
*/
@ExcelProperty(value = "合同模板ID")
private Long templateId;
/**
* ID
*/
@ExcelProperty(value = "附件ID")
private String ossId;
/**
*
*/
@ExcelProperty(value = "付款方式")
private String paymentMethod;
/**
*
*/
@ExcelProperty(value = "签字合同附件")
private Long signatureAppendix;
/**
* ()
*/
@ExcelProperty(value = "合同税率(预留)")
private BigDecimal taxRate;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
/**
* 1 0
*/
@ExcelProperty(value = "激活标识", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "active_flag")
private String activeFlag;
/**
*
*/
@ExcelProperty(value = "创建人")
private Long createBy;
/**
*
*/
@ExcelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@ExcelProperty(value = "更新人")
private Long updateBy;
/**
*
*/
@ExcelProperty(value = "更新时间")
private Date updateTime;
}

@ -0,0 +1,118 @@
package org.dromara.oa.erp.domain.vo;
import java.math.BigDecimal;
import org.dromara.oa.erp.domain.ErpContractMateriel;
import cn.idev.excel.annotation.ExcelIgnoreUnannotated;
import cn.idev.excel.annotation.ExcelProperty;
import org.dromara.common.excel.annotation.ExcelDictFormat;
import org.dromara.common.excel.convert.ExcelDictConvert;
import io.github.linpeilie.annotations.AutoMapper;
import lombok.Data;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* erp_contract_materiel
*
* @author Yinq
* @date 2025-10-11
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = ErpContractMateriel.class)
public class ErpContractMaterielVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
* ID
*/
@ExcelProperty(value = "合同物料ID")
private Long contractMaterielId;
/**
* ID
*/
@ExcelProperty(value = "合同ID")
private Long contractId;
/**
*
*/
@ExcelProperty(value = "产品名称")
private String productName;
/**
*
*/
@ExcelProperty(value = "规格描述")
private String specificationDescription;
/**
* ID
*/
@ExcelProperty(value = "物料ID")
private Long materielId;
/**
* ID
*/
@ExcelProperty(value = "销售物料ID")
private Long relationMaterielId;
/**
*
*/
@ExcelProperty(value = "数量")
private Long amount;
/**
* ID
*/
@ExcelProperty(value = "单位ID")
private Long unitId;
/**
*
*/
@ExcelProperty(value = "未税单价")
private BigDecimal beforePrice;
/**
*
*/
@ExcelProperty(value = "税率")
private BigDecimal taxRate;
/**
*
*/
@ExcelProperty(value = "含税单价")
private BigDecimal includingPrice;
/**
*
*/
@ExcelProperty(value = "小计")
private BigDecimal subtotal;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
/**
* 1 0
*/
@ExcelProperty(value = "激活标识", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "active_flag")
private String activeFlag;
}

@ -0,0 +1,37 @@
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.ErpContractInfo;
import org.dromara.oa.erp.domain.vo.ErpContractInfoVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-10-11
*/
public interface ErpContractInfoMapper extends BaseMapperPlus<ErpContractInfo, ErpContractInfoVo> {
/**
*
*
* @param page
* @param queryWrapper
* @return
*/
public Page<ErpContractInfoVo> selectCustomErpContractInfoVoList(@Param("page") Page<ErpContractInfoVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<ErpContractInfo> queryWrapper);
/**
*
*
* @param queryWrapper
* @return
*/
public List<ErpContractInfoVo> selectCustomErpContractInfoVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<ErpContractInfo> queryWrapper);
}

@ -0,0 +1,37 @@
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.ErpContractMateriel;
import org.dromara.oa.erp.domain.vo.ErpContractMaterielVo;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
/**
* Mapper
*
* @author Yinq
* @date 2025-10-11
*/
public interface ErpContractMaterielMapper extends BaseMapperPlus<ErpContractMateriel, ErpContractMaterielVo> {
/**
*
*
* @param page
* @param queryWrapper
* @return
*/
public Page<ErpContractMaterielVo> selectCustomErpContractMaterielVoList(@Param("page") Page<ErpContractMaterielVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<ErpContractMateriel> queryWrapper);
/**
*
*
* @param queryWrapper
* @return
*/
public List<ErpContractMaterielVo> selectCustomErpContractMaterielVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<ErpContractMateriel> queryWrapper);
}

@ -0,0 +1,69 @@
package org.dromara.oa.erp.service;
import org.dromara.oa.erp.domain.ErpContractInfo;
import org.dromara.oa.erp.domain.vo.ErpContractInfoVo;
import org.dromara.oa.erp.domain.bo.ErpContractInfoBo;
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-10-11
*/
public interface IErpContractInfoService {
/**
*
*
* @param contractId
* @return
*/
ErpContractInfoVo queryById(Long contractId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ErpContractInfoVo> queryPageList(ErpContractInfoBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<ErpContractInfoVo> queryList(ErpContractInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(ErpContractInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(ErpContractInfoBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,69 @@
package org.dromara.oa.erp.service;
import org.dromara.oa.erp.domain.ErpContractMateriel;
import org.dromara.oa.erp.domain.vo.ErpContractMaterielVo;
import org.dromara.oa.erp.domain.bo.ErpContractMaterielBo;
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-10-11
*/
public interface IErpContractMaterielService {
/**
*
*
* @param contractMaterielId
* @return
*/
ErpContractMaterielVo queryById(Long contractMaterielId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<ErpContractMaterielVo> queryPageList(ErpContractMaterielBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<ErpContractMaterielVo> queryList(ErpContractMaterielBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(ErpContractMaterielBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(ErpContractMaterielBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,154 @@
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.ErpContractInfoBo;
import org.dromara.oa.erp.domain.vo.ErpContractInfoVo;
import org.dromara.oa.erp.domain.ErpContractInfo;
import org.dromara.oa.erp.mapper.ErpContractInfoMapper;
import org.dromara.oa.erp.service.IErpContractInfoService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-10-11
*/
@RequiredArgsConstructor
@Service
public class ErpContractInfoServiceImpl implements IErpContractInfoService {
private final ErpContractInfoMapper baseMapper;
/**
*
*
* @param contractId
* @return
*/
@Override
public ErpContractInfoVo queryById(Long contractId){
return baseMapper.selectVoById(contractId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<ErpContractInfoVo> queryPageList(ErpContractInfoBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ErpContractInfo> lqw = buildQueryWrapper(bo);
Page<ErpContractInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<ErpContractInfoVo> queryList(ErpContractInfoBo bo) {
MPJLambdaWrapper<ErpContractInfo> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<ErpContractInfo> buildQueryWrapper(ErpContractInfoBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ErpContractInfo> lqw = JoinWrappers.lambda(ErpContractInfo.class)
.selectAll(ErpContractInfo.class)
.eq(StringUtils.isNotBlank(bo.getContractFlag()), ErpContractInfo::getContractFlag, bo.getContractFlag())
.eq(StringUtils.isNotBlank(bo.getContractCode()), ErpContractInfo::getContractCode, bo.getContractCode())
.like(StringUtils.isNotBlank(bo.getContractName()), ErpContractInfo::getContractName, bo.getContractName())
.eq(StringUtils.isNotBlank(bo.getContractCategory()), ErpContractInfo::getContractCategory, bo.getContractCategory())
.eq(StringUtils.isNotBlank(bo.getContractType()), ErpContractInfo::getContractType, bo.getContractType())
.eq(StringUtils.isNotBlank(bo.getBusinessDirection()), ErpContractInfo::getBusinessDirection, bo.getBusinessDirection())
.eq(bo.getContractDeptId() != null, ErpContractInfo::getContractDeptId, bo.getContractDeptId())
.eq(bo.getContractDate() != null, ErpContractInfo::getContractDate, bo.getContractDate())
.eq(bo.getTotalPrice() != null, ErpContractInfo::getTotalPrice, bo.getTotalPrice())
.eq(bo.getACustomerId() != null, ErpContractInfo::getACustomerId, bo.getACustomerId())
.eq(StringUtils.isNotBlank(bo.getARepresent()), ErpContractInfo::getARepresent, bo.getARepresent())
.eq(bo.getADate() != null, ErpContractInfo::getADate, bo.getADate())
.eq(bo.getBCustomerId() != null, ErpContractInfo::getBCustomerId, bo.getBCustomerId())
.eq(StringUtils.isNotBlank(bo.getBRepresent()), ErpContractInfo::getBRepresent, bo.getBRepresent())
.eq(bo.getBDate() != null, ErpContractInfo::getBDate, bo.getBDate())
.eq(StringUtils.isNotBlank(bo.getContractStatus()), ErpContractInfo::getContractStatus, bo.getContractStatus())
.eq(StringUtils.isNotBlank(bo.getFlowStatus()), ErpContractInfo::getFlowStatus, bo.getFlowStatus())
.eq(bo.getTemplateId() != null, ErpContractInfo::getTemplateId, bo.getTemplateId())
.eq(StringUtils.isNotBlank(bo.getOssId()), ErpContractInfo::getOssId, bo.getOssId())
.eq(StringUtils.isNotBlank(bo.getPaymentMethod()), ErpContractInfo::getPaymentMethod, bo.getPaymentMethod())
.eq(bo.getSignatureAppendix() != null, ErpContractInfo::getSignatureAppendix, bo.getSignatureAppendix())
.eq(bo.getTaxRate() != null, ErpContractInfo::getTaxRate, bo.getTaxRate())
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ErpContractInfo::getActiveFlag, bo.getActiveFlag())
;
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(ErpContractInfoBo bo) {
ErpContractInfo add = MapstructUtils.convert(bo, ErpContractInfo.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setContractId(add.getContractId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(ErpContractInfoBo bo) {
ErpContractInfo update = MapstructUtils.convert(bo, ErpContractInfo.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ErpContractInfo 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,143 @@
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.ErpContractMaterielBo;
import org.dromara.oa.erp.domain.vo.ErpContractMaterielVo;
import org.dromara.oa.erp.domain.ErpContractMateriel;
import org.dromara.oa.erp.mapper.ErpContractMaterielMapper;
import org.dromara.oa.erp.service.IErpContractMaterielService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author Yinq
* @date 2025-10-11
*/
@RequiredArgsConstructor
@Service
public class ErpContractMaterielServiceImpl implements IErpContractMaterielService {
private final ErpContractMaterielMapper baseMapper;
/**
*
*
* @param contractMaterielId
* @return
*/
@Override
public ErpContractMaterielVo queryById(Long contractMaterielId){
return baseMapper.selectVoById(contractMaterielId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<ErpContractMaterielVo> queryPageList(ErpContractMaterielBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<ErpContractMateriel> lqw = buildQueryWrapper(bo);
Page<ErpContractMaterielVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<ErpContractMaterielVo> queryList(ErpContractMaterielBo bo) {
MPJLambdaWrapper<ErpContractMateriel> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<ErpContractMateriel> buildQueryWrapper(ErpContractMaterielBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<ErpContractMateriel> lqw = JoinWrappers.lambda(ErpContractMateriel.class)
.selectAll(ErpContractMateriel.class)
.eq(bo.getContractId() != null, ErpContractMateriel::getContractId, bo.getContractId())
.like(StringUtils.isNotBlank(bo.getProductName()), ErpContractMateriel::getProductName, bo.getProductName())
.eq(StringUtils.isNotBlank(bo.getSpecificationDescription()), ErpContractMateriel::getSpecificationDescription, bo.getSpecificationDescription())
.eq(bo.getMaterielId() != null, ErpContractMateriel::getMaterielId, bo.getMaterielId())
.eq(bo.getRelationMaterielId() != null, ErpContractMateriel::getRelationMaterielId, bo.getRelationMaterielId())
.eq(bo.getAmount() != null, ErpContractMateriel::getAmount, bo.getAmount())
.eq(bo.getUnitId() != null, ErpContractMateriel::getUnitId, bo.getUnitId())
.eq(bo.getBeforePrice() != null, ErpContractMateriel::getBeforePrice, bo.getBeforePrice())
.eq(bo.getTaxRate() != null, ErpContractMateriel::getTaxRate, bo.getTaxRate())
.eq(bo.getIncludingPrice() != null, ErpContractMateriel::getIncludingPrice, bo.getIncludingPrice())
.eq(bo.getSubtotal() != null, ErpContractMateriel::getSubtotal, bo.getSubtotal())
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), ErpContractMateriel::getActiveFlag, bo.getActiveFlag())
;
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(ErpContractMaterielBo bo) {
ErpContractMateriel add = MapstructUtils.convert(bo, ErpContractMateriel.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setContractMaterielId(add.getContractMaterielId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(ErpContractMaterielBo bo) {
ErpContractMateriel update = MapstructUtils.convert(bo, ErpContractMateriel.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(ErpContractMateriel 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,14 @@
<?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.ErpContractInfoMapper">
<resultMap type="org.dromara.oa.erp.domain.vo.ErpContractInfoVo" id="ErpContractInfoResult">
</resultMap>
<select id="selectCustomErpContractInfoVoList" resultMap="ErpContractInfoResult">
select contract_id, tenant_id, contract_flag, contract_code, contract_name, contract_category, contract_type, business_direction, contract_dept_id, contract_date, total_price, a_customer_id, a_represent, a_date, b_customer_id, b_represent, b_date, contract_status, flow_status, template_id, oss_id, payment_method, signature_appendix, tax_rate, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_contract_info t
${ew.getCustomSqlSegment}
</select>
</mapper>

@ -0,0 +1,14 @@
<?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.ErpContractMaterielMapper">
<resultMap type="org.dromara.oa.erp.domain.vo.ErpContractMaterielVo" id="ErpContractMaterielResult">
</resultMap>
<select id="selectCustomErpContractMaterielVoList" resultMap="ErpContractMaterielResult">
select contract_materiel_id, tenant_id, contract_id, product_name, specification_description, materiel_id, relation_materiel_id, amount, unit_id, before_price, tax_rate, including_price, subtotal, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time from erp_contract_materiel t
${ew.getCustomSqlSegment}
</select>
</mapper>
Loading…
Cancel
Save