compile right but many logic bugs

change the model of the apply and topic. Change all the summary and the
detail. Move ahead the logic to judge the duplicate apply of a same
topic.