Subversion Repositories SmartDukaan

Rev

Rev 34902 | Rev 36399 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 34902 Rev 35963
Line 18... Line 18...
18
import com.spice.profitmandi.dao.repository.cs.CsService;
18
import com.spice.profitmandi.dao.repository.cs.CsService;
19
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
19
import com.spice.profitmandi.dao.repository.dtr.FofoStoreRepository;
20
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
20
import com.spice.profitmandi.dao.repository.dtr.UserAccountRepository;
21
import com.spice.profitmandi.dao.repository.user.UserRepository;
21
import com.spice.profitmandi.dao.repository.user.UserRepository;
22
import com.spice.profitmandi.service.AuthService;
22
import com.spice.profitmandi.service.AuthService;
-
 
23
import com.spice.profitmandi.service.mail.MailOutboxService;
23
import com.spice.profitmandi.service.NotificationService;
24
import com.spice.profitmandi.service.NotificationService;
24
import com.spice.profitmandi.service.user.RetailerService;
25
import com.spice.profitmandi.service.user.RetailerService;
25
import com.spice.profitmandi.service.wallet.WalletService;
26
import com.spice.profitmandi.service.wallet.WalletService;
26
import com.spice.profitmandi.service.whatsapp.WhatsappMessageType;
27
import com.spice.profitmandi.service.whatsapp.WhatsappMessageType;
27
import in.shop2020.model.v1.order.WalletReferenceType;
28
import in.shop2020.model.v1.order.WalletReferenceType;
Line 47... Line 48...
47
    @Autowired
48
    @Autowired
48
    AuthService authService;
49
    AuthService authService;
49
    @Autowired
50
    @Autowired
50
    JavaMailSender mailSender;
51
    JavaMailSender mailSender;
51
    @Autowired
52
    @Autowired
-
 
53
    MailOutboxService mailOutboxService;
-
 
54
    @Autowired
52
    UserRepository userRepository;
55
    UserRepository userRepository;
53
    @Autowired
56
    @Autowired
54
    CsService csService;
57
    CsService csService;
55
    @Autowired
58
    @Autowired
56
    BidRepository bidRepository;
59
    BidRepository bidRepository;
Line 89... Line 92...
89
                    + "is on hold until the payment against the stock is received. Kindly <br>"
92
                    + "is on hold until the payment against the stock is received. Kindly <br>"
90
                    + "top up your wallet with an amount of Rs.%s to proceed with the dispatch.",
93
                    + "top up your wallet with an amount of Rs.%s to proceed with the dispatch.",
91
                user.getName(), user.getName(), totalPayableAmount, (totalPayableAmount - netAmountInHand)
94
                user.getName(), user.getName(), totalPayableAmount, (totalPayableAmount - netAmountInHand)
92
        );
95
        );
93
 
96
 
94
        Utils.sendMailWithAttachments(mailSender, emailTo, ccTo, subject, message);
97
        mailOutboxService.queueMail(emailTo, ccTo, subject, message, "BidServiceImpl.sendMailToRBM");
95
        return ProfitMandiConstants.BID_ENUM.PROCESSING;
98
        return ProfitMandiConstants.BID_ENUM.PROCESSING;
96
    }
99
    }
97
 
100
 
98
    @Override
101
    @Override
99
    public void sendSummaryMailToUserAndManagers(int userId, List<Bid> bids, Liquidation liquidation) throws Exception {
102
    public void sendSummaryMailToUserAndManagers(int userId, List<Bid> bids, Liquidation liquidation) throws Exception {
Line 106... Line 109...
106
            String subject = "Liquidation Report";
109
            String subject = "Liquidation Report";
107
            String message = "Dear Team,<br><br>"
110
            String message = "Dear Team,<br><br>"
108
                    + "Liquidation has been completed. Here is the summary:<br><br>"
111
                    + "Liquidation has been completed. Here is the summary:<br><br>"
109
                    + content;
112
                    + content;
110
 
113
 
111
            Utils.sendMailWithAttachments(mailSender, emailTo, ccTo, subject, message);
114
            mailOutboxService.queueMail(emailTo, ccTo, subject, message, "BidServiceImpl.sendSummaryMailToUserAndManagers");
112
        }
115
        }
113
    }
116
    }
114
 
117
 
115
    @Override
118
    @Override
116
    public void notifyPartner(int fofoId, Bid bid, ProfitMandiConstants.BID_ENUM status) throws Exception {
119
    public void notifyPartner(int fofoId, Bid bid, ProfitMandiConstants.BID_ENUM status) throws Exception {
Line 328... Line 331...
328
        String subject = "Liquidation Report";
331
        String subject = "Liquidation Report";
329
        String message = "Dear Team,<br><br>"
332
        String message = "Dear Team,<br><br>"
330
                + "<h3>Liquidation has been completed. Here is the summary:</h3><br><br>"
333
                + "<h3>Liquidation has been completed. Here is the summary:</h3><br><br>"
331
                + sb.toString();
334
                + sb.toString();
332
 
335
 
333
        Utils.sendMailWithAttachments(mailSender, emailTo, null, subject, message);
336
        mailOutboxService.queueMail(emailTo, null, subject, message, "BidServiceImpl.sendLiquidationReport");
334
    }
337
    }
335
 
338
 
336
    public void refundBidAmountToWallet(Bid bid, ProfitMandiConstants.BID_ENUM finalBidStatus) throws ProfitMandiBusinessException {
339
    public void refundBidAmountToWallet(Bid bid, ProfitMandiConstants.BID_ENUM finalBidStatus) throws ProfitMandiBusinessException {
337
        if (finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CLOSED) || finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CANCELLED)){
340
        if (finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CLOSED) || finalBidStatus.equals(ProfitMandiConstants.BID_ENUM.CANCELLED)){
338
            String reason = "Amount refunded advance security for "+bid.getItemName()+" bid";
341
            String reason = "Amount refunded advance security for "+bid.getItemName()+" bid";