Merge pull request #54 from LQYBill/dev

Release 1.9.3
pull/6221/head
Qiuyi LI 2024-01-12 16:23:35 +01:00 committed by GitHub
commit 382eb3e65d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
17 changed files with 261 additions and 23 deletions

View File

@ -16,10 +16,7 @@ import org.jeecg.modules.business.entity.ShippingDiscount;
import org.jeecg.modules.business.entity.Sku; import org.jeecg.modules.business.entity.Sku;
import org.jeecg.modules.business.entity.SkuDeclaredValue; import org.jeecg.modules.business.entity.SkuDeclaredValue;
import org.jeecg.modules.business.entity.SkuPrice; import org.jeecg.modules.business.entity.SkuPrice;
import org.jeecg.modules.business.service.IShippingDiscountService; import org.jeecg.modules.business.service.*;
import org.jeecg.modules.business.service.ISkuDeclaredValueService;
import org.jeecg.modules.business.service.ISkuPriceService;
import org.jeecg.modules.business.service.ISkuService;
import org.jeecg.modules.business.vo.SkuName; import org.jeecg.modules.business.vo.SkuName;
import org.jeecg.modules.business.vo.SkuPage; import org.jeecg.modules.business.vo.SkuPage;
import org.jeecg.modules.business.vo.SkuUpdate; import org.jeecg.modules.business.vo.SkuUpdate;
@ -350,4 +347,12 @@ public class SkuController {
); );
} }
@GetMapping("/skusByClient")
public Result<?> skusByClient(@RequestParam String clientId) {
List<Sku> skus = skuService.fetchSkusByClient(clientId);
IPage<Sku> page = new Page<>();
page.setRecords(skus);
page.setTotal(skus.size());
return Result.OK(page);
}
} }

View File

