Merge remote-tracking branch 'origin/master'

This commit is contained in:
2023-12-14 18:00:17 +08:00
72 changed files with 1781 additions and 868 deletions

View File

@@ -0,0 +1,77 @@
package org.nl.acs.angle.controller;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.nl.acs.angle.domain.AcsPointAngle;
import org.nl.acs.angle.service.IAcsPointAngleService;
import org.nl.common.logging.annotation.Log;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.util.Map;
/**
* <p>
* 前端控制器
* </p>
*
* @author tq
* @since 2023-12-13
*/
@RestController
@Api(tags = "点位角度管理")
@RequestMapping("/api/acsPointAngle")
@Slf4j
public class AcsPointAngleController {
@Autowired
private IAcsPointAngleService acsPointAngleService;
@GetMapping
@Log("查询点位角度")
@ApiOperation("查询点位角度")
//@PreAuthorize("@el.check('acsPointAngle:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page) {
return new ResponseEntity<>(acsPointAngleService.queryAll(whereJson, page), HttpStatus.OK);
}
@PostMapping
@Log("新增点位角度")
@ApiOperation("新增点位角度")
//@PreAuthorize("@el.check('acsPointAngle:add')")
public ResponseEntity<Object> create(@Validated @RequestBody AcsPointAngle dto) {
acsPointAngleService.create(dto);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改点位角度")
@ApiOperation("修改点位角度")
//@PreAuthorize("@el.check('acsPointAngle:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody AcsPointAngle dto) {
acsPointAngleService.update(dto);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除点位角度")
@ApiOperation("删除点位角度")
//@PreAuthorize("@el.check('acsPointAngle:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
acsPointAngleService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/updateActive")
@Log("是否启用")
@ApiOperation("是否启用")
public ResponseEntity<Object> updateOn(@RequestParam Long id, @RequestParam String is_active) {
acsPointAngleService.updateOn(id, is_active);
return new ResponseEntity<>(HttpStatus.OK);
}
}

View File

@@ -0,0 +1,69 @@
package org.nl.acs.angle.domain;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* <p>
*
* </p>
*
* @author tq
* @since 2023-12-13
*/
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("acs_point_angle")
@ApiModel(value="AcsPointAngle对象", description="")
public class AcsPointAngle implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "id标识")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "起始点位编码")
private String start_point_code;
@ApiModelProperty(value = "起始设备编码")
private String start_device_code;
@ApiModelProperty(value = "目标点位编码")
private String next_point_code;
@ApiModelProperty(value = "目标设备编码")
private String next_device_code;
@ApiModelProperty(value = "起始点位角度")
private BigDecimal start_point_angle;
@ApiModelProperty(value = "目标点位角度")
private BigDecimal next_point_angle;
@ApiModelProperty(value = "是否启用")
private String is_active;
@ApiModelProperty(value = "创建者")
private String create_by;
@ApiModelProperty(value = "创建时间")
private String create_time;
@ApiModelProperty(value = "修改者")
private String update_by;
@ApiModelProperty(value = "修改时间")
private String update_time;
}

View File

@@ -0,0 +1,16 @@
package org.nl.acs.angle.mapper;
import org.nl.acs.angle.domain.AcsPointAngle;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* <p>
* Mapper 接口
* </p>
*
* @author tq
* @since 2023-12-13
*/
public interface AcsPointAngleMapper extends BaseMapper<AcsPointAngle> {
}

View File

@@ -0,0 +1,32 @@
package org.nl.acs.angle.service;
import org.nl.acs.angle.domain.AcsPointAngle;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springframework.data.domain.Pageable;
import java.util.Map;
/**
* <p>
* 服务类
* </p>
*
* @author tq
* @since 2023-12-13
*/
public interface IAcsPointAngleService extends IService<AcsPointAngle> {
void create(AcsPointAngle dto);
/**
* 编辑
*
* @param dto /
*/
void update(AcsPointAngle dto);
void deleteAll(String[] ids);
Map<String, Object> queryAll(Map whereJson, Pageable page);
void updateOn(Long id, String is_active);
}

