Commit 81b1130a authored by caotao's avatar caotao

江西电建新增运维评估模块接口

parent 03192419
package com.yeejoin.amos.boot.module.jxiop.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.experimental.Accessors;
/**
*
*
* @author system_generator
* @date 2023-06-08
*/
@Data
@Accessors(chain = true)
@TableName(value = "ywpg_module_info",autoResultMap = true)
public class YwpgMoudleInfo {
private static final long serialVersionUID = 1L;
/**
* 模块名称
*/
@TableField("module_name")
private String moduleName;
/**
* 模块tableid
*/
@TableField("module_table_id")
private String moduleTableId;
}
package com.yeejoin.amos.boot.module.jxiop.api.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.boot.module.jxiop.api.entity.YwpgMoudleInfo;
public interface YwpgMoudleInfoMapper extends BaseMapper<YwpgMoudleInfo> {
}
package com.yeejoin.amos.boot.module.jxiop.biz.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jxiop.biz.service.impl.YwpgModuleInfoServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import java.util.List;
import java.util.Map;
@RestController
@Api(tags = "JXIOP认证")
@RequestMapping(value = "/auth")
public class JxiopAuthController extends BaseController {
@Autowired
YwpgModuleInfoServiceImpl ywpgModuleInfoService;
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/v1")
@ApiOperation(httpMethod = "GET", value = "运维评模块数据过滤", notes = "运维评估模块数据过滤")
public ResponseModel<List<Map<String,Object>>> getIdxAuthInfo() {
ReginParams reginParams =getSelectedOrgInfo();
return ResponseHelper.buildResponse(ywpgModuleInfoService.getIdxAuthInfo(reginParams));
}
}
package com.yeejoin.amos.boot.module.jxiop.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.boot.module.jxiop.api.entity.YwpgMoudleInfo;
import com.yeejoin.amos.boot.module.jxiop.api.mapper.YwpgMoudleInfoMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
public class YwpgModuleInfoServiceImpl {
@Autowired
YwpgMoudleInfoMapper ywpgMoudleInfoMapper;
public List<Map<String, Object>> getIdxAuthInfo(ReginParams reginParams) {
List<Map<String, Object>> result = new ArrayList<>();
String orgCode = reginParams.getCompany().getOrgCode();
if(ObjectUtils.isEmpty(orgCode)){
return result;
}
List<YwpgMoudleInfo> ywpgMoudleInfoList = ywpgMoudleInfoMapper.selectList(new QueryWrapper<YwpgMoudleInfo>().isNotNull("module_name").isNotNull("module_table_id"));
//TODO 处理业务逻辑
Map<String,Object> item = new HashMap<>();
Map<String,Object> filters = new HashMap<>();
ywpgMoudleInfoList.stream().forEach(ywpgMoudleInfo -> {
item.put("name",ywpgMoudleInfo.getModuleName());
item.put("tableId",ywpgMoudleInfo.getModuleTableId());
filters.put("searchColumn","CODE");
filters.put("condition","startsWith");
filters.put("value",orgCode);
item.put("filters",filters);
result.add(item);
});
return result;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment