修改更新欠费状态功能
This commit is contained in:
+53
@@ -116,6 +116,59 @@ public class BillingController extends BaseController
|
||||
return success(prcOrderBillService.getBill(billId));
|
||||
}
|
||||
|
||||
/**
|
||||
* Batch update order credit arrears status (ARREARS -> NORMAL) with available-credit check.
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('price:billing:arrearsUpdate')")
|
||||
@Log(title = "Billing credit arrears", businessType = BusinessType.UPDATE)
|
||||
@PutMapping("/bill/creditArrears")
|
||||
public AjaxResult updateCreditArrears(@RequestBody java.util.List<String> billIds)
|
||||
{
|
||||
if (billIds == null || billIds.isEmpty())
|
||||
{
|
||||
return error("请勾选要更新的订单");
|
||||
}
|
||||
int success = 0;
|
||||
java.util.List<String> fails = new java.util.ArrayList<String>();
|
||||
for (String billId : billIds)
|
||||
{
|
||||
try
|
||||
{
|
||||
prcOrderBillService.updateCreditArrearsStatus(billId);
|
||||
success++;
|
||||
}
|
||||
catch (RuntimeException e)
|
||||
{
|
||||
String msg = e.getMessage();
|
||||
if (msg == null || msg.isEmpty())
|
||||
{
|
||||
msg = e.getClass().getSimpleName();
|
||||
}
|
||||
fails.add((billId == null ? "" : billId) + ": " + msg);
|
||||
}
|
||||
}
|
||||
if (fails.isEmpty())
|
||||
{
|
||||
return success("成功更新 " + success + " 条");
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
sb.append("成功 ").append(success).append(" 条,失败 ").append(fails.size()).append(" 条");
|
||||
int limit = Math.min(fails.size(), 5);
|
||||
for (int i = 0; i < limit; i++)
|
||||
{
|
||||
sb.append(";").append(fails.get(i));
|
||||
}
|
||||
if (fails.size() > limit)
|
||||
{
|
||||
sb.append("…");
|
||||
}
|
||||
if (success > 0)
|
||||
{
|
||||
return success(sb.toString());
|
||||
}
|
||||
return error(sb.toString());
|
||||
}
|
||||
|
||||
@PreAuthorize("@ss.hasPermi('price:billing:feeAdd')")
|
||||
@Log(title = "Billing income fee", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/bill/fee")
|
||||
|
||||
Reference in New Issue
Block a user