bug修复

This commit is contained in:
guo 2024-01-08 16:24:44 +08:00
parent 9582b73155
commit 3e9c95d20c
7 changed files with 137 additions and 109 deletions

View File

@ -125,7 +125,7 @@ public class SmartBeamFieldMakeBeamPedestalController {
* @return * @return
*/ */
@ApiOperation(value = "通过id查询智慧梁场-制梁台座信息", notes = "通过id查询智慧梁场-制梁台座信息", httpMethod = "GET") @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") @GetMapping(value = "/queryById")
public Result<SmartBeamFieldMakeBeamPedestal> queryById(@RequestParam(name = "id", required = true) String id) { public Result<SmartBeamFieldMakeBeamPedestal> queryById(@RequestParam(name = "id", required = true) String id) {
Result<SmartBeamFieldMakeBeamPedestal> result = new Result<SmartBeamFieldMakeBeamPedestal>(); Result<SmartBeamFieldMakeBeamPedestal> result = new Result<SmartBeamFieldMakeBeamPedestal>();

View File

@ -1,32 +1,28 @@
package com.zhgd.xmgl.modules.smartbeamfield.controller; package com.zhgd.xmgl.modules.smartbeamfield.controller;
import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeamToProcess; import com.baomidou.mybatisplus.core.metadata.IPage;
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.zhgd.jeecg.common.api.vo.Result; 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.entity.SmartBeamFieldProcess;
import com.zhgd.xmgl.modules.smartbeamfield.service.ISmartBeamFieldProcessService; import com.zhgd.xmgl.modules.smartbeamfield.service.ISmartBeamFieldProcessService;
import io.swagger.annotations.Api;
import com.baomidou.mybatisplus.core.metadata.IPage; import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.HashMap;
import java.util.List;
/** /**
* @Title: Controller * @Title: Controller
* @Description: 智慧梁场-工序 * @Description: 智慧梁场-工序
* @author pds * @author pds
* @date 2023-12-05 * @date 2023-12-05
* @version V1.0 * @version V1.0
*/ */
@RestController @RestController
@ -34,99 +30,109 @@ import org.springframework.web.bind.annotation.*;
@Slf4j @Slf4j
@Api(tags = "智慧梁场-工序相关Api") @Api(tags = "智慧梁场-工序相关Api")
public class SmartBeamFieldProcessController { public class SmartBeamFieldProcessController {
@Autowired @Autowired
private ISmartBeamFieldProcessService smartBeamFieldProcessService; private ISmartBeamFieldProcessService smartBeamFieldProcessService;
/** /**
* 分页列表查询 * 分页列表查询
* @return *
*/ * @return
@ApiOperation(value = "分页列表查询智慧梁场-工序信息", notes = "分页列表查询智慧梁场-工序信息", httpMethod="GET") */
@ApiImplicitParams({ @ApiOperation(value = "分页列表查询智慧梁场-工序信息", notes = "分页列表查询智慧梁场-工序信息", httpMethod = "GET")
@ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"), @ApiImplicitParams({
@ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"), @ApiImplicitParam(name = "pageNo", value = "第几页", paramType = "query", required = true, dataType = "Integer"),
}) @ApiImplicitParam(name = "pageSize", value = "每页显示条数", paramType = "query", required = true, dataType = "Integer"),
@GetMapping(value = "/page") @ApiImplicitParam(name = "smartBeamFieldMakeBeamPedestalId", value = "智慧梁场-制梁台座ID", paramType = "query", required = false, dataType = "String")
public Result<IPage<SmartBeamFieldProcess>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) { })
return Result.success(smartBeamFieldProcessService.queryPageList(paramMap)); @GetMapping(value = "/page")
} public Result<IPage<SmartBeamFieldProcess>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
return Result.success(smartBeamFieldProcessService.queryPageList(paramMap));
}
/** /**
* 列表查询 * 列表查询
* @return *
*/ * @return
@ApiOperation(value = "列表查询智慧梁场-工序信息", notes = "列表查询智慧梁场-工序信息", httpMethod="GET") */
@GetMapping(value = "/list") @ApiOperation(value = "列表查询智慧梁场-工序信息", notes = "列表查询智慧梁场-工序信息", httpMethod = "GET")
public Result<List<SmartBeamFieldProcess>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) { @ApiImplicitParams({
return Result.success(smartBeamFieldProcessService.queryList(paramMap)); @ApiImplicitParam(name = "smartBeamFieldMakeBeamPedestalId", value = "智慧梁场-制梁台座ID", paramType = "query", required = false, dataType = "String")
} })
@GetMapping(value = "/list")
public Result<List<SmartBeamFieldProcess>> queryList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
return Result.success(smartBeamFieldProcessService.queryList(paramMap));
}
/** /**
* 添加 * 添加
* @param smartBeamFieldProcess *
* @return * @param smartBeamFieldProcess
*/ * @return
@ApiOperation(value = "添加智慧梁场-工序信息", notes = "添加智慧梁场-工序信息" , httpMethod="POST") */
@PostMapping(value = "/add") @ApiOperation(value = "添加智慧梁场-工序信息", notes = "添加智慧梁场-工序信息", httpMethod = "POST")
public Result<SmartBeamFieldProcess> add(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) { @PostMapping(value = "/add")
smartBeamFieldProcessService.add(smartBeamFieldProcess); public Result<SmartBeamFieldProcess> add(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) {
return Result.ok(); smartBeamFieldProcessService.add(smartBeamFieldProcess);
} return Result.ok();
}
/** /**
* 编辑 * 编辑
* @param smartBeamFieldProcess *
* @return * @param smartBeamFieldProcess
*/ * @return
@ApiOperation(value = "编辑智慧梁场-工序信息", notes = "编辑智慧梁场-工序信息" , httpMethod="POST") */
@PostMapping(value = "/edit") @ApiOperation(value = "编辑智慧梁场-工序信息", notes = "编辑智慧梁场-工序信息", httpMethod = "POST")
public Result<SmartBeamFieldProcess> edit(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) { @PostMapping(value = "/edit")
smartBeamFieldProcessService.edit(smartBeamFieldProcess); public Result<SmartBeamFieldProcess> edit(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) {
return Result.ok(); smartBeamFieldProcessService.edit(smartBeamFieldProcess);
} return Result.ok();
}
/** /**
* 通过id删除 * 通过id删除
* @return *
*/ * @return
@ApiOperation(value = "删除智慧梁场-工序信息", notes = "删除智慧梁场-工序信息" , httpMethod="POST") */
@ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}") @ApiOperation(value = "删除智慧梁场-工序信息", notes = "删除智慧梁场-工序信息", httpMethod = "POST")
@PostMapping(value = "/delete") @ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
public Result<SmartBeamFieldProcess> delete(@ApiIgnore @RequestBody HashMap<String ,Object> map) { @PostMapping(value = "/delete")
String id = MapUtils.getString(map, "id"); public Result<SmartBeamFieldProcess> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
Result<SmartBeamFieldProcess> result = new Result<SmartBeamFieldProcess>(); String id = MapUtils.getString(map, "id");
SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id); Result<SmartBeamFieldProcess> result = new Result<SmartBeamFieldProcess>();
if(smartBeamFieldProcess==null) { SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id);
result.error500("未找到对应实体"); if (smartBeamFieldProcess == null) {
}else { result.error500("未找到对应实体");
} else {
boolean ok = smartBeamFieldProcessService.delete(id); boolean ok = smartBeamFieldProcessService.delete(id);
if(ok) { if (ok) {
result.success("删除成功!"); result.success("删除成功!");
} }
} }
return result; return result;
} }
/** /**
* 通过id查询 * 通过id查询
* @param id *
* @return * @param id
*/ * @return
@ApiOperation(value = "通过id查询智慧梁场-工序信息", notes = "通过id查询智慧梁场-工序信息" , httpMethod="GET") */
@ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "query", required = true, dataType = "Integer") @ApiOperation(value = "通过id查询智慧梁场-工序信息", notes = "通过id查询智慧梁场-工序信息", httpMethod = "GET")
@GetMapping(value = "/queryById") @ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "query", required = true, dataType = "Integer")
public Result<SmartBeamFieldProcess> queryById(@RequestParam(name="id",required=true) String id) { @GetMapping(value = "/queryById")
Result<SmartBeamFieldProcess> result = new Result<SmartBeamFieldProcess>(); public Result<SmartBeamFieldProcess> queryById(@RequestParam(name = "id", required = true) String id) {
SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id); Result<SmartBeamFieldProcess> result = new Result<SmartBeamFieldProcess>();
if (smartBeamFieldProcess == null) { SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id);
result.error500("未找到对应实体"); if (smartBeamFieldProcess == null) {
} else { result.error500("未找到对应实体");
result.setResult(smartBeamFieldProcess); } else {
result.setSuccess(true); result.setResult(smartBeamFieldProcess);
} result.setSuccess(true);
return result; }
} return result;
}
} }

