
/**
* @author deepthip
*
*/
import de.hybris.platform.cronjob.enums.*
import de.hybris.platform.servicelayer.cronjob.PerformResult
import de.hybris.platform.servicelayer.search.*
import de.hybris.platform.servicelayer.model.*
import de.hybris.platform.core.model.user.CustomerModel;
import com.core.enums.SourceStatus;
flexibleSearchService = spring.getBean("flexibleSearchService")
modelService = spring.getBean("modelService")
query = "SELECT {item.PK} FROM {Customer AS item} WHERE {item.fromconfigregistration}= 1 or {item.fromdriveform}= 1 or {item.fromnewsletterform}= 1 or {item.fromcontactusform}= 1 ";
result = flexibleSearchService.search(query);
itempk = "";
for (item in result.getResult()) {
println item.getFromnewsletterform();
println item.getFromcontactusform();
println item.getFromconfigregistration();
println item.getFromdriveform();
if (item.getFromnewsletterform() == true)
{
item.getSource();
println item.getSource();
item.setSource(SourceStatus.WEBSITE_NEWSLETTER);
item.setFromnewsletterform(false);
println item;
}
if (item.getFromcontactusform() == true)
{
item.getSource();
println item.getSource();
item.setSource(SourceStatus.WEBSITE_CONTACTFORM);
item.setFromcontactusform(false);
println item;
}
if (item.getFromconfigregistration() == true)
{
item.getSource();
println item.getSource();
item.setSource(SourceStatus.WEBSITE_CONFIGURATION);
item.setFromconfigregistration(false);
println item;
}
if (item.getFromdriveform() == true)
{
item.getSource();
println item.getSource();
item.setSource(SourceStatus.WEBSITE_DRIVEFORM);
item.setFromdriveform(false);
println item;
}
modelService.save(item)
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.