金林湾bug修复

This commit is contained in:
guo 2023-09-13 11:38:30 +08:00
parent ff55e03b4c
commit cb849b8e1d

View File

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