智慧梁场修改

This commit is contained in:
guo 2023-12-08 10:42:04 +08:00
parent dd10536a21
commit c95c66721d
6 changed files with 54 additions and 20 deletions

View File

@ -11,6 +11,7 @@ import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.MapUtils; import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
@ -67,7 +68,7 @@ public class SmartBeamFieldBeamController {
*/ */
@ApiOperation(value = "添加智慧梁场-梁信息", notes = "添加智慧梁场-梁信息", httpMethod = "POST") @ApiOperation(value = "添加智慧梁场-梁信息", notes = "添加智慧梁场-梁信息", httpMethod = "POST")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<SmartBeamFieldBeam> add(@RequestBody SmartBeamFieldBeam smartBeamFieldBeam) { public Result<SmartBeamFieldBeam> add(@RequestBody @Validated SmartBeamFieldBeam smartBeamFieldBeam) {
smartBeamFieldBeamService.add(smartBeamFieldBeam); smartBeamFieldBeamService.add(smartBeamFieldBeam);
return Result.ok(); return Result.ok();
} }
@ -152,4 +153,10 @@ public class SmartBeamFieldBeamController {
return Result.ok(); return Result.ok();
} }
@ApiOperation(value = "开始生产", notes = "开始生产", httpMethod = "POST")
@PostMapping(value = "/beginProduce")
public Result beginProduce(@RequestBody SmartBeamFieldBeam smartBeamFieldBeam) {
smartBeamFieldBeamService.beginProduce(smartBeamFieldBeam);
return Result.ok();
}
} }

View File

@ -8,9 +8,12 @@ import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.NonNull;
import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat; import org.springframework.format.annotation.DateTimeFormat;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.io.Serializable; import java.io.Serializable;
/** /**
@ -38,6 +41,7 @@ public class SmartBeamFieldBeam implements Serializable {
*/ */
@Excel(name = "智慧梁场-桥段id", width = 15) @Excel(name = "智慧梁场-桥段id", width = 15)
@ApiModelProperty(value = "智慧梁场-桥段id") @ApiModelProperty(value = "智慧梁场-桥段id")
@NotNull
private java.lang.Long smartBeamFieldBridgeSectionId; private java.lang.Long smartBeamFieldBridgeSectionId;
/** /**
* 智慧梁场-生产线id * 智慧梁场-生产线id
@ -197,8 +201,10 @@ public class SmartBeamFieldBeam implements Serializable {
private java.lang.Integer isSaveBeam; private java.lang.Integer isSaveBeam;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "梁的二维码页面url") @ApiModelProperty(value = "梁的二维码页面url")
@NotBlank
private java.lang.String beamQrCodeUrl; private java.lang.String beamQrCodeUrl;
@TableField(exist = false) @TableField(exist = false)
@ApiModelProperty(value = "梁和制梁进度的二维码页面url") @ApiModelProperty(value = "梁和制梁进度的二维码页面url")
@NotBlank
private java.lang.String makeBeamProcessQrCodeUrl; private java.lang.String makeBeamProcessQrCodeUrl;
} }

View File

@ -1,17 +1,29 @@
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.SmartBeamFieldBeam; import com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeam;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/** /**
* @Description: 智慧梁场- * @Description: 智慧梁场-
* @author pds * @author pds
* @date 2023-12-05 * @date 2023-12-05
* @version V1.0 * @version V1.0
*/ */
@Mapper @Mapper
public interface SmartBeamFieldBeamMapper extends BaseMapper<SmartBeamFieldBeam> { public interface SmartBeamFieldBeamMapper extends BaseMapper<SmartBeamFieldBeam> {
SmartBeamFieldBeam queryById(String id); SmartBeamFieldBeam queryById(String id);
IPage<SmartBeamFieldBeam> queryList(Page<SmartBeamFieldBeam> page, @Param(Constants.WRAPPER) QueryWrapper<SmartBeamFieldBeam> queryWrapper);
List<SmartBeamFieldBeam> queryList(@Param(Constants.WRAPPER) QueryWrapper<SmartBeamFieldBeam> queryWrapper);
} }

