CollisionInfoController.java 8.74 KB
package cn.com.glsx.entmicro.controller.collision;


import cn.com.glsx.entmicro.request.collision.*;
import cn.com.glsx.entmicro.request.outbound.PhoneCheckRopRequest;
import cn.com.glsx.entmicro.response.collision.*;
import cn.com.glsx.entmicro.response.outbound.PhoneCheckRopResponse;
import cn.com.glsx.entmicro.service.collision.CollisionInfoService;
import cn.com.glsx.entmicro.utils.Pagination;
import cn.com.glsx.framework.core.exception.RpcServiceException;
import cn.com.glsx.framework.rop.response.RopResponse;
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.springframework.beans.factory.annotation.Autowired;

import java.util.List;

/**
 *  碰撞线索
 */
@Slf4j
@Api("碰撞线模块接口")
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
public class CollisionInfoController {

    @Autowired
    private CollisionInfoService collisionInfoService;

    @ServiceMethod(method = "entmicro.api.collision.customer.device.list.export")
    @ApiOperation("设备管理-列表查询导出")
    public RopResponse<String> exportCustomerDeviceList(CollisionSnInfoSearchRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.exportCustomerDeviceList(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__exportCustomerDeviceList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.collision.customer.device.list")
    @ApiOperation("设备管理-列表查询")
    public RopResponse<Pagination<CollisionSnInfoRopResponse>> getCustomerDeviceList(CollisionSnInfoSearchRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.getCustomerDeviceList(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__getCustomerDeviceList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.collision.customer.device.edit")
    @ApiOperation("设备管理-编辑")
    public RopResponse<Boolean> customerDeviceEdit(CollisionSnInfoEditRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.customerDeviceEdit(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__customerDeviceDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.collision.customer.device.detail")
    @ApiOperation("设备管理-查询详情")
    public RopResponse<CollisionSnInfoRopResponse> getCustomerDeviceDetail(CollisionSnInfoSearchRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.getCustomerDeviceDetail(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__getCustomerDeviceDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.collision.device.import")
    @ApiOperation("设备管理-设备信息导入")
    public RopResponse<CustomerDeviceImportRopResponse> customerDeviceImport(CustomerDeviceImportRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.customerDeviceImport(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__customerDeviceImport__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }


    @ServiceMethod(method = "entmicro.api.collision.info.listCollisionInfoByPage")
    @ApiOperation("碰撞线索-分页查询")
    public RopResponse<Pagination<CollisionInfoRopResponse>> listCollisionInfoByPage(CollisionInfoSearchRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.listCollisionInfoByPage(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__listCollisionInfoByPage__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.collision.info.exportCollisionInfo")
    @ApiOperation("碰撞线索-列表导出")
    public RopResponse<String> exportCollisionInfo(CollisionInfoSearchRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.exportCollisionInfo(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__exportCollisionInfo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.collision.info.getDetail")
    @ApiOperation("碰撞线索-查询详情")
    public RopResponse<CollisionDetailInfoRopResponse> getCollisionDetail(CollisionInfoSearchRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.getCollisionDetail(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__getCollisionDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.collision.info.follow")
    @ApiOperation("碰撞线索-回访")
    public RopResponse<FollowInfoRopResponse> followCollisionInfo(FollowInfoRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.followCollisionInfo(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__followCollisionInfo__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }



    @ServiceMethod(method = "entmicro.api.collision.config.addOrUpdatePushConfig")
    @ApiOperation("碰撞线索-推送配置添加/修改")
    public RopResponse<CollisionPushConfigRopResponse> addOrUpdatePushConfig(CollisionPushConfigRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.addOrUpdatePushConfig(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__addOrUpdatePushConfig__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.collision.config.getDetail")
    @ApiOperation("碰撞线索-查询推送配置详情")
    public RopResponse<List<CollisionPushConfigRopResponse>> getPushConfigDetail(CollisionPushConfigRopRequest request) {
        try {
            return RopResponse.success(collisionInfoService.getPushConfigDetail(request));
        } catch (RpcServiceException e) {
            log.info("=======CollisionInfoController__invoke__getPushConfigDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        } catch (Exception e) {
            log.info(e.getMessage(), e);
            return RopResponse.error(e.getMessage());
        }
    }

}