上传钢丝绳记录

This commit is contained in:
Administrator 2023-05-24 15:26:54 +08:00
parent 85462c020b
commit 991cef191d
16 changed files with 825 additions and 4 deletions

View File

@ -72,7 +72,7 @@ public class GtMaterialPointCheckIntoWarehouseDetail implements Serializable {
*/ */
@Excel(name = "单价", width = 15) @Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价") @ApiModelProperty(value = "单价")
private java.lang.String unitPrice; private BigDecimal unitPrice;
/** /**
* 金额 * 金额
*/ */

View File

@ -1,6 +1,7 @@
package com.zhgd.xmgl.modules.gt.entity; package com.zhgd.xmgl.modules.gt.entity;
import java.io.Serializable; import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.IdType;
@ -61,7 +62,7 @@ public class GtMaterialWarehouseDetail implements Serializable {
*/ */
@Excel(name = "单价", width = 15) @Excel(name = "单价", width = 15)
@ApiModelProperty(value = "单价") @ApiModelProperty(value = "单价")
private java.lang.String unitPrice; private BigDecimal unitPrice;
/** /**
* 库存 * 库存
*/ */

View File

@ -1,5 +1,6 @@
package com.zhgd.xmgl.modules.gt.service.impl; package com.zhgd.xmgl.modules.gt.service.impl;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -30,8 +31,8 @@ public class GtMaterialWarehouseDetailServiceImpl extends ServiceImpl<GtMaterial
public IPage<GtMaterialWarehouseDetail> queryPageList(GtMaterialWarehouseDetail gtMaterialWarehouseDetail, Integer pageNo, Integer pageSize, HttpServletRequest req, String groupBy) { public IPage<GtMaterialWarehouseDetail> queryPageList(GtMaterialWarehouseDetail gtMaterialWarehouseDetail, Integer pageNo, Integer pageSize, HttpServletRequest req, String groupBy) {
String defaultAlias = "wd."; String defaultAlias = "wd.";
QueryWrapper<GtMaterialWarehouseDetail> queryWrapper = QueryGenerator.initQueryWrapper(gtMaterialWarehouseDetail, req.getParameterMap(), null, QueryWrapper<GtMaterialWarehouseDetail> queryWrapper = QueryGenerator.initQueryWrapper(gtMaterialWarehouseDetail, req.getParameterMap(), null,
ReflectionUtil.getFieldNameList(GtMaterialWarehouseDetail::getName), defaultAlias); ReflectionUtil.getFieldNameList(GtMaterialWarehouseDetail::getName, GtMaterialWarehouseDetail::getSpecification, GtMaterialWarehouseDetail::getUnit), defaultAlias);
queryWrapper.groupBy(StringUtils.isNotBlank(groupBy), defaultAlias + groupBy); queryWrapper.groupBy(StringUtils.isNotBlank(groupBy), defaultAlias + StrUtil.toUnderlineCase(groupBy));
Page<GtMaterialWarehouseDetail> page = new Page<GtMaterialWarehouseDetail>(pageNo, pageSize); Page<GtMaterialWarehouseDetail> page = new Page<GtMaterialWarehouseDetail>(pageNo, pageSize);
IPage<GtMaterialWarehouseDetail> pageList = gtMaterialWarehouseDetailMapper.queryPageList(page, queryWrapper, groupBy); IPage<GtMaterialWarehouseDetail> pageList = gtMaterialWarehouseDetailMapper.queryPageList(page, queryWrapper, groupBy);
return pageList; return pageList;

View File

@ -0,0 +1,205 @@
package com.zhgd.xmgl.modules.tckw.controller;
import com.alibaba.fastjson.JSONObject;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionDamageRecord;
import com.zhgd.xmgl.modules.tckw.service.ITckwWireRopeInspectionDamageRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.jeecg.common.util.oConvertUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
/**
* @Title: Controller
* @Description: TCK.W钢丝绳检测损伤记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/tckw/tckwWireRopeInspectionDamageRecord")
@Slf4j
@Api(tags = "TckwWireRopeInspectionDamageRecordController相关Api")
public class TckwWireRopeInspectionDamageRecordController {
@Autowired
private ITckwWireRopeInspectionDamageRecordService tckwWireRopeInspectionDamageRecordService;
/**
* 分页列表查询
*
* @param tckwWireRopeInspectionDamageRecord
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation(value = " 分页列表查询TCK.W钢丝绳检测损伤记录信息", notes = "分页列表查询TCK.W钢丝绳检测损伤记录信息", httpMethod = "GET")
@GetMapping(value = "/page")
public Result<IPage<TckwWireRopeInspectionDamageRecord>> queryPageList(TckwWireRopeInspectionDamageRecord tckwWireRopeInspectionDamageRecord,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<TckwWireRopeInspectionDamageRecord>> result = new Result<IPage<TckwWireRopeInspectionDamageRecord>>();
QueryWrapper<TckwWireRopeInspectionDamageRecord> queryWrapper = QueryGenerator.initQueryWrapper(tckwWireRopeInspectionDamageRecord, req.getParameterMap());
Page<TckwWireRopeInspectionDamageRecord> page = new Page<TckwWireRopeInspectionDamageRecord>(pageNo, pageSize);
IPage<TckwWireRopeInspectionDamageRecord> pageList = tckwWireRopeInspectionDamageRecordService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* 列表查询
*
* @param tckwWireRopeInspectionDamageRecord
* @param req
* @return
*/
@ApiOperation(value = " 列表查询TCK.W钢丝绳检测损伤记录信息", notes = "列表查询TCK.W钢丝绳检测损伤记录信息", httpMethod = "GET")
@GetMapping(value = "/list")
public Result<List<TckwWireRopeInspectionDamageRecord>> queryList(TckwWireRopeInspectionDamageRecord tckwWireRopeInspectionDamageRecord,
HttpServletRequest req) {
QueryWrapper<TckwWireRopeInspectionDamageRecord> queryWrapper = QueryGenerator.initQueryWrapper(tckwWireRopeInspectionDamageRecord, req.getParameterMap());
return Result.success(tckwWireRopeInspectionDamageRecordService.list(queryWrapper));
}
/**
* 添加
*
* @param tckwWireRopeInspectionDamageRecord
* @return
*/
@ApiOperation(value = " 添加TCK.W钢丝绳检测损伤记录信息", notes = "添加TCK.W钢丝绳检测损伤记录信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<TckwWireRopeInspectionDamageRecord> add(@RequestBody TckwWireRopeInspectionDamageRecord tckwWireRopeInspectionDamageRecord) {
Result<TckwWireRopeInspectionDamageRecord> result = new Result<TckwWireRopeInspectionDamageRecord>();
try {
tckwWireRopeInspectionDamageRecordService.save(tckwWireRopeInspectionDamageRecord);
result.success("添加成功!");
} catch (Exception e) {
e.printStackTrace();
log.info(e.getMessage());
result.error500("操作失败");
}
return result;
}
/**
* 编辑
*
* @param tckwWireRopeInspectionDamageRecord
* @return
*/
@ApiOperation(value = "编辑TCK.W钢丝绳检测损伤记录信息", notes = "编辑TCK.W钢丝绳检测损伤记录信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<TckwWireRopeInspectionDamageRecord> edit(@RequestBody TckwWireRopeInspectionDamageRecord tckwWireRopeInspectionDamageRecord) {
Result<TckwWireRopeInspectionDamageRecord> result = new Result<TckwWireRopeInspectionDamageRecord>();
TckwWireRopeInspectionDamageRecord tckwWireRopeInspectionDamageRecordEntity = tckwWireRopeInspectionDamageRecordService.getById(tckwWireRopeInspectionDamageRecord.getId());
if (tckwWireRopeInspectionDamageRecordEntity == null) {
result.error500("未找到对应实体");
} else {
tckwWireRopeInspectionDamageRecordService.updateById(tckwWireRopeInspectionDamageRecord);
result.success("修改成功!");
}
return result;
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation(value = "删除TCK.W钢丝绳检测损伤记录信息", notes = "删除TCK.W钢丝绳检测损伤记录信息", httpMethod = "POST")
@PostMapping(value = "/delete")
public Result<TckwWireRopeInspectionDamageRecord> delete(@RequestBody String id) {
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
id = String.valueOf(jsonObject.get("id"));
Result<TckwWireRopeInspectionDamageRecord> result = new Result<TckwWireRopeInspectionDamageRecord>();
TckwWireRopeInspectionDamageRecord tckwWireRopeInspectionDamageRecord = tckwWireRopeInspectionDamageRecordService.getById(id);
if (tckwWireRopeInspectionDamageRecord == null) {
result.error500("未找到对应实体");
} else {
boolean ok = tckwWireRopeInspectionDamageRecordService.removeById(id);
if (ok) {
result.success("删除成功!");
}
}
return result;
}
/**
* 批量删除
*
* @param ids
* @return
*/
@ApiOperation(value = "批量删除TCK.W钢丝绳检测损伤记录信息", notes = "批量删除TCK.W钢丝绳检测损伤记录信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "TCK.W钢丝绳检测损伤记录ID字符串", paramType = "query", required = true, dataType = "String")
@PostMapping(value = "/deleteBatch")
public Result<TckwWireRopeInspectionDamageRecord> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
Result<TckwWireRopeInspectionDamageRecord> result = new Result<TckwWireRopeInspectionDamageRecord>();
if (ids == null || "".equals(ids.trim())) {
result.error500("参数不识别!");
} else {
this.tckwWireRopeInspectionDamageRecordService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* 通过id查询
*
* @param id
* @return
*/
@ApiOperation(value = "通过id查询TCK.W钢丝绳检测损伤记录信息", notes = "通过id查询TCK.W钢丝绳检测损伤记录信息", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "TCK.W钢丝绳检测损伤记录ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryById")
public Result<TckwWireRopeInspectionDamageRecord> queryById(@RequestParam(name = "id", required = true) String id) {
Result<TckwWireRopeInspectionDamageRecord> result = new Result<TckwWireRopeInspectionDamageRecord>();
TckwWireRopeInspectionDamageRecord tckwWireRopeInspectionDamageRecord = tckwWireRopeInspectionDamageRecordService.getById(id);
if (tckwWireRopeInspectionDamageRecord == null) {
result.error500("未找到对应实体");
} else {
result.setResult(tckwWireRopeInspectionDamageRecord);
result.setSuccess(true);
}
return result;
}
}

View File

@ -0,0 +1,197 @@
package com.zhgd.xmgl.modules.tckw.controller;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhgd.jeecg.common.api.vo.Result;
import com.zhgd.jeecg.common.system.query.QueryGenerator;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionRecord;
import com.zhgd.xmgl.modules.tckw.service.ITckwWireRopeInspectionRecordService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.util.Arrays;
import java.util.HashMap;
import java.util.List;
/**
* @Title: Controller
* @Description: TCK.W钢丝绳检测记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
@RestController
@RequestMapping("/xmgl/tckw/tckwWireRopeInspectionRecord")
@Slf4j
@Api(tags = "TckwWireRopeInspectionRecordController相关Api")
public class TckwWireRopeInspectionRecordController {
@Autowired
private ITckwWireRopeInspectionRecordService tckwWireRopeInspectionRecordService;
/**
* 分页列表查询
*
* @param tckwWireRopeInspectionRecord
* @param pageNo
* @param pageSize
* @param req
* @return
*/
@ApiOperation(value = " 分页列表查询TCK.W钢丝绳检测记录信息", notes = "分页列表查询TCK.W钢丝绳检测记录信息", httpMethod = "GET")
@GetMapping(value = "/page")
public Result<IPage<TckwWireRopeInspectionRecord>> queryPageList(TckwWireRopeInspectionRecord tckwWireRopeInspectionRecord,
@RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize,
HttpServletRequest req) {
Result<IPage<TckwWireRopeInspectionRecord>> result = new Result<IPage<TckwWireRopeInspectionRecord>>();
QueryWrapper<TckwWireRopeInspectionRecord> queryWrapper = QueryGenerator.initQueryWrapper(tckwWireRopeInspectionRecord, req.getParameterMap());
Page<TckwWireRopeInspectionRecord> page = new Page<TckwWireRopeInspectionRecord>(pageNo, pageSize);
IPage<TckwWireRopeInspectionRecord> pageList = tckwWireRopeInspectionRecordService.page(page, queryWrapper);
result.setSuccess(true);
result.setResult(pageList);
return result;
}
/**
* 列表查询
*
* @param tckwWireRopeInspectionRecord
* @param req
* @return
*/
@ApiOperation(value = " 列表查询TCK.W钢丝绳检测记录信息", notes = "列表查询TCK.W钢丝绳检测记录信息", httpMethod = "GET")
@GetMapping(value = "/list")
public Result<List<TckwWireRopeInspectionRecord>> queryList(TckwWireRopeInspectionRecord tckwWireRopeInspectionRecord,
HttpServletRequest req) {
QueryWrapper<TckwWireRopeInspectionRecord> queryWrapper = QueryGenerator.initQueryWrapper(tckwWireRopeInspectionRecord, req.getParameterMap());
return Result.success(tckwWireRopeInspectionRecordService.list(queryWrapper));
}
/**
* 添加
*
* @param tckwWireRopeInspectionRecord
* @return
*/
@ApiOperation(value = " 添加TCK.W钢丝绳检测记录信息", notes = "添加TCK.W钢丝绳检测记录信息", httpMethod = "POST")
@PostMapping(value = "/add")
public Result<TckwWireRopeInspectionRecord> add(@RequestBody TckwWireRopeInspectionRecord tckwWireRopeInspectionRecord) {
Result<TckwWireRopeInspectionRecord> result = new Result<TckwWireRopeInspectionRecord>();
try {
tckwWireRopeInspectionRecordService.save(tckwWireRopeInspectionRecord);
result.success("添加成功!");
} catch (Exception e) {
e.printStackTrace();
log.info(e.getMessage());
result.error500("操作失败");
}
return result;
}
/**
* 编辑
*
* @param tckwWireRopeInspectionRecord
* @return
*/
@ApiOperation(value = "编辑TCK.W钢丝绳检测记录信息", notes = "编辑TCK.W钢丝绳检测记录信息", httpMethod = "POST")
@PostMapping(value = "/edit")
public Result<TckwWireRopeInspectionRecord> edit(@RequestBody TckwWireRopeInspectionRecord tckwWireRopeInspectionRecord) {
Result<TckwWireRopeInspectionRecord> result = new Result<TckwWireRopeInspectionRecord>();
TckwWireRopeInspectionRecord tckwWireRopeInspectionRecordEntity = tckwWireRopeInspectionRecordService.getById(tckwWireRopeInspectionRecord.getId());
if (tckwWireRopeInspectionRecordEntity == null) {
result.error500("未找到对应实体");
} else {
tckwWireRopeInspectionRecordService.updateById(tckwWireRopeInspectionRecord);
result.success("修改成功!");
}
return result;
}
/**
* 通过id删除
*
* @param id
* @return
*/
@ApiOperation(value = "删除TCK.W钢丝绳检测记录信息", notes = "删除TCK.W钢丝绳检测记录信息", httpMethod = "POST")
@PostMapping(value = "/delete")
public Result<TckwWireRopeInspectionRecord> delete(@RequestBody String id) {
JSONObject jsonObject = JSON.parseObject(id, JSONObject.class);
id = String.valueOf(jsonObject.get("id"));
Result<TckwWireRopeInspectionRecord> result = new Result<TckwWireRopeInspectionRecord>();
TckwWireRopeInspectionRecord tckwWireRopeInspectionRecord = tckwWireRopeInspectionRecordService.getById(id);
if (tckwWireRopeInspectionRecord == null) {
result.error500("未找到对应实体");
} else {
boolean ok = tckwWireRopeInspectionRecordService.removeById(id);
if (ok) {
result.success("删除成功!");
}
}
return result;
}
/**
* 批量删除
*
* @param ids
* @return
*/
@ApiOperation(value = "批量删除TCK.W钢丝绳检测记录信息", notes = "批量删除TCK.W钢丝绳检测记录信息", httpMethod = "POST")
@ApiImplicitParam(name = "id", value = "TCK.W钢丝绳检测记录ID字符串", paramType = "query", required = true, dataType = "String")
@PostMapping(value = "/deleteBatch")
public Result<TckwWireRopeInspectionRecord> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
Result<TckwWireRopeInspectionRecord> result = new Result<TckwWireRopeInspectionRecord>();
if (ids == null || "".equals(ids.trim())) {
result.error500("参数不识别!");
} else {
this.tckwWireRopeInspectionRecordService.removeByIds(Arrays.asList(ids.split(",")));
result.success("删除成功!");
}
return result;
}
/**
* 通过id查询
*
* @param id
* @return
*/
@ApiOperation(value = "通过id查询TCK.W钢丝绳检测记录信息", notes = "通过id查询TCK.W钢丝绳检测记录信息", httpMethod = "GET")
@ApiImplicitParam(name = "id", value = "TCK.W钢丝绳检测记录ID", paramType = "query", required = true, dataType = "Integer")
@GetMapping(value = "/queryById")
public Result<TckwWireRopeInspectionRecord> queryById(@RequestParam(name = "id", required = true) String id) {
Result<TckwWireRopeInspectionRecord> result = new Result<TckwWireRopeInspectionRecord>();
TckwWireRopeInspectionRecord tckwWireRopeInspectionRecord = tckwWireRopeInspectionRecordService.getById(id);
if (tckwWireRopeInspectionRecord == null) {
result.error500("未找到对应实体");
} else {
result.setResult(tckwWireRopeInspectionRecord);
result.setSuccess(true);
}
return result;
}
/**
* 设备端添加TCK.W钢丝绳记录
*/
@ApiOperation(value = " 设备端添加TCK.W钢丝绳记录", notes = "设备端添加TCK.W钢丝绳记录", httpMethod = "POST")
@PostMapping(value = "/addWithDamage")
public Result<TckwWireRopeInspectionRecord> addWithDamage(@RequestBody HashMap<String, Object> map) {
tckwWireRopeInspectionRecordService.addWithDamage(map);
return Result.ok();
}
}

View File

@ -0,0 +1,97 @@
package com.zhgd.xmgl.modules.tckw.entity;
import java.io.Serializable;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
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.ApiModelProperty;
/**
* @Description: TCK.W钢丝绳检测损伤记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
@Data
@TableName("tckw_wire_rope_inspection_damage_record")
@ApiModel(value = "TckwWireRopeInspectionDamageRecord实体类", description = "TckwWireRopeInspectionDamageRecord")
public class TckwWireRopeInspectionDamageRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键id")
private java.lang.Long id;
/**
* TCK.W钢丝绳检测记录id
*/
@Excel(name = "TCK.W钢丝绳检测记录id", width = 15)
@ApiModelProperty(value = "TCK.W钢丝绳检测记录id")
private java.lang.Long tckwWireRopeInspectionRecordId;
/**
* 钢丝绳号单绳总为1多绳按1234 区分
*/
@Excel(name = "钢丝绳号单绳总为1多绳按1、2、3、4 … 区分)", width = 15)
@ApiModelProperty(value = "钢丝绳号单绳总为1多绳按1、2、3、4 … 区分)")
private java.lang.Integer wireRopeNumber;
/**
* 损伤位置单位m
*/
@Excel(name = "损伤位置单位m", width = 15)
@ApiModelProperty(value = "损伤位置单位m")
private java.lang.Double damageLocation;
/**
* 损伤起始位置单位m
*/
@Excel(name = "损伤起始位置单位m", width = 15)
@ApiModelProperty(value = "损伤起始位置单位m")
private java.lang.Double damageStartPosition;
/**
* 损伤结束位置单位m
*/
@Excel(name = "损伤结束位置单位m", width = 15)
@ApiModelProperty(value = "损伤结束位置单位m")
private java.lang.Double damageEndPosition;
/**
* 损伤量值有效金属截面积损失率单位%
*/
@Excel(name = "损伤量值(有效金属截面积损失率),单位:%", width = 15)
@ApiModelProperty(value = "损伤量值(有效金属截面积损失率),单位:%")
private java.lang.Double damageValue;
/**
* 损伤程度0=轻微1=轻度2=中度3=较重4=严重 5=超限
*/
@Excel(name = "损伤程度0=轻微1=轻度2=中度3=较重4=严重, 5=超限)", width = 15)
@ApiModelProperty(value = "损伤程度0=轻微1=轻度2=中度3=较重4=严重, 5=超限)")
private java.lang.Integer damageSeverity;
/**
* 项目sn
*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private java.lang.String projectSn;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 20, format = "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")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**
* 更新时间
*/
@Excel(name = "更新时间", width = 20, format = "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")
@ApiModelProperty(value = "更新时间")
private java.util.Date updateTime;
}

View File

@ -0,0 +1,126 @@
package com.zhgd.xmgl.modules.tckw.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
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;
import java.util.Date;
/**
* @Description: TCK.W钢丝绳检测记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
@Data
@TableName("tckw_wire_rope_inspection_record")
@ApiModel(value = "TckwWireRopeInspectionRecord实体类", description = "TckwWireRopeInspectionRecord")
public class TckwWireRopeInspectionRecord implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 主键id
*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键id")
private java.lang.Long id;
/**
* TCK.W检测站点名称
*/
@Excel(name = "TCK.W检测站点名称", width = 15)
@ApiModelProperty(value = "TCK.W检测站点名称")
private java.lang.String name;
/**
* 检测开始时间格式2023-05-22 18:00:00
*/
@Excel(name = "检测开始时间格式2023-05-22 18:00:00", width = 15)
@ApiModelProperty(value = "检测开始时间格式2023-05-22 18:00:00")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* 检测结束时间格式2023-05-22 18:00:00
*/
@Excel(name = "检测结束时间格式2023-05-22 18:00:00", width = 15)
@ApiModelProperty(value = "检测结束时间格式2023-05-22 18:00:00")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/**
* 检测起始位置单位m
*/
@Excel(name = "检测起始位置单位m", width = 15)
@ApiModelProperty(value = "检测起始位置单位m")
private java.lang.Double startPos;
/**
* 检测结束位置单位m
*/
@Excel(name = "检测结束位置单位m", width = 15)
@ApiModelProperty(value = "检测结束位置单位m")
private java.lang.Double endPos;
/**
* 平均速度单位m/s
*/
@Excel(name = "平均速度单位m/s", width = 15)
@ApiModelProperty(value = "平均速度单位m/s")
private java.lang.Double avgSpeed;
/**
* 损伤数量
*/
@Excel(name = "损伤数量", width = 15)
@ApiModelProperty(value = "损伤数量")
private java.lang.Integer flawCnt;
/**
* 钢丝绳直径单位mm
*/
@Excel(name = "钢丝绳直径单位mm", width = 15)
@ApiModelProperty(value = "钢丝绳直径单位mm")
private java.lang.Double ropeDm;
/**
* 钢丝绳规格型号
*/
@Excel(name = "钢丝绳规格型号", width = 15)
@ApiModelProperty(value = "钢丝绳规格型号")
private java.lang.String ropeSpec;
/**
* 钢丝绳长度单位m
*/
@Excel(name = "钢丝绳长度单位m", width = 15)
@ApiModelProperty(value = "钢丝绳长度单位m")
private java.lang.Double ropeLen;
/**
* 钢丝绳根数
*/
@Excel(name = "钢丝绳根数", width = 15)
@ApiModelProperty(value = "钢丝绳根数")
private java.lang.Integer ropeCnt;
/**
* 项目sn
*/
@Excel(name = "项目sn", width = 15)
@ApiModelProperty(value = "项目sn")
private java.lang.String projectSn;
/**
* 创建时间
*/
@Excel(name = "创建时间", width = 20, format = "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")
@ApiModelProperty(value = "创建时间")
private java.util.Date createTime;
/**
* 更新时间
*/
@Excel(name = "更新时间", width = 20, format = "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")
@ApiModelProperty(value = "更新时间")
private java.util.Date updateTime;
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.tckw.mapper;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionDamageRecord;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: TCK.W钢丝绳检测损伤记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
@Mapper
public interface TckwWireRopeInspectionDamageRecordMapper extends BaseMapper<TckwWireRopeInspectionDamageRecord> {
}

View File

@ -0,0 +1,16 @@
package com.zhgd.xmgl.modules.tckw.mapper;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionRecord;
import org.apache.ibatis.annotations.Mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: TCK.W钢丝绳检测记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
@Mapper
public interface TckwWireRopeInspectionRecordMapper extends BaseMapper<TckwWireRopeInspectionRecord> {
}

View File

@ -0,0 +1,4 @@
<?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.tckw.mapper.TckwWireRopeInspectionDamageRecordMapper">
</mapper>

View File

@ -0,0 +1,4 @@
<?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.tckw.mapper.TckwWireRopeInspectionRecordMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package com.zhgd.xmgl.modules.tckw.service;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionDamageRecord;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: TCK.W钢丝绳检测损伤记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
public interface ITckwWireRopeInspectionDamageRecordService extends IService<TckwWireRopeInspectionDamageRecord> {
}

View File

@ -0,0 +1,17 @@
package com.zhgd.xmgl.modules.tckw.service;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionRecord;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.HashMap;
/**
* @Description: TCK.W钢丝绳检测记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
public interface ITckwWireRopeInspectionRecordService extends IService<TckwWireRopeInspectionRecord> {
void addWithDamage(HashMap<String, Object> map);
}

View File

@ -0,0 +1,19 @@
package com.zhgd.xmgl.modules.tckw.service.impl;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionDamageRecord;
import com.zhgd.xmgl.modules.tckw.mapper.TckwWireRopeInspectionDamageRecordMapper;
import com.zhgd.xmgl.modules.tckw.service.ITckwWireRopeInspectionDamageRecordService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: TCK.W钢丝绳检测损伤记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
@Service
public class TckwWireRopeInspectionDamageRecordServiceImpl extends ServiceImpl<TckwWireRopeInspectionDamageRecordMapper, TckwWireRopeInspectionDamageRecord> implements ITckwWireRopeInspectionDamageRecordService {
}

View File

@ -0,0 +1,103 @@
package com.zhgd.xmgl.modules.tckw.service.impl;
import cn.hutool.core.date.DateUtil;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.gexin.fastjson.JSON;
import com.gexin.fastjson.JSONArray;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionDamageRecord;
import com.zhgd.xmgl.modules.tckw.entity.TckwWireRopeInspectionRecord;
import com.zhgd.xmgl.modules.tckw.mapper.TckwWireRopeInspectionDamageRecordMapper;
import com.zhgd.xmgl.modules.tckw.mapper.TckwWireRopeInspectionRecordMapper;
import com.zhgd.xmgl.modules.tckw.service.ITckwWireRopeInspectionRecordService;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
/**
* @Description: TCK.W钢丝绳检测记录
* @author pds
* @date 2023-05-24
* @version V1.0
*/
@Service
@Transactional(rollbackFor = Exception.class)
public class TckwWireRopeInspectionRecordServiceImpl extends ServiceImpl<TckwWireRopeInspectionRecordMapper, TckwWireRopeInspectionRecord> implements ITckwWireRopeInspectionRecordService {
@Autowired
private TckwWireRopeInspectionDamageRecordMapper tckwWireRopeInspectionDamageRecordMapper;
@Override
public void addWithDamage(HashMap<String, Object> map) {
/*
请求例子
ID : <整型>, 释义TCK.W检测站点唯一ID号
name : <字符串>, 释义TCK.W检测站点名称
start_time : <字符串>, 释义检测开始时间格式2023-05-22 18:00:00
end_time : <字符串>, 释义检测结束时间格式2023-05-22 18:00:00
start_pos : <浮点数>, 释义检测起始位置单位m
end_pos : <浮点数>, 释义检测结束位置单位m
avg_speed : <浮点数>, 释义平均速度单位m/s
flaw_cnt : <整型>, 释义损伤数量
flaw_list : <数组>, 释义损伤列表
[
[
<整型>, 释义钢丝绳号单绳总为1多绳按1234 区分
<浮点数>, 释义损伤位置单位m
<浮点数>, 释义损伤起始位置单位m
<浮点数>, 释义损伤结束位置单位m
<浮点数>, 释义损伤量值有效金属截面积损失率单位%
<整型>, 释义损伤程度0=轻微1=轻度2=中度3=较重4=严重 5=超限
],
. . . . . .
],
rope_dm : <浮点数>, 释义钢丝绳直径单位mm
rope_spec : <字符串>, 释义钢丝绳规格型号
rope_len : <浮点数>, 释义钢丝绳长度单位m
rope_cnt : <整型>, 释义钢丝绳根数
*/
TckwWireRopeInspectionRecord tckwWireRopeInspectionRecord = saveTckwWireRopeInspectionRecord(map);
saveTckwWireRopeInspectionDamageRecord(map, tckwWireRopeInspectionRecord);
}
private void saveTckwWireRopeInspectionDamageRecord(HashMap<String, Object> map, TckwWireRopeInspectionRecord tckwWireRopeInspectionRecord) {
String flawList = MapUtils.getString(map, "flaw_list");
JSONArray array = JSON.parseArray(flawList);
for (Object one : array) {
JSONArray dataArr = JSON.parseArray(one.toString());
TckwWireRopeInspectionDamageRecord r = new TckwWireRopeInspectionDamageRecord();
r.setTckwWireRopeInspectionRecordId(tckwWireRopeInspectionRecord.getId());
r.setWireRopeNumber(Integer.valueOf(dataArr.get(0).toString()));
r.setDamageLocation(Double.valueOf(dataArr.get(1).toString()));
r.setDamageStartPosition(Double.valueOf(dataArr.get(2).toString()));
r.setDamageEndPosition(Double.valueOf(dataArr.get(3).toString()));
r.setDamageValue(Double.valueOf(dataArr.get(4).toString()));
r.setDamageSeverity(Integer.valueOf(dataArr.get(5).toString()));
r.setProjectSn("todo");
tckwWireRopeInspectionDamageRecordMapper.insert(r);
}
}
private TckwWireRopeInspectionRecord saveTckwWireRopeInspectionRecord(HashMap<String, Object> map) {
TckwWireRopeInspectionRecord r = new TckwWireRopeInspectionRecord();
r.setId(MapUtils.getLong(map, "ID"));
r.setName(MapUtils.getString(map, "name"));
r.setStartTime(DateUtil.parse(MapUtils.getString(map, "start_time")));
r.setEndTime(DateUtil.parse(MapUtils.getString(map, "end_time")));
r.setStartPos(MapUtils.getDouble(map, "start_pos"));
r.setEndPos(MapUtils.getDouble(map, "end_pos"));
r.setAvgSpeed(MapUtils.getDouble(map, "avg_speed"));
r.setFlawCnt(MapUtils.getInteger(map, "flaw_cnt"));
r.setRopeDm(MapUtils.getDouble(map, "rope_dm"));
r.setRopeSpec(MapUtils.getString(map, "rope_spec"));
r.setRopeLen(MapUtils.getDouble(map, "rope_len"));
r.setRopeCnt(MapUtils.getInteger(map, "rope_cnt"));
r.setProjectSn(MapUtils.getString(map, "todo"));
save(r);
return r;
}
}

View File

@ -226,6 +226,7 @@ public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
.antMatchers("/xmgl/weight/goodsName/list").permitAll() .antMatchers("/xmgl/weight/goodsName/list").permitAll()
.antMatchers("/xmgl/weight/weighBookVehicleInfo/weighingType").permitAll() .antMatchers("/xmgl/weight/weighBookVehicleInfo/weighingType").permitAll()
.antMatchers("/xmgl/weight/weighBookVehicleInfo/add").permitAll() .antMatchers("/xmgl/weight/weighBookVehicleInfo/add").permitAll()
.antMatchers("/xmgl/tckw/tckwWireRopeInspectionRecord/addWithDamage").permitAll()
.antMatchers(HttpMethod.OPTIONS, "/**").anonymous() .antMatchers(HttpMethod.OPTIONS, "/**").anonymous()
.anyRequest().authenticated() // 剩下所有的验证都需要验证 .anyRequest().authenticated() // 剩下所有的验证都需要验证
.and() .and()