|
|
@@ -490,4 +490,23 @@ public class ReceivableController {
|
|
|
List<Long> idList = Arrays.asList(ids);
|
|
|
return receivableService.deleteIncomesByIds(idList,userName);
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 计算两数只差
|
|
|
+ *
|
|
|
+ * @param minuend 被减数 例如 10-3 = 7 , 被减数就是10
|
|
|
+ * @param subtrahend 减数, 例如 10-3 = 7,减数就是3
|
|
|
+ * @author lipf
|
|
|
+ * @date 2026/5/27 19:29
|
|
|
+ */
|
|
|
+ @GetMapping("calSub")
|
|
|
+ public HttpResult<BigDecimal> sub(@RequestParam("minuend") BigDecimal minuend,
|
|
|
+ @RequestParam("subtrahend") BigDecimal subtrahend){
|
|
|
+ log.info("计算两数只差。 minuend=[{}], subtrahend=[{}]", minuend, subtrahend);
|
|
|
+ if(minuend == null || subtrahend == null){
|
|
|
+ return HttpResult.error("被减数和减数不能为空");
|
|
|
+ }
|
|
|
+ BigDecimal subtract = minuend.subtract(subtrahend);
|
|
|
+ return HttpResult.ok(subtract);
|
|
|
+ }
|
|
|
}
|