11-27-修改承包合同信息必填
This commit is contained in:
@ -1,13 +1,10 @@
|
|||||||
package org.dromara.xzd.domain.bo;
|
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 io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
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;
|
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;
|
private String tableName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 承包合同信息ID
|
* 承包合同信息ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long contractDetailsId;
|
private Long contractDetailsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,13 +1,10 @@
|
|||||||
package org.dromara.xzd.domain.bo;
|
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 io.github.linpeilie.annotations.AutoMapper;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import jakarta.validation.constraints.*;
|
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||||
|
import org.dromara.xzd.domain.XzdContractClause;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 合同条款-合同条款业务对象 xzd_contract_clause
|
* 合同条款-合同条款业务对象 xzd_contract_clause
|
||||||
@ -21,20 +18,20 @@ import jakarta.validation.constraints.*;
|
|||||||
public class XzdContractClauseBo extends BaseEntity {
|
public class XzdContractClauseBo extends BaseEntity {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 表名
|
* 表名
|
||||||
*/
|
*/
|
||||||
@NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotBlank(message = "表名不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private String tableName;
|
private String tableName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 承包合同信息ID
|
* 承包合同信息ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long contractDetailsId;
|
private Long contractDetailsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -1,12 +1,8 @@
|
|||||||
package org.dromara.xzd.domain.bo;
|
package org.dromara.xzd.domain.bo;
|
||||||
|
|
||||||
import io.github.linpeilie.annotations.AutoMapper;
|
import io.github.linpeilie.annotations.AutoMapper;
|
||||||
import jakarta.validation.constraints.NotBlank;
|
|
||||||
import jakarta.validation.constraints.NotNull;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
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.common.mybatis.core.domain.BaseEntity;
|
||||||
import org.dromara.xzd.domain.XzdDeductionItems;
|
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;
|
private String tableName;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 承包合同信息ID
|
* 承包合同信息ID
|
||||||
*/
|
*/
|
||||||
@NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
// @NotNull(message = "承包合同信息ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||||
private Long contractDetailsId;
|
private Long contractDetailsId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -262,24 +262,6 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
|||||||
throw new RuntimeException("该合同已被终止!");
|
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 (bo.getYskx() != null && !bo.getYskx().isEmpty()){
|
||||||
if (old.getYskx() != null && !old.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 (bo.getKkyjlx() != null && !bo.getKkyjlx().isEmpty()){
|
||||||
if (old.getKkyjlx() != null && !old.getKkyjlx().isEmpty()){
|
if (old.getKkyjlx() != null && !old.getKkyjlx().isEmpty()){
|
||||||
xzdDeductionItemsService.removeByIds(old.getKkyjlx());
|
xzdDeductionItemsService.removeByIds(old.getKkyjlx());
|
||||||
@ -316,20 +289,15 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
|||||||
}
|
}
|
||||||
xzdDeductionItemsService.saveBatch(bo.getKkyjlx());
|
xzdDeductionItemsService.saveBatch(bo.getKkyjlx());
|
||||||
}else {
|
}else {
|
||||||
if (old.getYskx() != null && !old.getYskx().isEmpty()){
|
if (old.getKkyjlx() != null && !old.getKkyjlx().isEmpty()){
|
||||||
xzdDeductionItemsService.removeByIds(old.getYskx());
|
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 (bo.getHttk() != null && !bo.getHttk().isEmpty()){
|
||||||
if (old.getHttk() != null && !old.getHttk().isEmpty()){
|
if (old.getHttk() != null && !old.getHttk().isEmpty()){
|
||||||
xzdContractClauseService.removeByIds(old.getHttk());
|
xzdContractClauseService.removeByIds(old.getHttk());
|
||||||
@ -340,20 +308,12 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
|||||||
}
|
}
|
||||||
xzdContractClauseService.saveBatch(bo.getHttk());
|
xzdContractClauseService.saveBatch(bo.getHttk());
|
||||||
}else {
|
}else {
|
||||||
if (old.getYskx() != null && !old.getYskx().isEmpty()){
|
if (old.getHttk() != null && !old.getHttk().isEmpty()){
|
||||||
xzdContractClauseService.removeByIds(old.getHttk());
|
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 (bo.getZftk() != null && !bo.getZftk().isEmpty()){
|
||||||
if (old.getZftk() != null && !old.getZftk().isEmpty()){
|
if (old.getZftk() != null && !old.getZftk().isEmpty()){
|
||||||
xzdSettlementRulesService.removeByIds(old.getZftk());
|
xzdSettlementRulesService.removeByIds(old.getZftk());
|
||||||
@ -363,7 +323,7 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
|||||||
}
|
}
|
||||||
xzdSettlementRulesService.saveBatch(bo.getZftk());
|
xzdSettlementRulesService.saveBatch(bo.getZftk());
|
||||||
}else {
|
}else {
|
||||||
if (old.getYskx() != null && !old.getYskx().isEmpty()){
|
if (old.getZftk() != null && !old.getZftk().isEmpty()){
|
||||||
xzdSettlementRulesService.removeByIds(old.getZftk());
|
xzdSettlementRulesService.removeByIds(old.getZftk());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -382,22 +342,22 @@ public class XzdContractDetailsServiceImpl extends ServiceImpl<XzdContractDetail
|
|||||||
}
|
}
|
||||||
|
|
||||||
//更新文件
|
//更新文件
|
||||||
if (bo.getFileId() != null && !bo.getFileId().isEmpty()){
|
// if (bo.getFileId() != null && !bo.getFileId().isEmpty()){
|
||||||
if (old.getFileId() != null && !old.getFileId().isEmpty()) {
|
// if (old.getFileId() != null && !old.getFileId().isEmpty()) {
|
||||||
List<Long> oldFileId = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
|
// List<Long> oldFileId = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
|
||||||
List<Long> nowFileId = Arrays.stream(bo.getFileId().split(",")).map(Long::valueOf).toList();
|
// List<Long> nowFileId = Arrays.stream(bo.getFileId().split(",")).map(Long::valueOf).toList();
|
||||||
for (Long l : oldFileId) {
|
// for (Long l : oldFileId) {
|
||||||
if (!nowFileId.contains(l)) {
|
// if (!nowFileId.contains(l)) {
|
||||||
sysOssService.deleteWithValidByIds(List.of(l), false);
|
// sysOssService.deleteWithValidByIds(List.of(l), false);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}else {
|
// }else {
|
||||||
if (old.getFileId()!= null && !old.getFileId().isEmpty()){
|
// if (old.getFileId()!= null && !old.getFileId().isEmpty()){
|
||||||
List<Long> deleteIds = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
|
// List<Long> deleteIds = Arrays.stream(old.getFileId().split(",")).map(Long::valueOf).toList();
|
||||||
sysOssService.deleteWithValidByIds(deleteIds, false);
|
// sysOssService.deleteWithValidByIds(deleteIds, false);
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
|
|
||||||
validEntityBeforeSave(update);
|
validEntityBeforeSave(update);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user