diff --git a/mcts/src/main/java/org/motechproject/nms/mcts/service/impl/MctsWsImportServiceImpl.java b/mcts/src/main/java/org/motechproject/nms/mcts/service/impl/MctsWsImportServiceImpl.java index 9a1737f0c..52f3b0c58 100644 --- a/mcts/src/main/java/org/motechproject/nms/mcts/service/impl/MctsWsImportServiceImpl.java +++ b/mcts/src/main/java/org/motechproject/nms/mcts/service/impl/MctsWsImportServiceImpl.java @@ -250,7 +250,7 @@ public MctsImportAudit saveImportedMothersData(MothersDataSet mothersDataSet, St MotherImportRejection motherImportRejection; for (Map record : rejectedMotherRecords) { action = (String) record.get(KilkariConstants.ACTION); - LOGGER.error("Existing Mother Record with same MSISDN in the data set"); + LOGGER.debug("Existing Mother Record with same MSISDN in the data set"); motherImportRejection = motherRejectionMcts(convertMapToMother(record), false, RejectionReasons.DUPLICATE_MOBILE_NUMBER_IN_DATASET.toString(), action); rejectedMothers.put(motherImportRejection.getIdNo(), motherImportRejection); rejectionStatus.put(motherImportRejection.getIdNo(), motherImportRejection.getAccepted()); @@ -593,7 +593,7 @@ private MctsImportAudit saveImportedAnmAshaData(AnmAshaDataSet anmAshaDataSet, S for (AnmAshaRecord record : rejectedAshaRecords) { record.setStateId(stateCode); action = this.flwActionFinder(record); - LOGGER.error("Existing Asha Record with same MSISDN in the data set"); + LOGGER.debug("Existing Asha Record with same MSISDN in the data set"); flwRejectionService.createUpdate(flwRejectionMcts(record, false, RejectionReasons.DUPLICATE_MOBILE_NUMBER_IN_DATASET.toString(), action)); rejected++; } diff --git a/rch/src/main/java/org/motechproject/nms/rch/service/impl/RchWebServiceFacadeImpl.java b/rch/src/main/java/org/motechproject/nms/rch/service/impl/RchWebServiceFacadeImpl.java index 61ae1c83f..95eecda73 100644 --- a/rch/src/main/java/org/motechproject/nms/rch/service/impl/RchWebServiceFacadeImpl.java +++ b/rch/src/main/java/org/motechproject/nms/rch/service/impl/RchWebServiceFacadeImpl.java @@ -139,6 +139,7 @@ public class RchWebServiceFacadeImpl implements RchWebServiceFacade { private static final String LOCAL_RESPONSE_DIR = "rch.local_response_dir"; private static final String REMOTE_RESPONSE_DIR = "rch.remote_response_dir"; private static final String REMOTE_RESPONSE_DIR_CSV = "rch.remote_response_dir_csv"; + private static final String REMOTE_RESPONSE_DIR_XML = "rch.remote_response_dir_xml"; private static final String LOC_UPDATE_DIR_RCH = "rch.loc_update_dir"; private static final String REMOTE_RESPONSE_DIR_LOCATION = "rch.remote_response_dir_locations"; private static final String NULL = "NULL"; @@ -615,7 +616,7 @@ private RchImportAudit saveImportedMothersData(RchMothersDataSet mothersDataSet, for (Map record : rejectedRchMothers) { action = (String) record.get(KilkariConstants.ACTION); - LOGGER.error("Existing Mother Record with same MSISDN in the data set"); + LOGGER.debug("Existing Mother Record with same MSISDN in the data set"); motherImportRejection = motherRejectionRch(convertMapToRchMother(record), false, RejectionReasons.DUPLICATE_MOBILE_NUMBER_IN_DATASET.toString(), action); rejectedMothers.put(motherImportRejection.getRegistrationNo(), motherImportRejection); rejectionStatus.put(motherImportRejection.getRegistrationNo(), motherImportRejection.getAccepted()); @@ -847,7 +848,7 @@ private RchImportAudit saveImportedAshaData(RchAnmAshaDataSet anmAshaDataSet, St String action = ""; for (RchAnmAshaRecord record : rejectedRchAshas) { action = this.rchFlwActionFinder(record); - LOGGER.error("Existing Asha Record with same MSISDN in the data set"); + LOGGER.debug("Existing Asha Record with same MSISDN in the data set"); flwRejectionService.createUpdate(flwRejectionRch(record, false, RejectionReasons.DUPLICATE_MOBILE_NUMBER_IN_DATASET.toString(), action)); } List acceptedRchAshas = rchAshaRecordsSet.get(1); @@ -884,7 +885,7 @@ private RchImportAudit saveImportedAshaData(RchAnmAshaDataSet anmAshaDataSet, St flwRejectionService.createUpdate(flwRejectionRch(record, false, RejectionReasons.INVALID_LOCATION.toString(), action)); rejected++; } catch (FlwImportException e) { - LOGGER.error("Existing FLW with same MSISDN but different RCH ID", e); + LOGGER.debug("Existing FLW with same MSISDN but different RCH ID", e); flwRejectionService.createUpdate(flwRejectionRch(record, false, RejectionReasons.MOBILE_NUMBER_ALREADY_IN_USE.toString(), action)); rejected++; } catch (FlwExistingRecordException e) { @@ -1093,6 +1094,10 @@ private File fileForLocUpdate(String fileName) { return new File(remoteResponseFile(fileName)); } + private File fileForXmlLocUpdate(String fileName) { + return new File(remoteResponseFileForXml(fileName)); + } + public String localResponseFile(String file) { String localFile = settingsFacade.getProperty(LOCAL_RESPONSE_DIR); localFile += localFile.endsWith("/") ? "" : "/"; @@ -1107,6 +1112,13 @@ public String remoteResponseFile(String file) { return remoteFile; } + public String remoteResponseFileForXml(String file) { + String remoteFile = settingsFacade.getProperty(REMOTE_RESPONSE_DIR_XML); + remoteFile += remoteFile.endsWith("/") ? "" : "/"; + remoteFile += file; + return remoteFile; + } + private Long getScpTimeout() { try { return Long.parseLong(settingsFacade.getProperty(SCP_TIMEOUT_SETTING)); @@ -1247,7 +1259,7 @@ public int compare(RchImportFacilitator m1, RchImportFacilitator m2) { for (RchImportFacilitator rchImportFile : rchImportFiles ) { - File remoteResponseFile = fileForLocUpdate(rchImportFile.getFileName()); + File remoteResponseFile = fileForXmlLocUpdate(rchImportFile.getFileName()); if (remoteResponseFile.exists() && !remoteResponseFile.isDirectory()) { diff --git a/rch/src/main/resources/rch.properties b/rch/src/main/resources/rch.properties index c95a3731e..c804d9005 100644 --- a/rch/src/main/resources/rch.properties +++ b/rch/src/main/resources/rch.properties @@ -40,6 +40,9 @@ rch.local_response_dir=/usr/local/RCH/rch-records-local #remote directory where RCH response file should be copied to rch.remote_response_dir=/usr/local/RCH/rch-records-remote +#remote directory where RCH response file should be copied to +rch.remote_response_dir_xml =/usr/local/RCH/rch-records-remote/xml + #remote directory where RCH response file should be copied to rch.remote_response_dir_csv =/usr/local/RCH/rch-records-remote/csv