xp-robotaxi-api/src/main/java/com/xiaopeng/api/model/operation/XpLoginAgreement.java
@@ -5,6 +5,7 @@ import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import com.xiaopeng.common.core.web.domain.BaseModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -22,16 +23,19 @@ * 数据类型(1=乘客登录协议,2=运维端登录协议) */ @TableField("type") @ApiModelProperty(value = "类型 1=乘客登录协议,2=运维端登录协议") private Integer type; /** * 协议名称 */ @TableField("name") @ApiModelProperty(value = "协议名称") private String name; /** * 协议内容 */ @TableField("content") @ApiModelProperty(value = "协议内容") private String content; /** * 版本号 @@ -42,6 +46,7 @@ * 排序 */ @TableField("sort") @ApiModelProperty(value = "排序") private Integer sort; } xp-robotaxi-maintenance-boot/src/main/java/com/xiaopeng/maintenance/service/impl/XpCruiseCheckInRuleServiceImpl.java
@@ -283,7 +283,7 @@ List<XpOperationsUser> data = xpOperationsUserClient.getByPhoneNumber(dto.getPhoneNumber()).getData(); ids.addAll(data.stream().map(XpOperationsUser::getId).collect(Collectors.toList())); } if(!list().isEmpty()){ if(!ids.isEmpty()){ List<XpCruiseCheckInRuleOperationsUser> operationsUserId = xpCruiseCheckInRuleOperationsUserMapper.selectList(new QueryWrapper<XpCruiseCheckInRuleOperationsUser>().in("operations_user_id", ids)); List<Integer> ruleIds = operationsUserId.stream().map(XpCruiseCheckInRuleOperationsUser::getCruiseCheckInRuleId).collect(Collectors.toList()); dto.setIds(ruleIds); xp-robotaxi-operation-boot/src/main/java/com/xiaopeng/operation/controller/XpAgreementController.java
@@ -1,6 +1,8 @@ package com.xiaopeng.operation.controller; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.xiaopeng.api.model.operation.XpAgreement; import com.xiaopeng.api.model.operation.XpLoginAgreement; import com.xiaopeng.common.core.domain.R; import com.xiaopeng.common.core.web.controller.BaseController; import com.xiaopeng.operation.dto.XpAgreementDTO; @@ -88,4 +90,33 @@ xpAgreementService.saveAgreement(dto); return R.ok(); } @ApiOperation(value = "获取登录协议列表", tags = {"管理后台-内容中心"}) @GetMapping("/api/v1/agreement/getLoginAgreementPageList/{type}") @ApiParam(name = "type", value = "类型(1=用户登录协议,2=运维APP登录协议)") public R<List<XpLoginAgreement>> getLoginAgreementPageList(@PathVariable Integer type) { List<XpLoginAgreement> list = xpLoginAgreementService.list(new QueryWrapper<XpLoginAgreement>().eq("type", type) .eq("is_deleted", 0).orderByDesc("sort")); return R.ok(list); } @ApiOperation(value = "保存登录协议", tags = {"管理后台-内容中心"}) @PostMapping("/api/v1/agreement/saveLoginAgreement") public R<?> saveLoginAgreement(@RequestBody @Valid XpLoginAgreement dto) { long count = xpLoginAgreementService.count(new QueryWrapper<XpLoginAgreement>().eq("type", dto.getType())); dto.setSort(Long.valueOf(count + 1).intValue()); xpLoginAgreementService.save(dto); return R.ok(); } @ApiOperation(value = "删除登录协议", tags = {"管理后台-内容中心"}) @DeleteMapping("/api/v1/agreement/deleteLoginAgreement/{id}") public R<?> deleteLoginAgreement(@PathVariable Integer id) { xpLoginAgreementService.removeById(id); return R.ok(); } }