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
*/
@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<SmartBeamFieldMakeBeamPedestal> queryById(@RequestParam(name = "id", required = true) String id) {
Result<SmartBeamFieldMakeBeamPedestal> result = new Result<SmartBeamFieldMakeBeamPedestal>();

View File

@ -1,25 +1,21 @@
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;
/**
@ -39,12 +35,14 @@ public class SmartBeamFieldProcessController {
/**
* 分页列表查询
*
* @return
*/
@ApiOperation(value = "分页列表查询智慧梁场-工序信息", notes = "分页列表查询智慧梁场-工序信息", httpMethod="GET")
@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<IPage<SmartBeamFieldProcess>> queryPageList(@ApiIgnore @RequestParam HashMap<String, Object> paramMap) {
@ -53,9 +51,13 @@ public class SmartBeamFieldProcessController {
/**
* 列表查询
*
* @return
*/
@ApiOperation(value = "列表查询智慧梁场-工序信息", notes = "列表查询智慧梁场-工序信息", httpMethod="GET")
@ApiOperation(value = "列表查询智慧梁场-工序信息", notes = "列表查询智慧梁场-工序信息", httpMethod = "GET")
@ApiImplicitParams({
@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));
@ -63,10 +65,11 @@ public class SmartBeamFieldProcessController {
/**
* 添加
*
* @param smartBeamFieldProcess
* @return
*/
@ApiOperation(value = "添加智慧梁场-工序信息", notes = "添加智慧梁场-工序信息" , httpMethod="POST")
@ApiOperation(value = "添加智慧梁场-工序信息", notes = "添加智慧梁场-工序信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<SmartBeamFieldProcess> add(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) {
smartBeamFieldProcessService.add(smartBeamFieldProcess);
@ -75,10 +78,11 @@ public class SmartBeamFieldProcessController {
/**
* 编辑
*
* @param smartBeamFieldProcess
* @return
*/
@ApiOperation(value = "编辑智慧梁场-工序信息", notes = "编辑智慧梁场-工序信息" , httpMethod="POST")
@ApiOperation(value = "编辑智慧梁场-工序信息", notes = "编辑智慧梁场-工序信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<SmartBeamFieldProcess> edit(@RequestBody SmartBeamFieldProcess smartBeamFieldProcess) {
smartBeamFieldProcessService.edit(smartBeamFieldProcess);
@ -87,20 +91,21 @@ public class SmartBeamFieldProcessController {
/**
* 通过id删除
*
* @return
*/
@ApiOperation(value = "删除智慧梁场-工序信息", notes = "删除智慧梁场-工序信息" , httpMethod="POST")
@ApiOperation(value = "删除智慧梁场-工序信息", notes = "删除智慧梁场-工序信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "智慧梁场-工序ID", paramType = "body", required = true, dataType = "String", example = "{\"id\":\"1\"}")
@PostMapping(value = "/delete")
public Result<SmartBeamFieldProcess> delete(@ApiIgnore @RequestBody HashMap<String ,Object> map) {
public Result<SmartBeamFieldProcess> delete(@ApiIgnore @RequestBody HashMap<String, Object> map) {
String id = MapUtils.getString(map, "id");
Result<SmartBeamFieldProcess> result = new Result<SmartBeamFieldProcess>();
SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id);
if(smartBeamFieldProcess==null) {
if (smartBeamFieldProcess == null) {
result.error500("未找到对应实体");
}else {
} else {
boolean ok = smartBeamFieldProcessService.delete(id);
if(ok) {
if (ok) {
result.success("删除成功!");
}
}
@ -110,13 +115,14 @@ public class SmartBeamFieldProcessController {
/**
* 通过id查询
*
* @param id
* @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")
@GetMapping(value = "/queryById")
public Result<SmartBeamFieldProcess> queryById(@RequestParam(name="id",required=true) String id) {
public Result<SmartBeamFieldProcess> queryById(@RequestParam(name = "id", required = true) String id) {
Result<SmartBeamFieldProcess> result = new Result<SmartBeamFieldProcess>();
SmartBeamFieldProcess smartBeamFieldProcess = smartBeamFieldProcessService.getById(id);
if (smartBeamFieldProcess == null) {

View File

@ -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<SmartBeamFieldProcess> {
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}
order by pltmbp.process_sort,mbptp.id
</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>

View File

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

View File

@ -44,7 +44,7 @@ public class SmartBeamFieldProcessServiceImpl extends ServiceImpl<SmartBeamField
public IPage<SmartBeamFieldProcess> queryPageList(HashMap<String, Object> paramMap) {
QueryWrapper<SmartBeamFieldProcess> queryWrapper = getQueryWrapper(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()));
return pageList;
}
@ -52,12 +52,17 @@ public class SmartBeamFieldProcessServiceImpl extends ServiceImpl<SmartBeamField
@Override
public List<SmartBeamFieldProcess> queryList(HashMap<String, Object> 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) {
String alias = "";
String alias = "sbfp.";
String toAlias = "sbfmbptp.";
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));
return queryWrapper;
}

View File

@ -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()