Continue resolving conflicts

pull/8040/head
Qiuyi LI 2024-10-14 16:15:43 +02:00
parent f32e44fc04
commit dee3f4be13
2 changed files with 85 additions and 97 deletions

View File

@ -1,8 +1,64 @@
package org.jeecg.modules.business.controller.admin; package org.jeecg.modules.business.controller.admin;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; 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.io.IOException;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;
@ -12,92 +68,7 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
import java.util.stream.Collectors; 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 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: * @Description:

View File

@ -5,10 +5,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.business.controller.UserException; import org.jeecg.modules.business.controller.UserException;
import org.jeecg.modules.business.domain.api.yd.YDTrackingNumberData; import org.jeecg.modules.business.domain.api.yd.YDTrackingNumberData;
import org.jeecg.modules.business.entity.*; import org.jeecg.modules.business.entity.*;
import org.jeecg.modules.business.vo.PlatformOrderOption; import org.jeecg.modules.business.vo.*;
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.clientPlatformOrder.ClientPlatformOrderPage; import org.jeecg.modules.business.vo.clientPlatformOrder.ClientPlatformOrderPage;
import org.jeecg.modules.business.vo.clientPlatformOrder.PurchaseConfirmation; import org.jeecg.modules.business.vo.clientPlatformOrder.PurchaseConfirmation;
import org.jeecg.modules.business.vo.clientPlatformOrder.section.ClientInfo; 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.io.Serializable;
import java.time.LocalDateTime; import java.time.LocalDateTime;
import java.util.*; import java.util.Collection;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* @Description: * @Description:
@ -105,6 +105,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
* @return list of pre-shipping orders and their contents * @return list of pre-shipping orders and their contents
*/ */
Map<PlatformOrder, List<PlatformOrderContent>> fetchOrderData(List<String> orderIds); Map<PlatformOrder, List<PlatformOrderContent>> fetchOrderData(List<String> orderIds);
Map<PlatformOrder, List<PlatformOrderContent>> fetchOrderDataByInvoiceCode(String invoiceCode); Map<PlatformOrder, List<PlatformOrderContent>> fetchOrderDataByInvoiceCode(String invoiceCode);
@ -127,7 +128,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
List<String> fetchBillCodesOfParcelsWithoutTrace(Date startDate, Date endDate, List<String> transporters); List<String> fetchBillCodesOfParcelsWithoutTrace(Date startDate, Date endDate, List<String> transporters);
List<String> fetchUninvoicedOrdersForShops(LocalDateTime startDate, LocalDateTime endDate, List<String> shops); List<PlatformOrder> fetchUninvoicedOrdersForShops(LocalDateTime startDate, LocalDateTime endDate, List<String> shops);
/** /**
* Fetch platformOrderId of shipped AND invoiced orders, from startDatetime to endDatetime, excluding orders from * Fetch platformOrderId of shipped AND invoiced orders, from startDatetime to endDatetime, excluding orders from
@ -144,6 +145,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
List<PlatformOrderShopSync> fetchOrderInShopsReadyForShopifySync(List<String> shopCodes); List<PlatformOrderShopSync> fetchOrderInShopsReadyForShopifySync(List<String> shopCodes);
List<PlatformOrderShopSync> fetchOrderInShopsWithoutShopifyNote(List<String> shopCodes); List<PlatformOrderShopSync> fetchOrderInShopsWithoutShopifyNote(List<String> shopCodes);
List<PlatformOrder> fetchOrderInShopsReadyForAbnNumberJob(List<String> shopCodes); List<PlatformOrder> fetchOrderInShopsReadyForAbnNumberJob(List<String> shopCodes);
List<PlatformOrder> fetchUninvoicedShippedOrderIDInShops(String startDate, String endDate, List<String> shops, List<String> warehouses); List<PlatformOrder> fetchUninvoicedShippedOrderIDInShops(String startDate, String endDate, List<String> shops, List<String> warehouses);
@ -151,6 +153,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
/** /**
* Fetch all platform orders between 2 dates and of status erp_status 4 or 5 * Fetch all platform orders between 2 dates and of status erp_status 4 or 5
* this list will then be archived * this list will then be archived
*
* @param startDate Start date time * @param startDate Start date time
* @param endDate End date time * @param endDate End date time
* @return List of PlatformOrder * @return List of PlatformOrder
@ -168,23 +171,27 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
/** /**
* Archive a list of platform orders * Archive a list of platform orders
*
* @param platformOrders list of platform orders * @param platformOrders list of platform orders
*/ */
void savePlatformOrderArchive(List<PlatformOrder> platformOrders); void savePlatformOrderArchive(List<PlatformOrder> platformOrders);
/** /**
* Cancel Invoice * Cancel Invoice
*
* @param invoiceNumber * @param invoiceNumber
*/ */
void cancelInvoice(String invoiceNumber); void cancelInvoice(String invoiceNumber, String clientId);
/** /**
* Cancel Invoice * Cancel Invoice
*
* @param invoiceNumbers * @param invoiceNumbers
*/ */
void cancelBatchInvoice(List<String> invoiceNumbers); void cancelBatchInvoice(List<String> invoiceNumbers);
/** /**
* Find all order that can be invoiced (shipping only). * 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 * @param erpStatuses list of erp_status
* @return list of orders * @return list of orders
@ -193,6 +200,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
/** /**
* Find all orders that can be invoiced (purchase only). * Find all orders that can be invoiced (purchase only).
*
* @param shopIds * @param shopIds
* @param erpStatuses * @param erpStatuses
* @return * @return
@ -201,6 +209,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
/** /**
* Find all order that can be invoiced (shipping and purchase). * Find all order that can be invoiced (shipping and purchase).
*
* @param shopIds * @param shopIds
* @param erpStatuses * @param erpStatuses
* @param column * @param column
@ -209,9 +218,10 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
* @param pageSize * @param pageSize
* @return * @return
*/ */
List<PlatformOrder> findUninvoicedOrdersByShopForClient(List<String> shopIds, List<Integer> erpStatuses); List<PlatformOrder> findUninvoicedOrdersByShopForClient(List<String> shopIds, List<Integer> erpStatuses, String column, String order, Integer pageNo, Integer pageSize);
/** /**
* Get ids of all order that can be invoiced by small clients (type 2) themselves. * 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 * @param erpStatuses list of erp_status
* @return list of orders * @return list of orders
@ -220,6 +230,7 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
/** /**
* Find all order with empty logistic_channel_name and invoice_logistic_channel_name * Find all order with empty logistic_channel_name and invoice_logistic_channel_name
*
* @param startDate * @param startDate
* @param endDate * @param endDate
* @return * @return
@ -233,15 +244,18 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
List<PlatformOrder> selectByPlatformOrderIds(List<String> platformOrderIds); List<PlatformOrder> selectByPlatformOrderIds(List<String> platformOrderIds);
void removePurchaseInvoiceNumber(String purchaseInvoiceNumber, String clientId); void removePurchaseInvoiceNumber(String purchaseInvoiceNumber, String clientId);
void removePurchaseInvoiceNumbers(List<String> invoiceNumbers); void removePurchaseInvoiceNumbers(List<String> invoiceNumbers);
void updatePurchaseInvoiceNumber(List<String> orderIds, String invoiceCode); void updatePurchaseInvoiceNumber(List<String> orderIds, String invoiceCode);
/** /**
* Fetch all orders with productAvailable = 1, purchaseInvoiceNumber NOT NULL, invoiceNumber NULL and erp_status IN (1,2) * Fetch all orders with productAvailable = 1, purchaseInvoiceNumber NOT NULL, invoiceNumber NULL and erp_status IN (1,2)
*
* @return * @return
*/ */
List<ShippingFeeBillableOrders> fetchShippingFeeBillableOrders(); List<ShippingFeeBillableOrders> fetchShippingFeeBillableOrders();
List<PlatformOrder> getPlatformOrdersByInvoiceNumber(String invoiceNumber); List<PlatformOrder> getPlatformOrdersByInvoiceNumber(String invoiceNumber);
Map<String, String> fetchShippingPeriodAndType(String invoiceNumber); Map<String, String> fetchShippingPeriodAndType(String invoiceNumber);
@ -252,15 +266,18 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
List<PlatformOrderOption> ordersByShop(String shopID); List<PlatformOrderOption> ordersByShop(String shopID);
List<String> fetchUninvoicedOrdersWithSkusInCountry(LocalDateTime startDateTime, LocalDateTime endDateTime, String shop, List<String> skus, List<String> countries); List<String> fetchUninvoicedOrdersWithSkusInCountry(LocalDateTime startDateTime, LocalDateTime endDateTime, String shop, List<String> skus, List<String> countries);
List<String> fetchUninvoicedOrdersWithSkusNotInCountry(LocalDateTime startDateTime, LocalDateTime endDateTime, String shop, List<String> skus, List<String> countries); List<String> fetchUninvoicedOrdersWithSkusNotInCountry(LocalDateTime startDateTime, LocalDateTime endDateTime, String shop, List<String> skus, List<String> countries);
List<String> findReadyAbnormalOrders(List<String> skus, List<String> shops); List<String> findReadyAbnormalOrders(List<String> skus, List<String> shops);
List<String> findReadyAbnormalOrdersWithSkus(List<String> skus); List<String> findReadyAbnormalOrdersWithSkus(List<String> skus);
void updateShopifySynced(Collection<String> platformOrderIds); void updateShopifySynced(Collection<String> platformOrderIds);
List<String> fetchShippedOrdersFromShopAndTransporters(String shopCode, List<String> transporters); List<String> fetchShippedOrdersFromShopAndTransporters(String shopCode, List<String> transporters);
void updateLocalTrackingNumber(List<YDTrackingNumberData> data); void updateLocalTrackingNumber(List<YDTrackingNumberData> data);
void pagePotentialShoumanOrders(IPage<PlatformOrderPage> page, String column, String order); void pagePotentialShoumanOrders(IPage<PlatformOrderPage> page, String column, String order);
} }