#
zzgtfwq
2 天以前 28ea25cc817e78f1023b8a7c7826441a4acadfc1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
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<TaskWrkLog> wrapper = new EntityWrapper<TaskWrkLog>().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();
    }
 
}