[BO] 수정 반영
This commit is contained in:
@@ -43,8 +43,10 @@ class UpdateNoticeController {
|
||||
updateFilePortIn.operate(
|
||||
new UpdateFileCmd(
|
||||
reqVO.getId(),
|
||||
reqVO.getFileMappingId().stream().map(Long::parseLong).toList(),
|
||||
FileUploadType.NOTICE)
|
||||
reqVO.getFileMappingId() != null
|
||||
? reqVO.getFileMappingId().stream().map(Long::parseLong).toList()
|
||||
: List.of(),
|
||||
FileUploadType.NOTICE)
|
||||
);
|
||||
|
||||
updateNoticePortIn.operate(
|
||||
|
||||
@@ -10,19 +10,24 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
@Repository
|
||||
@RequiredArgsConstructor
|
||||
class SaveHouseholdVisitInfoDao implements SaveHouseholdVisitInfoPortOut {
|
||||
private final SaveHouseholdVisitInfoMapper mapper;
|
||||
private final SaveHouseholdVisitInfoMapper mapper;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void operate(SaveHouseholdVisitInfoCmd cmd) {
|
||||
if (cmd.getVisitInfoId() != null) {
|
||||
mapper.findById(cmd.getHouseholdSeq())
|
||||
.ifPresentOrElse(
|
||||
v -> mapper.updateHouseholdVisitInfo(AuditUtil.update(cmd)),
|
||||
() -> { throw new IllegalArgumentException("방문정보가 없습니다."); }
|
||||
);
|
||||
} else {
|
||||
mapper.createHouseholdVisitInfo(AuditUtil.create(cmd));
|
||||
@Override
|
||||
@Transactional
|
||||
public void operate(SaveHouseholdVisitInfoCmd cmd) {
|
||||
// 답례품 전달 완료일 경우 기존 방문들 중 true → false로 변경
|
||||
if (Boolean.TRUE.equals(cmd.getIsGiftSent())) {
|
||||
mapper.updateGiftSentToFalse(AuditUtil.update(cmd));
|
||||
}
|
||||
|
||||
if (cmd.getVisitInfoId() != null) {
|
||||
mapper.findById(cmd.getHouseholdSeq())
|
||||
.ifPresentOrElse(v -> mapper.updateHouseholdVisitInfo(AuditUtil.update(cmd)),
|
||||
() -> {
|
||||
throw new IllegalArgumentException("방문정보가 없습니다.");
|
||||
});
|
||||
} else {
|
||||
mapper.createHouseholdVisitInfo(AuditUtil.create(cmd));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -9,4 +9,6 @@ public interface SaveHouseholdVisitInfoMapper {
|
||||
Optional<Long> findById(Long id);
|
||||
void createHouseholdVisitInfo(SaveHouseholdVisitInfoCmd cmd);
|
||||
void updateHouseholdVisitInfo(SaveHouseholdVisitInfoCmd cmd);
|
||||
void updateGiftSentToFalse(SaveHouseholdVisitInfoCmd cmd);
|
||||
|
||||
}
|
||||
|
||||
@@ -67,6 +67,10 @@ public class ResearcherDao implements ResearcherPortOut {
|
||||
@Override
|
||||
@UpdateCommand
|
||||
public Integer updateVisitHousehold(ResearchersVisitDetailReqVO reqVO) {
|
||||
if(Boolean.TRUE.equals(reqVO.getIsGiftSent())) {
|
||||
researcherMapper.updateGiftSentToFalse(reqVO);
|
||||
}
|
||||
|
||||
return researcherMapper.updateVisitHousehold(reqVO);
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ public interface ResearcherMapper {
|
||||
List<ResearchersHouseholdVisitDto> visitHouseholdList(ResearchersDetailReqVO reqVO);
|
||||
ResearchersHouseholdVisitDto visitHouseholdDetail(Integer id);
|
||||
Long visitHouseholdListCountAll(ResearchersDetailReqVO reqVO);
|
||||
void updateGiftSentToFalse(ResearchersVisitDetailReqVO reqVO);
|
||||
Integer updateVisitHousehold(ResearchersVisitDetailReqVO reqVO);
|
||||
VisitHouseholdPercentageDto selectVisitHouseholdPercentage(ResearchersDetailReqVO reqVO);
|
||||
Integer visitHouseholdDelete(@Param("selectIds") List<Integer> selectIds,@Param("deletedBy") String deletedBy);
|
||||
|
||||
@@ -12,8 +12,9 @@ import java.time.LocalDateTime;
|
||||
@Setter
|
||||
public class ResearchersVisitDetailReqVO extends AuditCommand {
|
||||
private Integer id;
|
||||
private Long householdSeq;
|
||||
private LocalDate visitDate;
|
||||
private ManagementType managementType;
|
||||
private String content;
|
||||
private String isGiftSent;
|
||||
private Boolean isGiftSent;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user