@ -792,6 +792,7 @@ public class InvoiceController {
metaDataErrorList.add(metaData); metaDataErrorList.add(metaData);
} }
else { else {
filenameList.add(INVOICE_PDF_DIR + "//" + "Invoice N°" + metaData.getInvoiceCode() + " (" + metaData.getInvoiceEntity() + ").pdf");
filenameList.add(INVOICE_DIR + "//" + metaData.getFilename()); filenameList.add(INVOICE_DIR + "//" + metaData.getFilename());
List<FactureDetail> factureDetails = shippingInvoiceService.getInvoiceDetail(metaData.getInvoiceCode()); List<FactureDetail> factureDetails = shippingInvoiceService.getInvoiceDetail(metaData.getInvoiceCode());
List<SavRefundWithDetail> refunds = savRefundWithDetailService.getRefundsByInvoiceNumber(metaData.getInvoiceCode()); List<SavRefundWithDetail> refunds = savRefundWithDetailService.getRefundsByInvoiceNumber(metaData.getInvoiceCode());

View File

@ -182,7 +182,7 @@ public class MabangSkuJob implements Job {
param.put("total_page", String.valueOf(messageContentList.size())); param.put("total_page", String.valueOf(messageContentList.size()));
TemplateMessageDTO message = new TemplateMessageDTO("admin", "admin", "SKU导入任务", param, "sku_mabang_job_result"); TemplateMessageDTO message = new TemplateMessageDTO("admin", "admin", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message); ISysBaseApi.sendTemplateAnnouncement(message);
message = new TemplateMessageDTO("admin", "Alice", "SKU导入任务", param, "sku_mabang_job_result"); // message = new TemplateMessageDTO("admin", "Alice", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message); ISysBaseApi.sendTemplateAnnouncement(message);
message = new TemplateMessageDTO("admin", "Jessyca", "SKU导入任务", param, "sku_mabang_job_result"); message = new TemplateMessageDTO("admin", "Jessyca", "SKU导入任务", param, "sku_mabang_job_result");
ISysBaseApi.sendTemplateAnnouncement(message); ISysBaseApi.sendTemplateAnnouncement(message);

View File

@ -0,0 +1,79 @@
package org.jeecg.modules.business.domain.job;
import freemarker.template.Template;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.business.entity.ClientSku;
import org.jeecg.modules.business.entity.Sku;
import org.jeecg.modules.business.service.*;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import java.util.*;
import java.util.stream.Collectors;
/**
* A Job that retrieves all Sku from Mabang
* if the sku is of status 3 (normal) and not in DB, then we insert it in DB
*/
@Slf4j
@Component
public class SkuAssociationToClientJob implements Job {
@Autowired
private ISkuService skuService;
@Autowired
private IClientSkuService clientSkuService;
@Autowired
private EmailService emailService;
@Autowired
private FreeMarkerConfigurer freemarkerConfigurer;
@Autowired
Environment env;
@Override
public void execute(JobExecutionContext context) throws JobExecutionException {
log.info("SkuAssociationToClientJob start");
List<String> allSkusIds = skuService.list().stream().map(Sku::getId).collect(Collectors.toList());
List<String> allClientSkuIds = clientSkuService.list().stream().map(ClientSku::getSkuId).collect(Collectors.toList());
List<String> newSkusIds = allSkusIds.stream().filter(skuId -> !allClientSkuIds.contains(skuId)).collect(Collectors.toList());
List<Sku> newSkus = skuService.listByIds(newSkusIds);
List<String> unknownClientSkus = clientSkuService.saveClientSku(newSkus);
// send email for manual check
if(!unknownClientSkus.isEmpty()) {
log.info("Sending email for manual check.");
Properties prop = emailService.getMailSender();
Session session = Session.getInstance(prop, new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(env.getProperty("spring.mail.username"), env.getProperty("spring.mail.password"));
}
});
String subject = "Association of Sku to Client failed";
String destEmail = env.getProperty("spring.mail.username");
Map<String, Object> templateModel = new HashMap<>();
templateModel.put("skus", unknownClientSkus);
try {
freemarkerConfigurer = emailService.freemarkerClassLoaderConfig();
Template template = freemarkerConfigurer.getConfiguration().getTemplate("admin/unknownClientForSku.ftl");
String htmlBody = FreeMarkerTemplateUtils.processTemplateIntoString(template, templateModel);
emailService.sendSimpleMessage(destEmail, subject, htmlBody, session);
log.info("Mail sent successfully");
} catch (Exception e) {
log.error("Error sending mail: " + e.getMessage());
}
}
}
}

View File

@ -19,4 +19,6 @@ public interface ClientCategoryMapper extends BaseMapper<ClientCategory> {
BigDecimal getBalanceThresholdByCategoryId(@Param("id") String id); BigDecimal getBalanceThresholdByCategoryId(@Param("id") String id);
String getClientCategoryByClientId(@Param("clientId") String clientId); String getClientCategoryByClientId(@Param("clientId") String clientId);
String getIdByCode(@Param("name") String categoryName);
} }

View File

@ -52,4 +52,6 @@ public interface SkuMapper extends BaseMapper<Sku> {
List<Sku> findMissingSkusInNotShippedOrders(@Param("start") LocalDateTime start); List<Sku> findMissingSkusInNotShippedOrders(@Param("start") LocalDateTime start);
List<SkuQuantity> getSkuQuantitiesFromOrderIds(@Param("orderIds") List<String> orderIds); List<SkuQuantity> getSkuQuantitiesFromOrderIds(@Param("orderIds") List<String> orderIds);
List<Sku> fetchSkusByClient(@Param("clientId") String clientId);
} }

View File

@ -13,4 +13,9 @@
ON c.client_category_id = cc.id ON c.client_category_id = cc.id
WHERE c.id = #{clientId}; WHERE c.id = #{clientId};
</select> </select>
<select id="getIdByCode" resultType="java.lang.String">
SELECT id
FROM client_category
WHERE name = #{name};
</select>
</mapper> </mapper>

View File