View File

@@ -0,0 +1,119 @@
package org.nl.acs.angle.service.impl;
import java.math.BigDecimal;
import java.util.HashMap;
import java.util.Map;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
import org.nl.acs.angle.domain.AcsPointAngle;
import org.nl.acs.angle.mapper.AcsPointAngleMapper;
import org.nl.acs.angle.service.IAcsPointAngleService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.nl.acs.device.domain.Device;
import org.nl.acs.utils.ConvertUtil;
import org.nl.acs.utils.PageUtil;
import org.nl.common.exception.BadRequestException;
import org.nl.common.utils.SecurityUtils;
import org.nl.config.language.LangProcess;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* <p>
* 服务实现类
* </p>
*
* @author tq
* @since 2023-12-13
*/
@Service
public class AcsPointAngleServiceImpl extends ServiceImpl<AcsPointAngleMapper, AcsPointAngle> implements IAcsPointAngleService {
@Autowired
private AcsPointAngleMapper acsPointAngleMapper;
@Override
@Transactional(rollbackFor = Exception.class)
public void create(AcsPointAngle dto) {
AcsPointAngle acsPointAngle = new AcsPointAngle();
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
acsPointAngle.setId(dto.getId());
acsPointAngle.setStart_point_code(dto.getStart_point_code());
acsPointAngle.setStart_device_code(dto.getStart_device_code());
acsPointAngle.setNext_point_code(dto.getNext_point_code());
acsPointAngle.setNext_device_code(dto.getNext_device_code());
acsPointAngle.setStart_point_angle(dto.getStart_point_angle());
acsPointAngle.setNext_point_angle(dto.getNext_point_angle());
acsPointAngle.setIs_active(dto.getIs_active());
acsPointAngle.setCreate_by("auto");
acsPointAngle.setCreate_time(now);
acsPointAngle.setUpdate_by(currentUsername);
acsPointAngle.setUpdate_time(now);
acsPointAngleMapper.insert(acsPointAngle);
}
@Override
public void update(AcsPointAngle dto) {
if (dto == null) {
throw new BadRequestException(LangProcess.msg("error_nullPoint"));
}
AcsPointAngle acsPointAngle = new AcsPointAngle();
acsPointAngle.setId(dto.getId());
//起点角度,终点角度变化
acsPointAngle.setStart_point_angle(dto.getStart_point_angle());
acsPointAngle.setNext_point_angle(dto.getNext_point_angle());
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
acsPointAngle.setUpdate_by(currentUsername);
acsPointAngle.setUpdate_time(now);
acsPointAngleMapper.updateById(acsPointAngle);
}
@Override
public void deleteAll(String[] ids) {
for (String id : ids) {
AcsPointAngle pointAngle = new LambdaQueryChainWrapper<>(acsPointAngleMapper)
.eq(AcsPointAngle::getId, id)
.one();
if (pointAngle == null) {
continue;
}
Map<String, Object> map = new HashMap<>();
map.put("id", id);
acsPointAngleMapper.deleteByMap(map);
}
}
@Override
public Map<String, Object> queryAll(Map whereJson, Pageable page) {
IPage<AcsPointAngle> queryPage = PageUtil.toMybatisPage(page);
LambdaQueryWrapper<AcsPointAngle> wrapper = new LambdaQueryWrapper<>();
wrapper.orderByDesc(AcsPointAngle::getUpdate_time);
IPage<AcsPointAngle> pointAnglePage = acsPointAngleMapper.selectPage(queryPage, wrapper);
final JSONObject json = (JSONObject) JSON.toJSON(ConvertUtil.convertPage(pointAnglePage, AcsPointAngle.class));
return json;
}
@Override
public void updateOn(Long id, String is_active) {
AcsPointAngle acsPointAngle = new AcsPointAngle();
acsPointAngle.setId(id);
acsPointAngle.setIs_active(is_active);
String currentUsername = SecurityUtils.getCurrentUsername();
String now = DateUtil.now();
acsPointAngle.setUpdate_by(currentUsername);
acsPointAngle.setUpdate_time(now);
acsPointAngleMapper.updateById(acsPointAngle);
}
}

