mirror of https://github.com/jeecgboot/jeecg-boot
Merge pull request #49 from LQYBill/fix/clientInvoice
fix : display shipping invoiced orders with invoiceable purchase fees…pull/6221/head
commit
323d22935c
|
@ -468,7 +468,7 @@ public class InvoiceController {
|
||||||
((LoginUser) SecurityUtils.getSubject().getPrincipal()).getUsername(),
|
((LoginUser) SecurityUtils.getSubject().getPrincipal()).getUsername(),
|
||||||
shopIds);
|
shopIds);
|
||||||
List<String> shopIdList = Arrays.asList(shopIds.split(","));
|
List<String> shopIdList = Arrays.asList(shopIds.split(","));
|
||||||
List<PlatformOrder> orders = platformOrderService.findUninvoicedOrdersByShopForClient(shopIdList, Collections.singletonList(1));
|
List<PlatformOrder> orders = platformOrderService.findUninvoicedShippingOrdersByShopForClient(shopIdList, Collections.singletonList(1));
|
||||||
|
|
||||||
IPage<PlatformOrder> page = new Page<>();
|
IPage<PlatformOrder> page = new Page<>();
|
||||||
page.setRecords(orders);
|
page.setRecords(orders);
|
||||||
|
@ -486,11 +486,10 @@ public class InvoiceController {
|
||||||
log.info("User : {} is requesting uninvoiced orders for shops : [{}]",
|
log.info("User : {} is requesting uninvoiced orders for shops : [{}]",
|
||||||
((LoginUser) SecurityUtils.getSubject().getPrincipal()).getUsername(),
|
((LoginUser) SecurityUtils.getSubject().getPrincipal()).getUsername(),
|
||||||
shopIds);
|
shopIds);
|
||||||
List<MutableTriple<PlatformOrder, String, String>> ordersAndStatus = new ArrayList<>();
|
|
||||||
List<MutableTriple<PlatformOrderFront, String, String>> finalOrderAndStatus = new ArrayList<>();
|
|
||||||
|
|
||||||
// checking shipping data availability
|
// checking shipping data availability
|
||||||
List<String> shopIdList = Arrays.asList(shopIds.split(","));
|
List<String> shopIdList = Arrays.asList(shopIds.split(","));
|
||||||
|
// fetch order that can be invoice either by shipping or purchase or both
|
||||||
List<PlatformOrder> orders = platformOrderService.findUninvoicedOrdersByShopForClient(shopIdList, Collections.singletonList(1));
|
List<PlatformOrder> orders = platformOrderService.findUninvoicedOrdersByShopForClient(shopIdList, Collections.singletonList(1));
|
||||||
if(orders.isEmpty())
|
if(orders.isEmpty())
|
||||||
return Result.OK("No order to invoice.");
|
return Result.OK("No order to invoice.");
|
||||||
|
@ -498,74 +497,96 @@ public class InvoiceController {
|
||||||
List<String> orderIds = orders.stream().map(PlatformOrder::getId).collect(Collectors.toList());
|
List<String> orderIds = orders.stream().map(PlatformOrder::getId).collect(Collectors.toList());
|
||||||
Map<PlatformOrder, List<PlatformOrderContent>> orderContentMap = platformOrderService.fetchOrderData(orderIds);
|
Map<PlatformOrder, List<PlatformOrderContent>> orderContentMap = platformOrderService.fetchOrderData(orderIds);
|
||||||
|
|
||||||
|
Map<String, String> errorMapToOrderId = new HashMap<>();
|
||||||
|
List<PlatformOrderFront> orderFronts = new ArrayList<>();
|
||||||
|
|
||||||
for(Map.Entry<PlatformOrder, List<PlatformOrderContent>> entry : orderContentMap.entrySet()) {
|
for(Map.Entry<PlatformOrder, List<PlatformOrderContent>> entry : orderContentMap.entrySet()) {
|
||||||
PlatformOrderFront orderFront = new PlatformOrderFront();
|
PlatformOrderFront orderFront = new PlatformOrderFront();
|
||||||
boolean hasError = false;
|
BeanUtils.copyProperties(entry.getKey(), orderFront);
|
||||||
//rename shop id by shop name to prevent it to leak in front
|
|
||||||
entry.getKey().setShopId(shops.get(entry.getKey().getShopId()));
|
|
||||||
// checks if logistic channel is missing
|
|
||||||
if(entry.getKey().getLogisticChannelName().isEmpty() && entry.getKey().getInvoiceLogisticChannelName() == null) {
|
|
||||||
ordersAndStatus.add(MutableTriple.of(entry.getKey(), "Error : Missing logistic channel for order : " + entry.getKey().getPlatformOrderId(), ""));
|
|
||||||
hasError = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
//rename shop id by shop name to prevent it to leak in front
|
||||||
|
orderFront.setShopId(shops.get(orderFront.getShopId()));
|
||||||
|
// set default value of shipping and purchase availability
|
||||||
|
orderFront.setShippingAvailable(PlatformOrderFront.invoiceStatus.Available.code);
|
||||||
|
orderFront.setPurchaseAvailable(PlatformOrderFront.invoiceStatus.Available.code);
|
||||||
List<String> skuIds = entry.getValue().stream().map(PlatformOrderContent::getSkuId).distinct().collect(Collectors.toList());
|
List<String> skuIds = entry.getValue().stream().map(PlatformOrderContent::getSkuId).distinct().collect(Collectors.toList());
|
||||||
// finds the first sku that isn't in db
|
// finds the first sku that isn't in db
|
||||||
List<Sku> skuIdsFound = skuService.listByIds(skuIds);
|
List<Sku> skuIdsFound = skuService.listByIds(skuIds);
|
||||||
if(skuIdsFound.size() != skuIds.size()) {
|
if(skuIdsFound.size() != skuIds.size()) {
|
||||||
if(ordersAndStatus.stream().noneMatch(order -> order.getLeft().getId().equals(entry.getKey().getId())))
|
if(!errorMapToOrderId.containsKey(entry.getKey().getPlatformOrderId()))
|
||||||
ordersAndStatus.add(MutableTriple.of(entry.getKey(), "Error : Missing one or more sku in db for order : " + entry.getKey().getPlatformOrderId(), "Error : Missing one or more sku in db for order : " + entry.getKey().getPlatformOrderId()));
|
errorMapToOrderId.put(entry.getKey().getPlatformOrderId(), "Error : Missing one or more sku in db for order : " + entry.getKey().getPlatformOrderId());
|
||||||
else {
|
else
|
||||||
ordersAndStatus.get(ordersAndStatus.size() - 1).setMiddle((ordersAndStatus.get(ordersAndStatus.size() - 1).getMiddle() + " and missing one or more sku in db for order : " + entry.getKey().getPlatformOrderId()));
|
errorMapToOrderId.put(entry.getKey().getPlatformOrderId(), errorMapToOrderId.get(entry.getKey().getPlatformOrderId()) + " and missing one or more sku in db");
|
||||||
ordersAndStatus.get(ordersAndStatus.size() - 1).setRight((ordersAndStatus.get(ordersAndStatus.size() - 1).getRight() + " and missing one or more sku in db for order : " + entry.getKey().getPlatformOrderId()));
|
|
||||||
|
orderFront.setShippingAvailable(PlatformOrderFront.invoiceStatus.Unavailable.code);
|
||||||
|
orderFront.setPurchaseAvailable(PlatformOrderFront.invoiceStatus.Unavailable.code);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(entry.getKey().getShippingInvoiceNumber() == null) {
|
||||||
|
// checks if logistic channel is missing
|
||||||
|
if(entry.getKey().getLogisticChannelName().isEmpty() && entry.getKey().getInvoiceLogisticChannelName() == null) {
|
||||||
|
if(!errorMapToOrderId.containsKey(entry.getKey().getPlatformOrderId()))
|
||||||
|
errorMapToOrderId.put(entry.getKey().getPlatformOrderId(), "Error : Missing logistic channel for order : " + entry.getKey().getPlatformOrderId());
|
||||||
|
else
|
||||||
|
errorMapToOrderId.put(entry.getKey().getPlatformOrderId(), errorMapToOrderId.get(entry.getKey().getPlatformOrderId()) + " and missing logistic channel");
|
||||||
|
orderFront.setShippingAvailable(PlatformOrderFront.invoiceStatus.Unavailable.code);
|
||||||
|
}
|
||||||
|
// finds the first product with missing weight
|
||||||
|
String missingWeightProductId = productService.searchFirstEmptyWeightProduct(skuIds);
|
||||||
|
if(missingWeightProductId != null) {
|
||||||
|
if(!errorMapToOrderId.containsKey(entry.getKey().getPlatformOrderId()))
|
||||||
|
errorMapToOrderId.put(entry.getKey().getPlatformOrderId(), "Error : Missing one or more weight for order : " + entry.getKey().getPlatformOrderId());
|
||||||
|
else
|
||||||
|
errorMapToOrderId.put(entry.getKey().getPlatformOrderId(), errorMapToOrderId.get(entry.getKey().getPlatformOrderId()) + " and missing weight");
|
||||||
|
orderFront.setShippingAvailable(PlatformOrderFront.invoiceStatus.Unavailable.code);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(entry.getKey().getPurchaseInvoiceNumber() == null) {
|
||||||
|
// finds the first sku with missing price
|
||||||
|
String missingPriceSkuId = skuService.searchFirstMissingPriceSku(skuIds);
|
||||||
|
if(missingPriceSkuId != null) {
|
||||||
|
if(!errorMapToOrderId.containsKey(entry.getKey().getPlatformOrderId()))
|
||||||
|
errorMapToOrderId.put(entry.getKey().getPlatformOrderId(), "Error : Missing one or more sku price for order : " + entry.getKey().getPlatformOrderId());
|
||||||
|
else
|
||||||
|
errorMapToOrderId.put(entry.getKey().getPlatformOrderId(), errorMapToOrderId.get(entry.getKey().getPlatformOrderId()) + " and missing one or more sku price");
|
||||||
|
orderFront.setPurchaseAvailable(PlatformOrderFront.invoiceStatus.Unavailable.code);
|
||||||
}
|
}
|
||||||
hasError = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// finds the first product with missing weight
|
// set purchase order status (-1 = unavailable, 0 = available, 1 = invoiced, 2 = paid)
|
||||||
String missingWeightProductId = productService.searchFirstEmptyWeightProduct(skuIds);
|
if(entry.getKey().getProductAvailable() == null) {
|
||||||
if(missingWeightProductId != null) {
|
orderFront.setProductAvailable(PlatformOrderFront.productStatus.Unavailable.code);
|
||||||
if(ordersAndStatus.stream().noneMatch(order -> order.getLeft().getId().equals(entry.getKey().getId())))
|
entry.getKey().setProductAvailable(PlatformOrderFront.productStatus.Unavailable.code);
|
||||||
ordersAndStatus.add(MutableTriple.of(entry.getKey(), "Error : Missing one or more weight for order : " + entry.getKey().getPlatformOrderId(), ""));
|
|
||||||
else
|
|
||||||
ordersAndStatus.get(ordersAndStatus.size() - 1).setMiddle((ordersAndStatus.get(ordersAndStatus.size() - 1).getMiddle() + " and missing weight for order : " + entry.getKey().getPlatformOrderId()));
|
|
||||||
hasError = true;
|
|
||||||
}
|
}
|
||||||
// finds the first sku with missing price
|
if(entry.getKey().getProductAvailable().equals(PlatformOrderFront.productStatus.Unavailable.code)
|
||||||
String missingPriceSkuId = skuService.searchFirstMissingPriceSku(skuIds);
|
&& entry.getKey().getVirtualProductAvailable().equals(PlatformOrderFront.productStatus.Available.code)
|
||||||
if(missingPriceSkuId != null) {
|
&& entry.getKey().getPurchaseInvoiceNumber() == null
|
||||||
if(ordersAndStatus.stream().noneMatch(order -> order.getLeft().getId().equals(entry.getKey().getId())))
|
)
|
||||||
ordersAndStatus.add(MutableTriple.of(entry.getKey(), "OK", "Error : Missing one or more sku price for order : " + entry.getKey().getPlatformOrderId()));
|
orderFront.setProductAvailable(PlatformOrderFront.productStatus.Ordered.code);
|
||||||
else
|
|
||||||
ordersAndStatus.get(ordersAndStatus.size() - 1).setRight( ordersAndStatus.get(ordersAndStatus.size() -1).getRight() + "and missing one or more sku price for order : " + entry.getKey().getPlatformOrderId());
|
|
||||||
hasError = true;
|
|
||||||
}
|
|
||||||
if(!hasError) ordersAndStatus.add(MutableTriple.of(entry.getKey(), "OK", "OK"));
|
|
||||||
|
|
||||||
if(entry.getKey().getProductAvailable().equals("0") && entry.getKey().getVirtualProductAvailable().equals("1"))
|
|
||||||
entry.getKey().setProductAvailable("2");
|
|
||||||
if(entry.getKey().getPurchaseInvoiceNumber() != null) {
|
if(entry.getKey().getPurchaseInvoiceNumber() != null) {
|
||||||
PurchaseOrder purchase = purchaseOrderService.getPurchaseByInvoiceNumber(entry.getKey().getPurchaseInvoiceNumber());
|
PurchaseOrder purchase = purchaseOrderService.getPurchaseByInvoiceNumber(entry.getKey().getPurchaseInvoiceNumber());
|
||||||
if(purchase.getStatus().equals("1"))
|
if(purchase.getPaidAmount().compareTo(BigDecimal.ZERO) == 0)
|
||||||
entry.getKey().setProductAvailable("3");
|
orderFront.setPurchaseAvailable(PlatformOrderFront.invoiceStatus.Invoiced.code);// invoiced
|
||||||
else
|
else
|
||||||
entry.getKey().setProductAvailable("4");
|
orderFront.setPurchaseAvailable(PlatformOrderFront.invoiceStatus.Paid.code);// paid
|
||||||
}
|
}
|
||||||
BeanUtils.copyProperties(entry.getKey(), orderFront);
|
// set shipping order status (-1 = unavailable, 0 = available, 1 = invoiced, 2 = paid)
|
||||||
finalOrderAndStatus.add(MutableTriple.of(orderFront, ordersAndStatus.get(ordersAndStatus.size() - 1).getMiddle(), ordersAndStatus.get(ordersAndStatus.size() - 1).getRight()));
|
if(entry.getKey().getShippingInvoiceNumber() != null) {
|
||||||
|
ShippingInvoice shippingInvoice = iShippingInvoiceService.getShippingInvoice(entry.getKey().getShippingInvoiceNumber());
|
||||||
|
if(shippingInvoice.getPaidAmount().compareTo(BigDecimal.ZERO) == 0) {
|
||||||
|
orderFront.setShippingAvailable(PlatformOrderFront.invoiceStatus.Invoiced.code); // invoiced
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
orderFront.setShippingAvailable(PlatformOrderFront.invoiceStatus.Paid.code); // paid
|
||||||
|
}
|
||||||
|
}
|
||||||
|
orderFronts.add(orderFront);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<String> errorMessages = new ArrayList<>();
|
List<String> errorMessages = new ArrayList<>(errorMapToOrderId.values());
|
||||||
for(MutableTriple<PlatformOrderFront, String, String> orderAndStatus : finalOrderAndStatus) {
|
|
||||||
if(!orderAndStatus.getMiddle().equals("OK")) {
|
|
||||||
errorMessages.add(orderAndStatus.getMiddle());
|
|
||||||
}
|
|
||||||
if(!orderAndStatus.getRight().equals("OK")) {
|
|
||||||
errorMessages.add(orderAndStatus.getRight());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// sorting by order time ascending
|
// sorting by order time ascending
|
||||||
finalOrderAndStatus = finalOrderAndStatus.stream().sorted(Comparator.comparing(o -> o.getLeft().getOrderTime())).collect(Collectors.toList());
|
orderFronts = orderFronts.stream().sorted(Comparator.comparing(PlatformOrderFront::getOrderTime)).collect(Collectors.toList());
|
||||||
// system notification
|
// system notification
|
||||||
String errors = SECTION_START;
|
String errors = SECTION_START;
|
||||||
int max_entries = 100;
|
int max_entries = 100;
|
||||||
|
@ -589,9 +610,9 @@ public class InvoiceController {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
IPage<MutableTriple<PlatformOrderFront, String, String>> page = new Page<>();
|
IPage<PlatformOrderFront> page = new Page<>();
|
||||||
page.setRecords(finalOrderAndStatus);
|
page.setRecords(orderFronts);
|
||||||
page.setTotal(finalOrderAndStatus.size());
|
page.setTotal(orderFronts.size());
|
||||||
return Result.OK(page);
|
return Result.OK(page);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ public class TransactionController {
|
||||||
public Result<?> debit(@RequestParam("clientId") String clientId, @RequestParam("currency") String currency) {
|
public Result<?> debit(@RequestParam("clientId") String clientId, @RequestParam("currency") String currency) {
|
||||||
List<String> errorMessages = new ArrayList<>();
|
List<String> errorMessages = new ArrayList<>();
|
||||||
List<String> shopIds = shopService.listIdByClient(clientId);
|
List<String> shopIds = shopService.listIdByClient(clientId);
|
||||||
List<PlatformOrder> orders = platformOrderService.findUninvoicedOrdersByShopForClient(shopIds, Arrays.asList(1,2,3));
|
List<PlatformOrder> orders = platformOrderService.findUninvoicedShippingOrdersByShopForClient(shopIds, Arrays.asList(1,2,3));
|
||||||
if(orders.isEmpty())
|
if(orders.isEmpty())
|
||||||
return Result.OK("No order to invoice.");
|
return Result.OK("No order to invoice.");
|
||||||
Date startDate = orders.stream().map(PlatformOrder::getOrderTime).min(Date::compareTo).get();
|
Date startDate = orders.stream().map(PlatformOrder::getOrderTime).min(Date::compareTo).get();
|
||||||
|
|
|
@ -90,7 +90,12 @@ public class PurchaseOrder implements Serializable {
|
||||||
@Excel(name = "最终金额", width = 15)
|
@Excel(name = "最终金额", width = 15)
|
||||||
@ApiModelProperty(value = "最终金额")
|
@ApiModelProperty(value = "最终金额")
|
||||||
private java.math.BigDecimal finalAmount;
|
private java.math.BigDecimal finalAmount;
|
||||||
|
/**
|
||||||
|
* paid amount
|
||||||
|
*/
|
||||||
|
@Excel(name = "已付金额", width = 15)
|
||||||
|
@ApiModelProperty(value = "已付金额")
|
||||||
|
private java.math.BigDecimal paidAmount;
|
||||||
/**
|
/**
|
||||||
* 订单发票号
|
* 订单发票号
|
||||||
*/
|
*/
|
||||||
|
@ -98,12 +103,6 @@ public class PurchaseOrder implements Serializable {
|
||||||
@ApiModelProperty(value = "订单发票号")
|
@ApiModelProperty(value = "订单发票号")
|
||||||
private String invoiceNumber;
|
private String invoiceNumber;
|
||||||
|
|
||||||
/**
|
|
||||||
* Purchase status
|
|
||||||
*/
|
|
||||||
@Excel(name = "status", width = 15)
|
|
||||||
@ApiModelProperty(value = "status")
|
|
||||||
private String status;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Payment document
|
* Payment document
|
||||||
|
|
|
@ -185,6 +185,7 @@ public interface PlatformOrderMapper extends BaseMapper<PlatformOrder> {
|
||||||
void cancelInvoice(@Param("invoiceNumber") String invoiceNumber);
|
void cancelInvoice(@Param("invoiceNumber") String invoiceNumber);
|
||||||
void cancelBatchInvoice(@Param("invoiceNumbers") List<String> invoiceNumbers);
|
void cancelBatchInvoice(@Param("invoiceNumbers") List<String> invoiceNumbers);
|
||||||
|
|
||||||
|
List<PlatformOrder> findUninvoicedShippingOrdersByShopForClient(@Param("shopIds") List<String> shopIds, @Param("erpStatuses") List<Integer> erpStatuses);
|
||||||
List<PlatformOrder> findUninvoicedOrdersByShopForClient(@Param("shopIds") List<String> shopIds, @Param("erpStatuses") List<Integer> erpStatuses);
|
List<PlatformOrder> findUninvoicedOrdersByShopForClient(@Param("shopIds") List<String> shopIds, @Param("erpStatuses") List<Integer> erpStatuses);
|
||||||
List<String> findUninvoicedOrderIdsByShopForClient(@Param("shopIds") List<String> shopIds, @Param("erpStatuses") List<Integer> erpStatuses);
|
List<String> findUninvoicedOrderIdsByShopForClient(@Param("shopIds") List<String> shopIds, @Param("erpStatuses") List<Integer> erpStatuses);
|
||||||
|
|
||||||
|
@ -209,4 +210,5 @@ public interface PlatformOrderMapper extends BaseMapper<PlatformOrder> {
|
||||||
List<ShippingFeeBillableOrders> fetchShippingFeeBillableOrders();
|
List<ShippingFeeBillableOrders> fetchShippingFeeBillableOrders();
|
||||||
|
|
||||||
List<PlatformOrder> getPlatformOrdersByInvoiceNumber(@Param("invoiceNumber") String invoiceNumber);
|
List<PlatformOrder> getPlatformOrdersByInvoiceNumber(@Param("invoiceNumber") String invoiceNumber);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -548,7 +548,7 @@
|
||||||
WHERE erp_status IN (4,5)
|
WHERE erp_status IN (4,5)
|
||||||
AND order_time < #{endDate};
|
AND order_time < #{endDate};
|
||||||
</select>
|
</select>
|
||||||
<select id="findUninvoicedOrdersByShopForClient" resultType="org.jeecg.modules.business.entity.PlatformOrder">
|
<select id="findUninvoicedShippingOrdersByShopForClient" resultType="org.jeecg.modules.business.entity.PlatformOrder">
|
||||||
SELECT *
|
SELECT *
|
||||||
FROM platform_order
|
FROM platform_order
|
||||||
WHERE erp_status IN
|
WHERE erp_status IN
|
||||||
|
@ -575,6 +575,35 @@
|
||||||
#{shopId}
|
#{shopId}
|
||||||
</foreach>;
|
</foreach>;
|
||||||
</select>
|
</select>
|
||||||
|
<select id="findUninvoicedOrdersByShopForClient" resultType="org.jeecg.modules.business.entity.PlatformOrder">
|
||||||
|
SELECT *
|
||||||
|
FROM platform_order
|
||||||
|
WHERE erp_status IN
|
||||||
|
<foreach
|
||||||
|
collection="erpStatuses"
|
||||||
|
separator=","
|
||||||
|
open="("
|
||||||
|
close=")"
|
||||||
|
index="index"
|
||||||
|
item="erpStatus"
|
||||||
|
>
|
||||||
|
#{erpStatus}
|
||||||
|
</foreach>
|
||||||
|
AND (shipping_invoice_number IS NULL
|
||||||
|
OR (shipping_invoice_number LIKE '%%%%-%%-2%%%'
|
||||||
|
AND purchase_invoice_number IS NULL))
|
||||||
|
AND shop_id IN
|
||||||
|
<foreach
|
||||||
|
collection="shopIds"
|
||||||
|
separator=","
|
||||||
|
open="("
|
||||||
|
close=")"
|
||||||
|
index="index"
|
||||||
|
item="shopId"
|
||||||
|
>
|
||||||
|
#{shopId}
|
||||||
|
</foreach>;
|
||||||
|
</select>
|
||||||
<insert id="insertPlatformOrdersArchives" parameterType="list">
|
<insert id="insertPlatformOrdersArchives" parameterType="list">
|
||||||
INSERT INTO platform_order_delete(id, create_by,
|
INSERT INTO platform_order_delete(id, create_by,
|
||||||
create_time, update_by,
|
create_time, update_by,
|
||||||
|
|
|
@ -180,11 +180,19 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
|
||||||
void cancelBatchInvoice(List<String> invoiceNumbers);
|
void cancelBatchInvoice(List<String> invoiceNumbers);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Find all order that can be invoiced themselves.
|
* 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
|
||||||
*/
|
*/
|
||||||
|
List<PlatformOrder> findUninvoicedShippingOrdersByShopForClient(List<String> shopIds, List<Integer> erpStatuses);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Find all order that can be invoiced (shipping and purchase).
|
||||||
|
* @param shopIds
|
||||||
|
* @param erpStatuses
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
List<PlatformOrder> findUninvoicedOrdersByShopForClient(List<String> shopIds, List<Integer> erpStatuses);
|
List<PlatformOrder> findUninvoicedOrdersByShopForClient(List<String> shopIds, List<Integer> erpStatuses);
|
||||||
/**
|
/**
|
||||||
* 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.
|
||||||
|
@ -219,4 +227,5 @@ public interface IPlatformOrderService extends IService<PlatformOrder> {
|
||||||
*/
|
*/
|
||||||
List<ShippingFeeBillableOrders> fetchShippingFeeBillableOrders();
|
List<ShippingFeeBillableOrders> fetchShippingFeeBillableOrders();
|
||||||
List<PlatformOrder> getPlatformOrdersByInvoiceNumber(String invoiceNumber);
|
List<PlatformOrder> getPlatformOrdersByInvoiceNumber(String invoiceNumber);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,6 +399,11 @@ public class PlatformOrderServiceImpl extends ServiceImpl<PlatformOrderMapper, P
|
||||||
platformOrderMap.cancelBatchInvoice(invoiceNumbers);
|
platformOrderMap.cancelBatchInvoice(invoiceNumbers);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<PlatformOrder> findUninvoicedShippingOrdersByShopForClient(List<String> shopIds, List<Integer> erpStatuses) {
|
||||||
|
return platformOrderMap.findUninvoicedShippingOrdersByShopForClient(shopIds, erpStatuses);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PlatformOrder> findUninvoicedOrdersByShopForClient(List<String> shopIds, List<Integer> erpStatuses) {
|
public List<PlatformOrder> findUninvoicedOrdersByShopForClient(List<String> shopIds, List<Integer> erpStatuses) {
|
||||||
return platformOrderMap.findUninvoicedOrdersByShopForClient(shopIds, erpStatuses);
|
return platformOrderMap.findUninvoicedOrdersByShopForClient(shopIds, erpStatuses);
|
||||||
|
|
|
@ -93,4 +93,40 @@ public class PlatformOrderFront {
|
||||||
@Excel(name = "有货(1=有,0=没有)", width = 15)
|
@Excel(name = "有货(1=有,0=没有)", width = 15)
|
||||||
@ApiModelProperty(value = "有货(1=有,0=没有)")
|
@ApiModelProperty(value = "有货(1=有,0=没有)")
|
||||||
private String productAvailable;
|
private String productAvailable;
|
||||||
|
/**
|
||||||
|
* 可开物流票(0=不可,1=可)
|
||||||
|
*/
|
||||||
|
@Excel(name = "可开物流票(0=不可,1=可)", width = 15)
|
||||||
|
@ApiModelProperty(value = "可开物流票(0=不可,1=可)")
|
||||||
|
private String shippingAvailable;
|
||||||
|
/**
|
||||||
|
* 可开采购票(0=不可,1=可)
|
||||||
|
*/
|
||||||
|
@Excel(name = "可开采购票(0=不可,1=可)", width = 15)
|
||||||
|
@ApiModelProperty(value = "可开采购票(0=不可,1=可)")
|
||||||
|
private String purchaseAvailable;
|
||||||
|
|
||||||
|
public enum invoiceStatus {
|
||||||
|
Unavailable("-1"),
|
||||||
|
Available("0"),
|
||||||
|
Invoiced("1"),
|
||||||
|
Paid("2");
|
||||||
|
|
||||||
|
public final String code;
|
||||||
|
|
||||||
|
invoiceStatus(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public enum productStatus {
|
||||||
|
Unavailable("0"),
|
||||||
|
Available("1"),
|
||||||
|
Ordered("2");
|
||||||
|
|
||||||
|
public final String code;
|
||||||
|
|
||||||
|
productStatus(String code) {
|
||||||
|
this.code = code;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue