kongdeqiang
2024-09-26 da9a4f7ad988c452f3a356989eaf7a6c06ae5032
src/main/java/com/boying/controller/CostRuleController.java
@@ -13,8 +13,7 @@
import com.boying.service.ParkService;
import com.boying.util.DateUtilOther;
import com.fasterxml.jackson.databind.ObjectMapper;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@@ -27,21 +26,18 @@
@RestController
@RequestMapping("ffzf/rule")
@RequiredArgsConstructor
@Tag(description = "ffzf/rule" , name = "缴费规则" )
public class CostRuleController{
    private final CostRuleService costRuleService;
    private final ParkService parkService;
    @GetMapping("test")
    @Operation(summary = "测试" , description = "测试" )
    public Object save(String start,String end) throws ParseException {
        double money = costRuleService.getMoney(4, DateUtilOther.stringToLocalDate(start,null), DateUtilOther.stringToLocalDate(end, null), 1);
        return R.ok(money);
    }
    @PostMapping("/findPage")
    @Operation(summary = "分页查询" , description = "分页查询" )
    public Object findPage(Page page,CostRule costRule) {
        QueryWrapper<CostRule> wrapper = new QueryWrapper<>();
        wrapper.lambda()
@@ -56,7 +52,6 @@
        return R.ok(page1);}
    @PostMapping("/save")
    @Operation(summary = "新增规则" , description = "新增规则" )
    public Object save(CostRule costRule) {
        costRuleService.saveOrUpdate(costRule);
        return R.ok("保存成功");
@@ -64,7 +59,6 @@
    @PostMapping("/delete")
    @Operation(summary = "删除规则" , description = "删除规则" )
    public Object delete(Long id) {
        costRuleService.removeById(id);
        return R.ok("删除成功");