Quellcode durchsuchen

node相关报错

zhuhaiwen vor 3 Jahren
Ursprung
Commit
b43e19fdbc

+ 3 - 3
oa-app/src/main/java/com/css/oa/exam/assign/service/AdmService.java

@ -9,7 +9,7 @@ import com.css.oa.exam.assign.repository.IAssignRepository;
9 9
import com.css.oa.exam.constants.BoolState;
10 10
import com.css.oa.exam.exam.repository.entity.Exam;
11 11
import com.css.oa.exam.exam.repository.IExamRepository;
12
import com.css.oa.exam.node.service.impl.NodeQueryService;
12
import com.css.oa.exam.node.service.impl.ExamNodeQueryService;
13 13
import com.css.oa.exam.room.repository.IRoomRepository;
14 14
import com.css.oa.exam.room.repository.entity.Room;
15 15
import com.css.oa.exam.student.repository.entity.Student;
@ -310,10 +310,10 @@ public class AdmService extends BaseAssignService {
310 310
    IExamRepository examRepository;
311 311
312 312
    @Autowired
313
    NodeQueryService nodeQueryService;
313
    ExamNodeQueryService examNodeQueryService;
314 314
315 315
    public Map myAdm(String student_id) {
316
        if(nodeQueryService.printAdmissionIsClose()){
316
        if(examNodeQueryService.printAdmissionIsClose()){
317 317
            List<MyAdmWrap> wraps = new ArrayList<>();
318 318
            Map map = new LinkedHashMap();
319 319
            map.put("total", 0);

+ 2 - 2
oa-app/src/main/java/com/css/oa/exam/enroll/controller/EnrollController.java

@ -6,7 +6,7 @@ import com.css.oa.exam.constants.BoolState;
6 6
import com.css.oa.exam.enroll.viewobjects.*;
7 7
import com.css.oa.exam.enroll.viewobjects.MyEnrollWrap;
8 8
import com.css.oa.exam.enroll.service.impl.EnrollServiceImpl;
9
import com.css.oa.exam.node.service.impl.NodeQueryService;
9
import com.css.oa.exam.node.service.impl.ExamNodeQueryService;
10 10
import com.css.oa.utils.Result;
11 11
import io.swagger.annotations.Api;
12 12
import io.swagger.annotations.ApiOperation;
@ -27,7 +27,7 @@ public class EnrollController extends BaseController {
27 27
    private EnrollServiceImpl mService;
28 28
29 29
    @Autowired
30
    private NodeQueryService nodeQuery;
30
    private ExamNodeQueryService nodeQuery;
31 31
32 32
    @Autowired
33 33
    private CheatSetService cheatService;

+ 13 - 13
oa-app/src/main/java/com/css/oa/exam/node/controller/NodeController.java

@ -2,9 +2,9 @@ package com.css.oa.exam.node.controller;
2 2
3 3
import com.css.oa.exam.base.BaseController;
4 4
import com.css.oa.exam.constants.BoolState;
5
import com.css.oa.exam.node.repository.entity.Node;
6
import com.css.oa.exam.node.service.impl.NodeQueryService;
7
import com.css.oa.exam.node.service.impl.NodeServiceImpl;
5
import com.css.oa.exam.node.repository.entity.ExamNode;
6
import com.css.oa.exam.node.service.impl.ExamNodeQueryService;
7
import com.css.oa.exam.node.service.impl.ExamNodeServiceImpl;
8 8
import com.css.oa.utils.Result;
9 9
import io.swagger.annotations.Api;
10 10
import io.swagger.annotations.ApiOperation;
@ -18,10 +18,10 @@ import java.util.Map;
18 18
@Api(tags = {"节点控制"})
19 19
@RestController
20 20
@RequestMapping("/node")
21
public class NodeController extends BaseController {
21
public class ExamNodeController extends BaseController {
22 22
23 23
    @Autowired
24
    private NodeServiceImpl mService;
24
    private ExamNodeServiceImpl mService;
25 25
26 26
    @ApiOperation(value = "列表")
27 27
    @GetMapping("/queryAll")
@ -39,7 +39,7 @@ public class NodeController extends BaseController {
39 39
40 40
    @ApiOperation(value = "编辑")
41 41
    @PostMapping("/update")
42
    public Result update(@RequestBody Node obj) {
42
    public Result update(@RequestBody ExamNode obj) {
43 43
        Result<Map> result;
44 44
        try {
45 45
            if (TextUtils.isEmpty(obj.uuid)) {
@ -60,7 +60,7 @@ public class NodeController extends BaseController {
60 60
61 61
    @ApiOperation(value = "增加节点控制")
62 62
    @PostMapping("/add")
63
    public Result add(@RequestBody Node obj) {
63
    public Result add(@RequestBody ExamNode obj) {
64 64
        Result<Map> result;
65 65
        try {
66 66
            if (TextUtils.isEmpty(obj.getName())) {
@ -90,14 +90,14 @@ public class NodeController extends BaseController {
90 90
    }
91 91
92 92
    @Autowired
93
    NodeQueryService nodeQueryService;
93
    ExamNodeQueryService examNodeQueryService;
94 94
95 95
    @ApiOperation(value = "报名节点是否已经关闭")
96 96
    @GetMapping("/enrollIsClose")
97 97
    public Result enrollIsClose() {
98 98
        Result<Map> result;
99 99
        try {
100
            boolean b = nodeQueryService.enrollIsClose();
100
            boolean b = examNodeQueryService.enrollIsClose();
101 101
            result = setResult("" + b);
102 102
        } catch (Exception e) {
103 103
            result = setErr(e.getMessage());
@ -111,7 +111,7 @@ public class NodeController extends BaseController {
111 111
    public Result payIsClose() {
112 112
        Result<Map> result;
113 113
        try {
114
            boolean b = nodeQueryService.payIsClose();
114
            boolean b = examNodeQueryService.payIsClose();
115 115
            result = setResult("" + b);
116 116
        } catch (Exception e) {
117 117
            result = setErr(e.getMessage());
@ -125,7 +125,7 @@ public class NodeController extends BaseController {
125 125
    public Result printAdmissionIsClose() {
126 126
        Result<Map> result;
127 127
        try {
128
            boolean b = nodeQueryService.printAdmissionIsClose();
128
            boolean b = examNodeQueryService.printAdmissionIsClose();
129 129
            result = setResult("" + b);
130 130
        } catch (Exception e) {
131 131
            result = setErr(e.getMessage());
@ -139,7 +139,7 @@ public class NodeController extends BaseController {
139 139
    public Result joinExamIsClose() {
140 140
        Result<Map> result;
141 141
        try {
142
            boolean b = nodeQueryService.joinExamIsClose();
142
            boolean b = examNodeQueryService.joinExamIsClose();
143 143
            result = setResult("" + b);
144 144
        } catch (Exception e) {
145 145
            result = setErr(e.getMessage());
@ -153,7 +153,7 @@ public class NodeController extends BaseController {
153 153
    public Result queryScoreIsClose() {
154 154
        Result<Map> result;
155 155
        try {
156
            boolean b = nodeQueryService.queryScoreIsClose();
156
            boolean b = examNodeQueryService.queryScoreIsClose();
157 157
            result = setResult("" + b);
158 158
        } catch (Exception e) {
159 159
            result = setErr(e.getMessage());

+ 3 - 3
oa-app/src/main/java/com/css/oa/exam/node/repository/INodeRepository.java

@ -1,6 +1,6 @@
1 1
package com.css.oa.exam.node.repository;
2 2
3
import com.css.oa.exam.node.repository.entity.Node;
3
import com.css.oa.exam.node.repository.entity.ExamNode;
4 4
import org.springframework.data.jpa.repository.JpaRepository;
5 5
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
6 6
import org.springframework.data.jpa.repository.Modifying;
@ -12,12 +12,12 @@ import org.springframework.transaction.annotation.Transactional;
12 12
import java.util.List;
13 13
14 14
@Repository
15
public interface INodeRepository extends JpaRepository<Node, String>, JpaSpecificationExecutor<Node> {
15
public interface ExamNodeRepository extends JpaRepository<ExamNode, String>, JpaSpecificationExecutor<ExamNode> {
16 16
17 17
    //批量删除
18 18
    @Modifying
19 19
    @Transactional
20
    @Query("delete from Node n where n.uuid in :ids")
20
    @Query("delete from ExamNode n where n.uuid in :ids")
21 21
    void deleteRealByIds(@Param("ids") List<String> ids);
22 22
23 23
}

+ 1 - 1
oa-app/src/main/java/com/css/oa/exam/node/repository/entity/Node.java

@ -13,7 +13,7 @@ import java.util.Date;
13 13
@Data
14 14
@Entity
15 15
@Table(name = "OP_EXAM_NODE")
16
public class Node implements Serializable {
16
public class ExamNode implements Serializable {
17 17
18 18
    public static final long serialVersionUID = -2982710232836091012L;
19 19

+ 18 - 0
oa-app/src/main/java/com/css/oa/exam/node/service/ExamNodeService.java

@ -0,0 +1,18 @@
1
package com.css.oa.exam.node.service;
2
3
import com.css.oa.exam.node.repository.entity.ExamNode;
4
5
import java.util.List;
6
import java.util.Map;
7
8
public interface ExamNodeService {
9
10
    void add(ExamNode test);
11
12
    Map queryAll();
13
14
    void update(ExamNode newTest);
15
16
    void delete(List<String> ids);
17
18
}

+ 0 - 18
oa-app/src/main/java/com/css/oa/exam/node/service/NodeService.java

@ -1,18 +0,0 @@
1
package com.css.oa.exam.node.service;
2
3
import com.css.oa.exam.node.repository.entity.Node;
4
5
import java.util.List;
6
import java.util.Map;
7
8
public interface NodeService {
9
10
    void add(Node test);
11
12
    Map queryAll();
13
14
    void update(Node newTest);
15
16
    void delete(List<String> ids);
17
18
}

+ 42 - 0
oa-app/src/main/java/com/css/oa/exam/node/service/impl/ExamNodeQueryService.java

@ -0,0 +1,42 @@
1
package com.css.oa.exam.node.service.impl;
2
3
import com.css.oa.exam.constants.BoolState;
4
import com.css.oa.exam.node.repository.entity.ExamNode;
5
import com.css.oa.exam.node.viewobjects.NodeType;
6
import com.css.oa.exam.node.repository.ExamNodeRepository;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.stereotype.Service;
9
10
@Service
11
public class ExamNodeQueryService implements NodeType {
12
13
    @Autowired
14
    ExamNodeRepository repository;
15
16
    public boolean enrollIsClose() {
17
        ExamNode examNode = repository.findById(ENROLL).get();
18
        return examNode.is_open == BoolState.NO;
19
    }
20
21
    public boolean payIsClose() {
22
        ExamNode examNode = repository.findById(PAY).get();
23
        return examNode.is_open == BoolState.NO;
24
    }
25
26
    public boolean printAdmissionIsClose() {
27
        ExamNode examNode = repository.findById(PRINT_ADMISSION).get();
28
        return examNode.is_open == BoolState.NO;
29
    }
30
31
    public boolean joinExamIsClose() {
32
        ExamNode examNode = repository.findById(JOIN_EXAM).get();
33
        return examNode.is_open == BoolState.NO;
34
    }
35
36
    public boolean queryScoreIsClose() {
37
        ExamNode examNode = repository.findById(QUERY_SCORE).get();
38
        return examNode.is_open == BoolState.NO;
39
    }
40
41
42
}

+ 9 - 9
oa-app/src/main/java/com/css/oa/exam/node/service/impl/NodeServiceImpl.java

@ -1,9 +1,9 @@
1 1
package com.css.oa.exam.node.service.impl;
2 2
3 3
import com.css.oa.exam.base.BaseService;
4
import com.css.oa.exam.node.repository.entity.Node;
5
import com.css.oa.exam.node.repository.INodeRepository;
6
import com.css.oa.exam.node.service.NodeService;
4
import com.css.oa.exam.node.repository.entity.ExamNode;
5
import com.css.oa.exam.node.repository.ExamNodeRepository;
6
import com.css.oa.exam.node.service.ExamNodeService;
7 7
import com.css.oa.exam.util.CopyObjTool;
8 8
import com.css.oa.utils.UUIDGenerator;
9 9
import lombok.extern.slf4j.Slf4j;
@ -14,13 +14,13 @@ import java.util.*;
14 14
15 15
@Slf4j
16 16
@Service
17
public class NodeServiceImpl extends BaseService implements NodeService {
17
public class ExamNodeServiceImpl extends BaseService implements ExamNodeService {
18 18
19 19
    @Autowired
20
    INodeRepository repository;
20
    ExamNodeRepository repository;
21 21
22 22
    @Override
23
    public void add(Node obj) {
23
    public void add(ExamNode obj) {
24 24
        System.out.println("传入的obj => " + obj.toString());
25 25
        String id = UUIDGenerator.getUUID();
26 26
        obj.setUuid(id);
@ -37,7 +37,7 @@ public class NodeServiceImpl extends BaseService implements NodeService {
37 37
    @Override
38 38
    public Map queryAll() {
39 39
        Long count = repository.count();
40
        List<Node> list = repository.findAll();
40
        List<ExamNode> list = repository.findAll();
41 41
        Map map = new LinkedHashMap();
42 42
        map.put("total", count);
43 43
        map.put("list", list);
@ -45,12 +45,12 @@ public class NodeServiceImpl extends BaseService implements NodeService {
45 45
    }
46 46
47 47
    @Override
48
    public void update(Node obj) {
48
    public void update(ExamNode obj) {
49 49
        if(obj.getUpdate_time() == null){
50 50
            Date newDate = new Date();
51 51
            obj.setUpdate_time(newDate);
52 52
        }
53
        Node old  = repository.findById(obj.getUuid()).get();
53
        ExamNode old  = repository.findById(obj.getUuid()).get();
54 54
        CopyObjTool.copyProperties(old, obj);
55 55
        repository.save(obj);
56 56
    }

+ 0 - 42
oa-app/src/main/java/com/css/oa/exam/node/service/impl/NodeQueryService.java

@ -1,42 +0,0 @@
1
package com.css.oa.exam.node.service.impl;
2
3
import com.css.oa.exam.constants.BoolState;
4
import com.css.oa.exam.node.viewobjects.NodeType;
5
import com.css.oa.exam.node.repository.INodeRepository;
6
import com.css.oa.exam.node.repository.entity.Node;
7
import org.springframework.beans.factory.annotation.Autowired;
8
import org.springframework.stereotype.Service;
9
10
@Service
11
public class NodeQueryService implements NodeType {
12
13
    @Autowired
14
    INodeRepository repository;
15
16
    public boolean enrollIsClose() {
17
        Node node = repository.findById(ENROLL).get();
18
        return node.is_open == BoolState.NO;
19
    }
20
21
    public boolean payIsClose() {
22
        Node node = repository.findById(PAY).get();
23
        return node.is_open == BoolState.NO;
24
    }
25
26
    public boolean printAdmissionIsClose() {
27
        Node node = repository.findById(PRINT_ADMISSION).get();
28
        return node.is_open == BoolState.NO;
29
    }
30
31
    public boolean joinExamIsClose() {
32
        Node node = repository.findById(JOIN_EXAM).get();
33
        return node.is_open == BoolState.NO;
34
    }
35
36
    public boolean queryScoreIsClose() {
37
        Node node = repository.findById(QUERY_SCORE).get();
38
        return node.is_open == BoolState.NO;
39
    }
40
41
42
}

+ 3 - 3
oa-app/src/main/java/com/css/oa/exam/score/service/impl/ScoreServiceImpl.java

@ -21,7 +21,7 @@ import com.css.oa.exam.constants.ExamConfig;
21 21
import com.css.oa.exam.constants.ExportDTO;
22 22
import com.css.oa.exam.exam.repository.entity.Exam;
23 23
import com.css.oa.exam.exam.repository.IExamRepository;
24
import com.css.oa.exam.node.service.impl.NodeQueryService;
24
import com.css.oa.exam.node.service.impl.ExamNodeQueryService;
25 25
import com.css.oa.exam.score.service.ScoreService;
26 26
import com.css.oa.exam.score.viewobjects.*;
27 27
import com.css.oa.exam.score.repository.IScoreRepository;
@ -379,10 +379,10 @@ public class ScoreServiceImpl extends BaseVerifyService implements ScoreService
379 379
    }
380 380
381 381
    @Autowired
382
    NodeQueryService nodeQueryService;
382
    ExamNodeQueryService examNodeQueryService;
383 383
384 384
    public Map myScore(String student_id) {
385
        if(nodeQueryService.queryScoreIsClose()){
385
        if(examNodeQueryService.queryScoreIsClose()){
386 386
            List<MyAdmWrap> wraps = new ArrayList<>();
387 387
            Map map = new LinkedHashMap();
388 388
            map.put("total", 0);