BAOLH
2025-05-09 f8dec6bfaef15f807d760ba0fde963498fbc78f3
eladmin-master/eladmin-system/src/main/java/me/zhengjie/modules/contract/service/impl/ContractServiceImpl.java
@@ -852,13 +852,13 @@
            if (oldSignYear.equals(newSignYear)) {
                contractNumber.append(resources.getContractNumber().substring(9, 14));
            } else {
                String companyCode = resources.getContractNumber().substring(0, 4);
                // 业绩年度(以签订日期为准)
                contractNumber.append(newSignYear);
                // 本公司当年编号(以签订日期为准)(因先存后改故排除本身数据)
                Long companySort = contractRepository.countContractSort(String.valueOf(calendar.get(Calendar.YEAR)), companyCode, resources.getContractId());
                contractNumber.append(String.format("%03d", (companySort == null ? 0L : companySort) + 1));
                // TODO:250115业务方提出修改为以创建日期为准
                contractNumber.append(resources.getContractNumber().substring(11, 14));
            }
            if (oldTrueContract.equals(newTrueContract)) {
                contractNumber.append(resources.getContractNumber().substring(14, 15));
            } else {
@@ -917,6 +917,8 @@
            calendar.setTime(resources.getSignDate());
            contractNumber.append(String.valueOf(calendar.get(Calendar.YEAR)).substring(2));
            // 本公司当年编号(以签订日期为准)(因先存后改故排除本身数据)
            // TODO:250115业务方提出修改为以创建日期为准
            calendar.setTime(resources.getCreateTime());
            Long companySort = contractRepository.countContractSort(String.valueOf(calendar.get(Calendar.YEAR)), companyCode, resources.getContractId());
            contractNumber.append(String.format("%03d", (companySort == null ? 0L : companySort) + 1));
            // 是否有真实合同
@@ -927,7 +929,6 @@
            }
            // 全部公司当年编号(以签订日期为准)(因先存后改故排除本身数据)
            // TODO:250115业务方提出修改为以创建日期为准
            calendar.setTime(resources.getCreateTime());
            Long allCompanySort = contractRepository.countAllContractSort(String.valueOf(calendar.get(Calendar.YEAR)), resources.getContractId());
            contractNumber.append(String.format("%04d", (allCompanySort == null ? 0L : allCompanySort) + 1));
@@ -1337,6 +1338,8 @@
                }
                if (checkRequiredColumn(row, "签订日期", rowNum, errorMap)) {
                    contract.setSignDate(Timestamp.valueOf(row.get("签订日期").toString()));
                    // 业绩日期按照签订日期填充
                    contract.setPerformanceDate(Timestamp.valueOf(row.get("签订日期").toString()));
                }
                if (checkRequiredColumn(row, "起始日期", rowNum, errorMap)) {
                    contract.setStartDate(Timestamp.valueOf(row.get("起始日期").toString()));
@@ -1932,7 +1935,6 @@
                    annualData.put(String.valueOf(year), currentMap);
                }
                for (Contract incomeContract : incomeContractList) {
                    // 支付统计(当前合同)
                    BigDecimal currentContractAmount = incomeContract.getContractAmount() != null ? incomeContract.getContractAmount() : new BigDecimal(0);
@@ -1949,7 +1951,7 @@
                    }
                    // 年度内统计
                    calendar.setTime(incomeContract.getSignDate());
                    calendar.setTime(incomeContract.getPerformanceDate());
                    Integer year = calendar.get(Calendar.YEAR);
                    Integer month = calendar.get(Calendar.MONTH) + 1;