调整应付配置和应付列表订单的费用重算

This commit is contained in:
liuminghui
2026-11-17 17:47:01 +08:00
parent 9483bb4899
commit 6b2b205083
45 changed files with 1448 additions and 2131 deletions
@@ -19,6 +19,7 @@ import com.bms.price.domain.PayOrderQuery;
import com.bms.price.domain.PayOrderRecalcCommand;
import com.bms.price.domain.PayOrderRecalcTask;
import com.bms.price.service.IPayOrderListService;
import com.bms.price.service.IPrcOrderBillService;
/** 提单管理下的应付列表。 */
@RestController
@@ -28,6 +29,9 @@ public class PayOrderController extends BaseController
@Autowired
private IPayOrderListService payOrderListService;
@Autowired
private IPrcOrderBillService orderBillService;
@PreAuthorize("@ss.hasPermi('price:payOrder:list')")
@GetMapping("/list")
public TableDataInfo list(PayOrderQuery query)
@@ -82,6 +86,19 @@ public class PayOrderController extends BaseController
return success(payOrderListService.cancelRecalc(taskId));
}
/**
* 应付列表里的订单详情。带出应收费用和应付费用,不按计费列表的销售员权限过滤。
*
* @param billId 计费订单 ID
* @return 订单、应收明细和应付明细
*/
@PreAuthorize("@ss.hasPermi('price:payOrder:query')")
@GetMapping("/{billId}")
public AjaxResult detail(@PathVariable Long billId)
{
return success(orderBillService.getPayOrderBill(billId));
}
/**
* 查看一票订单的应付费用,按 A、B、C、D 四段返回。
*
@@ -30,10 +30,10 @@ import com.bms.price.domain.PayProduct;
import com.bms.price.domain.PayProductTerm;
import com.bms.price.domain.PaySaveCommand;
import com.bms.price.pay.PayDetailExporter;
import com.bms.price.domain.PaySurchargeRuleSave;
import com.bms.price.pay.PayChargeMode;
import com.bms.price.pay.PayTemplateWorkbook;
import com.bms.price.service.IPayOrderCostService;
import com.bms.price.service.IPayProductService;
import com.bms.price.service.IPaySurchargeRuleService;
import jakarta.servlet.http.HttpServletResponse;
/**
@@ -49,9 +49,6 @@ public class PayProductController extends BaseController
@Autowired
private IPayOrderCostService payOrderCostService;
@Autowired
private IPaySurchargeRuleService paySurchargeRuleService;
@PreAuthorize("@ss.hasPermi('price:pay:list')")
@GetMapping("/list")
public TableDataInfo list(PayProduct query)
@@ -107,29 +104,36 @@ public class PayProductController extends BaseController
payProductService.writeSource(productId, response.getOutputStream());
}
/** 产品上的附加费计费条件。不按价格版本拆开。 */
@PreAuthorize("@ss.hasAnyPermi('price:pay:query,price:pay:edit')")
@GetMapping("/surchargeRule")
public AjaxResult surchargeRule(@RequestParam Long productId, @RequestParam(required = false) Long termId)
/** 下载所选计费模式的标准模板 */
@PreAuthorize("@ss.hasAnyPermi('price:pay:import,price:pay:add')")
@PostMapping("/template")
public void template(HttpServletResponse response, @RequestParam String chargeType) throws Exception
{
return success(paySurchargeRuleService.list(productId, termId));
String mode = PayChargeMode.code(chargeType);
String filename = (mode.isEmpty() ? "价卡" : PayChargeMode.label(mode)) + "模板.xlsx";
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
response.setCharacterEncoding("utf-8");
FileUtils.setAttachmentResponseHeader(response, filename);
PayTemplateWorkbook.write(mode, response.getOutputStream());
}
/** 这个产品上的附加费配置操作记录。 */
@PreAuthorize("@ss.hasAnyPermi('price:pay:query,price:pay:edit')")
@GetMapping("/surchargeRule/log")
public AjaxResult surchargeRuleLog(@RequestParam Long productId, @RequestParam(required = false) Long termId)
/** 按标准模板预览,不写数据库 */
@PreAuthorize("@ss.hasPermi('price:pay:import')")
@Log(title = "应付配置", businessType = BusinessType.IMPORT)
@PostMapping(value = "/template/preview", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public AjaxResult previewTemplate(MultipartFile file, @RequestParam String chargeType) throws Exception
{
return success(paySurchargeRuleService.logs(productId, termId));
assertWorkbook(file);
return success(payProductService.previewTemplate(file.getBytes(), file.getOriginalFilename(), chargeType));
}
@PreAuthorize("@ss.hasPermi('price:pay:edit')")
@Log(title = "应付附加费计费条件", businessType = BusinessType.UPDATE)
@PostMapping("/surchargeRule")
public AjaxResult saveSurchargeRule(@RequestBody PaySurchargeRuleSave command)
/** 按所选计费模式手工新增一条价卡 */
@PreAuthorize("@ss.hasPermi('price:pay:add')")
@Log(title = "应付配置", businessType = BusinessType.INSERT)
@PostMapping("/manual")
public AjaxResult manual(@RequestBody PayProduct product)
{
paySurchargeRuleService.save(command);
return success();
return success(payProductService.saveManual(product));
}
@PreAuthorize("@ss.hasPermi('price:pay:query')")