11-27-修改承包合同信息必填
This commit is contained in:
@ -1,13 +1,10 @@
|
||||
package org.dromara.xzd.domain.bo;
|
||||
|
||||
import org.dromara.xzd.domain.XzdContractAdvanceInfo;
|
||||
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 org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.xzd.domain.XzdContractAdvanceInfo;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
@ -30,13 +27,13 @@ public class XzdContractAdvanceInfoBo extends BaseEntity {
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
@NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 承包合同信息ID
|
||||
*/
|
||||
@NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long contractDetailsId;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,13 +1,10 @@
|
||||
package org.dromara.xzd.domain.bo;
|
||||
|
||||
import org.dromara.xzd.domain.XzdContractClause;
|
||||
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 org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.xzd.domain.XzdContractClause;
|
||||
|
||||
/**
|
||||
* 合同条款-合同条款业务对象 xzd_contract_clause
|
||||
@ -28,13 +25,13 @@ public class XzdContractClauseBo extends BaseEntity {
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
@NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 承包合同信息ID
|
||||
*/
|
||||
@NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long contractDetailsId;
|
||||
|
||||
/**
|
||||
|
||||
@ -1,12 +1,8 @@
|
||||
package org.dromara.xzd.domain.bo;
|
||||
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import jakarta.validation.constraints.NotBlank;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.xzd.domain.XzdDeductionItems;
|
||||
|
||||
@ -32,13 +28,13 @@ public class XzdDeductionItemsBo extends BaseEntity {
|
||||
/**
|
||||
* 表名
|
||||
*/
|
||||
@NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String tableName;
|
||||
|
||||
/**
|
||||
* 承包合同信息ID
|
||||
*/
|
||||
@NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
// @NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long contractDetailsId;
|
||||
|
||||
/**
|
||||
|
||||
@ -262,24 +262,6 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
||||
throw new RuntimeException("该合同已被终止!");
|
||||
}
|
||||
|
||||
// List<XzdContractDetailsVo> old1 = List.of(old);
|
||||
// setValue(old1);
|
||||
// old = old1.getFirst();
|
||||
|
||||
// if (bo.getSealInfo() != null && !bo.getSealInfo().isEmpty()){
|
||||
// if (old.getSealInfo() != null && !old.getSealInfo().isEmpty()){
|
||||
// xzdBusinessChangeService.removeByIds(old.getSealInfo());
|
||||
// }
|
||||
// for (XzdBusinessChange businessChange : bo.getSealInfo()) {
|
||||
// businessChange.setContractChangeId(update.getId());
|
||||
// }
|
||||
// xzdBusinessChangeService.saveBatch(bo.getSealInfo());
|
||||
// }else {
|
||||
// if (old.getSealInfo() != null && !old.getSealInfo().isEmpty()){
|
||||
// xzdBusinessChangeService.removeByIds(old.getSealInfo());
|
||||
// }
|
||||
// }
|
||||
|
||||
//合同文本-预收款项
|
||||
if (bo.getYskx() != null && !bo.getYskx().isEmpty()){
|
||||
if (old.getYskx() != null && !old.getYskx().isEmpty()){
|
||||
@ -297,15 +279,6 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
||||
}
|
||||
|
||||
//合同条款-扣款与奖励项
|
||||
// for (XzdDeductionItems advanceInfo : bo.getKkyjlx()) {
|
||||
// if (!old.getKkyjlx().contains(advanceInfo)){
|
||||
// xzdDeductionItemsService.removeById(advanceInfo);
|
||||
// }
|
||||
// advanceInfo.setContractDetailsId(update.getId());
|
||||
// advanceInfo.setTableName(tableName);
|
||||
// }
|
||||
// xzdDeductionItemsService.saveOrUpdateBatch(bo.getKkyjlx());
|
||||
|
||||
if (bo.getKkyjlx() != null && !bo.getKkyjlx().isEmpty()){
|
||||
if (old.getKkyjlx() != null && !old.getKkyjlx().isEmpty()){
|
||||
xzdDeductionItemsService.removeByIds(old.getKkyjlx());
|
||||
@ -316,20 +289,15 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
||||
}
|
||||
xzdDeductionItemsService.saveBatch(bo.getKkyjlx());
|
||||
}else {
|
||||
if (old.getYskx() != null && !old.getYskx().isEmpty()){
|
||||
xzdDeductionItemsService.removeByIds(old.getYskx());
|
||||
if (old.getKkyjlx() != null && !old.getKkyjlx().isEmpty()){
|
||||
boolean b = xzdDeductionItemsService.removeByIds(old.getKkyjlx());
|
||||
if (!b){
|
||||
log.error("删除老数据kkyjlx失败");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//合同条款-合同条款
|
||||
// for (XzdContractClause advanceInfo : bo.getHttk()) {
|
||||
// if (!old.getHttk().contains(advanceInfo)){
|
||||
// xzdContractClauseService.removeById(advanceInfo);
|
||||
// }
|
||||
// advanceInfo.setContractDetailsId(update.getId());
|
||||
// advanceInfo.setTableName(tableName);
|
||||
// }
|
||||
// xzdContractClauseService.saveOrUpdateBatch(bo.getHttk());
|
||||
if (bo.getHttk() != null && !bo.getHttk().isEmpty()){
|
||||
if (old.getHttk() != null && !old.getHttk().isEmpty()){
|
||||
xzdContractClauseService.removeByIds(old.getHttk());
|
||||
@ -340,20 +308,12 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
||||
}
|
||||
xzdContractClauseService.saveBatch(bo.getHttk());
|
||||
}else {
|
||||
if (old.getYskx() != null && !old.getYskx().isEmpty()){
|
||||
if (old.getHttk() != null && !old.getHttk().isEmpty()){
|
||||
xzdContractClauseService.removeByIds(old.getHttk());
|
||||
}
|
||||
}
|
||||
|
||||
//支付条款
|
||||
// for (XzdSettlementRules advanceInfo : bo.getZftk()) {
|
||||
// if (!old.getZftk().contains(advanceInfo)){
|
||||
// xzdSettlementRulesService.removeById(advanceInfo);
|
||||
// }
|
||||
// advanceInfo.setContractDetailsId(update.getId());
|
||||
// }
|
||||
// xzdSettlementRulesService.saveOrUpdateBatch(bo.getZftk());
|
||||
|
||||
if (bo.getZftk() != null && !bo.getZftk().isEmpty()){
|
||||
if (old.getZftk() != null && !old.getZftk().isEmpty()){
|
||||
xzdSettlementRulesService.removeByIds(old.getZftk());
|
||||
@ -363,7 +323,7 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
||||
}
|
||||
xzdSettlementRulesService.saveBatch(bo.getZftk());
|
||||
}else {
|
||||
if (old.getYskx() != null && !old.getYskx().isEmpty()){
|
||||
if (old.getZftk() != null && !old.getZftk().isEmpty()){
|
||||
xzdSettlementRulesService.removeByIds(old.getZftk());
|
||||
}
|
||||
}
|
||||
@ -382,22 +342,22 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
||||
}
|
||||
|
||||
//更新文件
|
||||
if (bo.getFileId() != null && !bo.getFileId().isEmpty()){
|
||||
if (old.getFileId() != null && !old.getFileId().isEmpty()) {
|
||||
List<Long> oldFileId = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
|
||||
List<Long> nowFileId = Arrays.stream(bo.getFileId().split(",")).map(Long::valueOf).toList();
|
||||
for (Long l : oldFileId) {
|
||||
if (!nowFileId.contains(l)) {
|
||||
sysOssService.deleteWithValidByIds(List.of(l), false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}else {
|
||||
if (old.getFileId()!= null && !old.getFileId().isEmpty()){
|
||||
List<Long> deleteIds = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
|
||||
sysOssService.deleteWithValidByIds(deleteIds, false);
|
||||
}
|
||||
}
|
||||
// if (bo.getFileId() != null && !bo.getFileId().isEmpty()){
|
||||
// if (old.getFileId() != null && !old.getFileId().isEmpty()) {
|
||||
// List<Long> oldFileId = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
|
||||
// List<Long> nowFileId = Arrays.stream(bo.getFileId().split(",")).map(Long::valueOf).toList();
|
||||
// for (Long l : oldFileId) {
|
||||
// if (!nowFileId.contains(l)) {
|
||||
// sysOssService.deleteWithValidByIds(List.of(l), false);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }else {
|
||||
// if (old.getFileId()!= null && !old.getFileId().isEmpty()){
|
||||
// List<Long> deleteIds = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
|
||||
// sysOssService.deleteWithValidByIds(deleteIds, false);
|
||||
// }
|
||||
// }
|
||||
|
||||
validEntityBeforeSave(update);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user