| Line 7... |
Line 7... |
| 7 |
import com.spice.profitmandi.common.model.*;
|
7 |
import com.spice.profitmandi.common.model.*;
|
| 8 |
import com.spice.profitmandi.common.util.FileUtil;
|
8 |
import com.spice.profitmandi.common.util.FileUtil;
|
| 9 |
import com.spice.profitmandi.common.util.Utils;
|
9 |
import com.spice.profitmandi.common.util.Utils;
|
| 10 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
10 |
import com.spice.profitmandi.common.util.Utils.Attachment;
|
| 11 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
11 |
import com.spice.profitmandi.common.web.util.ResponseSender;
|
| - |
|
12 |
import com.spice.profitmandi.service.mail.MailOutboxService;
|
| 12 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
13 |
import com.spice.profitmandi.dao.entity.auth.AuthUser;
|
| 13 |
import com.spice.profitmandi.dao.entity.catalog.*;
|
14 |
import com.spice.profitmandi.dao.entity.catalog.*;
|
| 14 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
15 |
import com.spice.profitmandi.dao.entity.cs.Region;
|
| 15 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
16 |
import com.spice.profitmandi.dao.entity.fofo.*;
|
| 16 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCISTable;
|
17 |
import com.spice.profitmandi.dao.entity.inventory.SaholicCISTable;
|
| Line 124... |
Line 125... |
| 124 |
|
125 |
|
| 125 |
@Autowired
|
126 |
@Autowired
|
| 126 |
private JavaMailSender googleMailSender;
|
127 |
private JavaMailSender googleMailSender;
|
| 127 |
|
128 |
|
| 128 |
@Autowired
|
129 |
@Autowired
|
| - |
|
130 |
private MailOutboxService mailOutboxService;
|
| - |
|
131 |
|
| - |
|
132 |
@Autowired
|
| 129 |
private ResponseSender responseSender;
|
133 |
private ResponseSender responseSender;
|
| 130 |
|
134 |
|
| 131 |
@Autowired
|
135 |
@Autowired
|
| 132 |
private CookiesProcessor cookiesProcessor;
|
136 |
private CookiesProcessor cookiesProcessor;
|
| 133 |
|
137 |
|
| Line 390... |
Line 394... |
| 390 |
Arrays.asList("Partner Id", "Partner Name", "Model Name", "Qty"),
|
394 |
Arrays.asList("Partner Id", "Partner Name", "Model Name", "Qty"),
|
| 391 |
plannedModel.stream()
|
395 |
plannedModel.stream()
|
| 392 |
.map(x -> Arrays.asList(x.getFofoId(), x.getStoreName(), x.getItemDescription(), x.getQty()))
|
396 |
.map(x -> Arrays.asList(x.getFofoId(), x.getStoreName(), x.getItemDescription(), x.getQty()))
|
| 393 |
.collect(Collectors.toList()));
|
397 |
.collect(Collectors.toList()));
|
| 394 |
LOGGER.info("baos" + baos);
|
398 |
LOGGER.info("baos" + baos);
|
| 395 |
Utils.sendMailWithAttachments(googleMailSender, new String[]{customRetailer.getEmail()},
|
399 |
mailOutboxService.queueMailWithAttachmentsViaGoogle(new String[]{customRetailer.getEmail()},
|
| 396 |
ccemails.toArray(new String[ccemails.size()]), bccemails.toArray(new String[bccemails.size()]),
|
400 |
ccemails.toArray(new String[ccemails.size()]), bccemails.toArray(new String[bccemails.size()]),
|
| 397 |
"Planned Indent", "PFA",
|
401 |
"Planned Indent", "PFA", false, "IndentController.confirmMonthlyPlanned",
|
| 398 |
new Attachment[]{new Attachment("PlannedIndent.csv", new ByteArrayResource(baos.toByteArray())),});
|
402 |
new Attachment("PlannedIndent.csv", new ByteArrayResource(baos.toByteArray())));
|
| 399 |
|
403 |
|
| 400 |
}
|
404 |
}
|
| 401 |
|
405 |
|
| 402 |
@RequestMapping(value = "/indent/download", method = RequestMethod.GET)
|
406 |
@RequestMapping(value = "/indent/download", method = RequestMethod.GET)
|
| 403 |
public ResponseEntity<ByteArrayResource> downloadIndent(HttpServletRequest request, Model model,
|
407 |
public ResponseEntity<ByteArrayResource> downloadIndent(HttpServletRequest request, Model model,
|