智慧梁场修改
This commit is contained in:
parent
dd10536a21
commit
c95c66721d
@ -11,6 +11,7 @@ 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.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import springfox.documentation.annotations.ApiIgnore;
|
||||
|
||||
@ -67,7 +68,7 @@ public class SmartBeamFieldBeamController {
|
||||
*/
|
||||
@ApiOperation(value = "添加智慧梁场-梁信息", notes = "添加智慧梁场-梁信息", httpMethod = "POST")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<SmartBeamFieldBeam> add(@RequestBody SmartBeamFieldBeam smartBeamFieldBeam) {
|
||||
public Result<SmartBeamFieldBeam> add(@RequestBody @Validated SmartBeamFieldBeam smartBeamFieldBeam) {
|
||||
smartBeamFieldBeamService.add(smartBeamFieldBeam);
|
||||
return Result.ok();
|
||||
}
|
||||
@ -152,4 +153,10 @@ public class SmartBeamFieldBeamController {
|
||||
return Result.ok();
|
||||
}
|
||||
|
||||
@ApiOperation(value = "开始生产", notes = "开始生产", httpMethod = "POST")
|
||||
@PostMapping(value = "/beginProduce")
|
||||
public Result beginProduce(@RequestBody SmartBeamFieldBeam smartBeamFieldBeam) {
|
||||
smartBeamFieldBeamService.beginProduce(smartBeamFieldBeam);
|
||||
return Result.ok();
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,9 +8,12 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.NonNull;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
@ -38,6 +41,7 @@ public class SmartBeamFieldBeam implements Serializable {
|
||||
*/
|
||||
@Excel(name = "智慧梁场-桥段id", width = 15)
|
||||
@ApiModelProperty(value = "智慧梁场-桥段id")
|
||||
@NotNull
|
||||
private java.lang.Long smartBeamFieldBridgeSectionId;
|
||||
/**
|
||||
* 智慧梁场-生产线id
|
||||
@ -197,8 +201,10 @@ public class SmartBeamFieldBeam implements Serializable {
|
||||
private java.lang.Integer isSaveBeam;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "梁的二维码页面url")
|
||||
@NotBlank
|
||||
private java.lang.String beamQrCodeUrl;
|
||||
@TableField(exist = false)
|
||||
@ApiModelProperty(value = "梁和制梁进度的二维码页面url")
|
||||
@NotBlank
|
||||
private java.lang.String makeBeamProcessQrCodeUrl;
|
||||
}
|
||||
|
||||
@ -1,17 +1,29 @@
|
||||
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.SmartBeamFieldBeam;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: 智慧梁场-梁
|
||||
* @author: pds
|
||||
* @date: 2023-12-05
|
||||
* @date: 2023-12-05
|
||||
* @version: V1.0
|
||||
*/
|
||||
@Mapper
|
||||
public interface SmartBeamFieldBeamMapper extends BaseMapper<SmartBeamFieldBeam> {
|
||||
|
||||
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);
|
||||
|
||||
}
|
||||
|
||||
@ -1,12 +1,18 @@
|
||||
<?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">
|
||||
<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 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="queryList" resultType="com.zhgd.xmgl.modules.smartbeamfield.entity.SmartBeamFieldBeam">
|
||||
select sbfb.*,sbfbs.bridge_section_name
|
||||
from smart_beam_field_beam sbfb
|
||||
join smart_beam_field_bridge_section sbfbs on sbfb.smart_beam_field_bridge_section_id = sbfbs.id
|
||||
${ew.customSqlSegment}
|
||||
</select>
|
||||
</mapper>
|
||||
|
||||
@ -30,4 +30,6 @@ public interface ISmartBeamFieldBeamService extends IService<SmartBeamFieldBeam>
|
||||
void bindSaveBeamForBeam(HashMap<String, Object> paramMap);
|
||||
|
||||
boolean delete(String id);
|
||||
|
||||
void beginProduce(SmartBeamFieldBeam smartBeamFieldBeam);
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ package com.zhgd.xmgl.modules.smartbeamfield.service.impl;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.io.FileUtil;
|
||||
import cn.hutool.core.util.IdUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import cn.hutool.extra.qrcode.QrCodeUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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) {
|
||||
QueryWrapper<SmartBeamFieldBeam> queryWrapper = getQueryWrapper(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()));
|
||||
return pageList;
|
||||
}
|
||||
@ -65,11 +64,11 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
|
||||
@Override
|
||||
public List<SmartBeamFieldBeam> queryList(HashMap<String, Object> paramMap) {
|
||||
QueryWrapper<SmartBeamFieldBeam> queryWrapper = getQueryWrapper(paramMap);
|
||||
return dealList(this.list(queryWrapper));
|
||||
return dealList(baseMapper.queryList(queryWrapper));
|
||||
}
|
||||
|
||||
private QueryWrapper<SmartBeamFieldBeam> getQueryWrapper(HashMap<String, Object> paramMap) {
|
||||
String alias = "";
|
||||
String alias = "sbfb.";
|
||||
QueryWrapper<SmartBeamFieldBeam> queryWrapper = QueryGenerator.initPageQueryWrapper(SmartBeamFieldBeam.class, paramMap, alias);
|
||||
queryWrapper.orderByDesc(alias + RefUtil.fieldNameUlc(SmartBeamFieldBeam::getId));
|
||||
return queryWrapper;
|
||||
@ -81,12 +80,6 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
|
||||
|
||||
@Override
|
||||
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.setMakeBeamProcessQrCode(IdUtil.simpleUUID() + ".jpg");
|
||||
smartBeamFieldBeam.setBeamQrCode(IdUtil.simpleUUID() + ".jpg");
|
||||
@ -101,6 +94,7 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
|
||||
|
||||
@Override
|
||||
public void edit(SmartBeamFieldBeam smartBeamFieldBeam) {
|
||||
//架梁状态
|
||||
smartBeamFieldBeam.setBeamErectionStatus(getStatus(smartBeamFieldBeam));
|
||||
baseMapper.updateById(smartBeamFieldBeam);
|
||||
}
|
||||
@ -132,7 +126,6 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
|
||||
throw new OpenAlertException(smartBeamFieldBeams.get(0).getBeamNo() + "已占用该生产线");
|
||||
}
|
||||
SmartBeamFieldBeam smartBeamFieldBeam = new SmartBeamFieldBeam();
|
||||
assert smartBeamFieldBeamId != null;
|
||||
smartBeamFieldBeam.setId(smartBeamFieldBeamId);
|
||||
smartBeamFieldBeam.setUseProductionLine(1);
|
||||
smartBeamFieldBeam.setSmartBeamFieldProductionLineId(smartBeamFieldProductionLineId);
|
||||
@ -189,4 +182,12 @@ public class SmartBeamFieldBeamServiceImpl extends ServiceImpl<SmartBeamFieldBea
|
||||
baseMapper.deleteById(id);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void beginProduce(SmartBeamFieldBeam smartBeamFieldBeam) {
|
||||
SmartBeamFieldBeam beam = new SmartBeamFieldBeam();
|
||||
beam.setId(smartBeamFieldBeam.getId());
|
||||
beam.setBeamMakeStatus(2);
|
||||
baseMapper.updateById(beam);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user