diff --git a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/PlatformOrderController.java b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/PlatformOrderController.java index adc00054d..b2e008c63 100644 --- a/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/PlatformOrderController.java +++ b/jeecg-module-system/jeecg-system-biz/src/main/java/org/jeecg/modules/business/controller/admin/PlatformOrderController.java @@ -1,8 +1,64 @@ package org.jeecg.modules.business.controller.admin; import com.alibaba.fastjson.JSON; -import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.google.common.base.CaseFormat; +import com.google.common.collect.Lists; +import freemarker.template.Template; +import freemarker.template.TemplateException; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.SecurityUtils; +import org.codehaus.jettison.json.JSONException; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.vo.LoginUser; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.business.domain.api.mabang.dochangeorder.ChangeOrderResponse; +import org.jeecg.modules.business.domain.api.mabang.dochangeorder.ChangeWarehouseRequest; +import org.jeecg.modules.business.domain.api.mabang.dochangeorder.ChangeWarehouseRequestBody; +import org.jeecg.modules.business.domain.api.mabang.getorderlist.*; +import org.jeecg.modules.business.domain.api.shouman.JsonOrderCreationRequestBody; +import org.jeecg.modules.business.domain.api.shouman.OrderCreationRequest; +import org.jeecg.modules.business.domain.api.shouman.OrderCreationRequestBody; +import org.jeecg.modules.business.domain.api.shouman.ShoumanOrderRequest; +import org.jeecg.modules.business.domain.job.ThrottlingExecutorService; +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.Shouman.ShoumanOrder; +import org.jeecg.modules.business.entity.ShoumanOrderContent; +import org.jeecg.modules.business.mapper.PlatformOrderContentMapper; +import org.jeecg.modules.business.mapper.PlatformOrderMapper; +import org.jeecg.modules.business.service.*; +import org.jeecg.modules.business.vo.*; +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.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +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.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; + +import javax.mail.Authenticator; +import javax.mail.MessagingException; +import javax.mail.PasswordAuthentication; +import javax.mail.Session; +import javax.servlet.http.HttpServletRequest; import java.io.IOException; import java.time.LocalDate; import java.time.format.DateTimeFormatter; @@ -12,92 +68,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; -import javax.mail.Authenticator; -import javax.mail.MessagingException; -import javax.mail.PasswordAuthentication; -import javax.mail.Session; -import javax.servlet.http.HttpServletRequest; - -import com.alibaba.fastjson.JSONObject; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.google.common.base.CaseFormat; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import lombok.extern.slf4j.Slf4j; -import org.apache.poi.util.StringUtil; -import org.apache.shiro.SecurityUtils; -import org.jeecg.common.api.vo.Result; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.common.system.vo.LoginUser; -import org.jeecg.common.util.oConvertUtils; -import org.jeecg.modules.business.domain.api.mabang.getorderlist.OrderStatus; -import org.jeecg.modules.business.domain.api.shouman.JsonOrderCreationRequestBody; -import org.jeecg.modules.business.domain.api.shouman.OrderCreationRequest; -import org.jeecg.modules.business.domain.api.shouman.OrderCreationRequestBody; -import org.jeecg.modules.business.domain.api.shouman.ShoumanOrderRequest; -import org.jeecg.modules.business.entity.PlatformOrder; -import org.jeecg.modules.business.entity.PlatformOrderContent; -import org.jeecg.modules.business.entity.Shouman.ShoumanOrder; -import org.jeecg.modules.business.entity.ShoumanOrderContent; -import org.jeecg.modules.business.mapper.PlatformOrderContentMapper; -import com.google.common.collect.Lists; -import freemarker.template.Template; -import freemarker.template.TemplateException; -import org.codehaus.jettison.json.JSONException; -import org.jeecg.modules.business.domain.api.mabang.dochangeorder.ChangeOrderResponse; -import org.jeecg.modules.business.domain.api.mabang.dochangeorder.ChangeWarehouseRequest; -import org.jeecg.modules.business.domain.api.mabang.dochangeorder.ChangeWarehouseRequestBody; -import org.jeecg.modules.business.domain.api.mabang.getorderlist.*; -import org.jeecg.modules.business.domain.job.ThrottlingExecutorService; -import org.jeecg.modules.business.entity.Client; -import org.jeecg.modules.business.mapper.PlatformOrderMapper; -import org.jeecg.modules.business.service.*; -import org.jeecg.modules.business.vo.*; -import org.jeecg.modules.business.service.IPlatformOrderService; -import org.jeecg.modules.business.service.IShoumanOrderService; -import org.jeecg.modules.business.vo.PlatformOrderPage; -import org.jeecg.modules.business.vo.PlatformOrderQuantity; -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.vo.LoginUser; -import org.apache.shiro.SecurityUtils; -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.PlatformOrderContent; -import org.jeecg.modules.business.entity.PlatformOrder; -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.core.env.Environment; -import org.springframework.ui.freemarker.FreeMarkerTemplateUtils; -import org.springframework.transaction.annotation.Transactional; -import org.springframework.web.bind.annotation.*; -import org.springframework.web.servlet.ModelAndView; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; -import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; -import com.baomidou.mybatisplus.core.metadata.IPage; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import lombok.extern.slf4j.Slf4j; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiOperation; -import org.jeecg.common.aspect.annotation.AutoLog; -import org.springframework.web.servlet.view.freemarker.FreeMarkerConfigurer; - import static org.jeecg.modules.business.vo.PlatformOrderOperation.Action.*; -import org.springframework.web.servlet.ModelAndView; - -import javax.servlet.http.HttpServletRequest; -import java.io.IOException; -import java.util.*; -import java.util.stream.Collectors; /** * @Description: 平台订单表 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 8beb7a125..29a4ab0d5 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 @@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService; import org.jeecg.modules.business.controller.UserException; import org.jeecg.modules.business.domain.api.yd.YDTrackingNumberData; import org.jeecg.modules.business.entity.*; -import org.jeecg.modules.business.vo.PlatformOrderOption; -import org.jeecg.modules.business.vo.PlatformOrderQuantity; -import org.jeecg.modules.business.vo.ShippingFeeBillableOrders; -import org.jeecg.modules.business.vo.SkuQuantity; +import org.jeecg.modules.business.vo.*; import org.jeecg.modules.business.vo.clientPlatformOrder.ClientPlatformOrderPage; import org.jeecg.modules.business.vo.clientPlatformOrder.PurchaseConfirmation; import org.jeecg.modules.business.vo.clientPlatformOrder.section.ClientInfo; @@ -17,7 +14,10 @@ import org.jeecg.modules.business.vo.clientPlatformOrder.section.OrdersStatistic import java.io.Serializable; import java.time.LocalDateTime; -import java.util.*; +import java.util.Collection; +import java.util.Date; +import java.util.List; +import java.util.Map; /** * @Description: 平台订单表 @@ -105,6 +105,7 @@ public interface IPlatformOrderService extends IService { * @return list of pre-shipping orders and their contents */ Map> fetchOrderData(List orderIds); + Map> fetchOrderDataByInvoiceCode(String invoiceCode); @@ -127,7 +128,7 @@ public interface IPlatformOrderService extends IService { List fetchBillCodesOfParcelsWithoutTrace(Date startDate, Date endDate, List transporters); - List fetchUninvoicedOrdersForShops(LocalDateTime startDate, LocalDateTime endDate, List shops); + List fetchUninvoicedOrdersForShops(LocalDateTime startDate, LocalDateTime endDate, List shops); /** * Fetch platformOrderId of shipped AND invoiced orders, from startDatetime to endDatetime, excluding orders from @@ -144,6 +145,7 @@ public interface IPlatformOrderService extends IService { List fetchOrderInShopsReadyForShopifySync(List shopCodes); List fetchOrderInShopsWithoutShopifyNote(List shopCodes); + List fetchOrderInShopsReadyForAbnNumberJob(List shopCodes); List fetchUninvoicedShippedOrderIDInShops(String startDate, String endDate, List shops, List warehouses); @@ -151,8 +153,9 @@ public interface IPlatformOrderService extends IService { /** * Fetch all platform orders between 2 dates and of status erp_status 4 or 5 * this list will then be archived + * * @param startDate Start date time - * @param endDate End date time + * @param endDate End date time * @return List of PlatformOrder */ List fetchOrdersToArchiveBetweenDate(String startDate, String endDate); @@ -168,24 +171,28 @@ public interface IPlatformOrderService extends IService { /** * Archive a list of platform orders + * * @param platformOrders list of platform orders */ void savePlatformOrderArchive(List platformOrders); /** * Cancel Invoice + * * @param invoiceNumber */ - void cancelInvoice(String invoiceNumber); + void cancelInvoice(String invoiceNumber, String clientId); /** * Cancel Invoice + * * @param invoiceNumbers */ void cancelBatchInvoice(List invoiceNumbers); /** * Find all order that can be invoiced (shipping only). - * @param shopIds list of shop id + * + * @param shopIds list of shop id * @param erpStatuses list of erp_status * @return list of orders */ @@ -193,6 +200,7 @@ public interface IPlatformOrderService extends IService { /** * Find all orders that can be invoiced (purchase only). + * * @param shopIds * @param erpStatuses * @return @@ -201,6 +209,7 @@ public interface IPlatformOrderService extends IService { /** * Find all order that can be invoiced (shipping and purchase). + * * @param shopIds * @param erpStatuses * @param column @@ -209,10 +218,11 @@ public interface IPlatformOrderService extends IService { * @param pageSize * @return */ - List findUninvoicedOrdersByShopForClient(List shopIds, List erpStatuses); + List findUninvoicedOrdersByShopForClient(List shopIds, List erpStatuses, String column, String order, Integer pageNo, Integer pageSize); /** * Get ids of all order that can be invoiced by small clients (type 2) themselves. - * @param shopIds list of shop id + * + * @param shopIds list of shop id * @param erpStatuses list of erp_status * @return list of orders */ @@ -220,6 +230,7 @@ public interface IPlatformOrderService extends IService { /** * Find all order with empty logistic_channel_name and invoice_logistic_channel_name + * * @param startDate * @param endDate * @return @@ -233,15 +244,18 @@ public interface IPlatformOrderService extends IService { List selectByPlatformOrderIds(List platformOrderIds); void removePurchaseInvoiceNumber(String purchaseInvoiceNumber, String clientId); + void removePurchaseInvoiceNumbers(List invoiceNumbers); void updatePurchaseInvoiceNumber(List orderIds, String invoiceCode); /** * Fetch all orders with productAvailable = 1, purchaseInvoiceNumber NOT NULL, invoiceNumber NULL and erp_status IN (1,2) + * * @return */ List fetchShippingFeeBillableOrders(); + List getPlatformOrdersByInvoiceNumber(String invoiceNumber); Map fetchShippingPeriodAndType(String invoiceNumber); @@ -252,15 +266,18 @@ public interface IPlatformOrderService extends IService { List ordersByShop(String shopID); List fetchUninvoicedOrdersWithSkusInCountry(LocalDateTime startDateTime, LocalDateTime endDateTime, String shop, List skus, List countries); + List fetchUninvoicedOrdersWithSkusNotInCountry(LocalDateTime startDateTime, LocalDateTime endDateTime, String shop, List skus, List countries); List findReadyAbnormalOrders(List skus, List shops); List findReadyAbnormalOrdersWithSkus(List skus); + void updateShopifySynced(Collection platformOrderIds); List fetchShippedOrdersFromShopAndTransporters(String shopCode, List transporters); void updateLocalTrackingNumber(List data); + void pagePotentialShoumanOrders(IPage page, String column, String order); }