CarConditionController.java
4.05 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
package cn.com.glsx.stoassistant.controller.carcondition;
import cn.com.glsx.framework.rop.response.RopResponse;
import cn.com.glsx.scrm.system.model.wechatapplets.LoginUserInfoResponse;
import cn.com.glsx.stoassistant.request.carcondition.CarConditionPadPageRequest;
import cn.com.glsx.stoassistant.response.carcondition.CarConditionPageVO;
import cn.com.glsx.stoassistant.service.cardition.CarConditionService;
import cn.com.glsx.stoassistant.utils.Pagination;
import com.rop.annotation.NeedInSessionType;
import com.rop.annotation.ServiceMethod;
import com.rop.annotation.ServiceMethodBean;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.oreframework.boot.autoconfigure.rop.util.RopThreadLocal;
import org.springframework.beans.factory.annotation.Autowired;
@Slf4j
@Api("车况管理")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
//@RestController
public class CarConditionController {
@Autowired
private CarConditionService carConditionService;
@ApiOperation("PAD端车况分页查询")
@ServiceMethod(method = "scrm.api.stoassistant.carCondition.page", needInSession = NeedInSessionType.YES)
// @PostMapping("/scrm.api.stoassistant.carCondition.page/1.0.0")
public RopResponse<Pagination<CarConditionPageVO>> page(CarConditionPadPageRequest request) {
try {
if (request == null) {
return RopResponse.error("参数不能为空");
}
if (StringUtils.isBlank(request.getOperatorId())) {
LoginUserInfoResponse loginUser = RopThreadLocal.getLoginUser(LoginUserInfoResponse.class);
request.setOperatorId(loginUser.getUuid());
}
return carConditionService.page(request);
} catch (Exception e) {
log.error("PAD端车况分页查询失败", e);
return RopResponse.error(e.getMessage());
}
}
// @ApiOperation("PAD端车况详情接口")
// @ServiceMethod(method = "scrm.api.stoassistant.carCondition.detail", needInSession = NeedInSessionType.YES)
// @PostMapping("/scrm.api.stoassistant.carCondition.detail/1.0.0")
// public RopResponse<CarConditionPadDetailVO> detail(CarConditionDetailRequest request) {
// try {
// if (request == null || request.getId() == null) {
// return RopResponse.error("车况唯一ID不能为空");
// }
// return carConditionService.detail(request);
// } catch (Exception e) {
// log.error("PAD端车况详情接口失败", e);
// return RopResponse.error(e.getMessage());
// }
// }
//
//
// @ApiOperation("新增车况录入")
// @ServiceMethod(method = "scrm.api.stoassistant.carCondition.add", needInSession = NeedInSessionType.YES)
// public RopResponse<Integer> add(CarConditionAddRequest request) {
// try {
// if (request == null || request.getSource() == null) {
// return RopResponse.error("车况来源不能为空");
// }
// return carConditionService.add(request);
// } catch (Exception e) {
// log.error("新增车况录入失败", e);
// return RopResponse.error(e.getMessage());
// }
//
// }
//
// @ApiOperation("编辑车况录入")
// @ServiceMethod(method = "scrm.api.stoassistant.carCondition.edit", needInSession = NeedInSessionType.YES)
// public RopResponse<Integer> edit(CarConditionEditRequest request) {
// try {
// if (request == null || request.getId() == null) {
// return RopResponse.error("车况唯一ID不能为空");
// }
// if (request.getSource() == null) {
// return RopResponse.error("车况来源不能为空");
// }
// return carConditionService.edit(request);
// } catch (Exception e) {
// log.error("编辑车况录入失败", e);
// return RopResponse.error(e.getMessage());
// }
// }
}