| | |
| | | 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; |
| | |
| | | @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() |
| | |
| | | return R.ok(page1);} |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "新增规则" , description = "新增规则" ) |
| | | public Object save(CostRule costRule) { |
| | | costRuleService.saveOrUpdate(costRule); |
| | | return R.ok("保存成功"); |
| | |
| | | |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除规则" , description = "删除规则" ) |
| | | public Object delete(Long id) { |
| | | costRuleService.removeById(id); |
| | | return R.ok("删除成功"); |