platformx-business-finance-biz/src/main/java/com/by4cloud/platformx/business/service/impl/ContractServiceImpl.java
@@ -33,7 +33,6 @@
import com.deepoove.poi.plugin.table.LoopRowTableRenderPolicy;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Service;
@@ -278,10 +277,10 @@
               .eq(ContractSubjectMatter::getContractId,id));
         if (ArrayUtil.isNotEmpty(subjectMatterList.toArray())) {
            subjectMatterList.stream().forEach(contractSubjectMatter -> {
            for (ContractSubjectMatter contractSubjectMatter: subjectMatterList)  {
               if (StrUtil.equals(contract.getExecFrequency(), "1")) {
                  Long weeksTrue = DateUtil.betweenWeek(DateUtil.beginOfWeek(contract.getEffectiveDate()),
                        DateUtil.endOfWeek(contract.getExpirationDate()), true);
                        DateUtil.endOfWeek(contract.getExpirationDate()), true)+1;
                  //循环日期
                  Date execDate0 = DateUtil.offsetDay(DateUtil.beginOfWeek(contract.getEffectiveDate()), contract.getExecDay());
                  for (int i = 0; i < weeksTrue.intValue(); i++) {
@@ -298,7 +297,7 @@
               }
               if (StrUtil.equals(contract.getExecFrequency(), "2")) {
                  Long weeksTrue = DateUtil.betweenMonth(DateUtil.beginOfMonth(contract.getEffectiveDate()),
                        DateUtil.endOfMonth(contract.getExpirationDate()), true);
                        DateUtil.endOfMonth(contract.getExpirationDate()), true)+1;
                  //循环日期
                  Date execDate0 = DateUtil.offsetDay(DateUtil.beginOfMonth(contract.getEffectiveDate()), contract.getExecDay());
                  for (int i = 0; i < weeksTrue.intValue(); i++) {
@@ -314,11 +313,11 @@
                  }
               }
               if (StrUtil.equals(contract.getExecFrequency(), "3")) {
                  Long weeksTrue = DateUtil.betweenMonth(DateUtil.beginOfQuarter(contract.getEffectiveDate()),
                        DateUtil.endOfQuarter(contract.getExpirationDate()), true)/3;
                  Long weeksTrue = (DateUtil.betweenMonth(DateUtil.beginOfQuarter(contract.getEffectiveDate()),
                        DateUtil.endOfQuarter(contract.getExpirationDate()), true)+1)/3;
                  //循环日期
                  Date execDate0 = DateUtil.offsetDay(DateUtil.beginOfWeek(contract.getExpirationDate()), contract.getExecDay());
                  Date execDate0 = DateUtil.offsetDay(DateUtil.beginOfQuarter(contract.getEffectiveDate()), contract.getExecDay());
                  for (int i = 0; i < weeksTrue.intValue(); i++) {
                     Date execDatei = DateUtil.offsetMonth(execDate0, i*3);
                     ContractExecDate execDate = new ContractExecDate();
@@ -348,9 +347,9 @@
                  if (7<=endMonth&&endMonth<=12){
                     endDate = DateUtil.endOfYear(endDate);
                  }
                  Long weeksTrue = DateUtil.betweenMonth(startDate,endDate, true)/6;
                  Long weeksTrue = (DateUtil.betweenMonth(startDate,endDate, true)+1)/6;
                  //循环日期
                  Date execDate0 = DateUtil.offsetDay(DateUtil.beginOfWeek(contract.getExpirationDate()), contract.getExecDay());
                  Date execDate0 = DateUtil.offsetDay(startDate, contract.getExecDay());
                  for (int i = 0; i < weeksTrue.intValue(); i++) {
                     Date execDatei = DateUtil.offsetMonth(execDate0, i*6);
                     ContractExecDate execDate = new ContractExecDate();
@@ -365,7 +364,7 @@
               }
               if (StrUtil.equals(contract.getExecFrequency(), "5")) {
                  Long weeksTrue = DateUtil.betweenWeek(DateUtil.beginOfYear(contract.getEffectiveDate()),
                        DateUtil.endOfYear(contract.getExpirationDate()), true);
                        DateUtil.endOfYear(contract.getExpirationDate()), true)+1;
                  //循环日期
                  Date execDate0 = DateUtil.offsetDay(DateUtil.beginOfYear(contract.getEffectiveDate()), contract.getExecDay());
                  for (int i = 0; i < weeksTrue.intValue(); i++) {
@@ -381,7 +380,7 @@
                  }
               }
            });
            }
         }
      } else {
         ContractPaymentSchedule fitstSchedule = contractPaymentScheduleMapper.selectOne(Wrappers.<ContractPaymentSchedule>lambdaQuery().eq(ContractPaymentSchedule::getContractId, contract.getId())
@@ -698,7 +697,7 @@
      map.put("items", items);
      //定制方
      BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
      map.put("companyName", customer.getCompanyName());
      map.put("companyName", customer.getRegisterName());
      map.put("legalPerson", customer.getLegalPerson());
      map.put("contactPhone", customer.getContactPhone());
      map.put("bankName", customer.getBankName());
@@ -867,7 +866,7 @@
      map.put("items", items);
      //定制方
      BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
      map.put("companyName", customer.getCompanyName());
      map.put("companyName", customer.getRegisterName());
      map.put("legalPerson", customer.getLegalPerson());
      map.put("contactPhone", customer.getContactPhone());
      map.put("bankName", customer.getBankName());
@@ -953,7 +952,7 @@
      map.put("items", items);
      //定制方
      BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
      map.put("companyName", customer.getCompanyName());
      map.put("companyName", customer.getRegisterName());
      map.put("legalPerson", customer.getLegalPerson());
      map.put("contactPhone", customer.getContactPhone());
      map.put("bankName", customer.getBankName());
@@ -1088,7 +1087,7 @@
      map.put("items", items);
      //定制方
      BusinessCustomer customer = businessCustomerMapper.selectById(contract.getPartyAId());
      map.put("companyName", customer.getCompanyName());
      map.put("companyName", customer.getRegisterName());
      map.put("legalPerson", customer.getLegalPerson());
      map.put("contactPhone", customer.getContactPhone());
      map.put("bankName", customer.getBankName());
@@ -1148,6 +1147,8 @@
      Map<String,Object> map = new HashMap<>();
      map.put("contractId",contract.getId());
      map.put("contractName",contract.getContractName());
      map.put("partyA",contract.getPartyA());
      map.put("partyB",contract.getPartyB());
      map.put("delayDay",dto.getDelayDay());
      map.put("applyName",SecurityUtils.getUser().getUsername());
      map.put("applyTime",DateUtil.format(delayOut.getApplyTime(),DatePattern.NORM_DATETIME_FORMAT));
@@ -1165,7 +1166,13 @@
   @Override
   public Page pageScope(Page page, ContracQueryDTO queryDTO) {
      return baseMapper.pageScope(page,queryDTO, DataScope.of("comp_id"));
   }
   public static void main(String[] args) {
      System.out.println(DateUtil.beginOfQuarter(DateUtil.parseDate("2026-06-05")));
      System.out.println(DateUtil.endOfQuarter(DateUtil.parseDate("2026-09-30")));
      System.out.println(DateUtil.betweenMonth(DateUtil.beginOfQuarter(DateUtil.parseDate("2026-06-05")),
            DateUtil.endOfQuarter(DateUtil.parseDate("2026-09-30")),true));
   }
}