| | |
| | | |
| | | /** |
| | | * 石家庄喜高科技有限责任公司 版权所有 © Copyright 2020<br> |
| | | * |
| | | * @Description: 业务操作记录 |
| | | * @Project: 运营中心 |
| | | * @CreateDate: Created in 2020-04-02 18:25:34 <br> |
| | |
| | | @RestController |
| | | @RequestMapping("/businessrecords") |
| | | @Api(tags = "业务操作记录") |
| | | public class BusinessRecordsController extends BaseController{ |
| | | public class BusinessRecordsController extends BaseController { |
| | | @Autowired |
| | | private IBusinessRecordsService businessRecordsService; |
| | | |
| | |
| | | }) |
| | | @GetMapping |
| | | public PageResult list(@RequestParam Map<String, Object> params) { |
| | | if(params.size()==0){ |
| | | params.put("page",1); |
| | | params.put("limit",10); |
| | | if (params.size() == 0) { |
| | | params.put("page", 1); |
| | | params.put("limit", 10); |
| | | } |
| | | return businessRecordsService.findList(params); |
| | | } |
| | |
| | | if (bindingResult.hasErrors()) { |
| | | return ResultBody.failed().msg(bindingResult.getFieldError().getDefaultMessage()); |
| | | } else { |
| | | boolean v= businessRecordsService.saveOrUpdate(businessRecords); |
| | | if(v) { |
| | | return ResultBody.ok().data(businessRecords).msg("保存成功"); |
| | | } |
| | | else { |
| | | return ResultBody.failed().msg("保存失败"); |
| | | BusinessRecords model = businessRecordsService.getById(businessRecords.getId()); |
| | | if (model == null) { |
| | | boolean v = businessRecordsService.saveOrUpdate(businessRecords); |
| | | if (v) { |
| | | return ResultBody.ok().data(businessRecords).msg("保存成功"); |
| | | } else { |
| | | return ResultBody.failed().msg("保存失败"); |
| | | } |
| | | } else { |
| | | return ResultBody.failed().msg("业务日志不允许更新!"); |
| | | } |
| | | } |
| | | } |
| | |
| | | @ApiOperation(value = "删除") |
| | | @DeleteMapping("/{id}") |
| | | public ResultBody delete(@PathVariable Long id) { |
| | | boolean v= businessRecordsService.removeById(id); |
| | | if(v) { |
| | | boolean v = businessRecordsService.removeById(id); |
| | | if (v) { |
| | | return ResultBody.ok().msg("删除成功"); |
| | | } |
| | | else { |
| | | } else { |
| | | return ResultBody.failed().msg("删除失败"); |
| | | } |
| | | } |