diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/CreditController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/CreditController.java index 655f39b07..5c9b9c797 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/CreditController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/CreditController.java @@ -2,17 +2,12 @@ package org.jeecg.modules.business.controller.admin; import java.util.Arrays; import java.util.List; -import java.util.Map; -import java.util.stream.Collectors; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.URLDecoder; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.util.oConvertUtils; import org.jeecg.modules.business.entity.Credit; +import org.jeecg.modules.business.service.IBalanceService; import org.jeecg.modules.business.service.ICreditService; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; @@ -20,22 +15,14 @@ import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import lombok.extern.slf4j.Slf4j; -import org.jeecgframework.poi.excel.ExcelImportUtil; -import org.jeecgframework.poi.excel.def.NormalExcelConstants; -import org.jeecgframework.poi.excel.entity.ExportParams; -import org.jeecgframework.poi.excel.entity.ImportParams; -import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; import org.jeecg.common.system.base.controller.JeecgController; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.*; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.servlet.ModelAndView; -import com.alibaba.fastjson.JSON; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.jeecg.common.aspect.annotation.AutoLog; -import org.apache.shiro.authz.annotation.RequiresPermissions; /** * @Description: credit @@ -50,6 +37,8 @@ import org.apache.shiro.authz.annotation.RequiresPermissions; public class CreditController extends JeecgController { @Autowired private ICreditService creditService; + @Autowired + private IBalanceService balanceService; /** * 分页列表查询 @@ -60,7 +49,6 @@ public class CreditController extends JeecgController { * @param req * @return */ - //@AutoLog(value = "credit-分页列表查询") @ApiOperation(value="credit-分页列表查询", notes="credit-分页列表查询") @GetMapping(value = "/list") public Result> queryPageList(Credit credit, @@ -81,9 +69,11 @@ public class CreditController extends JeecgController { */ @AutoLog(value = "credit-添加") @ApiOperation(value="credit-添加", notes="credit-添加") + @Transactional @PostMapping(value = "/add") public Result add(@RequestBody Credit credit) { creditService.save(credit); + balanceService.updateBalance(credit.getClientId(), credit.getId(), credit.getAmount(), credit.getCurrencyId()); return Result.OK("添加成功!"); } @@ -95,9 +85,11 @@ public class CreditController extends JeecgController { */ @AutoLog(value = "credit-编辑") @ApiOperation(value="credit-编辑", notes="credit-编辑") + @Transactional @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) public Result edit(@RequestBody Credit credit) { creditService.updateById(credit); + balanceService.editBalance(credit.getId(), "Credit", credit.getClientId() ,credit.getAmount(), credit.getCurrencyId()); return Result.OK("编辑成功!"); } @@ -109,9 +101,11 @@ public class CreditController extends JeecgController { */ @AutoLog(value = "credit-通过id删除") @ApiOperation(value="credit-通过id删除", notes="credit-通过id删除") + @Transactional @DeleteMapping(value = "/delete") - public Result delete(@RequestParam(name="id",required=true) String id) { + public Result delete(@RequestParam(name="id") String id) { creditService.removeById(id); + balanceService.deleteBalance(id, "Credit"); return Result.OK("删除成功!"); } @@ -123,9 +117,12 @@ public class CreditController extends JeecgController { */ @AutoLog(value = "credit-批量删除") @ApiOperation(value="credit-批量删除", notes="credit-批量删除") + @Transactional @DeleteMapping(value = "/deleteBatch") - public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { - this.creditService.removeByIds(Arrays.asList(ids.split(","))); + public Result deleteBatch(@RequestParam(name="ids") String ids) { + List idList = Arrays.asList(ids.split(",")); + creditService.removeByIds(idList); + balanceService.deleteBatchBalance(idList, "Credit"); return Result.OK("批量删除成功!"); } @@ -135,10 +132,9 @@ public class CreditController extends JeecgController { * @param id * @return */ - //@AutoLog(value = "credit-通过id查询") @ApiOperation(value="credit-通过id查询", notes="credit-通过id查询") @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { + public Result queryById(@RequestParam(name="id") String id) { Credit credit = creditService.getById(id); if(credit==null) { return Result.error("未找到对应数据"); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/UserClientController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/UserClientController.java index 9a8ccd210..e73f18c48 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/UserClientController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/UserClientController.java @@ -6,11 +6,6 @@ import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.business.entity.Client; -import org.jeecg.modules.business.entity.PlatformOrder; -import org.jeecg.modules.business.entity.PlatformOrderContent; -import org.jeecg.modules.business.entity.Shop; -import org.jeecg.modules.business.service.IPlatformOrderService; -import org.jeecg.modules.business.service.IShopService; import org.jeecg.modules.business.service.IUserClientService; import org.jeecg.modules.system.entity.SysRole; import org.jeecg.modules.system.service.ISysUserRoleService; @@ -32,10 +27,6 @@ public class UserClientController { private IUserClientService userClientService; @Autowired private ISysUserRoleService sysUserRoleService; - @Autowired - private IShopService shopService; - @Autowired - private IPlatformOrderService platformOrderService; /** * Checks if the user is a client or internal user * @return the client's info OR a list of clients @@ -44,7 +35,7 @@ public class UserClientController { public Result getClientByUserId() { LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); String userId = loginUser.getId(); -// userId = "1708866308713140225"; + userId = "1708866308713140225"; Client client = userClientService.getClientByUserId(userId); if(client == null) { List sysRoles = sysUserRoleService.getUserRole(userId); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/shippingInvoice/InvoiceController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/shippingInvoice/InvoiceController.java index 2049b0378..5e651abe1 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/shippingInvoice/InvoiceController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/shippingInvoice/InvoiceController.java @@ -15,6 +15,7 @@ import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.business.controller.UserException; import org.jeecg.modules.business.domain.api.mabang.getorderlist.OrderStatus; import org.jeecg.modules.business.entity.*; +import org.jeecg.modules.business.entity.Currency; import org.jeecg.modules.business.mapper.PlatformOrderContentMapper; import org.jeecg.modules.business.mapper.PlatformOrderMapper; import org.jeecg.modules.business.service.*; @@ -24,6 +25,7 @@ import org.jeecg.modules.quartz.service.IQuartzJobService; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; +import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; import org.springframework.web.bind.annotation.*; import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; @@ -36,6 +38,7 @@ import java.io.*; import java.math.BigDecimal; import java.math.RoundingMode; import java.text.ParseException; +import java.time.LocalDate; import java.util.*; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -52,9 +55,13 @@ import static org.jeecg.modules.business.entity.TaskHistory.TaskStatus.*; @RequestMapping("/shippingInvoice") @Slf4j public class InvoiceController { + @Autowired + private IBalanceService balanceService; @Autowired private IClientService clientService; @Autowired + private ICurrencyService currencyService; + @Autowired private IShopService shopService; @Autowired private PlatformOrderShippingInvoiceService shippingInvoiceService; @@ -197,9 +204,11 @@ public class InvoiceController { * in case of success, data will contain filename. */ @PostMapping(value = "/make") + @Transactional public Result makeInvoice(@RequestBody ShippingInvoiceParam param) { try { InvoiceMetaData metaData = shippingInvoiceService.makeInvoice(param); + balanceService.updateBalance(param.clientID(), metaData.getInvoiceCode(), "shipping"); return Result.OK(metaData); } catch (UserException e) { return Result.error(e.getMessage()); @@ -213,11 +222,13 @@ public class InvoiceController { * @param param ClientID, shopIDs[], startDate, endDate, erpStatuses[], warehouses[] * @return */ + @Transactional @PostMapping(value = "/makeComplete") public Result makeCompleteShippingInvoice(@RequestBody ShippingInvoiceParam param) { try { String method = param.getErpStatuses().toString().equals("[3]") ? "post" : param.getErpStatuses().toString().equals("[1, 2]") ? "pre-shipping" : "all"; InvoiceMetaData metaData = shippingInvoiceService.makeCompleteInvoicePostShipping(param, method); + balanceService.updateBalance(param.clientID(), metaData.getInvoiceCode(), "complete"); return Result.OK(metaData); } catch (UserException e) { return Result.error(e.getMessage()); @@ -234,10 +245,12 @@ public class InvoiceController { * @return Result of the generation, in case of error, message will be contained, * in case of success, data will contain filename. */ + @Transactional @PostMapping(value = "/makeManualInvoice") public Result makeManualShippingInvoice(@RequestBody ShippingInvoiceOrderParam param) { try { InvoiceMetaData metaData = shippingInvoiceService.makeInvoice(param); + balanceService.updateBalance(param.clientID(), metaData.getInvoiceCode(), "shipping"); return Result.OK(metaData); } catch (UserException e) { return Result.error(e.getMessage()); @@ -255,10 +268,12 @@ public class InvoiceController { * @return Result of the generation, in case of error, message will be contained, * in case of success, data will contain filename. */ + @Transactional @PostMapping(value = "/makeManualComplete") public Result makeManualCompleteInvoice(@RequestBody ShippingInvoiceOrderParam param) { try { InvoiceMetaData metaData = shippingInvoiceService.makeCompleteInvoice(param); + balanceService.updateBalance(param.clientID(), metaData.getInvoiceCode(), "complete"); return Result.OK(metaData); } catch (UserException e) { return Result.error(e.getMessage()); @@ -509,7 +524,7 @@ public class InvoiceController { log.info("Generating detail files ...{}/{}", cpt++, invoiceList.size()); } String zipFilename = shippingInvoiceService.zipInvoices(filenameList); - String subject = "Invoices generated from Breakdown Page"; + String subject = "[" + LocalDate.now() + "] Invoices generated from Breakdown Page"; String destEmail = sysUser.getEmail() == null ? env.getProperty("spring.mail.username") : sysUser.getEmail(); Properties prop = emailService.getMailSender(); Map templateModel = new HashMap<>(); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/shippingInvoice/ShippingInvoiceController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/shippingInvoice/ShippingInvoiceController.java index d6b410aad..2ba3f442a 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/shippingInvoice/ShippingInvoiceController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/shippingInvoice/ShippingInvoiceController.java @@ -65,6 +65,8 @@ import java.util.stream.Stream; @RequestMapping("/generated/shippingInvoice") @Slf4j public class ShippingInvoiceController { + @Autowired + private IBalanceService balanceService; @Autowired private IClientService clientService; @Autowired @@ -509,6 +511,8 @@ public class ShippingInvoiceController { platformOrderService.cancelInvoice(invoiceNumber); savRefundService.cancelInvoice(invoiceNumber); shippingInvoiceService.delMain(id); + log.info("Updating balance ..."); + balanceService.deleteBalance(id, "Debit"); log.info("Deleting invoice files ..."); String invoiceEntity = clientService.getClientEntity(clientId); List invoicePathList = getPath(INVOICE_LOCATION, invoiceNumber, invoiceEntity); @@ -569,7 +573,9 @@ public class ShippingInvoiceController { platformOrderContentService.cancelBatchInvoice(invoiceNumbers); platformOrderService.cancelBatchInvoice(invoiceNumbers); savRefundService.cancelBatchInvoice(invoiceNumbers); - shippingInvoiceService.delBatchMain(ids); + shippingInvoiceService.delBatchMain(ids);; + log.info("Updating balances ..."); + balanceService.deleteBatchBalance(ids, "Debit"); log.info("Deleting invoice files ..."); for(int i = 0; i < ids.size(); i++) { diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/client/TransactionController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/client/TransactionController.java index ad9f4c563..371b4db96 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/client/TransactionController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/client/TransactionController.java @@ -95,10 +95,6 @@ public class TransactionController { List shippingFeesEstimations = factory.getEstimations(clientId, orderIds, errorMessages); if(shippingFeesEstimations.isEmpty()) return Result.OK("No estimation found."); - System.out.println("Estimation size : " + shippingFeesEstimations.size()); - for(ShippingFeesEstimation estimation: shippingFeesEstimations) { - System.out.println("estimation : " + estimation.getDueForProcessedOrders()); - } // purchase estimation List estimationOrderIds = new ArrayList<>(); BigDecimal shippingFeesEstimation = BigDecimal.ZERO; @@ -106,7 +102,6 @@ public class TransactionController { estimationOrderIds.addAll(estimation.getOrderIds()); shippingFeesEstimation = shippingFeesEstimation.add(estimation.getDueForProcessedOrders()); } - System.out.println("Estimation order ids : " + estimationOrderIds); List orderContents = platformOrderContentMapper.fetchOrderContent(estimationOrderIds); List skuIds = orderContents.stream().map(PlatformOrderContent::getSkuId).collect(Collectors.toList()); List skuPrices = platformOrderContentMapper.searchSkuPrice(skuIds); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/job/LogisticChannelChoiceJob.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/job/LogisticChannelChoiceJob.java index 5ab0f31b4..2f42f901a 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/job/LogisticChannelChoiceJob.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/job/LogisticChannelChoiceJob.java @@ -48,14 +48,10 @@ public class LogisticChannelChoiceJob implements Job { @Autowired private IPlatformOrderService platformOrderService; @Autowired - private IPlatformOrderContentService platformOrderContentService; - @Autowired private ISensitiveAttributeService sensitiveAttributeService; @Autowired private IShopService shopService; @Autowired - private PlatformOrderContentMapper platformOrderContentMapper; - @Autowired Environment env; @Autowired private FreeMarkerConfigurer freemarkerConfigurer; @@ -115,15 +111,6 @@ public class LogisticChannelChoiceJob implements Job { } tempPlatformOrders.remove(orderToAdd); } - System.out.println("Attributes in orders : "); - for(Map.Entry> entry : orderMapByAttribute.entrySet()) { - System.out.println("attribute : " + entry.getKey()); - if(entry.getKey() != null) { - for(PlatformOrder order : entry.getValue()) { - System.out.println(order.getId()); - } - } - } System.gc(); Map>> orderMapByShopAndCountry = new HashMap<>(); for (PlatformOrder platformOrder : platformOrders) { @@ -147,9 +134,6 @@ public class LogisticChannelChoiceJob implements Job { List countryList = countryService.findIdByEnName(countries); Map countryNameToIdMap = countryList.stream().collect(toMap(Country::getNameEn, Country::getId)); - System.out.println("Country name to id map : "); - countryNameToIdMap.keySet().forEach(System.out::println); - Map logisticChannelIdToNameMap = logisticChannelService.listByIdAndZhName().stream().collect(toMap(LogisticChannel::getId, LogisticChannel::getZhName)); List sensitiveAttributes = sensitiveAttributeService.listIdAndPriority(); @@ -170,27 +154,18 @@ public class LogisticChannelChoiceJob implements Job { List logisticChoiceErrorList = new ArrayList<>(); for( Map.Entry>> entry: orderMapByShopAndCountry.entrySet()) { String shopId = entry.getKey(); - System.out.println("\nShop => " + shopId); Map> orderMapByCountry = entry.getValue(); for(Map.Entry> countryMapEntry: orderMapByCountry.entrySet()) { String countryName = countryMapEntry.getKey(); List orders = countryMapEntry.getValue(); - System.out.println("---- Country : " + countryName + ", Order number : " + orders.size()); for(PlatformOrder order: orders) { // reset iterator attributeMapIterator = new LinkedList(sortedAttributeIdToPriorityMap.entrySet()).listIterator(); -// for(Map.Entry attributeEntry: sortedAttributeIdToPriorityMap.entrySet()) { String orderAttributeId = sensitiveAttributeService.getHighestPriorityAttributeId(order.getId()); Integer orderAttributePriority = sortedAttributeIdToPriorityMap.get(orderAttributeId); - if(order.getPlatformOrderId().equals("5709926760777")) { - System.out.println("===> 5709926760777"); - System.out.println("===> order attribute" + orderAttributeId); - System.out.println("===> order attribute priority" + orderAttributePriority); - } if(orderMapByAttribute.get(orderAttributeId) == null || orderAttributeId == null) { continue; } - //todo : what is happening to EP4 Reunion 5709926760777 List choices = logisticChannelChoiceList.stream().filter( c -> c.getShopId().equals(shopId) && c.getCountryId().equals(countryNameToIdMap.get(countryName)) && c.getSensitiveAttributeId().equals(orderAttributeId)) .collect(Collectors.toList()); @@ -208,7 +183,7 @@ public class LogisticChannelChoiceJob implements Job { orderToAdd.setId(order.getId()); orderToAdd.setInvoiceLogisticChannelName(logisticChannelIdToNameMap.get(choice.getLogisticChannelId())); ordersToUpdate.add(orderToAdd); - System.out.println("La ligne " + choice.getLogisticChannelId() + " a été attribué à commande : " + order.getId()); + log.info("La ligne " + choice.getLogisticChannelId() + " a été attribué à commande : " + order.getId()); break; } //reset search to prepare for lower priority search @@ -226,7 +201,7 @@ public class LogisticChannelChoiceJob implements Job { PlatformOrder orderToAdd = new PlatformOrder(); orderToAdd.setId(order.getId()); orderToAdd.setInvoiceLogisticChannelName(logisticChannelIdToNameMap.get(choice.getLogisticChannelId())); - System.out.println("La ligne " + choice.getLogisticChannelId() + " a été attribué à commande : " + order.getId()); + log.info("La ligne " + choice.getLogisticChannelId() + " a été attribué à commande : " + order.getId()); ordersToUpdate.add(orderToAdd); break; } @@ -241,20 +216,19 @@ public class LogisticChannelChoiceJob implements Job { )); } else { - System.out.println("Trouvé"); PlatformOrder orderToAdd = new PlatformOrder(); orderToAdd.setId(order.getId()); orderToAdd.setInvoiceLogisticChannelName(logisticChannelIdToNameMap.get(choices.get(0).getLogisticChannelId())); ordersToUpdate.add(orderToAdd); - System.out.println("La ligne " + choices.get(0).getLogisticChannelId() + " a été attribué à commande : " + order.getId()); + log.info("La ligne " + choices.get(0).getLogisticChannelId() + " a été attribué à commande : " + order.getId()); continue; } } // end for orders } // end for in orderMapByCountry } // end for orderMapByShopAndCountry - System.out.println("Orders to Update => "); + log.info("Orders to Update => "); for(PlatformOrder order : ordersToUpdate) { - System.out.println(order.getId()); + log.info(order.getId()); } platformOrderService.updateBatchById(ordersToUpdate); if(!logisticChoiceErrorList.isEmpty()) { @@ -286,10 +260,8 @@ public class LogisticChannelChoiceJob implements Job { private LogisticChannelChoice getHigherLogisticChannelChoice(String shopId, String countryName, Integer priority, List logisticChannelChoiceList, ListIterator> attributeMapIterator, Map countryNameToIdMap) throws JobExecutionException { - System.out.println("On se rabat sur une priorité plus élevée"); + log.info("On se rabat sur une priorité plus élevée"); Map.Entry nextEntry = attributeMapIterator.next(); - System.out.println(nextEntry.getValue() + " ? " + priority); - System.out.println(nextEntry.getKey()); List logisticChannelChoices; LogisticChannelChoice logisticChannelChoice; if(nextEntry.getValue() > priority) { @@ -309,10 +281,8 @@ public class LogisticChannelChoiceJob implements Job { private LogisticChannelChoice getLowerLogisticChannelChoice(String shopId, String countryName, Integer priority, List logisticChannelChoiceList, ListIterator> attributeMapIterator, Map countryNameToIdMap) throws JobExecutionException { - System.out.println("On se rabat sur une priorité plus faible"); + log.info("On se rabat sur une priorité plus faible"); Map.Entry previousEntry = attributeMapIterator.previous(); - System.out.println(previousEntry.getValue() + " ? " + priority); - System.out.println(previousEntry.getKey()); List logisticChannelChoices; LogisticChannelChoice logisticChannelChoice; if(previousEntry.getValue() <= priority) { diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/job/VipInvoicingJob.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/job/VipInvoicingJob.java new file mode 100644 index 000000000..57486ca21 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/job/VipInvoicingJob.java @@ -0,0 +1,109 @@ +package org.jeecg.modules.business.domain.job; + +import freemarker.template.Template; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.tuple.Pair; +import org.jeecg.modules.business.entity.*; +import org.jeecg.modules.business.service.*; +import org.jeecg.modules.business.vo.FactureDetail; +import org.jeecg.modules.business.vo.InvoiceMetaData; +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.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.io.IOException; +import java.time.LocalDate; +import java.util.*; +import java.util.stream.Collectors; + +@Slf4j +public class VipInvoicingJob implements Job { + @Autowired + private IClientService clientService; + @Autowired + private EmailService emailService; + @Autowired + private PlatformOrderShippingInvoiceService platformOrderShippingInvoiceService; + @Autowired + private ISavRefundWithDetailService savRefundWithDetailService; + + @Autowired + Environment env; + @Autowired + private FreeMarkerConfigurer freemarkerConfigurer; + @Override + public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException { + log.info("VIP Invoicing Job executed."); + List clients = clientService.getClientsByType("vip"); + List shippingClientIds = clients.stream().filter(client -> client.getIsCompleteInvoice().equals("0")).map(Client::getId).collect(Collectors.toList()); + List completeClientIds = clients.stream().filter(client -> client.getIsCompleteInvoice().equals("1")).map(Client::getId).collect(Collectors.toList()); + + log.info("shippingClientIds size : " + shippingClientIds.size()); + log.info("completeClientIds size : " + completeClientIds.size()); + List invoiceList = new ArrayList<>(); + if(!shippingClientIds.isEmpty()) { + log.info("Making shipping invoice for clients : {}", shippingClientIds); + invoiceList = new ArrayList<>(platformOrderShippingInvoiceService.breakdownInvoiceClientByType(shippingClientIds, 0)); + } + if(!completeClientIds.isEmpty()) { + log.info("Making complete shipping invoice for clients : {}", completeClientIds); + invoiceList.addAll(platformOrderShippingInvoiceService.breakdownInvoiceClientByType(completeClientIds, 1)); + } + if (invoiceList.isEmpty()) { + log.info("Nothing to invoice."); + return; + } + + List metaDataErrorList = new ArrayList<>(); + log.info("Generating detail files ...0/{}", invoiceList.size()); + int cpt = 1; + for(InvoiceMetaData metaData: invoiceList){ + if(metaData.getInvoiceCode().equals("error")) { + metaDataErrorList.add(metaData); + } + else { + List factureDetails = platformOrderShippingInvoiceService.getInvoiceDetail(metaData.getInvoiceCode()); + List refunds = savRefundWithDetailService.getRefundsByInvoiceNumber(metaData.getInvoiceCode()); + try { + platformOrderShippingInvoiceService.exportToExcel(factureDetails, refunds, metaData.getInvoiceCode(), metaData.getInvoiceEntity(), metaData.getInternalCode()); + } catch (IOException e) { + throw new RuntimeException(e); + } + } + log.info("Generating detail files ...{}/{}", cpt++, invoiceList.size()); + } + if(!metaDataErrorList.isEmpty()) { + String subject = "[" + LocalDate.now() + "] VIP invoicing job report"; + String destEmail = env.getProperty("spring.mail.username"); + Properties prop = emailService.getMailSender(); + Map templateModel = new HashMap<>(); + templateModel.put("errors", metaDataErrorList); + + Session session = Session.getInstance(prop, new Authenticator() { + @Override + protected PasswordAuthentication getPasswordAuthentication() { + return new PasswordAuthentication(env.getProperty("spring.mail.username"), env.getProperty("spring.mail.password")); + } + }); + try { + freemarkerConfigurer = emailService.freemarkerClassLoaderConfig(); + Template freemarkerTemplate = freemarkerConfigurer.getConfiguration() + .getTemplate("vipInvoicingJobReport.ftl"); + String htmlBody = FreeMarkerTemplateUtils.processTemplateIntoString(freemarkerTemplate, templateModel); + emailService.sendSimpleMessage(destEmail, subject, htmlBody, session); + log.info("Mail sent successfully"); + } catch (Exception e) { + log.error("Error while sending mail in VipInvoicingJob", e); + e.printStackTrace(); + } + } + log.info("VIP invoicing job finished."); + } +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/shippingInvoice/ShippingInvoice.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/shippingInvoice/ShippingInvoice.java index a5e8680f3..9ae0e5fba 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/shippingInvoice/ShippingInvoice.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/domain/shippingInvoice/ShippingInvoice.java @@ -66,7 +66,6 @@ public class ShippingInvoice extends AbstractInvoice shopIds = uninvoicedOrdersByShopId.keySet(); - System.out.println(shopIds); Set clientIds = new HashSet<>(); List shops = shopMapper.selectBatchIds(shopIds); shops.forEach(shop -> clientIds.add(clientMapper.selectById(shop.getOwnerId()).getId())); @@ -834,8 +833,6 @@ public class ShippingInvoiceFactory { return estimations; } Set orderSet = ordersMap.keySet(); - System.out.println("orderSet : "); - orderSet.forEach(System.out::println); Map orderMap = orderSet.stream().collect(toMap(PlatformOrder::getId, Function.identity())); Map orderMapByShopId = orderSet.stream().collect(toMap(PlatformOrder::getId, PlatformOrder::getShopId)); List orderContents = ordersMap.values().stream().flatMap(Collection::stream).collect(toList()); @@ -847,7 +844,6 @@ public class ShippingInvoiceFactory { ) ); Collection shopIds = orderMapByShopId.values(); - System.out.println("shopIds : " + shopIds); Client client = clientMapper.selectById(clientId); List shops = shopMapper.selectBatchIds(shopIds); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Balance.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Balance.java index 52d5d637f..0ce58f624 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Balance.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Balance.java @@ -1,6 +1,9 @@ package org.jeecg.modules.business.entity; import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; @@ -67,4 +70,38 @@ public class Balance implements Serializable { @Excel(name = "balance amount", width = 15) @ApiModelProperty(value = "balance amount") private java.math.BigDecimal amount; + + public Balance() { + + } + + public Balance(String id, + String createBy, + Date createTime, + String updateBy, + Date updateTime, + String clientId, + String currencyId, + String operationType, + String operationId, + BigDecimal amount) { + this.id = id; + this.createBy = createBy; + this.createTime = createTime; + this.updateBy = updateBy; + this.updateTime = updateTime; + this.clientId = clientId; + this.currencyId = currencyId; + this.operationType = operationType; + this.operationId = operationId; + this.amount = amount; + } + public static Balance of (String username, + String clientId, + String currencyId, + String operationType, + String operationId, + BigDecimal amount) { + return new Balance(null, username, new Date(), null, null, clientId, currencyId, operationType, operationId, amount); + } } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ClientCategory.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ClientCategory.java new file mode 100644 index 000000000..766963988 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ClientCategory.java @@ -0,0 +1,63 @@ +package org.jeecg.modules.business.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: client category + * @Author: jeecg-boot + * @Date: 2023-10-19 + * @Version: V1.0 + */ +@Data +@TableName("client_category") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="client_category对象", description="client category") +public class ClientCategory implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**category name*/ + @Excel(name = "category name", width = 15) + @ApiModelProperty(value = "category name") + private java.lang.String name; + /**description*/ + @Excel(name = "description", width = 15) + @ApiModelProperty(value = "description") + private java.lang.String description; +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Currency.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Currency.java new file mode 100644 index 000000000..365494f4d --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Currency.java @@ -0,0 +1,67 @@ +package org.jeecg.modules.business.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 货币 + * @Author: jeecg-boot + * @Date: 2023-10-17 + * @Version: V1.0 + */ +@Data +@TableName("currency") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@ApiModel(value="currency对象", description="货币") +public class Currency implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @ApiModelProperty(value = "主键") + private java.lang.String id; + /**创建人*/ + @ApiModelProperty(value = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @ApiModelProperty(value = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @ApiModelProperty(value = "更新日期") + private java.util.Date updateTime; + /**货币代码*/ + @Excel(name = "货币代码", width = 15) + @ApiModelProperty(value = "货币代码") + private java.lang.String code; + /**中文名称*/ + @Excel(name = "中文名称", width = 15) + @ApiModelProperty(value = "中文名称") + private java.lang.String zhName; + /**英文名称*/ + @Excel(name = "英文名称", width = 15) + @ApiModelProperty(value = "英文名称") + private java.lang.String enName; +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ShippingInvoice.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ShippingInvoice.java index 147a41e78..159651f6b 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ShippingInvoice.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/ShippingInvoice.java @@ -53,6 +53,7 @@ public class ShippingInvoice implements Serializable { /** * 客户 ID */ + @Dict(dictTable = "client", dicText = "internal_code", dicCode = "id") @Excel(name = "客户", width = 15) @ApiModelProperty(value = "客户") private String clientId; @@ -156,7 +157,8 @@ public class ShippingInvoice implements Serializable { BigDecimal totalAmount, BigDecimal discountAmount, BigDecimal finalAmount, - BigDecimal paidAmount) { + BigDecimal paidAmount, + String currencyId) { this.id = id; this.createBy = createBy; this.createTime = createTime; @@ -168,6 +170,7 @@ public class ShippingInvoice implements Serializable { this.discountAmount = discountAmount; this.finalAmount = finalAmount; this.paidAmount = paidAmount; + this.currencyId = currencyId; } public static ShippingInvoice of( String username, @@ -175,9 +178,10 @@ public class ShippingInvoice implements Serializable { String invoiceNumber, BigDecimal totalAmount, BigDecimal discountAmount, - BigDecimal paidAmount + BigDecimal paidAmount, + String currencyId ) { return new ShippingInvoice(null, username, new Date(), username, new Date(), clientId, - invoiceNumber, totalAmount, discountAmount, totalAmount.subtract(discountAmount), paidAmount); + invoiceNumber, totalAmount, discountAmount, totalAmount.subtract(discountAmount), paidAmount, currencyId); } } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Transaction.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Transaction.java index 37268790c..28b22ad09 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Transaction.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/entity/Transaction.java @@ -9,7 +9,6 @@ import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; -import org.jeecg.common.aspect.annotation.Dict; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.EqualsAndHashCode; diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BalanceMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BalanceMapper.java index be14a8542..66c9b45e0 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BalanceMapper.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/BalanceMapper.java @@ -18,4 +18,15 @@ import org.springframework.stereotype.Repository; public interface BalanceMapper extends BaseMapper { BigDecimal getBalanceByClientIdAndCurrency(@Param("clientId")String clientId, @Param("currency")String currency); + + void deleteBalance(@Param("operationId") String operationId, @Param("operationType") String operationType); + + void deleteBatchBalance(@Param("operationIds") List operationIds, @Param("operationType") String operationType); + + void editBalance(@Param("operationId") String operationId, + @Param("operationType") String operationType, + @Param("username") String username, + @Param("clientId") String clientId, + @Param("amount") BigDecimal amount, + @Param("currencyId") String currencyId); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ClientCategoryMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ClientCategoryMapper.java new file mode 100644 index 000000000..9c9781c0b --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ClientCategoryMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.business.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.business.entity.ClientCategory; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: client category + * @Author: jeecg-boot + * @Date: 2023-10-19 + * @Version: V1.0 + */ +public interface ClientCategoryMapper extends BaseMapper { + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ClientMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ClientMapper.java index b137543ca..4450611f8 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ClientMapper.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ClientMapper.java @@ -20,4 +20,6 @@ public interface ClientMapper extends BaseMapper { String getClientEntity(@Param("id") String id); Map getClientsEntity(@Param("ids") List ids); String getClientByInternalCode(@Param("code") String code); + + List getClientByType(@Param("type") String type); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/CurrencyMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/CurrencyMapper.java new file mode 100644 index 000000000..8008b3d41 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/CurrencyMapper.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.business.mapper; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.business.entity.Currency; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.springframework.stereotype.Repository; + +/** + * @Description: 货币 + * @Author: jeecg-boot + * @Date: 2023-10-17 + * @Version: V1.0 + */ +@Repository +public interface CurrencyMapper extends BaseMapper { + String getCodeById(@Param("currencyId") String currencyId); + + String getIdByCode(@Param("code") String code); +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/PlatformOrderMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/PlatformOrderMapper.java index fe3c72d76..244e85dfa 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/PlatformOrderMapper.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/PlatformOrderMapper.java @@ -188,6 +188,8 @@ public interface PlatformOrderMapper extends BaseMapper { void cancelBatchInvoice(@Param("invoiceNumbers") List invoiceNumbers); List findUninvoicedOrdersByShopForClient(@Param("shopIds") List shopIds, @Param("erpStatuses") List erpStatuses); + List findUninvoicedOrderIdsByShopForClient(@Param("shopIds") List shopIds, @Param("erpStatuses") List erpStatuses); List fetchEmptyLogisticChannelOrders(@Param("startDate") String startDate,@Param("endDate") String endDate); + } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ShopMapper.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ShopMapper.java index 896db0682..61af732ce 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ShopMapper.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/ShopMapper.java @@ -22,4 +22,6 @@ public interface ShopMapper extends BaseMapper { List selectByClient(@Param("clientID") String clientID); List selectShopIdByClient(@Param("clientID") String clientID); + + List getShopIdsByClientAndType(@Param("clientIds") List clientIds, @Param("type") String clientType); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BalanceMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BalanceMapper.xml index 92b1f7d9b..b56e628dc 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BalanceMapper.xml +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/BalanceMapper.xml @@ -1,14 +1,39 @@ - + + + DELETE + FROM balance + WHERE operation_id = #{operationId} + AND operation_type = #{operationType} + + + DELETE + FROM balance + WHERE operation_id IN + + #{operationId} + + AND operation_type = #{operationType} + + + UPDATE balance + SET amount = #{amount}, + update_by = #{username}, + update_time = NOW(), + currency_id = #{currencyId}, + client_id = #{clientId} + WHERE operation_id = #{operationId} + AND operation_type = #{operationType} + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ClientCategoryMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ClientCategoryMapper.xml new file mode 100644 index 000000000..02b894b6e --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ClientCategoryMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ClientMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ClientMapper.xml index 307cb3ded..068aaab03 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ClientMapper.xml +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ClientMapper.xml @@ -19,4 +19,12 @@ FROM client WHERE internal_code = #{code} + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/CurrencyMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/CurrencyMapper.xml new file mode 100644 index 000000000..197937ef9 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/CurrencyMapper.xml @@ -0,0 +1,14 @@ + + + + + + \ No newline at end of file diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/PlatformOrderMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/PlatformOrderMapper.xml index 784ca1a1b..f325b150c 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/PlatformOrderMapper.xml +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/PlatformOrderMapper.xml @@ -567,6 +567,33 @@ #{shopId} ; + INSERT INTO platform_order_delete(id, create_by, create_time, update_by, diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShippingInvoiceMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShippingInvoiceMapper.xml index 4fdbd22c2..8368613d1 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShippingInvoiceMapper.xml +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShippingInvoiceMapper.xml @@ -15,7 +15,7 @@ WHERE invoice_number = #{invoiceNumber} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShopMapper.xml b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShopMapper.xml index 371191c5c..d5c3bbd73 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShopMapper.xml +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/mapper/xml/ShopMapper.xml @@ -22,4 +22,17 @@ FROM shop WHERE owner_id = #{clientID} AND active = '1' + diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBalanceService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBalanceService.java index 424815ebf..9837ea434 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBalanceService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IBalanceService.java @@ -2,8 +2,10 @@ package org.jeecg.modules.business.service; import org.jeecg.modules.business.entity.Balance; import com.baomidou.mybatisplus.extension.service.IService; +import org.jeecg.modules.business.vo.InvoiceMetaData; import java.math.BigDecimal; +import java.util.List; /** * @Description: balance @@ -14,4 +16,25 @@ import java.math.BigDecimal; public interface IBalanceService extends IService { BigDecimal getBalanceByClientIdAndCurrency(String clientId, String currency); + void updateBalance(String clientId, String invoiceCode, String invoiceType); + void updateBalance(String clientId, String CreditId, BigDecimal amount, String currencyId); + + /** + * Delete balance record + * @param operationId operation id : invoice id or credit id + * @param operationType operation type : invoice or credit + */ + void deleteBalance(String operationId, String operationType); + + /** + * Edit balance record + * @param operationId operation id : invoice id or credit id + * @param operationType operation type : invoice or credit + * @param clientId + * @param amount + * @param currencyId + */ + void editBalance(String operationId, String operationType, String clientId, BigDecimal amount, String currencyId); + + void deleteBatchBalance(List operationIds, String operationType); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IClientCategoryService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IClientCategoryService.java new file mode 100644 index 000000000..34ac42fe2 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IClientCategoryService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.business.service; + +import org.jeecg.modules.business.entity.ClientCategory; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: client category + * @Author: jeecg-boot + * @Date: 2023-10-19 + * @Version: V1.0 + */ +public interface IClientCategoryService extends IService { + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IClientService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IClientService.java index 8c449811f..c787af1a3 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IClientService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IClientService.java @@ -47,4 +47,5 @@ public interface IClientService extends IService { */ Client getCurrentClient(); + List getClientsByType(String type); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/ICurrencyService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/ICurrencyService.java new file mode 100644 index 000000000..cd0e923fc --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/ICurrencyService.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.business.service; + +import org.jeecg.modules.business.entity.Currency; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 货币 + * @Author: jeecg-boot + * @Date: 2023-10-17 + * @Version: V1.0 + */ +public interface ICurrencyService extends IService { + + String getCodeById(String currencyId); + + String getIdByCode(String code); +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IPlatformOrderService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IPlatformOrderService.java index f338ed218..1d31784a4 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IPlatformOrderService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IPlatformOrderService.java @@ -179,11 +179,18 @@ public interface IPlatformOrderService extends IService { /** * Find all order that can be invoiced by small clients (type 2) themselves. - * Invoices of erp_status 1 * @param shopIds list of shop id + * @param erpStatuses list of erp_status * @return list of orders */ List findUninvoicedOrdersByShopForClient(List shopIds, List erpStatuses); + /** + * Get ids of all order that can be invoiced by small clients (type 2) themselves. + * @param shopIds list of shop id + * @param erpStatuses list of erp_status + * @return list of orders + */ + List findUninvoicedOrderIdsByShopForClient(List shopIds, List erpStatuses); /** * Find all order with empty logistic_channel_name and invoice_logistic_channel_name diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IShopService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IShopService.java index f4f8dd100..2234e76ea 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IShopService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/IShopService.java @@ -16,4 +16,6 @@ public interface IShopService extends IService { List listByClient(String clientID); List listIdByClient(String clientID); + + List getShopIdsByClientAndType(List clientIds, String clientType); } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/PlatformOrderShippingInvoiceService.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/PlatformOrderShippingInvoiceService.java index 3cccd532d..4c562f3eb 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/PlatformOrderShippingInvoiceService.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/PlatformOrderShippingInvoiceService.java @@ -3,6 +3,7 @@ package org.jeecg.modules.business.service; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import lombok.extern.slf4j.Slf4j; import org.apache.shiro.SecurityUtils; +import org.apache.shiro.subject.Subject; import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.business.controller.UserException; import org.jeecg.modules.business.domain.excel.SheetManager; @@ -40,11 +41,15 @@ import java.util.zip.ZipOutputStream; @Slf4j public class PlatformOrderShippingInvoiceService { + @Autowired + ICurrencyService currencyService; @Autowired ShippingInvoiceMapper shippingInvoiceMapper; @Autowired PlatformOrderMapper platformOrderMapper; @Autowired + IBalanceService balanceService; + @Autowired ClientMapper clientMapper; @Autowired ShopMapper shopMapper; @@ -165,7 +170,14 @@ public class PlatformOrderShippingInvoiceService { platformOrderService, clientMapper, shopMapper, logisticChannelMapper, logisticChannelPriceMapper, platformOrderContentService, skuDeclaredValueService, countryService, exchangeRatesMapper, purchaseOrderService, purchaseOrderContentMapper, skuPromotionHistoryMapper, savRefundService, savRefundWithDetailService); - String username = ((LoginUser) SecurityUtils.getSubject().getPrincipal()).getUsername(); + Subject subject = null; + try { + subject = SecurityUtils.getSubject(); + } + catch (Exception e) { + log.error("Error while getting subject", e); + } + String username = subject == null ? "admin" : ((LoginUser) subject.getPrincipal()).getUsername(); // Creates invoice by factory ShippingInvoice invoice = factory.createInvoice(param.clientID(), param.shopIDs(), @@ -278,6 +290,7 @@ public class PlatformOrderShippingInvoiceService { Path out = Paths.get(INVOICE_DIR, filename); Files.copy(src, out, StandardCopyOption.REPLACE_EXISTING); invoice.toExcelFile(out); + String currencyId = currencyService.getIdByCode(invoice.client().getCurrency()); // save to DB org.jeecg.modules.business.entity.ShippingInvoice shippingInvoiceEntity = org.jeecg.modules.business.entity.ShippingInvoice.of( username, @@ -285,7 +298,8 @@ public class PlatformOrderShippingInvoiceService { invoice.code(), invoice.getTotalAmount(), invoice.reducedAmount(), - invoice.paidAmount() + invoice.paidAmount(), + currencyId ); shippingInvoiceMapper.insert(shippingInvoiceEntity); return new InvoiceMetaData(filename, invoice.code(), invoice.client().getInternalCode(), invoice.client().getInvoiceEntity(), ""); @@ -455,6 +469,11 @@ public class PlatformOrderShippingInvoiceService { } for(Map.Entry> entry: clientShopIDsMap.entrySet()) { Period period = getValidPeriod(entry.getValue()); + if(!period.isValid()) { + String internalCode = clientMapper.selectById(entry.getKey()).getInternalCode(); + invoiceList.add(new InvoiceMetaData("", "error", internalCode, entry.getKey(), "No order to invoice.")); + continue; + } Calendar calendar = Calendar.getInstance(); calendar.setTime(period.start()); String start = calendar.get(Calendar.YEAR) + "-" + (calendar.get(Calendar.MONTH)+1 < 10 ? "0" : "") + (calendar.get(Calendar.MONTH)+1) + "-" + (calendar.get(Calendar.DAY_OF_MONTH) < 10 ? "0" : "") + (calendar.get(Calendar.DAY_OF_MONTH)); @@ -466,13 +485,18 @@ public class PlatformOrderShippingInvoiceService { try { ShippingInvoiceParam param = new ShippingInvoiceParam(entry.getKey(), entry.getValue(), start, end, Collections.singletonList(3), Arrays.asList("0", "1")); InvoiceMetaData metaData; - if(invoiceType == 0) + if(invoiceType == 0) { metaData = makeInvoice(param); - else + balanceService.updateBalance(entry.getKey(), metaData.getInvoiceCode(), "shipping"); + } + else { metaData = makeCompleteInvoicePostShipping(param, "post"); + balanceService.updateBalance(entry.getKey(), metaData.getInvoiceCode(), "complete"); + } invoiceList.add(metaData); } catch (UserException | IOException | ParseException e) { - invoiceList.add(new InvoiceMetaData("", "error", "", entry.getKey(), e.getMessage())); + String internalCode = clientMapper.selectById(entry.getKey()).getInternalCode(); + invoiceList.add(new InvoiceMetaData("", "error", internalCode, entry.getKey(), e.getMessage())); log.error(e.getMessage()); } System.gc(); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BalanceServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BalanceServiceImpl.java index 93c795b2f..e6912a7f1 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BalanceServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/BalanceServiceImpl.java @@ -1,14 +1,25 @@ package org.jeecg.modules.business.service.impl; +import org.checkerframework.checker.units.qual.A; import org.jeecg.modules.business.entity.Balance; +import org.jeecg.modules.business.entity.PlatformOrder; +import org.jeecg.modules.business.entity.PlatformOrderContent; +import org.jeecg.modules.business.entity.ShippingInvoice; import org.jeecg.modules.business.mapper.BalanceMapper; import org.jeecg.modules.business.service.IBalanceService; +import org.jeecg.modules.business.service.ICurrencyService; +import org.jeecg.modules.business.service.IPlatformOrderService; +import org.jeecg.modules.business.service.IShippingInvoiceService; +import org.jeecg.modules.system.entity.SysUser; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import java.math.BigDecimal; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; /** * @Description: balance @@ -20,8 +31,64 @@ import java.math.BigDecimal; public class BalanceServiceImpl extends ServiceImpl implements IBalanceService { @Autowired private BalanceMapper balanceMapper; + @Autowired + private ICurrencyService currencyService; + @Autowired + private IPlatformOrderService platformOrderService; + @Autowired + IShippingInvoiceService iShippingInvoiceService; @Override public BigDecimal getBalanceByClientIdAndCurrency(String clientId, String currency) { return balanceMapper.getBalanceByClientIdAndCurrency(clientId, currency); } + + @Override + public void updateBalance(String clientId, String invoiceCode, String invoiceType) { + + // balance update + ShippingInvoice invoice = iShippingInvoiceService.getShippingInvoice(invoiceCode); + String currency = currencyService.getCodeById(invoice.getCurrencyId()); + BigDecimal previousBalance = getBalanceByClientIdAndCurrency(clientId, currency); + BigDecimal currentBalance = previousBalance.subtract(invoice.getFinalAmount()); + if(invoiceType.equals("complete")) { + List orderIds = iShippingInvoiceService.getPlatformOrder(invoiceCode).stream().map(PlatformOrder::getId).collect(Collectors.toList()); + Map> orderMap = platformOrderService.fetchOrderData(orderIds); + BigDecimal purchaseFees = BigDecimal.ZERO; + for(Map.Entry> entry : orderMap.entrySet()) { + for(PlatformOrderContent content : entry.getValue()) { + purchaseFees = purchaseFees.add(content.getPurchaseFee()); + } + } + currentBalance = currentBalance.add(purchaseFees); + } + SysUser sysUser = new SysUser(); + Balance balance = Balance.of(sysUser.getUsername(), clientId, invoice.getCurrencyId(), "Debit", invoice.getId(), currentBalance); + balanceMapper.insert(balance); + } + + @Override + public void updateBalance(String clientId, String CreditId, BigDecimal amount, String currencyId) { + String currency = currencyService.getCodeById(currencyId); + BigDecimal previousBalance = getBalanceByClientIdAndCurrency(clientId, currency); + BigDecimal currentBalance = previousBalance.add(amount); + SysUser sysUser = new SysUser(); + Balance balance = Balance.of(sysUser.getUsername(), clientId, currencyId, "Credit", CreditId, currentBalance); + balanceMapper.insert(balance); + } + + @Override + public void deleteBalance(String operationId, String operationType) { + balanceMapper.deleteBalance(operationId, operationType); + } + + @Override + public void deleteBatchBalance(List operationIds, String operationType) { + balanceMapper.deleteBatchBalance(operationIds, operationType); + } + @Override + public void editBalance(String operationId, String operationType, String clientId, BigDecimal amount, String currencyId) { + SysUser sysUser = new SysUser(); + balanceMapper.editBalance(operationId, operationType, sysUser.getUsername(), clientId, amount, currencyId); + } + } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ClientCategoryServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ClientCategoryServiceImpl.java new file mode 100644 index 000000000..3d6c8ba03 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ClientCategoryServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.business.service.impl; + +import org.jeecg.modules.business.entity.ClientCategory; +import org.jeecg.modules.business.mapper.ClientCategoryMapper; +import org.jeecg.modules.business.service.IClientCategoryService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: client category + * @Author: jeecg-boot + * @Date: 2023-10-19 + * @Version: V1.0 + */ +@Service +public class ClientCategoryServiceImpl extends ServiceImpl implements IClientCategoryService { + +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ClientServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ClientServiceImpl.java index 716c804a5..5f451350d 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ClientServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ClientServiceImpl.java @@ -118,6 +118,11 @@ public class ClientServiceImpl extends ServiceImpl impleme return clientUserMap.selectClientByUserId(sysUser.getId()); } + @Override + public List getClientsByType(String type) { + return clientMapper.getClientByType(type); + } + @Override public String getClientEntity(String id) { return clientMapper.getClientEntity(id); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/CurrencyServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/CurrencyServiceImpl.java new file mode 100644 index 000000000..13a0517cf --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/CurrencyServiceImpl.java @@ -0,0 +1,32 @@ +package org.jeecg.modules.business.service.impl; + +import lombok.extern.slf4j.Slf4j; +import org.jeecg.modules.business.entity.Currency; +import org.jeecg.modules.business.mapper.CurrencyMapper; +import org.jeecg.modules.business.service.ICurrencyService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 货币 + * @Author: jeecg-boot + * @Date: 2023-10-17 + * @Version: V1.0 + */ +@Slf4j +@Service +public class CurrencyServiceImpl extends ServiceImpl implements ICurrencyService { + @Autowired + private CurrencyMapper currencyMapper; + @Override + public String getCodeById(String currencyId) { + return currencyMapper.getCodeById(currencyId); + } + + @Override + public String getIdByCode(String code) { + return currencyMapper.getIdByCode(code); + } +} diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/PlatformOrderServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/PlatformOrderServiceImpl.java index 6a51df0e2..a3753b85b 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/PlatformOrderServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/PlatformOrderServiceImpl.java @@ -400,6 +400,11 @@ public class PlatformOrderServiceImpl extends ServiceImpl findUninvoicedOrderIdsByShopForClient(List shopIds, List erpStatuses) { + return platformOrderMap.findUninvoicedOrderIdsByShopForClient(shopIds, erpStatuses); + } + @Override public List fetchEmptyLogisticChannelOrders(String startDate, String endDate) { return platformOrderMap.fetchEmptyLogisticChannelOrders(startDate, endDate); diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ShopServiceImpl.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ShopServiceImpl.java index cd9ce1db6..4dfb38de8 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ShopServiceImpl.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/service/impl/ShopServiceImpl.java @@ -33,4 +33,9 @@ public class ShopServiceImpl extends ServiceImpl implements IS public List listIdByClient(String clientID) { return shopMapper.selectShopIdByClient(clientID); } + + @Override + public List getShopIdsByClientAndType(List clientIds, String clientType) { + return shopMapper.getShopIdsByClientAndType(clientIds, clientType); + } } diff --git a/jeecg-module-system/jeecg-system-biz/src/main/resources/templates/vipInvoicingJobReport.ftl b/jeecg-module-system/jeecg-system-biz/src/main/resources/templates/vipInvoicingJobReport.ftl new file mode 100644 index 000000000..728917954 --- /dev/null +++ b/jeecg-module-system/jeecg-system-biz/src/main/resources/templates/vipInvoicingJobReport.ftl @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + +
+ + logo + +
+ + + + + + + + + + + + +
Cher(s) collègue(s),
Des erreurs se sont produites lors du déroulement de la tâche plannifiée : VIP invoicing job
Erreurs : + <#if errors?size = 0> + No error + +
+ + + + + + + + <#list errors as error> + + + + + + +
ClientError Message
${error.internalCode}${error.errorMsg}
+
Merci d’utiliser nos services.
Cordialement
L’équipe WIA Sourcing.
+ + + + + + + + + + + + + + + + + + + +
Ce message a été envoyé automatiquement. Merci de ne pas répondre. Ce message et ainsi que toutes les pièces jointes sont confidentielles.
Si vous avez reçu ce message par erreur, merci de nous avertir immédiatement et de détruire ce message.
Service client :
Pour obtenir plus d’informations concernant nos services, veuillez nous contacter à l’adresse ci-dessous ou en visitant notre site web.
+ + + + + + + + +
Nous contacterNotre site web
+ + + + + + + + + + + + +
WIA SOURCING
© 2018/2023 par WIA Sourcing Agency.
TOUS DROITS RÉSERVÉS©
+ + + + + + \ No newline at end of file