View File

@@ -11,7 +11,7 @@ import java.util.List;
@Data
public class ItemProtocol {
/**
/**
* 心跳
*/
public static String item_heartbeat = "heartbeat";
@@ -21,17 +21,17 @@ public class ItemProtocol {
*/
public static String item_deviceCode = "deviceCode";
/**
/**
* 工作模式
*/
public static String item_mode = "mode";
/**
*作业状态
* 作业状态
*/
public static String item_command = "command";
/**
/**
* 任务号
*/
public static String item_task = "task";
@@ -56,7 +56,7 @@ public class ItemProtocol {
*/
public static String item_y = "y";
/**
/**
* 行走开关信号
*/
public static String item_move = "move";
@@ -66,12 +66,12 @@ public class ItemProtocol {
*/
public static String item_cargoMove = "cargoMove";
/**
/**
* 行走动作信号
*/
public static String item_action = "action";
/**
/**
* 行走激光数值
*/
public static String item_distancex = "distancex";
@@ -82,88 +82,88 @@ public class ItemProtocol {
public static String item_distancey = "distancey";
/**
*载货台超限信号
* 载货台超限信号
*/
public static String item_cargoError = "cargoError";
/**
*货叉探货信号
* 货叉探货信号
*/
public static String item_forkCargo = "forkCargo";
/**
*货叉位置信号
* 货叉位置信号
*/
public static String item_forkLocation = "forkLocation";
/**
*货叉动作信号
* 货叉动作信号
*/
public static String item_forkAction = "forkAction";
/**
/**
* 特殊开关量1
*/
public static String item_special1 = "special1";
/**
/**
* 特殊开关量2
*/
public static String item_special2 = "special2";
/**
*托盘条码
* 托盘条码
*/
public static String item_trayCode = "trayCode";
/**
/**
* 水箱和消防缓存位有无货
*/
public static String item_storage_cache = "storage_cache";
/**
/**
* 速度(转/分钟)
*/
public static String item_stacker_rpm = "stacker_rpm";
/**
/**
* 电流
*/
public static String item_stacker_electricCurrent = "stacker_electric Current";
/**
/**
* 轴运行次数
*/
public static String item_stacker_runing_time = "stacker_runing time";
/**
/**
* 轴工作时间(小时)
*/
public static String item_stacker_workingHours = "stacker_workingHours";
/**
*载货台速度(转/分钟)
* 载货台速度(转/分钟)
*/
public static String item_cargo_rpm = "cargo_rpm";
/**
*载货台电流
* 载货台电流
*/
public static String item_cargo_electric_Current = "cargo_electric Current";
/**
*载货台轴工作小时数
* 载货台轴工作小时数
*/
public static String item_cargo_workingHours = "cargo_workingHours";
/**
*载货台轴运行次数
* 载货台轴运行次数
*/
public static String item_cargo_runingTimes = "cargo_runingTimes";
/**
*货叉速度(转/分钟
* 货叉速度(转/分钟
*/
public static String item_fork_rpm = "fork_rpm";
/**
*货叉电流
* 货叉电流
*/
public static String item_fork_electric_Current = "fork_electric Current";
/**
*货叉轴工作时间(小时
* 货叉轴工作时间(小时
*/
public static String item_fork_workingHours = "fork_workingHours";
/**
*货叉轴运行次数
* 货叉轴运行次数
*/
public static String item_fork_runingTimes = "fork_runingTimes";
@@ -176,7 +176,7 @@ public class ItemProtocol {
* 堆垛机号
*/
public static String item_to_device_code = "to_device_code";
/**
/**
* 轴运行次数
*/
public static String item_to_command = "to_command";
@@ -184,12 +184,12 @@ public class ItemProtocol {
* 物料类型
*/
public static String item_to_type = "to_type";
/**
/**
* 任务号
*/
public static String item_to_task = "to_task";
/**
*作业排
* 作业排
*/
public static String item_to_z = "to_z";
/**
@@ -467,5 +467,4 @@ public class ItemProtocol {
public String toString() {
return "";
}
}

View File

@@ -20,6 +20,7 @@ import cn.hutool.core.date.DateUtil;
import org.nl.common.utils.ElAdminConstant;
import org.nl.common.utils.FileUtil;
import org.nl.common.utils.StringUtils;
import org.nl.config.language.LangProcess;
import org.nl.system.service.monitor.MonitorService;
import org.springframework.stereotype.Service;
import oshi.SystemInfo;
@@ -145,10 +146,10 @@ public class MonitorServiceImpl implements MonitorService {
private Map<String,Object> getCpuInfo(CentralProcessor processor) {
Map<String,Object> cpuInfo = new LinkedHashMap<>();
cpuInfo.put("name", processor.getProcessorIdentifier().getName());
cpuInfo.put("package", processor.getPhysicalPackageCount() + "个物理CPU");
cpuInfo.put("core", processor.getPhysicalProcessorCount() + "个物理核心");
cpuInfo.put("package", processor.getPhysicalPackageCount() +" " +LangProcess.msg("physical_cpu"));
cpuInfo.put("core", processor.getPhysicalProcessorCount() +" " +LangProcess.msg("physical_core"));
cpuInfo.put("coreNumber", processor.getPhysicalProcessorCount());
cpuInfo.put("logic", processor.getLogicalProcessorCount() + "个逻辑CPU");
cpuInfo.put("logic", processor.getLogicalProcessorCount() +" " +LangProcess.msg("logical_cpu"));
// CPU信息
long[] prevTicks = processor.getSystemCpuLoadTicks();
// 等待1秒...

View File

@@ -4,3 +4,6 @@ device_checkRoute=设备{0}路由已存在,无法操作
device_checkStatus=该设备已有呼叫请求未响应,操作失败\!
device_checkrelate=设备{0}关联信息{1}异常\:{2}
route_isNull=路由不通
physical_cpu=个物理CPU
physical_core=个物理核心
logical_cpu=个逻辑CPU

View File

@@ -4,3 +4,6 @@ device_checkRoute=Device {0} route already exists and cannot be operated
device_checkStatus=The device has an unresponsive call request and the operation has failed\!
device_checkrelate=Device {0} association information {1} exception\: {2}
route_isNull=Routing not working
physical_cpu=Physical CPU
physical_core=Physical core
logical_cpu=Logical CPU

View File

@@ -4,3 +4,7 @@ device_checkRoute=Jalan perangkat {0} sudah ada dan tidak dapat beroperasi
device_checkStatus=Perangkat memiliki permintaan panggilan yang tidak respon dan operasinya gagal\!
device_checkrelate=Informasi asosiasi perangkat {0} pengecualian {1}\: {2}
route_isNull=Jalan tidak bekerja
physical_cpu=CPU fisik
physical_core=CPU logis
logical_cpu=CPU logis

View File

@@ -4,3 +4,6 @@ device_checkRoute=设备{0}路由已存在,无法操作
device_checkStatus=该设备已有呼叫请求未响应,操作失败\!
device_checkrelate=设备{0}关联信息{1}异常\:{2}
route_isNull=路由不通
physical_cpu=个物理CPU
physical_core=个物理核心
logical_cpu=个逻辑CPU

View File

@@ -0,0 +1,10 @@
<?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="org.nl.acs.angle.mapper.AcsPointAngleMapper">
<!-- 通用查询结果列 -->
<sql id="Base_Column_List">
id, start_point_code, start_device_code, next_point_code, next_device_code, start_point_angle, next_point_angle, is_active, create_by, create_time, update_by, update_time
</sql>
</mapper>