金林湾bug修复
This commit is contained in:
parent
ff55e03b4c
commit
cb849b8e1d
@ -20,13 +20,14 @@ import org.springframework.web.bind.annotation.*;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
|
||||
|
||||
/**
|
||||
/**
|
||||
* @Title: Controller
|
||||
* @Description: 项目配置
|
||||
* @author: pds
|
||||
* @date: 2020-08-17
|
||||
* @date: 2020-08-17
|
||||
* @version: V1.0
|
||||
*/
|
||||
@RestController
|
||||
@ -34,101 +35,111 @@ import java.util.Map;
|
||||
@Slf4j
|
||||
@Api(tags = "项目配置")
|
||||
public class ProjectConfigController {
|
||||
@Autowired
|
||||
private IProjectConfigService projectConfigService;
|
||||
@Autowired
|
||||
private IProjectConfigService projectConfigService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
* @param projectConfig
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param projectConfig
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "分页列表查询项目配置信息", notes = "分页列表查询项目配置信息", httpMethod = "GET")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<IPage<ProjectConfig>> queryPageList(ProjectConfig projectConfig,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<ProjectConfig>> result = new Result<IPage<ProjectConfig>>();
|
||||
QueryWrapper<ProjectConfig> queryWrapper = QueryGenerator.initQueryWrapper(projectConfig, req.getParameterMap());
|
||||
Page<ProjectConfig> page = new Page<ProjectConfig>(pageNo, pageSize);
|
||||
IPage<ProjectConfig> pageList = projectConfigService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
public Result<IPage<ProjectConfig>> queryPageList(ProjectConfig projectConfig,
|
||||
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
Result<IPage<ProjectConfig>> result = new Result<IPage<ProjectConfig>>();
|
||||
QueryWrapper<ProjectConfig> queryWrapper = QueryGenerator.initQueryWrapper(projectConfig, req.getParameterMap());
|
||||
Page<ProjectConfig> page = new Page<ProjectConfig>(pageNo, pageSize);
|
||||
IPage<ProjectConfig> pageList = projectConfigService.page(page, queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(pageList);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param projectConfig
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目管理",operType = "编辑项目配置",operDesc = "编辑项目配置")
|
||||
@ApiOperation(value = "编辑项目配置信息", notes = "编辑项目配置信息" , httpMethod="POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<ProjectConfig> edit(@RequestBody ProjectConfig projectConfig) {
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param projectConfig
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目管理", operType = "编辑项目配置", operDesc = "编辑项目配置")
|
||||
@ApiOperation(value = "编辑项目配置信息", notes = "编辑项目配置信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<ProjectConfig> edit(@RequestBody ProjectConfig projectConfig) {
|
||||
projectConfigService.editProjectConfig(projectConfig);
|
||||
return Result.ok();
|
||||
}
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目管理",operType = "删除项目配置",operDesc = "删除项目配置")
|
||||
@ApiOperation(value = "删除项目配置信息", notes = "删除项目配置信息" , httpMethod="POST")
|
||||
@ApiImplicitParam(name = "id", value = "项目配置ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<ProjectConfig> delete(@RequestBody Map<String,Object> map) {
|
||||
Result<ProjectConfig> result = new Result<ProjectConfig>();
|
||||
ProjectConfig projectConfig = projectConfigService.getById(MapUtils.getString(map,"id"));
|
||||
if(projectConfig==null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
}else {
|
||||
boolean ok = projectConfigService.removeById(MapUtils.getString(map,"id"));
|
||||
if(ok) {
|
||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
||||
}
|
||||
}
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@OperLog(operModul = "项目管理", operType = "删除项目配置", operDesc = "删除项目配置")
|
||||
@ApiOperation(value = "删除项目配置信息", notes = "删除项目配置信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "项目配置ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/delete")
|
||||
public Result<ProjectConfig> delete(@RequestBody Map<String, Object> map) {
|
||||
Result<ProjectConfig> result = new Result<ProjectConfig>();
|
||||
ProjectConfig projectConfig = projectConfigService.getById(MapUtils.getString(map, "id"));
|
||||
if (projectConfig == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
boolean ok = projectConfigService.removeById(MapUtils.getString(map, "id"));
|
||||
if (ok) {
|
||||
result.successMsg(MessageUtil.get("deleteSucess"));
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询项目配置信息", notes = "通过id查询项目配置信息" , httpMethod="POST")
|
||||
@ApiImplicitParam(name = "id", value = "项目配置ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<ProjectConfig> queryById(@RequestBody Map<String,Object> map) {
|
||||
Result<ProjectConfig> result = new Result<ProjectConfig>();
|
||||
ProjectConfig projectConfig = projectConfigService.getById(MapUtils.getString(map,"id"));
|
||||
if(projectConfig==null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
}else {
|
||||
result.setResult(projectConfig);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value = "通过id查询项目配置信息", notes = "通过id查询项目配置信息", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "id", value = "项目配置ID", paramType = "query", required = true, dataType = "Integer")
|
||||
@PostMapping(value = "/queryById")
|
||||
public Result<ProjectConfig> queryById(@RequestBody Map<String, Object> map) {
|
||||
Result<ProjectConfig> result = new Result<ProjectConfig>();
|
||||
ProjectConfig projectConfig = projectConfigService.getById(MapUtils.getString(map, "id"));
|
||||
if (projectConfig == null) {
|
||||
result.error500(MessageUtil.get("notFindErr"));
|
||||
} else {
|
||||
result.setResult(projectConfig);
|
||||
result.setSuccess(true);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@ApiOperation(value = "通过项目sn查询项目配置", notes = "通过项目sn查询项目配置", httpMethod="POST")
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String")
|
||||
@PostMapping(value = "/getProjectConfigList")
|
||||
public Result<List<ProjectConfig>> getProjectConfigList(@RequestBody Map<String,Object> map) {
|
||||
Result<List<ProjectConfig>> result = new Result<List<ProjectConfig>>();
|
||||
QueryWrapper<ProjectConfig> queryWrapper=new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(ProjectConfig::getProjectSn, MapUtils.getString(map,"projectSn"));
|
||||
List<ProjectConfig> list=projectConfigService.list(queryWrapper);
|
||||
result.setSuccess(true);
|
||||
result.setResult(list);
|
||||
return result;
|
||||
}
|
||||
@ApiOperation(value = "通过项目sn查询项目配置", notes = "通过项目sn查询项目配置", httpMethod = "POST")
|
||||
@ApiImplicitParam(name = "projectSn", value = "项目SN", paramType = "query", required = true, dataType = "String")
|
||||
@PostMapping(value = "/getProjectConfigList")
|
||||
public Result<List<ProjectConfig>> getProjectConfigList(@RequestBody Map<String, Object> map) {
|
||||
Result<List<ProjectConfig>> result = new Result<List<ProjectConfig>>();
|
||||
QueryWrapper<ProjectConfig> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(ProjectConfig::getProjectSn, MapUtils.getString(map, "projectSn"));
|
||||
List<ProjectConfig> list = projectConfigService.list(queryWrapper);
|
||||
for (ProjectConfig projectConfig : list) {
|
||||
if (!Objects.equals(projectConfig.getPositionType(), 1)) {
|
||||
projectConfig.setPositionType(1);
|
||||
projectConfigService.updateById(projectConfig);
|
||||
}
|
||||
}
|
||||
result.setSuccess(true);
|
||||
result.setResult(list);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user