CZT
2023-11-27 c206acfaedc69c390fb67daa81bc686f58a212ef
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
package com.ld.igds.phone.service.impl;
 
import com.alibaba.fastjson.JSONObject;
import com.ld.igds.constant.BizType;
import com.ld.igds.constant.RespCodeEnum;
import com.ld.igds.constant.WarnStatus;
import com.ld.igds.models.MWarnInfo;
import com.ld.igds.phone.constant.PhoneConstant;
import com.ld.igds.phone.dto.AuthUser;
import com.ld.igds.phone.dto.Dto5003;
import com.ld.igds.phone.dto.PhoneResponse;
import com.ld.igds.phone.mapper.PhoneCommonMapper;
import com.ld.igds.phone.param.ParamWarn;
import com.ld.igds.phone.param.PhoneRequest;
import com.ld.igds.phone.service.PhoneService;
import com.ld.igds.phone.util.PhoneRespUtil;
import com.ld.igds.util.DateUtil;
import com.ld.igds.warn.service.CoreWarnService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
 
import java.util.Date;
import java.util.List;
 
/**
 * 警告处理
 * @author chen
 */
@Service
public class ServiceImpl5005 implements PhoneService {
 
    @Autowired
    private PhoneCommonMapper phoneCommonMapper;
    @Override
    public String getInterfaceId() {
        return PhoneConstant.API_PHONE_5005;
    }
 
    @SuppressWarnings("unchecked")
    @Override
    public PhoneResponse<Object> execute(PhoneRequest<JSONObject> req, AuthUser authUser)
            throws Exception {
 
        //转化为对象
        ParamWarn param = JSONObject.parseObject(req.getData().toString(), ParamWarn.class);
 
        //设置查询参数
        if(null == param || StringUtils.isEmpty(param.getId()) || StringUtils.isEmpty(param.getStatus())){
            return PhoneRespUtil.error(RespCodeEnum.CODE_1007, "参数有误,请重试!");
        }
 
        param.setCompanyId(authUser.getCompanyId());
        param.setCompleteTime(new Date());
        param.setCompleteUser(authUser.getCname());
 
        phoneCommonMapper.updateWarn(param);
 
        return PhoneRespUtil.success(null, req);
    }
}