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
package com.xiaopeng.operation.controller;
 
 
import com.xiaopeng.api.model.operation.XpPointSituationReport;
import com.xiaopeng.api.vo.account.LoginOperationUser;
import com.xiaopeng.common.core.domain.R;
import com.xiaopeng.common.security.service.TokenService;
import com.xiaopeng.operation.service.IXpPointSituationReportService;
import com.xiaopeng.operation.vo.XpAgreementVo;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
 
import javax.annotation.Resource;
import java.time.LocalDateTime;
 
@RestController
@RequestMapping("")
public class XpPointSituationReportController {
 
    @Resource
    private IXpPointSituationReportService xpPointSituationReportService;
 
    @Resource
    private TokenService tokenService;
 
 
 
 
 
 
    @ApiOperation(value = "现场情况上报", tags = {"运维APP-站点管理"}, response = XpPointSituationReport.class)
    @PostMapping("/maintenance-app/api/v1/pointSituationReport/addPointSituationReport")
    public R<?> addPointSituationReport(@RequestBody XpPointSituationReport xpPointSituationReport){
        LoginOperationUser loginOperationUser = tokenService.getLoginOperationUser();
        xpPointSituationReport.setOperationsUserId(loginOperationUser.getId());
        xpPointSituationReport.setReportingTime(LocalDateTime.now());
        xpPointSituationReport.setDeleted(false);
        xpPointSituationReportService.save(xpPointSituationReport);
        return R.ok();
    }
}