RescueConfigController.java 17.5 KB
package cn.com.glsx.entmicro.controller.drainage;

import cn.com.glsx.entmicro.model.response.DracRescueAppletVO;
import cn.com.glsx.entmicro.model.response.DracRescueStaffFollowVO;
import cn.com.glsx.entmicro.model.response.DracRescueStaffVO;
import cn.com.glsx.entmicro.request.DefaultRequest;
import cn.com.glsx.entmicro.request.drainage.rescue.*;
import cn.com.glsx.entmicro.response.drainage.rescue.*;
import cn.com.glsx.entmicro.service.drainage.DracImService;
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 javax.annotation.Resource;
import java.util.List;

/**
 * @ClassName RescueController
 * @Description 道路救援卡
 * @Author lichongyuan
 * @Date 2022/8/5
 */
@ServiceMethodBean(version = "1.0.0", needInSession = NeedInSessionType.YES)
@Api("道路救援卡")
@Slf4j
public class RescueConfigController {

    @Resource
    private DracImService dracImService;

    /**
     * 编辑救援卡
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.config.updateConfig",needInSession = NeedInSessionType.YES)
    @ApiOperation("编辑救援卡")
    public RopResponse<Boolean> updateConfig(DracRescueConfigSaveRopRequest dracRescueConfigSaveRopRequest) {
        try {
            dracImService.updateConfig(dracRescueConfigSaveRopRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__updateConfig__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 救援卡详情
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.config.getConfigDetail",needInSession = NeedInSessionType.YES)
    @ApiOperation("救援卡详情")
    public RopResponse<DracRescueConfigDetailRopResponse> getConfigDetail(DracSearchRescueRopRequest dracSearchRescueRopRequest) {
        try {
            DracRescueConfigDetailRopResponse configDetail = dracImService.getConfigDetail(dracSearchRescueRopRequest);
            return RopResponse.success(configDetail);
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__getConfigDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 救援卡联系方式列表
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.listContact",needInSession = NeedInSessionType.YES)
    @ApiOperation("救援卡联系方式列表")
    public RopResponse<List<DracRescueContactListRopResponse>> listContact(DracSearchRescueRopRequest dracSearchRescueRopRequest) {
        try {
            List<DracRescueContactListRopResponse> dracRescueContactListRopResponses = dracImService.listContact(dracSearchRescueRopRequest);
            return RopResponse.success(dracRescueContactListRopResponses);
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__listContact__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 删除联系方式
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.deleteContact",needInSession = NeedInSessionType.YES)
    @ApiOperation("删除联系方式")
    public RopResponse<Boolean> deleteContact(DracRescueDeleteRopRequest dracRescueDeleteRopRequest) {
        try {
            dracImService.deleteContact(dracRescueDeleteRopRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__deleteContact__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 保存联系方式
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.saveContact",needInSession = NeedInSessionType.YES)
    @ApiOperation("保存联系方式")
    public RopResponse<Boolean> saveContact(DracRescueContactSaveRopRequest dracRescueContactSaveRopRequest) {
        try {
            dracImService.saveContact(dracRescueContactSaveRopRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__saveContact__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 编辑联系方式
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.updateContact",needInSession = NeedInSessionType.YES)
    @ApiOperation("编辑联系方式")
    public RopResponse<Boolean> updateContact(DracRescueContactSaveRopRequest dracRescueContactSaveRopRequest) {
        try {
            dracImService.updateContact(dracRescueContactSaveRopRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__updateContact__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 道路救援卡客户列表查询接口
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.listCustomer",needInSession = NeedInSessionType.YES)
    @ApiOperation("道路救援卡客户列表查询接口")
    public RopResponse<Pagination<DracRescueFollowRopResponse>> listCustomer(DracSearchRescueCustomerRopRequest dracSearchRescueCustomerRopRequest) {
        try {
            return RopResponse.success(dracImService.listCustomer(dracSearchRescueCustomerRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__listCustomer__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 客户列表导出
     *
     * @param dracSearchRescueCustomerExportRopRequest
     * @return
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.listCustomerExport",needInSession = NeedInSessionType.YES)
    @ApiOperation("客户列表导出")
    public RopResponse<String> listCustomerExport(DracSearchRescueCustomerExportRopRequest dracSearchRescueCustomerExportRopRequest) {
        try {
            return RopResponse.success(dracImService.listCustomerExport(dracSearchRescueCustomerExportRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__listCustomerExport__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 获取道路救援卡小程序客户页面
     *
     * @param dracRescueAppleRopRequest    获取道路救援小程序页面请求参数
     * @return  获取道路救援卡小程序客户页面
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.getRescueCustomerView",needInSession = NeedInSessionType.NO)
    @ApiOperation("获取道路救援卡小程序客户页面接口")
    public RopResponse<DracRescueAppletVO> getRescueCustomerView(DracRescueAppleRopRequest dracRescueAppleRopRequest) {
        try {
            return RopResponse.success(dracImService.getRescueCustomerView(dracRescueAppleRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__getRescueCustomerView__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 刷新生成企微员工二维码
     *
     * @param dracRescueAppleRopRequest    刷新生成企微员工二维码请求参数
     * @return  企微员工二维码
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.getRescueStaffCode",needInSession = NeedInSessionType.YES)
    @ApiOperation("刷新生成企微员工二维码接口")
    public RopResponse<String> getRescueStaffCode(DracRescueAppleRopRequest dracRescueAppleRopRequest) {
        try {
            return RopResponse.success(dracImService.getRescueStaffCode(dracRescueAppleRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__getRescueStaffCode__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 道路救援卡小程序重新定位
     *
     * @param dracRescueAppleRopRequest    刷新生成企微员工二维码请求参数
     * @return  定位更新结果
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.rescueReacquireLocation",needInSession = NeedInSessionType.NO)
    @ApiOperation("道路救援卡小程序重新定位接口")
    public RopResponse<Boolean> rescueReacquireLocation(DracRescueAppleRopRequest dracRescueAppleRopRequest) {
        try {
            return RopResponse.success(dracImService.rescueReacquireLocation(dracRescueAppleRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__rescueReacquireLocation__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 校验首次进入页面
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.config.validFirst",needInSession = NeedInSessionType.YES)
    @ApiOperation("校验首次进入页面")
    public RopResponse<Boolean> validFirst(DracRescueConfigSaveRopRequest dracRescueConfigSaveRopRequest) {
        try {
            dracImService.validFirst(dracRescueConfigSaveRopRequest);
            return RopResponse.success(true);
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__validFirst__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 道路救援员工跟进详情
     *
     * @param dracRescueStaffFollwRopRequest    道路救援员工跟进详情请求参数
     * @return  道路救援员工跟进详情
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.rescueStaffFollowDetail",needInSession = NeedInSessionType.YES)
    @ApiOperation("道路救援员工跟进详情接口")
    public RopResponse<DracRescueStaffFollowVO> rescueStaffFollowDetail(DracRescueStaffFollwRopRequest dracRescueStaffFollwRopRequest) {
        try {
            return RopResponse.success(dracImService.rescueStaffFollowDetail(dracRescueStaffFollwRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__rescueStaffFollowDetail__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 道路救援员工跟进结果
     *
     * @param dracRescueStaffFollwRopRequest    道路救援员工跟进结果请求参数
     * @return  道路救援员工跟进结果
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.rescueStaffFollowResult",needInSession = NeedInSessionType.YES)
    @ApiOperation("道路救援员工跟进结果接口")
    public RopResponse<Boolean> rescueStaffFollowResult(DracRescueStaffFollwRopRequest dracRescueStaffFollwRopRequest) {
        try {
            return RopResponse.success(dracImService.rescueStaffFollowResult(dracRescueStaffFollwRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__rescueStaffFollowResult__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 道路救援卡员工跟进列表
     *
     * @param dracRescueStaffFollwRopRequest    道路救援卡员工跟进列表请求参数
     * @return  道路救援卡员工跟进列表
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.getRescueStaffFollowList",needInSession = NeedInSessionType.YES)
    @ApiOperation("道路救援卡员工跟进列表接口")
    public RopResponse<DracRescueStaffVO> getRescueStaffFollowList(DracRescueStaffFollwRopRequest dracRescueStaffFollwRopRequest) {
        try {
            return RopResponse.success(dracImService.getRescueStaffFollowList(dracRescueStaffFollwRopRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__getRescueStaffFollowList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    /**
     * 道路救援跟进类型
     *
     * @param ropRequest    道路救援跟进类型请求参数
     * @return  道路救援跟进类型
     */
    @ServiceMethod(method = "entmicro.api.drac.rescue.findDictByRescueFollowType",needInSession = NeedInSessionType.YES)
    @ApiOperation("道路救援跟进结果类型接口")
    public RopResponse<List<String>> findDictByRescueFollowType(DefaultRequest ropRequest) {
        try {
            return RopResponse.success(dracImService.findDictByRescueFollowType(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__getRescueStaffFollowList__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.drac.rescue.move.car.code.bind",needInSession = NeedInSessionType.YES)
    @ApiOperation("车主绑定挪车码")
    public RopResponse<Boolean> moveCarCodeBind(MoveCarCodeBindRopRequest ropRequest) {
        try {
            return RopResponse.success(dracImService.moveCarCodeBind(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__moveCarCodeBind__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.drac.rescue.move.car.code.check",needInSession = NeedInSessionType.NO)
    @ApiOperation("挪车码校验是否被绑定")
    public RopResponse<Integer> moveCarCodeCheck(MoveCarCodeCheckRopRequest ropRequest) {
        try {
            return RopResponse.success(dracImService.moveCarCodeCheck(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__moveCarCodeCheck__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }


    @ServiceMethod(method = "entmicro.api.drac.rescue.move.car.code.bind.ax",needInSession = NeedInSessionType.NO)
    @ApiOperation("调用百度接口绑定车主和X虚拟号码(返回值为虚拟号码X)")
    public RopResponse<String> moveCarCodeBindAX(MoveCarCodeBindAXRopRequest ropRequest) {
        try {
            return RopResponse.success(dracImService.moveCarCodeBindAX(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__moveCarCodeBindAX__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.drac.rescue.move.car.code.bind.update",needInSession = NeedInSessionType.YES)
    @ApiOperation("修改挪车码绑定信息")
    public RopResponse<Boolean> moveCarCodeBindUpdate(MoveCarCodeBindUpdateRopRequest ropRequest) {
        try {
            return RopResponse.success(dracImService.moveCarCodeBindUpdate(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__moveCarCodeBindUpdate__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.drac.rescue.move.car.code.bind.get",needInSession = NeedInSessionType.NO)
    @ApiOperation("挪车码绑定信息获取")
    public RopResponse<MoveCarCodeBindRopResponse> moveCarCodeBindGet(MoveCarCodeBindGetRopRequest ropRequest) {
        try {
            return RopResponse.success(dracImService.moveCarCodeBindGet(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__moveCarCodeBindGet__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.drac.rescue.card.scan.record.save",needInSession = NeedInSessionType.YES)
    @ApiOperation("救援码扫码信息保存")
    public RopResponse<Boolean> rescueCardScanRecordSave(RescueCardScanRecordRopRequest ropRequest) {
        try {
            return RopResponse.success(dracImService.rescueCardScanRecordSave(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__rescueCardScanRecordSave__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }

    @ServiceMethod(method = "entmicro.api.drac.rescue.card.scan.record.page",needInSession = NeedInSessionType.YES)
    @ApiOperation("救援码扫码信息分页查询")
    public RopResponse<Pagination<RescueCardScanRecordRopResponse>> rescueCardScanRecordPage(RescueCardScanRecordPageRopRequest ropRequest) {
        try {
            return RopResponse.success(dracImService.rescueCardScanRecordPage(ropRequest));
        } catch (RpcServiceException e) {
            log.info("=======RescueConfigController__invoke__rescueCardScanRecordPage__exception:{}", e.getMessage());
            return RopResponse.error(e.getErrId(), e.getMessage());
        }
    }
}