private void populateIsRejectionAllowed(OrderLine orderLine,OrderHeader orderHeader) {…
- User
private void populateIsRejectionAllowed(OrderLine orderLine,OrderHeader orderHeader) { //If the return reasons are matching "RPC000006", "RPC000007", "RPC000012" then set the value as N if(IGNORE_PRIMARY_REFUND_REJECTION_REASON.contains(orderLine.getPrimaryReturnReasonCode()) && isEmailValid(orderHeader.getCustomerEmail())){ orderLine.setIsRejectionAllowed("N"); } }.....update above code use this public String getConfigValueForIsRejectAllowed(String configKey) { Query query = new Query(); query.addCriteria(Criteria.where("key").is(configKey)); Config config = mongoTemplate.findOne(query, Config.class); // Return the value associated with the "value" field in the matched document return config != null ? config.getValue() : null; }
- Assistant
private void populateIsRejectionAllowed(OrderLine orderLine,OrderHeader orderHeader) { //If the return reasons are matching "RPC000006", "RPC000007", "RPC000012" then set the value as N if(IGNORE_PRIMARY_REFUND_REJECTION_REASON.contains(orderLine.getPrimaryReturnReasonCode()) && isEmailValid(orderHeader.getCustomerEmail())){ // Get the config value for isRejectionAllowed String isRejectionAllowedConfig = getConfigValueForIsRejectAllowed("isRejectionAllowed");
codeorderLine.setIsRejectionAllowed(isRejectionAllowedConfig); } }public String getConfigValueForIsRejectAllowed(String configKey) { Query query = new Query(); query.addCriteria(Criteria.where("key").is(configKey)); Config config = mongoTemplate.findOne(query, Config.class); // Return the value associated with the "value" field in the matched document return config != null ? config.getValue() : null; }