@ -151,4 +151,11 @@
AND virtual_product_available = 0 AND virtual_product_available = 0
GROUP BY sku_id; GROUP BY sku_id;
</select> </select>
<select id="fetchSkusByClient" resultType="org.jeecg.modules.business.entity.Sku">
SELECT s.id, s.erp_code, CONCAT(p.code, '(', p.zh_name,')') as product_id ,s.purchasing_amount, s.available_amount, s.image_source, s.shipping_discount, s.service_fee
FROM sku s
JOIN client_sku cs ON s.id = cs.sku_id
JOIN product p ON s.product_id = p.id
WHERE cs.client_id = #{clientId};
</select>
</mapper> </mapper>

View File

@ -12,4 +12,6 @@ import com.baomidou.mybatisplus.extension.service.IService;
public interface IClientCategoryService extends IService<ClientCategory> { public interface IClientCategoryService extends IService<ClientCategory> {
String getClientCategoryByClientId(String clientId); String getClientCategoryByClientId(String clientId);
String getIdByCode(String categoryName);
} }

View File

@ -2,6 +2,8 @@ package org.jeecg.modules.business.service;
import org.jeecg.modules.business.entity.ClientSku; import org.jeecg.modules.business.entity.ClientSku;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.business.entity.Sku;
import java.util.List; import java.util.List;
/** /**
@ -13,4 +15,8 @@ import java.util.List;
public interface IClientSkuService extends IService<ClientSku> { public interface IClientSkuService extends IService<ClientSku> {
public List<ClientSku> selectByMainId(String mainId); public List<ClientSku> selectByMainId(String mainId);
List<String> saveClientSku(List<Sku> newSkus);
void addClientSku(String clientId, String skuId);
} }

View File

@ -93,4 +93,6 @@ public interface ISkuService extends IService<Sku> {
List<Sku> findMissingSkusInNotShippedOrders(LocalDateTime start); List<Sku> findMissingSkusInNotShippedOrders(LocalDateTime start);
List<SkuQuantity> getSkuQuantitiesFromOrderIds(List<String> orderIds); List<SkuQuantity> getSkuQuantitiesFromOrderIds(List<String> orderIds);
List<Sku> fetchSkusByClient(String clientId);
} }

View File

@ -11,6 +11,8 @@ import org.jeecg.modules.business.domain.excel.SheetManager;
import org.jeecg.modules.business.domain.shippingInvoice.CompleteInvoice; import org.jeecg.modules.business.domain.shippingInvoice.CompleteInvoice;
import org.jeecg.modules.business.domain.shippingInvoice.ShippingInvoice; import org.jeecg.modules.business.domain.shippingInvoice.ShippingInvoice;
import org.jeecg.modules.business.domain.shippingInvoice.ShippingInvoiceFactory; import org.jeecg.modules.business.domain.shippingInvoice.ShippingInvoiceFactory;
import org.jeecg.modules.business.entity.Client;
import org.jeecg.modules.business.entity.ClientCategory.CategoryName;
import org.jeecg.modules.business.entity.PlatformOrder; import org.jeecg.modules.business.entity.PlatformOrder;
import org.jeecg.modules.business.entity.SavRefundWithDetail; import org.jeecg.modules.business.entity.SavRefundWithDetail;
import org.jeecg.modules.business.mapper.*; import org.jeecg.modules.business.mapper.*;
@ -58,6 +60,8 @@ public class PlatformOrderShippingInvoiceService {
@Autowired @Autowired
ClientMapper clientMapper; ClientMapper clientMapper;
@Autowired @Autowired
IClientCategoryService clientCategoryService;
@Autowired
EmailService emailService; EmailService emailService;
@Autowired @Autowired
ShopMapper shopMapper; ShopMapper shopMapper;
@ -482,9 +486,10 @@ public class PlatformOrderShippingInvoiceService {
clientShopIDsMap.put(id, shopService.listIdByClient(id)); clientShopIDsMap.put(id, shopService.listIdByClient(id));
} }
for(Map.Entry<String, List<String>> entry: clientShopIDsMap.entrySet()) { for(Map.Entry<String, List<String>> entry: clientShopIDsMap.entrySet()) {
Client client = clientMapper.selectById(entry.getKey());
Period period = getValidPeriod(entry.getValue()); Period period = getValidPeriod(entry.getValue());
if(!period.isValid()) { if(!period.isValid()) {
String internalCode = clientMapper.selectById(entry.getKey()).getInternalCode(); String internalCode = client.getInternalCode();
invoiceList.add(new InvoiceMetaData("", "error", internalCode, entry.getKey(), "No order to invoice.")); invoiceList.add(new InvoiceMetaData("", "error", internalCode, entry.getKey(), "No order to invoice."));
continue; continue;
} }
@ -501,18 +506,23 @@ public class PlatformOrderShippingInvoiceService {
InvoiceMetaData metaData; InvoiceMetaData metaData;
if(invoiceType == 0) { if(invoiceType == 0) {
metaData = makeInvoice(param); metaData = makeInvoice(param);
balanceService.updateBalance(entry.getKey(), metaData.getInvoiceCode(), "shipping"); if(client.getClientCategoryId().equals(clientCategoryService.getIdByCode(CategoryName.VIP.getName()))
|| client.getClientCategoryId().equals(clientCategoryService.getIdByCode(CategoryName.CONFIRMED.getName())))
balanceService.updateBalance(entry.getKey(), metaData.getInvoiceCode(), "shipping");
} }
else { else {
metaData = makeCompleteInvoicePostShipping(param, "post"); metaData = makeCompleteInvoicePostShipping(param, "post");
balanceService.updateBalance(entry.getKey(), metaData.getInvoiceCode(), "complete"); if(client.getClientCategoryId().equals(clientCategoryService.getIdByCode(CategoryName.VIP.getName()))
|| client.getClientCategoryId().equals(clientCategoryService.getIdByCode(CategoryName.CONFIRMED.getName())))
balanceService.updateBalance(entry.getKey(), metaData.getInvoiceCode(), "complete");
} }
convertToPdf(metaData.getInvoiceCode(), "invoice");
invoiceList.add(metaData); invoiceList.add(metaData);
} catch (UserException | IOException | ParseException e) { } catch (UserException | IOException | ParseException e) {
String internalCode = clientMapper.selectById(entry.getKey()).getInternalCode(); String internalCode = clientMapper.selectById(entry.getKey()).getInternalCode();
invoiceList.add(new InvoiceMetaData("", "error", internalCode, entry.getKey(), e.getMessage())); invoiceList.add(new InvoiceMetaData("", "error", internalCode, entry.getKey(), e.getMessage()));
log.error(e.getMessage()); log.error(e.getMessage());
} catch (MessagingException e) { } catch (Exception e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
System.gc(); System.gc();

View File

@ -22,4 +22,9 @@ public class ClientCategoryServiceImpl extends ServiceImpl<ClientCategoryMapper,
public String getClientCategoryByClientId(String clientId) { public String getClientCategoryByClientId(String clientId) {
return clientCategoryMapper.getClientCategoryByClientId(clientId); return clientCategoryMapper.getClientCategoryByClientId(clientId);
} }
@Override
public String getIdByCode(String categoryName) {
return clientCategoryMapper.getIdByCode(categoryName);
}
} }

View File

@ -1,9 +1,14 @@
package org.jeecg.modules.business.service.impl; package org.jeecg.modules.business.service.impl;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.business.entity.ClientSku; import org.jeecg.modules.business.entity.ClientSku;
import org.jeecg.modules.business.entity.Sku;
import org.jeecg.modules.business.mapper.ClientSkuMapper; import org.jeecg.modules.business.mapper.ClientSkuMapper;
import org.jeecg.modules.business.service.IClientService;
import org.jeecg.modules.business.service.IClientSkuService; import org.jeecg.modules.business.service.IClientSkuService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -14,14 +19,53 @@ import org.springframework.beans.factory.annotation.Autowired;
* @Date: 2021-04-02 * @Date: 2021-04-02
* @Version: V1.0 * @Version: V1.0
*/ */
@Slf4j
@Service @Service
public class ClientSkuServiceImpl extends ServiceImpl<ClientSkuMapper, ClientSku> implements IClientSkuService { public class ClientSkuServiceImpl extends ServiceImpl<ClientSkuMapper, ClientSku> implements IClientSkuService {
@Autowired @Autowired
private ClientSkuMapper clientSkuMapper; private ClientSkuMapper clientSkuMapper;
@Autowired
private IClientService clientService;
@Override @Override
public List<ClientSku> selectByMainId(String mainId) { public List<ClientSku> selectByMainId(String mainId) {
return clientSkuMapper.selectByMainId(mainId); return clientSkuMapper.selectByMainId(mainId);
} }
@Override
public List<String> saveClientSku(List<Sku> newSkus) {
List<String> unknownSkuErpCode = new ArrayList<>(); // sku erp code that we couldn't find client for
for(Sku sku : newSkus) {
String erpCode = sku.getErpCode();
if(erpCode == null) {
log.info("Couldn't associate sku \"{}\" with any client. ErpCode is NULL", sku.getId());
unknownSkuErpCode.add("Sku ID : " + sku.getId() + " - ErpCode is NULL");
continue;
}
int index = erpCode.lastIndexOf("-");
if(index == -1) {
log.info("Couldn't associate sku \"{}\" with any client. Wrong format", erpCode);
unknownSkuErpCode.add(erpCode + " - Wrong format");
continue;
}
String internalCode = erpCode.substring(index+1);
String clientId = clientService.getClientIdByCode(internalCode);
if(clientId == null) {
log.info("Couldn't associate sku \"{}\" with any client. ", erpCode);
unknownSkuErpCode.add(erpCode);
continue;
}
log.info("Associating sku \"{}\" with client \"{}\". ", sku.getErpCode(), clientId);
addClientSku(clientId, sku.getId());
}
return unknownSkuErpCode;
}
@Override
public void addClientSku(String clientId, String skuId) {
ClientSku clientSku = new ClientSku();
clientSku.setClientId(clientId);
clientSku.setSkuId(skuId);
clientSkuMapper.insert(clientSku);
}
} }

