package com.zy.asrs.controller; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.mapper.Wrapper; import com.zy.asrs.entity.TaskWrkLog; import com.zy.asrs.service.TaskWrkLogService; import com.core.annotations.ManagerAuth; import com.core.common.BaseRes; import com.core.common.R; import com.zy.common.web.BaseController; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; @RestController public class TaskWrkLogController extends BaseController { @Autowired private TaskWrkLogService taskWrkLogService; @RequestMapping(value = "/taskWrkLog/{id}/auth") @ManagerAuth public R get(@PathVariable("id") String id) { return R.ok(taskWrkLogService.selectById(String.valueOf(id))); } @RequestMapping(value = "/taskWrkLog/add/auth") @ManagerAuth public R add(TaskWrkLog taskWrkLog) { taskWrkLogService.insert(taskWrkLog); return R.ok(); } @RequestMapping(value = "/taskWrkLog/delete/auth") @ManagerAuth public R delete(@RequestParam(value="ids[]") Long[] ids){ for (Long id : ids){ taskWrkLogService.deleteById(id); } return R.ok(); } @RequestMapping(value = "/taskWrkLog/check/column/auth") @ManagerAuth public R query(@RequestBody JSONObject param) { Wrapper wrapper = new EntityWrapper().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); if (null != taskWrkLogService.selectOne(wrapper)){ return R.parse(BaseRes.REPEAT).add(getComment(TaskWrkLog.class, String.valueOf(param.get("key")))); } return R.ok(); } }