智能地磅的bug修改

This commit is contained in:
Administrator 2023-03-23 11:33:12 +08:00
parent 1be0228231
commit 5937e00652
6 changed files with 89 additions and 29 deletions

View File

@ -74,6 +74,14 @@ public class WeighPicController {
return result; return result;
} }
@ApiOperation(value = " 列表查询称重图片信息", httpMethod = "GET")
@GetMapping(value = "/list/condition")
public Result<List<WeighPic>> queryList(WeighPic weighPic,
HttpServletRequest req) {
QueryWrapper<WeighPic> queryWrapper = QueryGenerator.initQueryWrapper(weighPic, req.getParameterMap());
return Result.success(weighPicService.list(queryWrapper));
}
/** /**
* 添加 * 添加
* *
@ -83,16 +91,7 @@ public class WeighPicController {
@ApiOperation(value = " 添加称重图片信息", notes = "添加称重图片信息", httpMethod = "POST") @ApiOperation(value = " 添加称重图片信息", notes = "添加称重图片信息", httpMethod = "POST")
@PostMapping(value = "/add") @PostMapping(value = "/add")
public Result<WeighPic> add(@RequestBody WeighPic weighPic) { public Result<WeighPic> add(@RequestBody WeighPic weighPic) {
Result<WeighPic> result = new Result<WeighPic>(); return weighPicService.add(weighPic);
try {
weighPicService.save(weighPic);
result.success("添加成功!");
} catch (Exception e) {
e.printStackTrace();
log.info(e.getMessage());
result.error500("操作失败");
}
return result;
} }
/** /**

View File

@ -1,16 +1,16 @@
package com.zhgd.xmgl.modules.weight.entity; package com.zhgd.xmgl.modules.weight.entity;
import java.io.Serializable;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
/** /**
* @Description: 称重记录表 * @Description: 称重记录表
* @author pds * @author pds
@ -85,14 +85,22 @@ public class WeighInfo implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="一磅时间") @ApiModelProperty(value="一磅时间")
private java.util.Date aCheckTime ; private java.util.Date aCheckTime ;
/**二磅时间*/ /**
* 二磅时间
*/
@Excel(name = "二磅时间", width = 20, format = "yyyy-MM-dd HH:mm:ss") @Excel(name = "二磅时间", width = 20, format = "yyyy-MM-dd HH:mm:ss")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value="二磅时间") @ApiModelProperty(value = "二磅时间")
private java.util.Date bCheckTime ; private java.util.Date bCheckTime;
/**所属项目SN*/ /**
* 所属项目SN
*/
@Excel(name = "所属项目SN", width = 15) @Excel(name = "所属项目SN", width = 15)
@ApiModelProperty(value="所属项目SN") @ApiModelProperty(value = "所属项目SN")
private java.lang.String projectSn ; private java.lang.String projectSn;
/**
* 远程现场的weighdata_info的id
*/
private java.lang.String removeWeighdataInfoId;
} }

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.weight.entity; package com.zhgd.xmgl.modules.weight.entity;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
@ -35,7 +36,7 @@ public class WeighPic implements Serializable {
*/ */
@Excel(name = "称重记录ID", width = 15) @Excel(name = "称重记录ID", width = 15)
@ApiModelProperty(value = "称重记录ID") @ApiModelProperty(value = "称重记录ID")
private java.lang.Integer weighDataInfoId; private java.lang.Long weighDataInfoId;
/** /**
* 重车图片1 * 重车图片1
*/ */
@ -54,6 +55,7 @@ public class WeighPic implements Serializable {
@Excel(name = "重车图片3", width = 15) @Excel(name = "重车图片3", width = 15)
@ApiModelProperty(value = "重车图片3") @ApiModelProperty(value = "重车图片3")
private java.lang.String fullPic3; private java.lang.String fullPic3;
private java.lang.String fullPic4;
/** /**
* 空车图片1 * 空车图片1
*/ */
@ -72,6 +74,7 @@ public class WeighPic implements Serializable {
@Excel(name = "空车图片3", width = 15) @Excel(name = "空车图片3", width = 15)
@ApiModelProperty(value = "空车图片3") @ApiModelProperty(value = "空车图片3")
private java.lang.String emptyPic3; private java.lang.String emptyPic3;
private java.lang.String emptyPic4;
/** /**
* 录入时间 * 录入时间
*/ */
@ -94,4 +97,10 @@ public class WeighPic implements Serializable {
@Excel(name = "备注", width = 15) @Excel(name = "备注", width = 15)
@ApiModelProperty(value = "备注") @ApiModelProperty(value = "备注")
private java.lang.String remarks; private java.lang.String remarks;
/**
* 远程现场的weighdata_info的id
*/
@TableField(exist = false)
private java.lang.String removeWeighdataInfoId;
} }

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.weight.service; package com.zhgd.xmgl.modules.weight.service;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.weight.entity.WeighPic; import com.zhgd.xmgl.modules.weight.entity.WeighPic;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
@ -11,4 +12,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/ */
public interface IWeighPicService extends IService<WeighPic> { public interface IWeighPicService extends IService<WeighPic> {
Result<WeighPic> add(WeighPic weighPic);
} }

View File

@ -1,19 +1,44 @@
package com.zhgd.xmgl.modules.weight.service.impl; package com.zhgd.xmgl.modules.weight.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.xmgl.modules.weight.entity.WeighInfo;
import com.zhgd.xmgl.modules.weight.entity.WeighPic; import com.zhgd.xmgl.modules.weight.entity.WeighPic;
import com.zhgd.xmgl.modules.weight.mapper.WeighInfoMapper;
import com.zhgd.xmgl.modules.weight.mapper.WeighPicMapper; import com.zhgd.xmgl.modules.weight.mapper.WeighPicMapper;
import com.zhgd.xmgl.modules.weight.service.IWeighPicService; import com.zhgd.xmgl.modules.weight.service.IWeighPicService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/** /**
* @Description: 称重图片 * @Description: 称重图片
* @author pds * @author pds
* @date 2023-03-21 * @date 2023-03-21
* @version V1.0 * @version V1.0
*/ */
@Service @Service
@Slf4j
public class WeighPicServiceImpl extends ServiceImpl<WeighPicMapper, WeighPic> implements IWeighPicService { public class WeighPicServiceImpl extends ServiceImpl<WeighPicMapper, WeighPic> implements IWeighPicService {
@Autowired
private WeighInfoMapper weighInfoMapper;
@Override
public Result<WeighPic> add(WeighPic weighPic) {
WeighInfo weighInfo = weighInfoMapper.selectOne(new LambdaQueryWrapper<WeighInfo>().eq(WeighInfo::getRemoveWeighdataInfoId, weighPic.getRemoveWeighdataInfoId()));
if (weighInfo != null) {
weighPic.setWeighDataInfoId(weighInfo.getId());
}
Result<WeighPic> result = new Result<WeighPic>();
try {
save(weighPic);
result.success("添加成功!");
} catch (Exception e) {
e.printStackTrace();
log.info(e.getMessage());
result.error500("操作失败");
}
return result;
}
} }

View File

@ -61,7 +61,7 @@ public class ${entityName}Controller {
* @return * @return
*/ */
@ApiOperation(value = " 分页列表查询${tableVo.ftlDescription}信息", notes = "分页列表查询${tableVo.ftlDescription}信息", httpMethod="GET") @ApiOperation(value = " 分页列表查询${tableVo.ftlDescription}信息", notes = "分页列表查询${tableVo.ftlDescription}信息", httpMethod="GET")
@GetMapping(value = "/list") @GetMapping(value = "/page")
public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first}, public Result<IPage<${entityName}>> queryPageList(${entityName} ${entityName?uncap_first},
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize, @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
@ -75,6 +75,23 @@ public class ${entityName}Controller {
return result; return result;
} }
/**
* 列表查询
* @param ${entityName?uncap_first}
* @param pageNo 页码
* @param pageSize 条数
* @param req
* @return
*/
@ApiOperation(value = " 列表查询${tableVo.ftlDescription}信息", notes = "列表查询${tableVo.ftlDescription}信息", httpMethod="GET")
@GetMapping(value = "/list")
public Result<List<${entityName}>> queryList(${entityName} ${entityName?uncap_first},
HttpServletRequest req) {
QueryWrapper<${entityName}> queryWrapper = QueryGenerator.initQueryWrapper(${entityName?uncap_first}, req.getParameterMap());
return Result.success(${entityName?uncap_first}Service.list(queryWrapper));
}
/** /**
* 添加 * 添加
* @param ${entityName?uncap_first} * @param ${entityName?uncap_first}