Resolved conflicts

This commit is contained in:
nisha
2024-11-25 00:04:57 +05:30
22 changed files with 310 additions and 112 deletions

View File

@@ -15,6 +15,7 @@ import net.gepafin.tendermanagement.model.request.FieldRequest;
import net.gepafin.tendermanagement.model.response.*;
import net.gepafin.tendermanagement.repositories.*;
import net.gepafin.tendermanagement.service.ApplicationService;
import net.gepafin.tendermanagement.service.AssignedApplicationsService;
import net.gepafin.tendermanagement.service.CallService;
import net.gepafin.tendermanagement.service.UserService;
import net.gepafin.tendermanagement.util.DateTimeUtil;
@@ -83,12 +84,15 @@ public class ApplicationEvaluationDao {
@Autowired
private FormDao formDao;
@Autowired
private AssignedApplicationsService assignedApplicationsService;
private ApplicationEvaluationEntity convertToEntity(UserEntity user, ApplicationEvaluationRequest req, Long assignedApplciationId) {
ApplicationEvaluationEntity entity = new ApplicationEvaluationEntity();
AssignedApplicationsEntity assignedApplications = assignedApplicationsRepository.findByIdAndIsDeletedFalse(assignedApplciationId).orElse(null);
AssignedApplicationsEntity assignedApplications = assignedApplicationsService.validateAssignedApplication(assignedApplciationId);
ApplicationEntity application = applicationService.validateApplication(assignedApplications.getApplication().getId());
entity.setApplicationId(application.getId());
entity.setAssignedApplicationsEntity(assignedApplications);
@@ -97,6 +101,7 @@ public class ApplicationEvaluationDao {
entity.setChecklist(Utils.convertObjectToJson(req.getChecklist()));
entity.setFile(Utils.convertObjectToJson(req.getFiles()));
entity.setNote(req.getNote());
entity.setMotivation(req.getMotivation());
entity.setIsDeleted(false);
entity.setInitialDays(30L);
entity.setRemainingDays(30L);
@@ -133,6 +138,7 @@ public class ApplicationEvaluationDao {
AssignedApplicationsEntity assignedApplications = assignedApplicationsRepository.findByIdAndIsDeletedFalse(entity.getAssignedApplicationsEntity().getId()).orElse(null);
response.setAssignedApplicationId(assignedApplications.getId());
response.setNote(entity.getNote());
response.setMotivation(entity.getMotivation());
response.setStatus(ApplicationEvaluationStatusTypeEnum.valueOf(entity.getStatus()));
response.setEvaluationEndDate(entity.getEndDate());
response.setCreatedDate(entity.getCreatedDate());
@@ -257,19 +263,21 @@ public class ApplicationEvaluationDao {
List<DocumentResponseBean> documentResponseBeans = new ArrayList<>();
for (String docId : documentIds) {
Long documentId = Long.valueOf(docId.trim());
documentRepository.findByIdAndNotDeleted(documentId).ifPresent(documentEntity -> {
DocumentResponseBean responseBean = new DocumentResponseBean();
responseBean.setId(documentEntity.getId());
responseBean.setName(documentEntity.getFileName());
responseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
responseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
responseBean.setSourceId(documentEntity.getSourceId());
responseBean.setFilePath(documentEntity.getFilePath());
responseBean.setCreatedDate(documentEntity.getCreatedDate());
responseBean.setUpdatedDate(documentEntity.getUpdatedDate());
documentResponseBeans.add(responseBean);
});
if (Boolean.FALSE.equals(docId.isEmpty())){
Long documentId = Long.valueOf(docId.trim());
documentRepository.findByIdAndNotDeleted(documentId).ifPresent(documentEntity -> {
DocumentResponseBean responseBean = new DocumentResponseBean();
responseBean.setId(documentEntity.getId());
responseBean.setName(documentEntity.getFileName());
responseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
responseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
responseBean.setSourceId(documentEntity.getSourceId());
responseBean.setFilePath(documentEntity.getFilePath());
responseBean.setCreatedDate(documentEntity.getCreatedDate());
responseBean.setUpdatedDate(documentEntity.getUpdatedDate());
documentResponseBeans.add(responseBean);
});
}
}
mappedField.setFieldValue(documentResponseBeans);
}
@@ -359,19 +367,21 @@ public class ApplicationEvaluationDao {
List<DocumentResponseBean> documentResponseBeans = new ArrayList<>();
for (String docId : documentIds) {
Long documentId = Long.valueOf(docId.trim());
documentRepository.findByIdAndNotDeleted(documentId).ifPresent(documentEntity -> {
DocumentResponseBean responseBean = new DocumentResponseBean();
responseBean.setId(documentEntity.getId());
responseBean.setName(documentEntity.getFileName());
responseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
responseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
responseBean.setSourceId(documentEntity.getSourceId());
responseBean.setFilePath(documentEntity.getFilePath());
responseBean.setCreatedDate(documentEntity.getCreatedDate());
responseBean.setUpdatedDate(documentEntity.getUpdatedDate());
documentResponseBeans.add(responseBean);
});
if (Boolean.FALSE.equals(docId.isEmpty())){
Long documentId = Long.valueOf(docId.trim());
documentRepository.findByIdAndNotDeleted(documentId).ifPresent(documentEntity -> {
DocumentResponseBean responseBean = new DocumentResponseBean();
responseBean.setId(documentEntity.getId());
responseBean.setName(documentEntity.getFileName());
responseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
responseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
responseBean.setSourceId(documentEntity.getSourceId());
responseBean.setFilePath(documentEntity.getFilePath());
responseBean.setCreatedDate(documentEntity.getCreatedDate());
responseBean.setUpdatedDate(documentEntity.getUpdatedDate());
documentResponseBeans.add(responseBean);
});
}
}
fieldResponse.setFileDetail(documentResponseBeans);
@@ -436,6 +446,7 @@ public class ApplicationEvaluationDao {
entity.setFile(Utils.convertObjectToJson(filterNonNullFields(processField(entity, req))));
entity.setIsDeleted(false);
setIfUpdated(entity::getNote, entity::setNote, req.getNote());
setIfUpdated(entity::getMotivation, entity::setMotivation, req.getMotivation());
} else {
entity = convertToEntity(user, req, assignedApplicationId);
}
@@ -635,6 +646,7 @@ public class ApplicationEvaluationDao {
response.setApplicationId(application.getId());
response.setAssignedApplicationId(assignedApplications.getId());
response.setNote(null);
response.setMotivation(null);
response.setApplicationStatus(ApplicationStatusTypeEnum.valueOf(application.getStatus()));
response.setStatus(ApplicationEvaluationStatusTypeEnum.valueOf(ApplicationEvaluationStatusTypeEnum.OPEN.getValue()));
response.setMinScore(call.getThreshold()!=null?call.getThreshold():null);
@@ -896,19 +908,21 @@ public class ApplicationEvaluationDao {
List<DocumentResponseBean> documentResponseBeans = new ArrayList<>();
for (String docId : documentIds) {
Long documentId = Long.valueOf(docId.trim());
documentRepository.findByIdAndNotDeleted(documentId).ifPresent(documentEntity -> {
DocumentResponseBean responseBean = new DocumentResponseBean();
responseBean.setId(documentEntity.getId());
responseBean.setName(documentEntity.getFileName());
responseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
responseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
responseBean.setSourceId(documentEntity.getSourceId());
responseBean.setFilePath(documentEntity.getFilePath());
responseBean.setCreatedDate(documentEntity.getCreatedDate());
responseBean.setUpdatedDate(documentEntity.getUpdatedDate());
documentResponseBeans.add(responseBean);
});
if (Boolean.FALSE.equals(docId.isEmpty())) {
Long documentId = Long.valueOf(docId.trim());
documentRepository.findByIdAndNotDeleted(documentId).ifPresent(documentEntity -> {
DocumentResponseBean responseBean = new DocumentResponseBean();
responseBean.setId(documentEntity.getId());
responseBean.setName(documentEntity.getFileName());
responseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
responseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
responseBean.setSourceId(documentEntity.getSourceId());
responseBean.setFilePath(documentEntity.getFilePath());
responseBean.setCreatedDate(documentEntity.getCreatedDate());
responseBean.setUpdatedDate(documentEntity.getUpdatedDate());
documentResponseBeans.add(responseBean);
});
}
}
fieldResponse.setFileDetail(documentResponseBeans);
@@ -1254,21 +1268,22 @@ public class ApplicationEvaluationDao {
List<DocumentResponseBean> documentResponseBeans = new ArrayList<>();
for (String docId : documentIds) {
Long documentId = Long.valueOf(docId.trim());
documentRepository.findByIdAndNotDeleted(documentId).ifPresent(documentEntity -> {
DocumentResponseBean responseBean = new DocumentResponseBean();
responseBean.setId(documentEntity.getId());
responseBean.setName(documentEntity.getFileName());
responseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
responseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
responseBean.setSourceId(documentEntity.getSourceId());
responseBean.setFilePath(documentEntity.getFilePath());
responseBean.setCreatedDate(documentEntity.getCreatedDate());
responseBean.setUpdatedDate(documentEntity.getUpdatedDate());
documentResponseBeans.add(responseBean);
});
if (Boolean.FALSE.equals(docId.isEmpty())){
Long documentId = Long.valueOf(docId.trim());
documentRepository.findByIdAndNotDeleted(documentId).ifPresent(documentEntity -> {
DocumentResponseBean responseBean = new DocumentResponseBean();
responseBean.setId(documentEntity.getId());
responseBean.setName(documentEntity.getFileName());
responseBean.setType(DocumentTypeEnum.valueOf(documentEntity.getType()));
responseBean.setSource(DocumentSourceTypeEnum.valueOf(documentEntity.getSource()));
responseBean.setSourceId(documentEntity.getSourceId());
responseBean.setFilePath(documentEntity.getFilePath());
responseBean.setCreatedDate(documentEntity.getCreatedDate());
responseBean.setUpdatedDate(documentEntity.getUpdatedDate());
documentResponseBeans.add(responseBean);
});
}
}
fieldResponse.setFileDetail(documentResponseBeans);
fieldResponses.add(fieldResponse);
}