View File

@ -1,6 +1,7 @@
package org.jeecg.modules.business.service.impl; package org.jeecg.modules.business.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import freemarker.template.Template;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.business.domain.api.mabang.doSearchSkuList.SkuData; import org.jeecg.modules.business.domain.api.mabang.doSearchSkuList.SkuData;
import org.jeecg.modules.business.domain.api.mabang.doSearchSkuList.SkuListRequestErrorException; import org.jeecg.modules.business.domain.api.mabang.doSearchSkuList.SkuListRequestErrorException;
@ -11,9 +12,15 @@ import org.jeecg.modules.business.entity.SkuPrice;
import org.jeecg.modules.business.mapper.SkuListMabangMapper; import org.jeecg.modules.business.mapper.SkuListMabangMapper;
import org.jeecg.modules.business.service.*; import org.jeecg.modules.business.service.*;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.ui.freemarker.FreeMarkerTemplateUtils;
import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer;
import javax.mail.Authenticator;
import javax.mail.PasswordAuthentication;
import javax.mail.Session;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
@ -28,21 +35,25 @@ import static java.util.stream.Collectors.toList;
@Service @Service
@Slf4j @Slf4j
public class SkuListMabangServiceImpl extends ServiceImpl<SkuListMabangMapper, SkuData> implements ISkuListMabangService { public class SkuListMabangServiceImpl extends ServiceImpl<SkuListMabangMapper, SkuData> implements ISkuListMabangService {
private final SkuListMabangMapper skuListMabangMapper;
private final IProductService productService;
private final ISkuService skuService;
private final ISkuPriceService skuPriceService;
private final ISkuDeclaredValueService skuDeclaredValueService;
@Autowired @Autowired
public SkuListMabangServiceImpl(SkuListMabangMapper skuListMabangMapper, IProductService productService, private SkuListMabangMapper skuListMabangMapper;
ISkuService skuService, ISkuPriceService skuPriceService, ISkuDeclaredValueService skuDeclaredValueService) { @Autowired
this.skuListMabangMapper = skuListMabangMapper; private IProductService productService;
this.productService = productService; @Autowired
this.skuService = skuService; private ISkuService skuService;
this.skuPriceService = skuPriceService; @Autowired
this.skuDeclaredValueService = skuDeclaredValueService; private ISkuPriceService skuPriceService;
} @Autowired
private ISkuDeclaredValueService skuDeclaredValueService;
@Autowired
private IClientSkuService clientSkuService;
@Autowired
private EmailService emailService;
@Autowired
private FreeMarkerConfigurer freemarkerConfigurer;
@Autowired
Environment env;
/** /**
* Save skus to DB from mabang api. * Save skus to DB from mabang api.
@ -97,6 +108,35 @@ public class SkuListMabangServiceImpl extends ServiceImpl<SkuListMabangMapper, S
newSkus = createSkus(newSkuDatas); newSkus = createSkus(newSkuDatas);
skuService.saveBatch(newSkus); skuService.saveBatch(newSkus);
// attributing sku to client
List<String> unknownClientSkus = clientSkuService.saveClientSku(newSkus);
// send email for manual check
if(!unknownClientSkus.isEmpty()) {
log.info("Sending email for manual check.");
Properties prop = emailService.getMailSender();
Session session = Session.getInstance(prop, new Authenticator() {
@Override
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(env.getProperty("spring.mail.username"), env.getProperty("spring.mail.password"));
}
});
String subject = "Association of Sku to Client failed while creating new Sku";
String destEmail = env.getProperty("spring.mail.username");
Map<String, Object> templateModel = new HashMap<>();
templateModel.put("skus", unknownClientSkus);
try {
freemarkerConfigurer = emailService.freemarkerClassLoaderConfig();
Template template = freemarkerConfigurer.getConfiguration().getTemplate("admin/unknownClientForSku.ftl");
String htmlBody = FreeMarkerTemplateUtils.processTemplateIntoString(template, templateModel);
emailService.sendSimpleMessage(destEmail, subject, htmlBody, session);
log.info("Mail sent successfully");
} catch (Exception e) {
log.error("Error sending mail: " + e.getMessage());
}
}
// adding the additional information to List and pairing it to a sku with the associated product code // adding the additional information to List and pairing it to a sku with the associated product code
List<String> productIdInMap = new ArrayList<>(); List<String> productIdInMap = new ArrayList<>();
for(Sku sku : newSkus) { for(Sku sku : newSkus) {

View File

@ -2,6 +2,7 @@ package org.jeecg.modules.business.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.shiro.SecurityUtils; import org.apache.shiro.SecurityUtils;
import org.jeecg.common.system.vo.LoginUser; import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.modules.business.controller.UserException; import org.jeecg.modules.business.controller.UserException;
@ -32,6 +33,7 @@ import java.util.stream.Collectors;
* @Date: 2021-06-28 * @Date: 2021-06-28
* @Version: V1.1 * @Version: V1.1
*/ */
@Slf4j
@Service @Service
public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuService { public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuService {
@ -408,4 +410,9 @@ public class SkuServiceImpl extends ServiceImpl<SkuMapper, Sku> implements ISkuS
public List<SkuQuantity> getSkuQuantitiesFromOrderIds(List<String> orderIds) { public List<SkuQuantity> getSkuQuantitiesFromOrderIds(List<String> orderIds) {
return skuMapper.getSkuQuantitiesFromOrderIds(orderIds); return skuMapper.getSkuQuantitiesFromOrderIds(orderIds);
} }
@Override
public List<Sku> fetchSkusByClient(String clientId) {
return skuMapper.fetchSkusByClient(clientId);
}
} }

View File

@ -0,0 +1,21 @@
<#include "../components/header.ftl">
<tr>
<td style="padding:35px 0;">Cher Collègue</td>
</tr>
<tr>
<td style="padding:0 0 35px 0;">Un ou plusieurs SKU n'ont pas pu être attribué à un client :</td>
</tr>
<tr>
<td>
<ul>
<#if skus?size = 0 >
<li>Aucune erreur</li>
<#else>
<#list skus as sku>
<li>${sku}</li>
</#list>
</#if>
</ul>
</td>
</tr>
<#include "../components/footer.ftl">