| Line 20... |
Line 20... |
| 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.NotificationService;
|
23 |
import com.spice.profitmandi.service.NotificationService;
|
| 24 |
import com.spice.profitmandi.service.user.RetailerService;
|
24 |
import com.spice.profitmandi.service.user.RetailerService;
|
| - |
|
25 |
import com.spice.profitmandi.service.wallet.WalletService;
|
| 25 |
import com.spice.profitmandi.service.whatsapp.WhatsappMessageType;
|
26 |
import com.spice.profitmandi.service.whatsapp.WhatsappMessageType;
|
| - |
|
27 |
import in.shop2020.model.v1.order.WalletReferenceType;
|
| 26 |
import org.apache.logging.log4j.LogManager;
|
28 |
import org.apache.logging.log4j.LogManager;
|
| 27 |
import org.apache.logging.log4j.Logger;
|
29 |
import org.apache.logging.log4j.Logger;
|
| 28 |
import org.springframework.beans.factory.annotation.Autowired;
|
30 |
import org.springframework.beans.factory.annotation.Autowired;
|
| 29 |
import org.springframework.mail.javamail.JavaMailSender;
|
31 |
import org.springframework.mail.javamail.JavaMailSender;
|
| 30 |
import org.springframework.stereotype.Component;
|
32 |
import org.springframework.stereotype.Component;
|
| Line 60... |
Line 62... |
| 60 |
private UserAccountRepository userAccountRepository;
|
62 |
private UserAccountRepository userAccountRepository;
|
| 61 |
@Autowired
|
63 |
@Autowired
|
| 62 |
private FofoStoreRepository fofoStoreRepository;
|
64 |
private FofoStoreRepository fofoStoreRepository;
|
| 63 |
@Autowired
|
65 |
@Autowired
|
| 64 |
private RetailerService retailerService;
|
66 |
private RetailerService retailerService;
|
| - |
|
67 |
@Autowired
|
| - |
|
68 |
private WalletService walletService;
|
| 65 |
|
69 |
|
| 66 |
@Override
|
70 |
@Override
|
| 67 |
public ProfitMandiConstants.BID_ENUM sendMailToRBM(double netAmountInHand, double totalPayableAmount, int fofoId) throws Exception {
|
71 |
public ProfitMandiConstants.BID_ENUM sendMailToRBM(double netAmountInHand, double totalPayableAmount, int fofoId) throws Exception {
|
| 68 |
User user = userRepository.selectById(fofoId);
|
72 |
User user = userRepository.selectById(fofoId);
|
| 69 |
int rbmId = csService.getAuthUserId(ProfitMandiConstants.TICKET_CATEGORY_RBM, EscalationType.L1, fofoId);
|
73 |
int rbmId = csService.getAuthUserId(ProfitMandiConstants.TICKET_CATEGORY_RBM, EscalationType.L1, fofoId);
|
| Line 72... |
Line 76... |
| 72 |
String[] ccTo;
|
76 |
String[] ccTo;
|
| 73 |
if (authUser == null){
|
77 |
if (authUser == null){
|
| 74 |
emailTo = new String[] { "sdtech@smartdukaan.com", "mohit.gulati@smartdukaan.com", "manish.gupta1@smartdukaan.com", "sourcing@smartdukaan.com" };
|
78 |
emailTo = new String[] { "sdtech@smartdukaan.com", "mohit.gulati@smartdukaan.com", "manish.gupta1@smartdukaan.com", "sourcing@smartdukaan.com" };
|
| 75 |
ccTo = new String[]{};
|
79 |
ccTo = new String[]{};
|
| 76 |
} else {
|
80 |
} else {
|
| 77 |
emailTo = new String[] { user.getEmailId(), "sdtech@smartdukaan.com" };
|
81 |
emailTo = new String[] { user.getEmailId(), "sdtech@smartdukaan.com", "sourcing@smartdukaan.com" };
|
| 78 |
ccTo = new String[]{authUser.getEmailId()};
|
82 |
ccTo = new String[]{authUser.getEmailId()};
|
| 79 |
}
|
83 |
}
|
| 80 |
|
84 |
|
| 81 |
String subject = "Dispatch On Hold(Bidding)";
|
85 |
String subject = "Dispatch On Hold(Bidding)";
|
| 82 |
String message = String.format(
|
86 |
String message = String.format(
|
| Line 327... |
Line 331... |
| 327 |
+ sb.toString();
|
331 |
+ sb.toString();
|
| 328 |
|
332 |
|
| 329 |
Utils.sendMailWithAttachments(mailSender, emailTo, null, subject, message);
|
333 |
Utils.sendMailWithAttachments(mailSender, emailTo, null, subject, message);
|
| 330 |
}
|
334 |
}
|
| 331 |
|
335 |
|
| - |
|
336 |
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)){
|
| - |
|
338 |
String reason = "Amount refunded advance security for "+bid.getItemName()+" bid";
|
| - |
|
339 |
walletService.addAmountToWallet(bid.getFofoId(),bid.getId(), WalletReferenceType.ADVANCE_REVERSAL,reason,ProfitMandiConstants.BID_CHARGES,LocalDateTime.now());
|
| - |
|
340 |
}
|
| - |
|
341 |
}
|
| - |
|
342 |
|
| 332 |
}
|
343 |
}
|