View File

@ -1,9 +1,15 @@
package com.zhgd.xmgl.modules.smartbeamfield.mapper; 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 org.apache.ibatis.annotations.Mapper;
import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldProcess; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldProcess;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.HashMap;
import java.util.List; import java.util.List;
/** /**
@ -16,4 +22,8 @@ import java.util.List;
public interface SmartBeamFieldProcessMapper extends BaseMapper<SmartBeamFieldProcess> { public interface SmartBeamFieldProcessMapper extends BaseMapper<SmartBeamFieldProcess> {
List<SmartBeamFieldProcess> getProcessAndMakeBeamPedestalByLineId(Long smartBeamFieldProductionLineId); List<SmartBeamFieldProcess> getProcessAndMakeBeamPedestalByLineId(Long smartBeamFieldProductionLineId);
IPage<SmartBeamFieldProcess> queryList(Page<SmartBeamFieldProcess> page, @Param(Constants.WRAPPER) QueryWrapper<SmartBeamFieldProcess> queryWrapper, @Param("p") HashMap<String, Object> paramMap);
List<SmartBeamFieldProcess> queryList(@Param(Constants.WRAPPER) QueryWrapper<SmartBeamFieldProcess> queryWrapper, @Param("p") HashMap<String, Object> paramMap);
} }

View File

@ -12,4 +12,13 @@
where pltmbp.smart_beam_field_production_line_id = #{smartBeamFieldProductionLineId} where pltmbp.smart_beam_field_production_line_id = #{smartBeamFieldProductionLineId}
order by pltmbp.process_sort,mbptp.id order by pltmbp.process_sort,mbptp.id
</select> </select>
<select id="queryList" resultType="com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldProcess">
select sbfp.* from smart_beam_field_process sbfp
<if test="p.smartBeamFieldMakeBeamPedestalId != null and p.smartBeamFieldMakeBeamPedestalId != ''">
join smart_beam_field_make_beam_pedestal_to_process sbfmbptp on sbfp.id =
sbfmbptp.smart_beam_field_process_id
</if>
${ew.customSqlSegment}
</select>
</mapper> </mapper>

View File

@ -177,8 +177,8 @@ public class SmartBeamFieldMakeBeamPedestalServiceImpl extends ServiceImpl<Smart
if (!exsit) { if (!exsit) {
pr.setSmartBeamFieldMakeBeamPedestalId(queryPedestal.getId()); pr.setSmartBeamFieldMakeBeamPedestalId(queryPedestal.getId());
pr.setSmartBeamFieldBeamId(beamId); pr.setSmartBeamFieldBeamId(beamId);
pr.setSmartBeamFieldProcessId(pr.getId()); pr.setSmartBeamFieldProcessId(process.getId());
pr.setProcessName(pr.getProcessName()); pr.setProcessName(process.getProcessName());
pr.setMakeBeamPedestalSn(makeBeamPedestalSn); pr.setMakeBeamPedestalSn(makeBeamPedestalSn);
pr.setProjectSn(queryPedestal.getProjectSn()); pr.setProjectSn(queryPedestal.getProjectSn());
} }

View File

@ -44,7 +44,7 @@ public class SmartBeamFieldProcessServiceImpl extends ServiceImpl<SmartBeamField
public IPage<SmartBeamFieldProcess> queryPageList(HashMap<String, Object> paramMap) { public IPage<SmartBeamFieldProcess> queryPageList(HashMap<String, Object> paramMap) {
QueryWrapper<SmartBeamFieldProcess> queryWrapper = getQueryWrapper(paramMap); QueryWrapper<SmartBeamFieldProcess> queryWrapper = getQueryWrapper(paramMap);
Page<SmartBeamFieldProcess> page = PageUtil.getPage(paramMap); Page<SmartBeamFieldProcess> page = PageUtil.getPage(paramMap);
IPage<SmartBeamFieldProcess> pageList = this.page(page, queryWrapper); IPage<SmartBeamFieldProcess> pageList = baseMapper.queryList(page, queryWrapper, paramMap);
pageList.setRecords(dealList(pageList.getRecords())); pageList.setRecords(dealList(pageList.getRecords()));
return pageList; return pageList;
} }
@ -52,12 +52,17 @@ public class SmartBeamFieldProcessServiceImpl extends ServiceImpl<SmartBeamField
@Override @Override
public List<SmartBeamFieldProcess> queryList(HashMap<String, Object> paramMap) { public List<SmartBeamFieldProcess> queryList(HashMap<String, Object> paramMap) {
QueryWrapper<SmartBeamFieldProcess> queryWrapper = getQueryWrapper(paramMap); QueryWrapper<SmartBeamFieldProcess> queryWrapper = getQueryWrapper(paramMap);
return dealList(this.list(queryWrapper)); return dealList(baseMapper.queryList(queryWrapper, paramMap));
} }
private QueryWrapper<SmartBeamFieldProcess> getQueryWrapper(HashMap<String, Object> paramMap) { private QueryWrapper<SmartBeamFieldProcess> getQueryWrapper(HashMap<String, Object> paramMap) {
String alias = ""; String alias = "sbfp.";
String toAlias = "sbfmbptp.";
QueryWrapper<SmartBeamFieldProcess> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartBeamFieldProcess.class, paramMap, alias); QueryWrapper<SmartBeamFieldProcess> 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)); queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SmartBeamFieldProcess::getId));
return queryWrapper; return queryWrapper;
} }

View File

@ -266,9 +266,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/xmgl/weight/weighBookVehicleInfo/pull/list").permitAll() .antMatchers("/xmgl/weight/weighBookVehicleInfo/pull/list").permitAll()
.antMatchers("/xmgl/gouliPkpmModel/getBimTokenByProjectSn").permitAll() .antMatchers("/xmgl/gouliPkpmModel/getBimTokenByProjectSn").permitAll()
.antMatchers("/xmgl/gouliPkpmModel/queryById").permitAll() .antMatchers("/xmgl/gouliPkpmModel/queryById").permitAll()
.antMatchers("/xmgl/smartBeamFieldMaintainData/page").permitAll() .antMatchers("/xmgl/smartBeamFieldMaintainData/**").permitAll()
.antMatchers("/xmgl/smartBeamFieldMaintainData/countCustomData").permitAll()
.antMatchers("/xmgl/smartBeamFieldMaintainData/getAvgData").permitAll()
.antMatchers("/xmgl/smartBeamFieldMakeBeamPedestal/list").permitAll() .antMatchers("/xmgl/smartBeamFieldMakeBeamPedestal/list").permitAll()
.antMatchers("/xmgl/smartBeamFieldBeam/countSmartBeamFieldBeam").permitAll() .antMatchers("/xmgl/smartBeamFieldBeam/countSmartBeamFieldBeam").permitAll()
.antMatchers("/service-address/workers").permitAll() .antMatchers("/service-address/workers").permitAll()