| | |
| | | import com.ruoyi.project.service.IBaseTravelcityService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.aspectj.weaver.loadtime.Aj; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.security.access.prepost.PreAuthorize; |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | |
| | | /** |
| | | * 差旅城市和补贴标准Controller |
| | | * |
| | | * |
| | | * @author ruoyi |
| | | * @date 2023-04-23 |
| | | */ |
| | | @Slf4j |
| | | @Api("差旅城市和补贴标准") |
| | | @RestController |
| | | @RequestMapping("/project/travelcity") |
| | | public class BaseTravelcityController extends BaseController |
| | | { |
| | | public class BaseTravelcityController extends BaseController { |
| | | @Autowired |
| | | private IBaseTravelcityService baseTravelcityService; |
| | | |
| | |
| | | * 查询差旅城市和补贴标准列表 |
| | | */ |
| | | @ApiOperation("查询差旅城市和补贴标准列表") |
| | | @PreAuthorize("@ss.hasPermi('project:travelcity:list')") |
| | | // @PreAuthorize("@ss.hasPermi('project:travelcity:list')") |
| | | @GetMapping("/list") |
| | | public TableDataInfo list(BaseTravelcity baseTravelcity) |
| | | { |
| | | public TableDataInfo list(BaseTravelcity baseTravelcity) { |
| | | log.info("查询差旅城市和补贴标准列表{}:", baseTravelcity); |
| | | startPage(); |
| | | List<BaseTravelcity> list = baseTravelcityService.queryList(baseTravelcity); |
| | | return getDataTable(list); |
| | |
| | | * 导出差旅城市和补贴标准列表 |
| | | */ |
| | | @ApiOperation("导出差旅城市和补贴标准列表") |
| | | @PreAuthorize("@ss.hasPermi('project:travelcity:export')") |
| | | // @PreAuthorize("@ss.hasPermi('project:travelcity:export')") |
| | | @Log(title = "差旅城市和补贴标准", businessType = BusinessType.EXPORT) |
| | | @GetMapping("/export") |
| | | public AjaxResult export(BaseTravelcity baseTravelcity) |
| | | { |
| | | public AjaxResult export(BaseTravelcity baseTravelcity) { |
| | | log.info("导出差旅城市和补贴标准列表{}:", baseTravelcity); |
| | | List<BaseTravelcity> list = baseTravelcityService.queryList(baseTravelcity); |
| | | ExcelUtil<BaseTravelcity> util = new ExcelUtil<BaseTravelcity>(BaseTravelcity.class); |
| | | return util.exportExcel(list, "差旅城市和补贴标准数据"); |
| | |
| | | * 获取差旅城市和补贴标准详细信息 |
| | | */ |
| | | @ApiOperation("获取差旅城市和补贴标准详细信息") |
| | | @PreAuthorize("@ss.hasPermi('project:travelcity:query')") |
| | | // @PreAuthorize("@ss.hasPermi('project:travelcity:query')") |
| | | @GetMapping(value = "/{id}") |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) |
| | | { |
| | | public AjaxResult getInfo(@PathVariable("id") Long id) { |
| | | log.info("获取差旅城市和补贴标准详细信息{}:", id); |
| | | return AjaxResult.success(baseTravelcityService.getById(id)); |
| | | } |
| | | |
| | |
| | | * 新增差旅城市和补贴标准 |
| | | */ |
| | | @ApiOperation("新增差旅城市和补贴标准") |
| | | @PreAuthorize("@ss.hasPermi('project:travelcity:add')") |
| | | // @PreAuthorize("@ss.hasPermi('project:travelcity:add')") |
| | | @Log(title = "差旅城市和补贴标准", businessType = BusinessType.INSERT) |
| | | @PostMapping |
| | | @PostMapping("/add") |
| | | @RepeatSubmit |
| | | public AjaxResult add(@RequestBody BaseTravelcity baseTravelcity) |
| | | { |
| | | return toAjax(baseTravelcityService.save(baseTravelcity)); |
| | | public AjaxResult add(@RequestBody BaseTravelcity baseTravelcity) { |
| | | log.info("新增差旅城市和补贴标准{}:", baseTravelcity); |
| | | boolean save = baseTravelcityService.save(baseTravelcity); |
| | | log.info("新增差旅城市和补贴标准baseTravelcity的id{}:", baseTravelcity.getId()); |
| | | return AjaxResult.success(baseTravelcity); |
| | | } |
| | | |
| | | /** |
| | | * 修改差旅城市和补贴标准 |
| | | */ |
| | | @ApiOperation("修改差旅城市和补贴标准") |
| | | @PreAuthorize("@ss.hasPermi('project:travelcity:edit')") |
| | | // @PreAuthorize("@ss.hasPermi('project:travelcity:edit')") |
| | | @Log(title = "差旅城市和补贴标准", businessType = BusinessType.UPDATE) |
| | | @PutMapping |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody BaseTravelcity baseTravelcity) |
| | | { |
| | | @RepeatSubmit |
| | | public AjaxResult edit(@RequestBody BaseTravelcity baseTravelcity) { |
| | | log.info("修改差旅城市和补贴标准{}:", baseTravelcity); |
| | | return toAjax(baseTravelcityService.updateById(baseTravelcity)); |
| | | } |
| | | |
| | |
| | | * 删除差旅城市和补贴标准 |
| | | */ |
| | | @ApiOperation("删除差旅城市和补贴标准") |
| | | @PreAuthorize("@ss.hasPermi('project:travelcity:remove')") |
| | | // @PreAuthorize("@ss.hasPermi('project:travelcity:remove')") |
| | | @Log(title = "差旅城市和补贴标准", businessType = BusinessType.DELETE) |
| | | @DeleteMapping("/{ids}") |
| | | public AjaxResult remove(@PathVariable Long[] ids) |
| | | { |
| | | public AjaxResult remove(@PathVariable Long[] ids) { |
| | | log.info("删除差旅城市和补贴标准{}:", ids); |
| | | return toAjax(baseTravelcityService.removeByIds(Arrays.asList(ids))); |
| | | } |
| | | |
| | |
| | | * 根据区域获取伙食补助、公杂要补助 |
| | | */ |
| | | @ApiOperation("根据区域获取补助") |
| | | // @PreAuthorize("@ss.hasPermi('project:travelcity:list')") |
| | | // // @PreAuthorize("@ss.hasPermi('project:travelcity:list')") |
| | | @GetMapping("/getSubsidy/{cityCode}") |
| | | public AjaxResult getSubsidy(@PathVariable String cityCode) |
| | | { |
| | | BaseTravelcity baseTravelcity=baseTravelcityService.getSubsidy(cityCode); |
| | | public AjaxResult getSubsidy(@PathVariable String cityCode) { |
| | | log.info("根据区域获取伙食补助、公杂要补助{}:", cityCode); |
| | | BaseTravelcity baseTravelcity = baseTravelcityService.getSubsidy(cityCode); |
| | | return AjaxResult.success(baseTravelcity); |
| | | } |
| | | } |