diff --git a/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/dao/xml/ChildCareFeeDetailMapper.xml b/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/dao/xml/ChildCareFeeDetailMapper.xml index 343d82ac37e909a0fe7e1fb365083d64c241d200..23a45b3f9cf762b395d36028a7cd2d5967ccecec 100644 --- a/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/dao/xml/ChildCareFeeDetailMapper.xml +++ b/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/dao/xml/ChildCareFeeDetailMapper.xml @@ -21,7 +21,8 @@ AND a.grant_id=#{grantId} resultType="com.seasky.nurseryFeesclaims.web.dto.result.ChildCareFeeDetailResult"> SELECT a.*, b.grant_year_month FROM tb_childcarefee_detail a - LEFT JOIN tb_childcarefee_grant b on a.grant_id = b.id AND b.available = 'YES' + JOIN tb_childcarefee_grant b on a.grant_id = b.id AND b.available = 'YES' + JOIN tb_childcarefee_apply c ON c.id = a.apply_id AND c.available = 'YES' WHERE a.apply_id = #{queryRequest.applyId} AND a.available = 'YES' <if test="queryRequest.applyYearMonthStart != null"> @@ -35,10 +36,8 @@ AND a.grant_id=#{grantId} resultType="com.seasky.nurseryFeesclaims.web.dto.result.ChildCareFeeDetailResult"> SELECT a.*, b.grant_year_month FROM tb_childcarefee_detail a - JOIN tb_childcarefee_grant b on a.grant_id = b.id AND b.available = 'YES' + LEFT JOIN tb_childcarefee_grant b on a.grant_id = b.id AND b.available = 'YES' WHERE a.apply_id = #{queryRequest.applyId} AND a.available = 'YES' </select> - - </mapper> \ No newline at end of file diff --git a/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/service/ChildCareFeeApplyServiceImpl.java b/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/service/ChildCareFeeApplyServiceImpl.java index 04e9475d6a7f7f17b7a6814a376f9fa73888a03d..dbf6479874a784abce9b5a7bd4f76d8b5164600c 100644 --- a/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/service/ChildCareFeeApplyServiceImpl.java +++ b/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/service/ChildCareFeeApplyServiceImpl.java @@ -403,13 +403,16 @@ public class ChildCareFeeApplyServiceImpl extends AbstractService<ChildCareFeeAp if (!Objects.isNull(detailIdList) && detailIdList.size() > 0) { childCareFeeDetailMapper.delete(new QueryWrapper<ChildCareFeeDetailEntity>().eq("apply_id", childCareFeeApplyRequest.getId()).eq("type", ChildCareFeeDetailTypeEnum.鍙戠エ.getKey()).notIn("id", detailIdList)); } - List<ChildCareFeeDetailEntity> FeeDetailEntitys = childCareFeeDetailMapper.selectList(new QueryWrapper<ChildCareFeeDetailEntity>().eq("apply_id", childCareFeeApplyRequest.getId())); - FeeDetailEntitys.stream().forEach(f -> { - String formatYearMonth = formatter.format(f.getApplyYearMonth()); - if (setYearMonth.contains(formatYearMonth)) { - throw ExceptionUtil.getException(null, "璇ョ敵璇峰凡瀛樺湪鐢虫姤骞存湀" + formatYearMonth); - } - }); + List<String> addYearMonth = childCareFeeApplyRequest.getChildCareFeeDetailRequestList().stream().filter(f -> f.getId() != null).map(ChildCareFeeDetailRequest::getApplyYearMonth).map(yearMonth -> formatter.format(yearMonth)).collect(Collectors.toList()); + if (!Objects.isNull(addYearMonth) && addYearMonth.size() > 0) { + List<ChildCareFeeDetailEntity> FeeDetailEntitys = childCareFeeDetailMapper.selectList(new QueryWrapper<ChildCareFeeDetailEntity>().eq("apply_id", childCareFeeApplyRequest.getId())); + FeeDetailEntitys.stream().forEach(f -> { + String formatYearMonth = formatter.format(f.getApplyYearMonth()); + if (addYearMonth.contains(formatYearMonth)) { + throw ExceptionUtil.getException(null, "璇ョ敵璇峰凡瀛樺湪鐢虫姤骞存湀" + formatYearMonth); + } + }); + } Calendar applyYearMonthCalendar = Calendar.getInstance(); for (int i = 0; i < childCareFeeApplyRequest.getChildCareFeeDetailRequestList().size(); i++) { ChildCareFeeDetailRequest childCareFeeDetailRequest = childCareFeeApplyRequest.getChildCareFeeDetailRequestList().get(i); diff --git a/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/service/ChildCareFeeDetailServiceImpl.java b/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/service/ChildCareFeeDetailServiceImpl.java index afc8d78c95e7f465cc2e6b2cc002ce558cb00d6e..4aefb845314f672336d242b31ad74e2adf5d41dd 100644 --- a/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/service/ChildCareFeeDetailServiceImpl.java +++ b/ServiceSiteCommon/src/main/java/com/seasky/nurseryFeesclaims/business/service/ChildCareFeeDetailServiceImpl.java @@ -152,14 +152,17 @@ public class ChildCareFeeDetailServiceImpl extends AbstractService<ChildCareFeeD if (listYearMonth.size() != setYearMonth.size()) { throw ExceptionUtil.getException(null, "鐢虫姤骞存湀涓嶈兘閲嶅"); } - List<ChildCareFeeDetailEntity> detailEntityList = this.mapper.selectList(new QueryWrapper<ChildCareFeeDetailEntity>().eq("apply_id", childCareFeeDetailHandSaveRequest.getApplyId())); - if (null != detailEntityList && !detailEntityList.isEmpty()) { - List<String> yearMonths = detailEntityList.stream().map(ChildCareFeeDetailEntity::getApplyYearMonth).map(yearMonth -> formatter.format(yearMonth)).collect(Collectors.toList()); - setYearMonth.stream().forEach(yearMonth -> { - if (yearMonths.contains(yearMonth)) { - throw ExceptionUtil.getException(null, "璇ョ敵璇峰凡瀛樺湪鐢虫姤骞存湀" + yearMonth); - } - }); + List<String> addYearMonth = childCareFeeDetailHandSaveRequest.getChildCareFeeDetailRequestList().stream().filter(f -> f.getId() == null).map(ChildCareFeeDetailRequest::getApplyYearMonth).map(yearMonth -> formatter.format(yearMonth)).collect(Collectors.toList()); + if (!Objects.isNull(addYearMonth) && addYearMonth.size() > 0) { + List<ChildCareFeeDetailEntity> detailEntityList = this.mapper.selectList(new QueryWrapper<ChildCareFeeDetailEntity>().eq("apply_id", childCareFeeDetailHandSaveRequest.getApplyId())); + if (null != detailEntityList && !detailEntityList.isEmpty()) { + List<String> yearMonths = detailEntityList.stream().map(ChildCareFeeDetailEntity::getApplyYearMonth).map(yearMonth -> formatter.format(yearMonth)).collect(Collectors.toList()); + addYearMonth.stream().forEach(yearMonth -> { + if (yearMonths.contains(yearMonth)) { + throw ExceptionUtil.getException(null, "璇ョ敵璇峰凡瀛樺湪鐢虫姤骞存湀" + yearMonth); + } + }); + } } int claimsMonth = 0; try {