From fca21683e1b5b906d2514082ddfbae8eb820c9ea Mon Sep 17 00:00:00 2001
From: shiyunteng <shiyunteng@example.com>
Date: 星期五, 15 五月 2026 17:12:55 +0800
Subject: [PATCH] feat:合同模版、出库标的物、合同管理拆分
---
platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java | 43 +++++++++++++++++++++++--------------------
1 files changed, 23 insertions(+), 20 deletions(-)
diff --git a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
index dcc0047..be9ffc8 100644
--- a/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
+++ b/platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractPaymentScheduleProcessServiceImpl.java
@@ -8,14 +8,8 @@
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.by4cloud.platformx.business.dto.ContractPaymentScheduleProcessAddDTO;
-import com.by4cloud.platformx.business.entity.Contract;
-import com.by4cloud.platformx.business.entity.ContractPaymentSchedule;
-import com.by4cloud.platformx.business.entity.ContractPaymentScheduleProcess;
-import com.by4cloud.platformx.business.entity.PaymentConfirm;
-import com.by4cloud.platformx.business.mapper.ContractMapper;
-import com.by4cloud.platformx.business.mapper.ContractPaymentScheduleMapper;
-import com.by4cloud.platformx.business.mapper.ContractPaymentScheduleProcessMapper;
-import com.by4cloud.platformx.business.mapper.PaymentConfirmMapper;
+import com.by4cloud.platformx.business.entity.*;
+import com.by4cloud.platformx.business.mapper.*;
import com.by4cloud.platformx.business.service.ContractPaymentScheduleProcessService;
import com.by4cloud.platformx.business.vo.ContractPaymentScheduleVo;
import com.by4cloud.platformx.business.vo.ScheduleProcessVo;
@@ -41,6 +35,7 @@
private final ContractPaymentScheduleMapper contractPaymentScheduleMapper;
private final ContractPaymentScheduleProcessMapper processMapper;
private final ContractMapper contractMapper;
+ private final ContractSubjectMatterMapper subjectMatterMapper;
private final PaymentConfirmMapper paymentConfirmMapper;
@Override
@@ -51,6 +46,13 @@
}
//鍚堝悓
Contract contract = contractMapper.selectById(schedule.getContractId());
+ List<ContractSubjectMatter> subjectMatterList = subjectMatterMapper.selectList(Wrappers.<ContractSubjectMatter>lambdaQuery().eq(ContractSubjectMatter::getContractId,contract.getId()));
+ if (ArrayUtil.isEmpty(subjectMatterList.toArray())){
+ return R.failed("璇ュ悎鍚屾爣鐨勭墿寮傚父锛岃鑱旂郴鎶�鏈汉鍛�");
+ }
+ if (!subjectMatterList.stream().allMatch(item->item.getDeliveryStatus()==2)){
+ return R.failed("鍑哄簱鏁伴噺灏忎簬褰撳墠鍚堝悓鏍囩殑鐗╂暟閲忥紝鏃犳硶杩涜褰撳墠鎿嶄綔");
+ }
//鏂板褰撳墠闃舵搴旀敹
PaymentConfirm currentConfim = new PaymentConfirm();
currentConfim.setBusinessType(schedule.getStageName()+"搴旀敹");
@@ -88,7 +90,7 @@
ContractPaymentSchedule beforeSchedule = contractPaymentScheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, schedule.getContractId())
.lt(ContractPaymentSchedule::getStageOrder, schedule.getStageOrder()).orderByDesc(ContractPaymentSchedule::getCreateTime).last("limit 1"));
if (ObjUtil.isNotNull(beforeSchedule)){
- beforeSchedule.setEffectiveEndDate(DateUtil.offsetDay(addDTO.getProcessDate(),beforeSchedule.getAgreedDays()));
+ beforeSchedule.setEffectiveEndDate(schedule.getEffectiveDate());
contractPaymentScheduleMapper.updateById(beforeSchedule);
//涔嬪墠闃舵鏄惁鏀舵瀹屾垚
// if (beforeSchedule.getPaymentStatus()!=2){
@@ -166,6 +168,14 @@
//鏇存柊鍚堝悓涓嬩釜闃舵
contract.setNextScheduleName("鏃�");
contractMapper.updateById(contract);
+ //褰撳墠涓哄悎鍚屾渶鍚庨樁娈�
+ PaymentConfirm lastNewConfirm = paymentConfirmMapper.selectOne(Wrappers.<PaymentConfirm>lambdaQuery().eq(PaymentConfirm::getContractId,contract.getId())
+ .orderByDesc(PaymentConfirm::getCreateTime).last("limit 1"));
+ if (lastNewConfirm.getTotalAmount().compareTo(new BigDecimal("0"))>=0){
+ //鏈夐浠樹笖瓒呰繃搴旀敹 鍏抽棴鍚堝悓鐘舵��
+ contract.setContractStatus(3);
+ contractMapper.updateById(contract);
+ }
}
return R.ok();
}
@@ -176,20 +186,13 @@
.select(ContractPaymentSchedule::getId,ContractPaymentSchedule::getStageName,ContractPaymentSchedule::getEffectiveDate,
ContractPaymentSchedule::getPlannedAmount,ContractPaymentSchedule::getPlannedAmount,
ContractPaymentSchedule::getEffectiveEndDate,ContractPaymentSchedule::getPaymentDate,
- ContractPaymentSchedule::getPaymentStatus,ContractPaymentSchedule::getActualAmount)
+ ContractPaymentSchedule::getPaymentStatus,ContractPaymentSchedule::getActualAmount,
+ ContractPaymentSchedule::getAgreedDays)
+ .select(ContractPaymentScheduleProcess::getProcessDate)
+ .leftJoin(ContractPaymentScheduleProcess.class,ContractPaymentScheduleProcess::getScheduleId,ContractPaymentSchedule::getId)
.eq(ContractPaymentSchedule::getContractId,id)
.orderByAsc(ContractPaymentSchedule::getCreateTime);
List<ContractPaymentScheduleVo> scheduleVoList = contractPaymentScheduleMapper.selectJoinList(ContractPaymentScheduleVo.class,wrapper);
- if (ArrayUtil.isEmpty(scheduleVoList.toArray())){
- scheduleVoList.stream().forEach(contractPaymentScheduleVo -> {
- List<ContractPaymentScheduleProcess> paymentScheduleProcessList = processMapper.selectList(Wrappers.<ContractPaymentScheduleProcess>lambdaQuery()
- .eq(ContractPaymentScheduleProcess::getContractId,contractPaymentScheduleVo.getId())
- .orderByAsc(ContractPaymentScheduleProcess::getCreateTime));
- if (ArrayUtil.isNotEmpty(paymentScheduleProcessList.toArray())){
- contractPaymentScheduleVo.setProcessVoList(BeanUtil.copyToList(paymentScheduleProcessList, ScheduleProcessVo.class));
- }
- });
- }
return R.ok(scheduleVoList);
}
}
\ No newline at end of file
--
Gitblit v1.9.1