合同资金拆分实现
This commit is contained in:
@@ -74,7 +74,12 @@ public class TmplInscItmBsnServiceImpl implements TmplInscItmBsnService {
|
||||
@Override
|
||||
public void updateTmplInscItmBsnBatch(List<TmplInscItmBsnSaveReqVO> updateReqVOS) {
|
||||
tmplInscItmBsnMapper.physicalDeleteByBsnIds(updateReqVOS.stream().map(TmplInscItmBsnSaveReqVO::getBsnId).toList());
|
||||
List<TmplInscItmBsnDO> bean = BeanUtils.toBean(updateReqVOS, TmplInscItmBsnDO.class);
|
||||
List<TmplInscItmBsnDO> bean =new ArrayList<>();
|
||||
updateReqVOS.forEach(updateReqVO -> {
|
||||
TmplInscItmBsnDO tmplInscItmBsnDO = BeanUtils.toBean(updateReqVO, TmplInscItmBsnDO.class);
|
||||
tmplInscItmBsnDO.setInscItmId(updateReqVO.getInstceItmId());
|
||||
bean.add(tmplInscItmBsnDO);
|
||||
});
|
||||
tmplInscItmBsnMapper.insertBatch(bean);
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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.zt.plat.module.bse.dal.dao.amountdismantle.AmountDismantleMapper">
|
||||
|
||||
<!--
|
||||
一般情况下,尽可能使用 Mapper 进行 CRUD 增删改查即可。
|
||||
无法满足的场景,例如说多表关联查询,才使用 XML 编写 SQL。
|
||||
代码生成器暂时只生成 Mapper XML 文件本身,更多推荐 MybatisX 快速开发插件来生成查询。
|
||||
文档可见:https://www.iocoder.cn/MyBatis/x-plugins/
|
||||
-->
|
||||
|
||||
</mapper>
|
||||
@@ -0,0 +1,41 @@
|
||||
package com.zt.plat.module.contractorder.api.vo.contract;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import java.math.BigDecimal;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 结算金额拆分分页 Request VO")
|
||||
@Data
|
||||
public class AmountDismantlePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "物料名称", example = "赵六")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@Schema(description = "元素名称", example = "张三")
|
||||
private String elementName;
|
||||
|
||||
@Schema(description = "元素编码")
|
||||
private String elementCode;
|
||||
|
||||
@Schema(description = "占比")
|
||||
private BigDecimal ratio;
|
||||
|
||||
@Schema(description = "合同id", example = "3781")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
package com.zt.plat.module.contractorder.api.vo.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 结算金额拆分 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class AmountDismantleRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17357")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "物料名称", example = "赵六")
|
||||
@ExcelProperty("物料名称")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
@ExcelProperty("物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "元素缩写")
|
||||
@ExcelProperty("元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@Schema(description = "元素名称", example = "张三")
|
||||
@ExcelProperty("元素名称")
|
||||
private String elementName;
|
||||
|
||||
@Schema(description = "元素编码")
|
||||
@ExcelProperty("元素编码")
|
||||
private String elementCode;
|
||||
|
||||
@Schema(description = "占比")
|
||||
@ExcelProperty("占比")
|
||||
private BigDecimal ratio;
|
||||
|
||||
@Schema(description = "合同id", example = "3781")
|
||||
@ExcelProperty("合同id")
|
||||
private Long contractId;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
package com.zt.plat.module.contractorder.api.vo.contract;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@Schema(description = "管理后台 - 结算金额拆分新增/修改 Request VO")
|
||||
@Data
|
||||
public class AmountDismantleSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "17357")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "物料名称", example = "赵六")
|
||||
private String materialName;
|
||||
|
||||
@Schema(description = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@Schema(description = "元素缩写")
|
||||
private String elementAbbreviation;
|
||||
|
||||
@Schema(description = "元素名称", example = "张三")
|
||||
private String elementName;
|
||||
|
||||
@Schema(description = "元素编码")
|
||||
private String elementCode;
|
||||
|
||||
@Schema(description = "占比")
|
||||
private BigDecimal ratio;
|
||||
|
||||
@Schema(description = "合同id", example = "3781")
|
||||
private Long contractId;
|
||||
|
||||
}
|
||||
@@ -244,6 +244,8 @@ public class ContractSaveReqVO {
|
||||
private String salesTaxNumber;
|
||||
@Schema(description = "是否信用", example = "1")
|
||||
private String hasCredit;
|
||||
//资金拆分表
|
||||
private List<AmountDismantleSaveReqVO> amountSplit;
|
||||
// 收发货规则
|
||||
private List<ContractReceiveSendSaveReqVO> contractReceiveSends;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ public interface ErrorCodeConstants {
|
||||
ErrorCode CONTRACT_PARTNER_NOT_EXISTS = new ErrorCode(1_027_000_017, "客商信息不存在");
|
||||
ErrorCode CONTRACT_PUSH_FAIL = new ErrorCode(1_027_000_019, "推送合同失败:{}");
|
||||
ErrorCode CONTRACT_STATUS_NOT_CANCEL = new ErrorCode(1_027_000_020, "{}状态合同不允许作废");
|
||||
|
||||
ErrorCode AMOUNT_DISMANTLE_NOT_EXISTS = new ErrorCode(1_027_000_022, "资金拆分不存在");
|
||||
ErrorCode CONTRACT_RECEIVE_SEND_NOT_EXISTS = new ErrorCode(1_027_000_021, "收发货规则不存在");
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,71 @@
|
||||
package com.zt.plat.module.contractorder.dal.dataobject.amountdismantle;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 结算金额拆分 DO
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@TableName("bse_amt_dsmt")
|
||||
@KeySequence("bse_amt_dsmt_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class AmountDismantleDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@TableField("MTRL_NAME")
|
||||
private String materialName;
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@TableField("MTRL_CD")
|
||||
private String materialCode;
|
||||
/**
|
||||
* 元素缩写
|
||||
*/
|
||||
@TableField("ELEM_ABBR")
|
||||
private String elementAbbreviation;
|
||||
/**
|
||||
* 元素名称
|
||||
*/
|
||||
@TableField("ELEM_NAME")
|
||||
private String elementName;
|
||||
/**
|
||||
* 元素编码
|
||||
*/
|
||||
@TableField("ELEM_CD")
|
||||
private String elementCode;
|
||||
/**
|
||||
* 占比
|
||||
*/
|
||||
@TableField("RTIO")
|
||||
private BigDecimal ratio;
|
||||
/**
|
||||
* 合同id
|
||||
*/
|
||||
@TableField("CTRT_ID")
|
||||
private Long contractId;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
package com.zt.plat.module.contractorder.dal.mysql.amountdismantle;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
|
||||
import com.zt.plat.module.contractorder.api.vo.contract.AmountDismantlePageReqVO;
|
||||
import com.zt.plat.module.contractorder.dal.dataobject.amountdismantle.AmountDismantleDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
|
||||
/**
|
||||
* 结算金额拆分 Mapper
|
||||
*
|
||||
* @author 后台管理-1
|
||||
*/
|
||||
@Mapper
|
||||
public interface AmountDismantleMapper extends BaseMapperX<AmountDismantleDO> {
|
||||
|
||||
default PageResult<AmountDismantleDO> selectPage(AmountDismantlePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<AmountDismantleDO>()
|
||||
.likeIfPresent(AmountDismantleDO::getMaterialName, reqVO.getMaterialName())
|
||||
.eqIfPresent(AmountDismantleDO::getMaterialCode, reqVO.getMaterialCode())
|
||||
.eqIfPresent(AmountDismantleDO::getElementAbbreviation, reqVO.getElementAbbreviation())
|
||||
.likeIfPresent(AmountDismantleDO::getElementName, reqVO.getElementName())
|
||||
.eqIfPresent(AmountDismantleDO::getElementCode, reqVO.getElementCode())
|
||||
.eqIfPresent(AmountDismantleDO::getRatio, reqVO.getRatio())
|
||||
.eqIfPresent(AmountDismantleDO::getContractId, reqVO.getContractId())
|
||||
.betweenIfPresent(AmountDismantleDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(AmountDismantleDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user