优化计费逻辑

This commit is contained in:
wuweihua
2026-10-17 01:37:33 +08:00
parent 52f714c760
commit db6f5e882a
29 changed files with 1460 additions and 145 deletions
@@ -131,7 +131,7 @@ public class TabOrderMonitorController extends BaseController
return success(tabOrderMonitorService.selectOrderIdsByProduct(query));
}
@PreAuthorize("@ss.hasPermi('monitor:orderSource:sync')")
@PreAuthorize("@ss.hasPermi('monitor:orderSource:sync') or @ss.hasPermi('price:orderBill:rebill')")
@Log(title = "order source sync filter", businessType = BusinessType.UPDATE)
@PostMapping("/syncByFilter")
public AjaxResult syncByFilter(@RequestBody TabOrderMonitorQuery query)
@@ -157,7 +157,7 @@ public class TabOrderMonitorController extends BaseController
return success(data);
}
@PreAuthorize("@ss.hasPermi('monitor:orderSource:sync') or @ss.hasPermi('monitor:orderSource:list')")
@PreAuthorize("@ss.hasPermi('monitor:orderSource:sync') or @ss.hasPermi('monitor:orderSource:list') or @ss.hasPermi('price:orderBill:rebill')")
@GetMapping("/syncTask/{asyncTaskId}")
public AjaxResult syncTaskProgress(@PathVariable("asyncTaskId") String asyncTaskId)
{
@@ -169,7 +169,7 @@ public class TabOrderMonitorController extends BaseController
return success(task);
}
@PreAuthorize("@ss.hasPermi('monitor:orderSource:sync')")
@PreAuthorize("@ss.hasPermi('monitor:orderSource:sync') or @ss.hasPermi('price:orderBill:rebill')")
@Log(title = "order source sync selected", businessType = BusinessType.UPDATE)
@PostMapping("/sync")
public AjaxResult syncSelected(@RequestBody List<TabOrderMonitorVo> rows)
@@ -193,7 +193,7 @@ public class TabOrderMonitorController extends BaseController
return success(data);
}
@PreAuthorize("@ss.hasPermi('monitor:orderSource:list')")
@PreAuthorize("@ss.hasPermi('monitor:orderSource:list') or @ss.hasPermi('price:orderBill:list')")
@GetMapping("/syncLog/list")
public TableDataInfo syncLogList(
@RequestParam(value = "bizId", required = false) String bizId,
@@ -211,7 +211,7 @@ public class TabOrderMonitorController extends BaseController
return rsp;
}
@PreAuthorize("@ss.hasPermi('monitor:orderSource:list')")
@PreAuthorize("@ss.hasPermi('monitor:orderSource:list') or @ss.hasPermi('price:orderBill:list')")
@GetMapping("/syncLog/{docId}")
public AjaxResult syncLogInfo(@PathVariable("docId") String docId)
{
@@ -1,6 +1,8 @@
package com.bms.web.controller.price;
import java.io.ByteArrayInputStream;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
@@ -127,29 +129,68 @@ public class BillingController extends BaseController
@GetMapping("/bill/list")
public TableDataInfo billList(PrcOrderBill query)
{
if (query == null)
{
query = new PrcOrderBill();
}
// Billing list only shows success and the three soft misses.
query.setBillingFailStatuses(limitBillingListFailStatus(query.getBillingFailStatuses()));
query.setBillingFailStatus(null);
startPage();
List<PrcOrderBill> list = prcOrderBillService.selectBillList(query);
return getDataTable(list);
}
private static List<Integer> limitBillingListFailStatus(List<Integer> requested)
{
List<Integer> allowed = Arrays.asList(Integer.valueOf(0), Integer.valueOf(1), Integer.valueOf(2), Integer.valueOf(3));
if (requested == null || requested.isEmpty())
{
return new ArrayList<Integer>(allowed);
}
List<Integer> kept = new ArrayList<Integer>();
for (Integer status : requested)
{
if (status != null && allowed.contains(status) && !kept.contains(status))
{
kept.add(status);
}
}
if (kept.isEmpty())
{
kept.add(Integer.valueOf(-1));
}
return kept;
}
/** All prc_order_bill rows. Billing list stays limited to status 0-3. */
@PreAuthorize("@ss.hasPermi('price:orderBill:list')")
@GetMapping("/orderBill/list")
public TableDataInfo orderBillList(PrcOrderBill query)
{
startPage();
List<PrcOrderBill> list = prcOrderBillService.selectBillList(query == null ? new PrcOrderBill() : query);
return getDataTable(list);
}
/**
* Order no options for remote-search dropdown (bill list multi search).
*/
@PreAuthorize("@ss.hasPermi('price:billing:bill')")
@PreAuthorize("@ss.hasPermi('price:billing:bill') or @ss.hasPermi('price:orderBill:list')")
@GetMapping("/bill/orderNos")
public AjaxResult orderNoOptions(@RequestParam(value = "keyword", required = false) String keyword)
{
return success(prcOrderBillService.listOrderNoOptions(buildBillOptionQuery(keyword)));
}
@PreAuthorize("@ss.hasPermi('price:billing:bill')")
@PreAuthorize("@ss.hasPermi('price:billing:bill') or @ss.hasPermi('price:orderBill:list')")
@GetMapping("/bill/trackingNos")
public AjaxResult trackingNoOptions(@RequestParam(value = "keyword", required = false) String keyword)
{
return success(prcOrderBillService.listTrackingNoOptions(buildBillOptionQuery(keyword)));
}
@PreAuthorize("@ss.hasPermi('price:billing:bill')")
@PreAuthorize("@ss.hasPermi('price:billing:bill') or @ss.hasPermi('price:orderBill:list')")
@GetMapping("/bill/transferNos")
public AjaxResult transferNoOptions(@RequestParam(value = "keyword", required = false) String keyword)
{
@@ -167,7 +208,7 @@ public class BillingController extends BaseController
return query;
}
@PreAuthorize("@ss.hasPermi('price:billing:bill')")
@PreAuthorize("@ss.hasPermi('price:billing:bill') or @ss.hasPermi('price:orderBill:list')")
@GetMapping("/bill/{billId}")
public AjaxResult getBill(@PathVariable String billId)
{