View File

@ -1,12 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.zhgd.xmgl.modules.smartbeamfield.mapper.SmartBeamFieldBeamMapper"> <mapper namespace="com.zhgd.xmgl.modules.smartbeamfield.mapper.SmartBeamFieldBeamMapper">
<select id="queryById" resultType="com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeam">
select sbfb.*,bp.save_beam_pedestal_sn from smart_beam_field_beam sbfb
left join smart_beam_field_beam_to_save_beam_pedestal pb on pb.smart_beam_field_beam_id = sbfb.id and
pb.is_save_beam=1
left join smart_beam_field_save_beam_pedestal bp on bp.id = pb.smart_beam_field_save_beam_pedestal_id
where sbfb.id=#{id}
</select>
<select id="queryById" resultType="com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeam"> <select id="queryList" resultType="com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeam">
select sbfb.*,bp.save_beam_pedestal_sn from smart_beam_field_beam sbfb select sbfb.*,sbfbs.bridge_section_name
left join smart_beam_field_beam_to_save_beam_pedestal pb on pb.smart_beam_field_beam_id = sbfb.id and from smart_beam_field_beam sbfb
pb.is_save_beam=1 join smart_beam_field_bridge_section sbfbs on sbfb.smart_beam_field_bridge_section_id = sbfbs.id
left join smart_beam_field_save_beam_pedestal bp on bp.id = pb.smart_beam_field_save_beam_pedestal_id ${ew.customSqlSegment}
where sbfb.id=#{id} </select>
</select>
</mapper> </mapper>

View File

@ -30,4 +30,6 @@ public interface ISmartBeamFieldBeamService extends IService<SmartBeamFieldBeam>
void bindSaveBeamForBeam(HashMap<String, Object> paramMap); void bindSaveBeamForBeam(HashMap<String, Object> paramMap);
boolean delete(String id); boolean delete(String id);
void beginProduce(SmartBeamFieldBeam smartBeamFieldBeam);
} }

View File

