diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldMakeBeamPedestalController.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldMakeBeamPedestalController.java index 959841235..89dba972e 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldMakeBeamPedestalController.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldMakeBeamPedestalController.java @@ -125,7 +125,7 @@ public class SmartBeamFieldMakeBeamPedestalController { * @return */ @ApiOperation(value = "通过id查询智慧梁场-制梁台座信息", notes = "通过id查询智慧梁场-制梁台座信息", httpMethod = "GET") - @ApiImplicitParam(name = "id", value = "智慧梁场-制梁台座ID", paramType = "query", required = true, dataType = "Integer") + @ApiImplicitParam(name = "id", value = "智慧梁场-制梁台座ID", paramType = "query", required = true, dataType = "String") @GetMapping(value = "/queryById") public Result queryById(@RequestParam(name = "id", required = true) String id) { Result result = new Result(); diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldProcessController.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldProcessController.java index cfd0f14e3..9b9fbb42b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldProcessController.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/controller/SmartBeamFieldProcessController.java @@ -1,32 +1,28 @@ package com.zhgd.xmgl.modules.smartbeamfield.controller; -import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeamToProcess; -import io.swagger.annotations.Api; -import io.swagger.annotations.ApiImplicitParam; -import io.swagger.annotations.ApiOperation; -import io.swagger.annotations.ApiImplicitParams; -import java.util.HashMap; -import springfox.documentation.annotations.ApiIgnore; - -import java.util.List; - +import com.baomidou.mybatisplus.core.metadata.IPage; import com.zhgd.jeecg.common.api.vo.Result; -import org.apache.commons.collections.MapUtils; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldProcess; import com.zhgd.xmgl.modules.smartbeamfield.service.ISmartBeamFieldProcessService; - -import com.baomidou.mybatisplus.core.metadata.IPage; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiImplicitParam; +import io.swagger.annotations.ApiImplicitParams; +import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; - +import org.apache.commons.collections.MapUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.web.bind.annotation.*; +import springfox.documentation.annotations.ApiIgnore; + +import java.util.HashMap; +import java.util.List; /** * @Title: Controller * @Description: 智慧梁场-工序 * @author: pds - * @date: 2023-12-05 + * @date: 2023-12-05 * @version: V1.0 */ @RestController @@ -34,99 +30,109 @@ import org.springframework.web.bind.annotation.*; @Slf4j @Api(tags = "智慧梁场-工序相关Api") public class SmartBeamFieldProcessController { - @Autowired - private ISmartBeamFieldProcessService smartBeamFieldProcessService; + @Autowired + private ISmartBeamFieldProcessService smartBeamFieldProcessService; - /** - * 分页列表查询 - * @return - */ - @ApiOperation(value = "分页列表查询智慧梁场-工序信息", notes = "分页列表查询智慧梁场-工序信息", httpMethod="GET") - @ApiImplicitParams({ - @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"), - @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"), - }) - @GetMapping(value = "/page") - public Result> queryPageList(@ApiIgnore @RequestParam HashMap paramMap) { - return Result.success(smartBeamFieldProcessService.queryPageList(paramMap)); - } + /** + * 分页列表查询 + * + * @return + */ + @ApiOperation(value = "分页列表查询智慧梁场-工序信息", notes = "分页列表查询智慧梁场-工序信息", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"), + @ApiImplicitParam(name = "smartBeamFieldMakeBeamPedestalId", value = "智慧梁场-制梁台座ID", paramType = "query", required = false, dataType = "String") + }) + @GetMapping(value = "/page") + public Result> queryPageList(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(smartBeamFieldProcessService.queryPageList(paramMap)); + } - /** - * 列表查询 - * @return - */ - @ApiOperation(value = "列表查询智慧梁场-工序信息", notes = "列表查询智慧梁场-工序信息", httpMethod="GET") - @GetMapping(value = "/list") - public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { - return Result.success(smartBeamFieldProcessService.queryList(paramMap)); - } + /** + * 列表查询 + * + * @return + */ + @ApiOperation(value = "列表查询智慧梁场-工序信息", notes = "列表查询智慧梁场-工序信息", httpMethod = "GET") + @ApiImplicitParams({ + @ApiImplicitParam(name = "smartBeamFieldMakeBeamPedestalId", value = "智慧梁场-制梁台座ID", paramType = "query", required = false, dataType = "String") + }) + @GetMapping(value = "/list") + public Result> queryList(@ApiIgnore @RequestParam HashMap paramMap) { + return Result.success(smartBeamFieldProcessService.queryList(paramMap)); + } - /** - * 添加 - * @param smartBeamFieldProcess - * @return - */ - @ApiOperation(value = "添加智慧梁场-工序信息", notes = "添加智慧梁场-工序信息" , httpMethod="POST") - @PostMapping(value = "/add") - public Result add(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) { - smartBeamFieldProcessService.add(smartBeamFieldProcess); - return Result.ok(); - } + /** + * 添加 + * + * @param smartBeamFieldProcess + * @return + */ + @ApiOperation(value = "添加智慧梁场-工序信息", notes = "添加智慧梁场-工序信息", httpMethod = "POST") + @PostMapping(value = "/add") + public Result add(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) { + smartBeamFieldProcessService.add(smartBeamFieldProcess); + return Result.ok(); + } - /** - * 编辑 - * @param smartBeamFieldProcess - * @return - */ - @ApiOperation(value = "编辑智慧梁场-工序信息", notes = "编辑智慧梁场-工序信息" , httpMethod="POST") - @PostMapping(value = "/edit") - public Result edit(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) { - smartBeamFieldProcessService.edit(smartBeamFieldProcess); - return Result.ok(); - } + /** + * 编辑 + * + * @param smartBeamFieldProcess + * @return + */ + @ApiOperation(value = "编辑智慧梁场-工序信息", notes = "编辑智慧梁场-工序信息", httpMethod = "POST") + @PostMapping(value = "/edit") + public Result edit(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) { + smartBeamFieldProcessService.edit(smartBeamFieldProcess); + return Result.ok(); + } - /** - * 通过id删除 - * @return - */ - @ApiOperation(value = "删除智慧梁场-工序信息", notes = "删除智慧梁场-工序信息" , httpMethod="POST") - @ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}") - @PostMapping(value = "/delete") - public Result delete(@ApiIgnore @RequestBody HashMap map) { - String id = MapUtils.getString(map, "id"); - Result result = new Result(); - SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id); - if(smartBeamFieldProcess==null) { - result.error500("未找到对应实体"); - }else { + /** + * 通过id删除 + * + * @return + */ + @ApiOperation(value = "删除智慧梁场-工序信息", notes = "删除智慧梁场-工序信息", httpMethod = "POST") + @ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}") + @PostMapping(value = "/delete") + public Result delete(@ApiIgnore @RequestBody HashMap map) { + String id = MapUtils.getString(map, "id"); + Result result = new Result(); + SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id); + if (smartBeamFieldProcess == null) { + result.error500("未找到对应实体"); + } else { boolean ok = smartBeamFieldProcessService.delete(id); - if(ok) { - result.success("删除成功!"); - } - } + if (ok) { + result.success("删除成功!"); + } + } - return result; - } + return result; + } - /** - * 通过id查询 - * @param id - * @return - */ - @ApiOperation(value = "通过id查询智慧梁场-工序信息", notes = "通过id查询智慧梁场-工序信息" , httpMethod="GET") - @ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "query", required = true, dataType = "Integer") - @GetMapping(value = "/queryById") - public Result queryById(@RequestParam(name="id",required=true) String id) { - Result result = new Result(); - SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id); - if (smartBeamFieldProcess == null) { - result.error500("未找到对应实体"); - } else { - result.setResult(smartBeamFieldProcess); - result.setSuccess(true); - } - return result; - } + /** + * 通过id查询 + * + * @param id + * @return + */ + @ApiOperation(value = "通过id查询智慧梁场-工序信息", notes = "通过id查询智慧梁场-工序信息", httpMethod = "GET") + @ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "query", required = true, dataType = "Integer") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + Result result = new Result(); + SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id); + if (smartBeamFieldProcess == null) { + result.error500("未找到对应实体"); + } else { + result.setResult(smartBeamFieldProcess); + result.setSuccess(true); + } + return result; + } } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldProcessMapper.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldProcessMapper.java index ece2c8236..dc07d1d78 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldProcessMapper.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/SmartBeamFieldProcessMapper.java @@ -1,9 +1,15 @@ package com.zhgd.xmgl.modules.smartbeamfield.mapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.core.toolkit.Constants; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import org.apache.ibatis.annotations.Mapper; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldProcess; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Param; +import java.util.HashMap; import java.util.List; /** @@ -16,4 +22,8 @@ import java.util.List; public interface SmartBeamFieldProcessMapper extends BaseMapper { List getProcessAndMakeBeamPedestalByLineId(Long smartBeamFieldProductionLineId); + + IPage queryList(Page page, @Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("p") HashMap paramMap); + + List queryList(@Param(Constants.WRAPPER) QueryWrapper queryWrapper, @Param("p") HashMap paramMap); } diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldProcessMapper.xml b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldProcessMapper.xml index 844605750..6087e24fe 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldProcessMapper.xml +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/mapper/xml/SmartBeamFieldProcessMapper.xml @@ -12,4 +12,13 @@ where pltmbp.smart_beam_field_production_line_id = #{smartBeamFieldProductionLineId} order by pltmbp.process_sort,mbptp.id + + diff --git a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldMakeBeamPedestalServiceImpl.java b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldMakeBeamPedestalServiceImpl.java index e1b888ffd..f5153df9b 100644 --- a/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldMakeBeamPedestalServiceImpl.java +++ b/src/main/java/com/zhgd/xmgl/modules/smartbeamfield/service/impl/SmartBeamFieldMakeBeamPedestalServiceImpl.java @@ -177,8 +177,8 @@ public class SmartBeamFieldMakeBeamPedestalServiceImpl extends ServiceImpl queryPageList(HashMap paramMap) { QueryWrapper queryWrapper = getQueryWrapper(paramMap); Page page = PageUtil.getPage(paramMap); - IPage pageList = this.page(page, queryWrapper); + IPage pageList = baseMapper.queryList(page, queryWrapper, paramMap); pageList.setRecords(dealList(pageList.getRecords())); return pageList; } @@ -52,12 +52,17 @@ public class SmartBeamFieldProcessServiceImpl extends ServiceImpl queryList(HashMap paramMap) { QueryWrapper queryWrapper = getQueryWrapper(paramMap); - return dealList(this.list(queryWrapper)); + return dealList(baseMapper.queryList(queryWrapper, paramMap)); } private QueryWrapper getQueryWrapper(HashMap paramMap) { - String alias = ""; + String alias = "sbfp."; + String toAlias = "sbfmbptp."; QueryWrapper queryWrapper = QueryGenerator.initPageQueryWrapper(SmartBeamFieldProcess.class, paramMap, alias); + String smartBeamFieldMakeBeamPedestalToProcessId = MapUtils.getString(paramMap, "smartBeamFieldMakeBeamPedestalId"); + if (StrUtil.isNotBlank(smartBeamFieldMakeBeamPedestalToProcessId)) { + queryWrapper.eq(toAlias + RefUtil.fieldNameUlc(SmartBeamFieldMakeBeamPedestalToProcess::getSmartBeamFieldMakeBeamPedestalId), smartBeamFieldMakeBeamPedestalToProcessId); + } queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SmartBeamFieldProcess::getId)); return queryWrapper; } diff --git a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java index 2e541fdf3..41f2cb757 100644 --- a/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java +++ b/src/main/java/com/zhgd/xmgl/security/WebSecurityConfig.java @@ -266,9 +266,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter { .antMatchers("/xmgl/weight/weighBookVehicleInfo/pull/list").permitAll() .antMatchers("/xmgl/gouliPkpmModel/getBimTokenByProjectSn").permitAll() .antMatchers("/xmgl/gouliPkpmModel/queryById").permitAll() - .antMatchers("/xmgl/smartBeamFieldMaintainData/page").permitAll() - .antMatchers("/xmgl/smartBeamFieldMaintainData/countCustomData").permitAll() - .antMatchers("/xmgl/smartBeamFieldMaintainData/getAvgData").permitAll() + .antMatchers("/xmgl/smartBeamFieldMaintainData/**").permitAll() .antMatchers("/xmgl/smartBeamFieldMakeBeamPedestal/list").permitAll() .antMatchers("/xmgl/smartBeamFieldBeam/countSmartBeamFieldBeam").permitAll() .antMatchers("/service-address/workers").permitAll()