Skip to content

Commit

Permalink
fix message createAt
Browse files Browse the repository at this point in the history
  • Loading branch information
Laki Sik committed Sep 20, 2016
1 parent 5a1834e commit d2c150c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/ahancer/rr/services/CampaignService.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import java.util.Arrays;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.Set;
Expand Down Expand Up @@ -180,6 +181,7 @@ public CampaignRequest updateCampaignByBrand(Long campaignId, CampaignRequest re
ProposalMessage robotMessage = new ProposalMessage();
String message = messageSource.getMessage("robot.campaign.message", null, locale).replace("{{Brand Name}}", user.getBrand().getBrandName());
robotMessage.setMessage(message);
robotMessage.setCreatedAt(new Date());
User robotUser = robotService.getRobotUser();
for(Proposal proposal : proposalList) {
robotMessage.setProposal(proposal);
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/com/ahancer/rr/services/ProposalService.java
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,7 @@ public Proposal createCampaignProposalByInfluencer(Long campaignId, Proposal pro
firstMessage.setMessage(proposal.getDescription());
firstMessage.setProposal(proposal);
firstMessage.setUserId(influecnerId);
firstMessage.setCreatedAt(new Date());
firstMessage = proposalMessageDao.save(firstMessage);
String to = campaign.getBrand().getUser().getEmail();
String subject = messageSource.getMessage("email.brand.new.proposal.subject",null,locale);
Expand Down Expand Up @@ -317,6 +318,7 @@ public Proposal updateCampaignProposalByInfluencer(Long proposalId, Proposal pro
rebotMessage.setProposal(proposal);
User robotUser = robotService.getRobotUser();
rebotMessage.setUserId(robotUser.getUserId());
rebotMessage.setCreatedAt(new Date());
rebotMessage = proposalMessageDao.save(rebotMessage);
oldProposal = proposalDao.save(oldProposal);
rebotMessage.setUser(robotUser);
Expand All @@ -331,6 +333,7 @@ public Proposal updateProposalStatusByBrand(Long proposalId,ProposalStatus statu
oldProposal.setStatus(status);

ProposalMessage rebotMessage = new ProposalMessage();
rebotMessage.setCreatedAt(new Date());
rebotMessage.setIsBrandRead(true);
rebotMessage.setIsInfluencerRead(true);
Calendar cal = Calendar.getInstance();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ public Transaction confirmTransaction(Long transactioId, Locale locale) throws E
//update proposal status
Calendar cal = Calendar.getInstance();
ProposalMessage robotMessage = new ProposalMessage();
robotMessage.setCreatedAt(new Date());
String message = messageSource.getMessage("robot.proposal.working.status.message", null, locale)
.replace("{{Brand Name}}", transaction.getUser().getBrand().getBrandName());
User robotUser = robotService.getRobotUser();
Expand Down

0 comments on commit d2c150c

Please sign in to comment.