@ -3,7 +3,6 @@ package com.zhgd.xmgl.modules.smartbeamfield.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.io.FileUtil; import cn.hutool.core.io.FileUtil;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.extra.qrcode.QrCodeUtil; import cn.hutool.extra.qrcode.QrCodeUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -57,7 +56,7 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
public IPage<SmartBeamFieldBeam> queryPageList(HashMap<String, Object> paramMap) { public IPage<SmartBeamFieldBeam> queryPageList(HashMap<String, Object> paramMap) {
QueryWrapper<SmartBeamFieldBeam> queryWrapper = getQueryWrapper(paramMap); QueryWrapper<SmartBeamFieldBeam> queryWrapper = getQueryWrapper(paramMap);
Page<SmartBeamFieldBeam> page = PageUtil.getPage(paramMap); Page<SmartBeamFieldBeam> page = PageUtil.getPage(paramMap);
IPage<SmartBeamFieldBeam> pageList = this.page(page, queryWrapper); IPage<SmartBeamFieldBeam> pageList = baseMapper.queryList(page, queryWrapper);
pageList.setRecords(dealList(pageList.getRecords())); pageList.setRecords(dealList(pageList.getRecords()));
return pageList; return pageList;
} }
@ -65,11 +64,11 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
@Override @Override
public List<SmartBeamFieldBeam> queryList(HashMap<String, Object> paramMap) { public List<SmartBeamFieldBeam> queryList(HashMap<String, Object> paramMap) {
QueryWrapper<SmartBeamFieldBeam> queryWrapper = getQueryWrapper(paramMap); QueryWrapper<SmartBeamFieldBeam> queryWrapper = getQueryWrapper(paramMap);
return dealList(this.list(queryWrapper)); return dealList(baseMapper.queryList(queryWrapper));
} }
private QueryWrapper<SmartBeamFieldBeam> getQueryWrapper(HashMap<String, Object> paramMap) { private QueryWrapper<SmartBeamFieldBeam> getQueryWrapper(HashMap<String, Object> paramMap) {
String alias = ""; String alias = "sbfb.";
QueryWrapper<SmartBeamFieldBeam> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartBeamFieldBeam.class, paramMap, alias); QueryWrapper<SmartBeamFieldBeam> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartBeamFieldBeam.class, paramMap, alias);
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SmartBeamFieldBeam::getId)); queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SmartBeamFieldBeam::getId));
return queryWrapper; return queryWrapper;
@ -81,12 +80,6 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
@Override @Override
public void add(SmartBeamFieldBeam smartBeamFieldBeam) { public void add(SmartBeamFieldBeam smartBeamFieldBeam) {
if (StrUtil.isBlank(smartBeamFieldBeam.getBeamQrCodeUrl())) {
throw new OpenAlertException("梁的二维码页面url不能为空");
}
if (StrUtil.isBlank(smartBeamFieldBeam.getMakeBeamProcessQrCodeUrl())) {
throw new OpenAlertException("梁和制梁进度的二维码页面url不能为空");
}
smartBeamFieldBeam.setId(null); smartBeamFieldBeam.setId(null);
smartBeamFieldBeam.setMakeBeamProcessQrCode(IdUtil.simpleUUID() + ".jpg"); smartBeamFieldBeam.setMakeBeamProcessQrCode(IdUtil.simpleUUID() + ".jpg");
smartBeamFieldBeam.setBeamQrCode(IdUtil.simpleUUID() + ".jpg"); smartBeamFieldBeam.setBeamQrCode(IdUtil.simpleUUID() + ".jpg");
@ -101,6 +94,7 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
@Override @Override
public void edit(SmartBeamFieldBeam smartBeamFieldBeam) { public void edit(SmartBeamFieldBeam smartBeamFieldBeam) {
//架梁状态
smartBeamFieldBeam.setBeamErectionStatus(getStatus(smartBeamFieldBeam)); smartBeamFieldBeam.setBeamErectionStatus(getStatus(smartBeamFieldBeam));
baseMapper.updateById(smartBeamFieldBeam); baseMapper.updateById(smartBeamFieldBeam);
} }
@ -132,7 +126,6 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
throw new OpenAlertException(smartBeamFieldBeams.get(0).getBeamNo() + "已占用该生产线"); throw new OpenAlertException(smartBeamFieldBeams.get(0).getBeamNo() + "已占用该生产线");
} }
SmartBeamFieldBeam smartBeamFieldBeam = new SmartBeamFieldBeam(); SmartBeamFieldBeam smartBeamFieldBeam = new SmartBeamFieldBeam();
assert smartBeamFieldBeamId != null;
smartBeamFieldBeam.setId(smartBeamFieldBeamId); smartBeamFieldBeam.setId(smartBeamFieldBeamId);
smartBeamFieldBeam.setUseProductionLine(1); smartBeamFieldBeam.setUseProductionLine(1);
smartBeamFieldBeam.setSmartBeamFieldProductionLineId(smartBeamFieldProductionLineId); smartBeamFieldBeam.setSmartBeamFieldProductionLineId(smartBeamFieldProductionLineId);
@ -189,4 +182,12 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
baseMapper.deleteById(id); baseMapper.deleteById(id);
return true; return true;
} }
@Override
public void beginProduce(SmartBeamFieldBeam smartBeamFieldBeam) {
SmartBeamFieldBeam beam = new SmartBeamFieldBeam();
beam.setId(smartBeamFieldBeam.getId());
beam.setBeamMakeStatus(2);
baseMapper.updateById(beam);
}
} }