|
@@ -1,6 +1,7 @@
|
|
|
package cn.com.ty.lift.business.contract.service;
|
|
|
|
|
|
import cn.com.ty.lift.business.contract.dao.entity.Contracts;
|
|
|
+import cn.com.ty.lift.business.contract.dao.entity.ContractsHistory;
|
|
|
import cn.com.ty.lift.business.contract.dao.entity.Payment;
|
|
|
import cn.com.ty.lift.business.contract.dao.entity.model.request.ContractRequest;
|
|
|
import cn.com.ty.lift.business.contract.dao.entity.model.response.ContractResponse;
|
|
@@ -23,10 +24,7 @@ import org.springframework.transaction.interceptor.TransactionAspectSupport;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
-import java.util.Map;
|
|
|
-import java.util.Optional;
|
|
|
+import java.util.*;
|
|
|
|
|
|
import static java.math.BigDecimal.ZERO;
|
|
|
|
|
@@ -174,11 +172,15 @@ public class ContractService extends ServiceImpl<ContractsMapper, Contracts> {
|
|
|
return RestResponse.fail(MessageUtils.get("msg.modify.fail"));
|
|
|
|
|
|
Contracts entry = oldContract.get();
|
|
|
- //保存合同操作记录
|
|
|
- boolean historyResult = contractHistoryService.saveOperaHistory(entry, contracts);
|
|
|
- if (!historyResult) {
|
|
|
- TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
- return RestResponse.fail(MessageUtils.get("msg.modify.fail"));
|
|
|
+ //生成合同操作记录
|
|
|
+ ContractsHistory history = contractHistoryService.createOperaHistory(entry, contracts);
|
|
|
+ if (Objects.nonNull(history)) {
|
|
|
+ //保存合同操作记录
|
|
|
+ boolean historyResult = contractHistoryService.save(history);
|
|
|
+ if (!historyResult) {
|
|
|
+ TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
|
|
|
+ return RestResponse.fail(MessageUtils.get("msg.modify.fail"));
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
if (CollUtil.isNotEmpty(paymentList)) {
|