add: 手持设备操作记录
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
package org.nl.wms.das.devicecheck.controller;
|
package org.nl.wms.das.device.check.controller;
|
||||||
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
@@ -6,8 +6,8 @@ import lombok.extern.slf4j.Slf4j;
|
|||||||
import org.nl.common.base.TableDataInfo;
|
import org.nl.common.base.TableDataInfo;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.wms.das.devicecheck.service.IDasDeviceCheckRecordService;
|
import org.nl.wms.das.device.check.service.IDasDeviceCheckRecordService;
|
||||||
import org.nl.wms.das.devicecheck.service.dao.DasDeviceCheckRecord;
|
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
package org.nl.wms.das.devicecheck.service;
|
package org.nl.wms.das.device.check.service;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import org.nl.wms.das.devicecheck.service.dao.DasDeviceCheckRecord;
|
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.nl.wms.das.devicecheck.service.dao;
|
package org.nl.wms.das.device.check.service.dao;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.IdType;
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.nl.wms.das.devicecheck.service.dao.mapper;
|
package org.nl.wms.das.device.check.service.dao.mapper;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import org.nl.wms.das.devicecheck.service.dao.DasDeviceCheckRecord;
|
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lyd
|
* @author lyd
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
<?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="org.nl.wms.das.devicecheck.service.dao.mapper.DasDeviceCheckRecordMapper">
|
<mapper namespace="org.nl.wms.das.device.check.service.dao.mapper.DasDeviceCheckRecordMapper">
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package org.nl.wms.das.devicecheck.service.dto;
|
package org.nl.wms.das.device.check.service.dto;
|
||||||
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.nl.wms.das.devicecheck.service.dto;
|
package org.nl.wms.das.device.check.service.dto;
|
||||||
|
|
||||||
import org.nl.common.domain.query.BaseQuery;
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
import org.nl.wms.das.devicecheck.service.dao.DasDeviceCheckRecord;
|
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author lyd
|
* @author lyd
|
||||||
@@ -1,22 +1,19 @@
|
|||||||
package org.nl.wms.das.devicecheck.service.impl;
|
package org.nl.wms.das.device.check.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.date.DateUtil;
|
import cn.hutool.core.date.DateUtil;
|
||||||
import cn.hutool.core.util.IdUtil;
|
import cn.hutool.core.util.IdUtil;
|
||||||
import cn.hutool.core.util.ObjectUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
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;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import lombok.RequiredArgsConstructor;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.domain.query.PageQuery;
|
import org.nl.common.domain.query.PageQuery;
|
||||||
import org.nl.common.exception.BadRequestException;
|
import org.nl.common.exception.BadRequestException;
|
||||||
import org.nl.common.utils.SecurityUtils;
|
|
||||||
import org.nl.system.service.user.ISysUserService;
|
import org.nl.system.service.user.ISysUserService;
|
||||||
import org.nl.system.service.user.dao.SysUser;
|
import org.nl.system.service.user.dao.SysUser;
|
||||||
import org.nl.wms.das.devicecheck.service.IDasDeviceCheckRecordService;
|
import org.nl.wms.das.device.check.service.IDasDeviceCheckRecordService;
|
||||||
import org.nl.wms.das.devicecheck.service.dao.mapper.DasDeviceCheckRecordMapper;
|
import org.nl.wms.das.device.check.service.dao.mapper.DasDeviceCheckRecordMapper;
|
||||||
import org.nl.wms.das.devicecheck.service.dao.DasDeviceCheckRecord;
|
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||||
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
package org.nl.wms.das.device.operation.controller;
|
||||||
|
|
||||||
|
import io.swagger.annotations.Api;
|
||||||
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.base.TableDataInfo;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.logging.annotation.Log;
|
||||||
|
import org.nl.wms.das.device.operation.service.IDasDeviceOperationRecordService;
|
||||||
|
import org.nl.wms.das.device.operation.service.dao.DasDeviceOperationRecord;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
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;
|
||||||
|
import java.util.Set;
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-08-09
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@RestController
|
||||||
|
@Api(tags = "设备动作操作记录管理")
|
||||||
|
@RequestMapping("/api/dasDeviceOperationRecord")
|
||||||
|
public class DasDeviceOperationRecordController {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private IDasDeviceOperationRecordService dasDeviceOperationRecordService;
|
||||||
|
|
||||||
|
@GetMapping
|
||||||
|
@Log("查询设备动作操作记录")
|
||||||
|
@ApiOperation("查询设备动作操作记录")
|
||||||
|
//@SaCheckPermission("@el.check('dasDeviceOperationRecord:list')")
|
||||||
|
public ResponseEntity<Object> query(@RequestParam Map whereJson, PageQuery page){
|
||||||
|
return new ResponseEntity<>(TableDataInfo.build(dasDeviceOperationRecordService.queryAll(whereJson,page)),HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping
|
||||||
|
@Log("新增设备动作操作记录")
|
||||||
|
@ApiOperation("新增设备动作操作记录")
|
||||||
|
//@SaCheckPermission("@el.check('dasDeviceOperationRecord:add')")
|
||||||
|
public ResponseEntity<Object> create(@Validated @RequestBody DasDeviceOperationRecord entity){
|
||||||
|
dasDeviceOperationRecordService.create(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.CREATED);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PutMapping
|
||||||
|
@Log("修改设备动作操作记录")
|
||||||
|
@ApiOperation("修改设备动作操作记录")
|
||||||
|
//@SaCheckPermission("@el.check('dasDeviceOperationRecord:edit')")
|
||||||
|
public ResponseEntity<Object> update(@Validated @RequestBody DasDeviceOperationRecord entity){
|
||||||
|
dasDeviceOperationRecordService.update(entity);
|
||||||
|
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Log("删除设备动作操作记录")
|
||||||
|
@ApiOperation("删除设备动作操作记录")
|
||||||
|
//@SaCheckPermission("@el.check('dasDeviceOperationRecord:del')")
|
||||||
|
@DeleteMapping
|
||||||
|
public ResponseEntity<Object> delete(@RequestBody Set<String> ids) {
|
||||||
|
dasDeviceOperationRecordService.deleteAll(ids);
|
||||||
|
return new ResponseEntity<>(HttpStatus.OK);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package org.nl.wms.das.device.operation.service;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
import org.nl.wms.das.device.operation.service.dao.DasDeviceOperationRecord;
|
||||||
|
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 服务接口
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-08-09
|
||||||
|
**/
|
||||||
|
public interface IDasDeviceOperationRecordService extends IService<DasDeviceOperationRecord> {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询数据分页
|
||||||
|
* @param whereJson 条件
|
||||||
|
* @param pageable 分页参数
|
||||||
|
* @return IPage<DasDeviceOperationRecord>
|
||||||
|
*/
|
||||||
|
IPage<DasDeviceOperationRecord> queryAll(Map whereJson, PageQuery pageable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
PdaResponseVo create(DasDeviceOperationRecord entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 编辑
|
||||||
|
* @param entity /
|
||||||
|
*/
|
||||||
|
void update(DasDeviceOperationRecord entity);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 多选删除
|
||||||
|
* @param ids /
|
||||||
|
*/
|
||||||
|
void deleteAll(Set<String> ids);
|
||||||
|
}
|
||||||
@@ -0,0 +1,43 @@
|
|||||||
|
package org.nl.wms.das.device.operation.service.dao;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-08-09
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = false)
|
||||||
|
@TableName("das_device_operation_record")
|
||||||
|
public class DasDeviceOperationRecord implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
@TableId(value = "record_id", type = IdType.NONE)
|
||||||
|
@ApiModelProperty(value = "记录标识")
|
||||||
|
private String record_id;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "账号")
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "用户名")
|
||||||
|
private String person_name;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "记录时间")
|
||||||
|
private String record_time;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "设备号")
|
||||||
|
private String device_code;
|
||||||
|
|
||||||
|
@ApiModelProperty(value = "动作")
|
||||||
|
private String device_action;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.das.device.operation.service.dao.mapper;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
import org.nl.wms.das.device.operation.service.dao.DasDeviceOperationRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-08-09
|
||||||
|
**/
|
||||||
|
public interface DasDeviceOperationRecordMapper extends BaseMapper<DasDeviceOperationRecord> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
<?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.wms.das.device.operation.service.dao.mapper.DasDeviceOperationRecordMapper">
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
package org.nl.wms.das.device.operation.service.dto;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import java.io.Serializable;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description /
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-08-09
|
||||||
|
**/
|
||||||
|
@Data
|
||||||
|
public class DasDeviceOperationRecordDto implements Serializable {
|
||||||
|
|
||||||
|
/** 记录标识 */
|
||||||
|
private String record_id;
|
||||||
|
|
||||||
|
/** 账号 */
|
||||||
|
private String username;
|
||||||
|
|
||||||
|
/** 用户名 */
|
||||||
|
private String person_name;
|
||||||
|
|
||||||
|
/** 记录时间 */
|
||||||
|
private String record_time;
|
||||||
|
|
||||||
|
/** 设备号 */
|
||||||
|
private String device_code;
|
||||||
|
|
||||||
|
/** 动作 */
|
||||||
|
private String device_action;
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
package org.nl.wms.das.device.operation.service.dto;
|
||||||
|
|
||||||
|
import org.nl.common.domain.query.BaseQuery;
|
||||||
|
import org.nl.wms.das.device.operation.service.dao.DasDeviceOperationRecord;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-08-09
|
||||||
|
**/
|
||||||
|
public class DasDeviceOperationRecordQuery extends BaseQuery<DasDeviceOperationRecord> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,74 @@
|
|||||||
|
package org.nl.wms.das.device.operation.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.date.DateUtil;
|
||||||
|
import cn.hutool.core.util.IdUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.nl.common.domain.query.PageQuery;
|
||||||
|
import org.nl.common.exception.BadRequestException;
|
||||||
|
import org.nl.common.utils.SecurityUtils;
|
||||||
|
import org.nl.system.service.user.ISysUserService;
|
||||||
|
import org.nl.system.service.user.dao.SysUser;
|
||||||
|
import org.nl.wms.das.device.operation.service.IDasDeviceOperationRecordService;
|
||||||
|
import org.nl.wms.das.device.operation.service.dao.mapper.DasDeviceOperationRecordMapper;
|
||||||
|
import org.nl.wms.das.device.operation.service.dao.DasDeviceOperationRecord;
|
||||||
|
import org.nl.wms.pda.service.dao.vo.PdaResponseVo;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @description 服务实现
|
||||||
|
* @author lyd
|
||||||
|
* @date 2023-08-09
|
||||||
|
**/
|
||||||
|
@Slf4j
|
||||||
|
@Service
|
||||||
|
public class DasDeviceOperationRecordServiceImpl extends ServiceImpl<DasDeviceOperationRecordMapper, DasDeviceOperationRecord> implements IDasDeviceOperationRecordService {
|
||||||
|
|
||||||
|
@Autowired
|
||||||
|
private DasDeviceOperationRecordMapper dasDeviceOperationRecordMapper;
|
||||||
|
@Autowired
|
||||||
|
private ISysUserService userService;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public IPage<DasDeviceOperationRecord> queryAll(Map whereJson, PageQuery page){
|
||||||
|
LambdaQueryWrapper<DasDeviceOperationRecord> lam = new LambdaQueryWrapper<>();
|
||||||
|
IPage<DasDeviceOperationRecord> pages = new Page<>(page.getPage() + 1, page.getSize());
|
||||||
|
dasDeviceOperationRecordMapper.selectPage(pages, lam);
|
||||||
|
return pages;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public PdaResponseVo create(DasDeviceOperationRecord entity) {
|
||||||
|
SysUser sysUser = userService.getOne(new LambdaQueryWrapper<SysUser>()
|
||||||
|
.eq(SysUser::getUsername, entity.getUsername()));
|
||||||
|
entity.setRecord_id(IdUtil.getSnowflake(1, 1).nextIdStr());
|
||||||
|
entity.setRecord_time(DateUtil.now());
|
||||||
|
entity.setPerson_name(sysUser.getPerson_name());
|
||||||
|
dasDeviceOperationRecordMapper.insert(entity);
|
||||||
|
return PdaResponseVo.pdaResultOk("设备[" + entity.getDevice_code() + "]动作切换成功,操作人: " + sysUser.getPerson_name());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update(DasDeviceOperationRecord entity) {
|
||||||
|
DasDeviceOperationRecord dto = dasDeviceOperationRecordMapper.selectById(entity.getRecord_id());
|
||||||
|
if (dto == null) throw new BadRequestException("被删除或无权限,操作失败!");
|
||||||
|
entity.setRecord_time(DateUtil.now());
|
||||||
|
|
||||||
|
dasDeviceOperationRecordMapper.updateById(entity);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAll(Set<String> ids) {
|
||||||
|
// 真删除
|
||||||
|
dasDeviceOperationRecordMapper.deleteBatchIds(ids);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,14 +1,14 @@
|
|||||||
package org.nl.wms.pda.controller;
|
package org.nl.wms.pda.controller;
|
||||||
|
|
||||||
import cn.dev33.satoken.annotation.SaIgnore;
|
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.nl.common.logging.annotation.Log;
|
import org.nl.common.logging.annotation.Log;
|
||||||
import org.nl.wms.das.devicecheck.service.IDasDeviceCheckRecordService;
|
import org.nl.wms.das.device.check.service.IDasDeviceCheckRecordService;
|
||||||
import org.nl.wms.das.devicecheck.service.dao.DasDeviceCheckRecord;
|
import org.nl.wms.das.device.check.service.dao.DasDeviceCheckRecord;
|
||||||
|
import org.nl.wms.das.device.operation.service.IDasDeviceOperationRecordService;
|
||||||
|
import org.nl.wms.das.device.operation.service.dao.DasDeviceOperationRecord;
|
||||||
import org.nl.wms.pda.service.PdaService;
|
import org.nl.wms.pda.service.PdaService;
|
||||||
import org.nl.wms.pdm.workorder.service.dao.PdmBdWorkorder;
|
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.HttpStatus;
|
import org.springframework.http.HttpStatus;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
@@ -31,6 +31,8 @@ public class PdaController {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private IDasDeviceCheckRecordService deviceCheckRecordService;
|
private IDasDeviceCheckRecordService deviceCheckRecordService;
|
||||||
@Autowired
|
@Autowired
|
||||||
|
private IDasDeviceOperationRecordService deviceOperationRecordService;
|
||||||
|
@Autowired
|
||||||
private PdaService pdaService;
|
private PdaService pdaService;
|
||||||
@PostMapping("/deviceCheck/verify")
|
@PostMapping("/deviceCheck/verify")
|
||||||
@Log("设备点检")
|
@Log("设备点检")
|
||||||
@@ -53,4 +55,17 @@ public class PdaController {
|
|||||||
return new ResponseEntity<>(pdaService.getDeviceStatus(), HttpStatus.OK);
|
return new ResponseEntity<>(pdaService.getDeviceStatus(), HttpStatus.OK);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostMapping("/deviceSwitchover/deviceAction")
|
||||||
|
@Log("设备动作下拉框数据")
|
||||||
|
@ApiOperation("设备动作下拉框数据")
|
||||||
|
public ResponseEntity<Object> deviceAction(){
|
||||||
|
return new ResponseEntity<>(pdaService.deviceAction(), HttpStatus.OK);
|
||||||
|
}
|
||||||
|
|
||||||
|
@PostMapping("/deviceSwitchover/verify")
|
||||||
|
@Log("设备动作切换")
|
||||||
|
@ApiOperation("设备动作切换")
|
||||||
|
public ResponseEntity<Object> deviceSwitchover(@Validated @RequestBody DasDeviceOperationRecord entity){
|
||||||
|
return new ResponseEntity<>(deviceOperationRecordService.create(entity), HttpStatus.OK);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,4 +13,6 @@ public interface PdaService {
|
|||||||
List<DropdownListVo> getDeviceInfo();
|
List<DropdownListVo> getDeviceInfo();
|
||||||
|
|
||||||
List<DropdownListVo> getDeviceStatus();
|
List<DropdownListVo> getDeviceStatus();
|
||||||
|
|
||||||
|
List<DropdownListVo> deviceAction();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -29,4 +29,9 @@ public class PdaServiceImpl implements PdaService {
|
|||||||
public List<DropdownListVo> getDeviceStatus() {
|
public List<DropdownListVo> getDeviceStatus() {
|
||||||
return pdaMapper.getDictByCode("device_status");
|
return pdaMapper.getDictByCode("device_status");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DropdownListVo> deviceAction() {
|
||||||
|
return pdaMapper.getDictByCode("device_action");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -39,15 +39,19 @@
|
|||||||
<el-table-column prop="record_time" label="记录时间" :min-width="flexWidth('record_time',crud.data,'记录时间')"/>
|
<el-table-column prop="record_time" label="记录时间" :min-width="flexWidth('record_time',crud.data,'记录时间')"/>
|
||||||
<el-table-column prop="device_code" label="设备号" :min-width="flexWidth('device_code',crud.data,'设备号')"/>
|
<el-table-column prop="device_code" label="设备号" :min-width="flexWidth('device_code',crud.data,'设备号')"/>
|
||||||
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')"/>
|
<el-table-column prop="remark" label="备注" :min-width="flexWidth('remark',crud.data,'备注')"/>
|
||||||
<el-table-column prop="check_status" label="点检状态" :min-width="flexWidth('check_status',crud.data,'点检状态')"/>
|
<el-table-column prop="check_status" label="点检状态" :min-width="flexWidth('check_status',crud.data,'点检状态')">
|
||||||
<el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">
|
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<udOperation
|
{{ dict.label.device_status[scope.row.check_status] }}
|
||||||
:data="scope.row"
|
|
||||||
:permission="permission"
|
|
||||||
/>
|
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
<!-- <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <udOperation-->
|
||||||
|
<!-- :data="scope.row"-->
|
||||||
|
<!-- :permission="permission"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
</el-table>
|
</el-table>
|
||||||
<!--分页组件-->
|
<!--分页组件-->
|
||||||
<pagination />
|
<pagination />
|
||||||
@@ -57,11 +61,11 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import crudDasDeviceCheckRecord from './dasDeviceCheckRecord'
|
import crudDasDeviceCheckRecord from './dasDeviceCheckRecord'
|
||||||
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
import CRUD, { crud, form, header, presenter } from '@crud/crud'
|
||||||
import rrOperation from '@crud/RR.operation'
|
import rrOperation from '@crud/RR.operation.vue'
|
||||||
import crudOperation from '@crud/CRUD.operation'
|
import crudOperation from '@crud/CRUD.operation.vue'
|
||||||
import udOperation from '@crud/UD.operation'
|
import udOperation from '@crud/UD.operation.vue'
|
||||||
import pagination from '@crud/Pagination'
|
import pagination from '@crud/Pagination.vue'
|
||||||
|
|
||||||
const defaultForm = {
|
const defaultForm = {
|
||||||
record_id: null,
|
record_id: null,
|
||||||
@@ -73,7 +77,8 @@ const defaultForm = {
|
|||||||
check_status: null
|
check_status: null
|
||||||
}
|
}
|
||||||
export default {
|
export default {
|
||||||
name: 'DasDeviceCheckRecord',
|
name: 'DeviceCheckRecord',
|
||||||
|
dicts: ['device_status'],
|
||||||
components: { pagination, crudOperation, rrOperation, udOperation },
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
mixins: [presenter(), header(), form(defaultForm), crud()],
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
cruds() {
|
cruds() {
|
||||||
@@ -82,7 +87,14 @@ export default {
|
|||||||
url: 'api/dasDeviceCheckRecord',
|
url: 'api/dasDeviceCheckRecord',
|
||||||
idField: 'record_id',
|
idField: 'record_id',
|
||||||
sort: 'record_id,desc',
|
sort: 'record_id,desc',
|
||||||
crudMethod: { ...crudDasDeviceCheckRecord }
|
crudMethod: { ...crudDasDeviceCheckRecord },
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
import request from '@/utils/request'
|
||||||
|
|
||||||
|
export function add(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/dasDeviceOperationRecord',
|
||||||
|
method: 'post',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function del(ids) {
|
||||||
|
return request({
|
||||||
|
url: 'api/dasDeviceOperationRecord/',
|
||||||
|
method: 'delete',
|
||||||
|
data: ids
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export function edit(data) {
|
||||||
|
return request({
|
||||||
|
url: 'api/dasDeviceOperationRecord',
|
||||||
|
method: 'put',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
export default { add, edit, del }
|
||||||
113
lms/nladmin-ui/src/views/wms/das/device/operation/index.vue
Normal file
113
lms/nladmin-ui/src/views/wms/das/device/operation/index.vue
Normal file
@@ -0,0 +1,113 @@
|
|||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<!--工具栏-->
|
||||||
|
<div class="head-container">
|
||||||
|
<!--如果想在工具栏加入更多按钮,可以使用插槽方式, slot = 'left' or 'right'-->
|
||||||
|
<crudOperation :permission="permission" />
|
||||||
|
<!--表单组件-->
|
||||||
|
<el-dialog :close-on-click-modal="false" :before-close="crud.cancelCU" :visible.sync="crud.status.cu > 0" :title="crud.status.title" width="500px">
|
||||||
|
<el-form ref="form" :model="form" :rules="rules" size="mini" label-width="80px">
|
||||||
|
<el-form-item label="账号">
|
||||||
|
<el-input v-model="form.username" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="用户名">
|
||||||
|
<el-input v-model="form.person_name" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="记录时间">
|
||||||
|
<el-input v-model="form.record_time" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="设备号">
|
||||||
|
<el-input v-model="form.device_code" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="动作">
|
||||||
|
<el-input v-model="form.device_action" style="width: 370px;" />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button type="text" @click="crud.cancelCU">取消</el-button>
|
||||||
|
<el-button :loading="crud.cu === 2" type="primary" @click="crud.submitCU">确认</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
|
<!--表格渲染-->
|
||||||
|
<el-table ref="table" v-loading="crud.loading" :data="crud.data" size="mini" style="width: 100%;" @selection-change="crud.selectionChangeHandler">
|
||||||
|
<el-table-column type="selection" width="55" />
|
||||||
|
<el-table-column prop="username" label="账号" :min-width="flexWidth('username',crud.data,'账号')"/>
|
||||||
|
<el-table-column prop="person_name" label="用户名" :min-width="flexWidth('person_name',crud.data,'用户名')"/>
|
||||||
|
<el-table-column prop="record_time" label="记录时间" :min-width="flexWidth('record_time',crud.data,'记录时间')"/>
|
||||||
|
<el-table-column prop="device_code" label="设备号" :min-width="flexWidth('device_code',crud.data,'设备号')"/>
|
||||||
|
<el-table-column prop="device_action" label="动作" :min-width="flexWidth('device_action',crud.data,'动作')">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{ dict.label.device_action[scope.row.device_action] }}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
<!-- <el-table-column v-permission="[]" label="操作" width="120px" align="center" fixed="right">-->
|
||||||
|
<!-- <template slot-scope="scope">-->
|
||||||
|
<!-- <udOperation-->
|
||||||
|
<!-- :data="scope.row"-->
|
||||||
|
<!-- :permission="permission"-->
|
||||||
|
<!-- />-->
|
||||||
|
<!-- </template>-->
|
||||||
|
<!-- </el-table-column>-->
|
||||||
|
</el-table>
|
||||||
|
<!--分页组件-->
|
||||||
|
<pagination />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import crudDasDeviceOperationRecord from './dasDeviceOperationRecord'
|
||||||
|
import CRUD, {crud, form, header, presenter} from '@crud/crud'
|
||||||
|
import rrOperation from '@crud/RR.operation'
|
||||||
|
import crudOperation from '@crud/CRUD.operation'
|
||||||
|
import udOperation from '@crud/UD.operation'
|
||||||
|
import pagination from '@crud/Pagination'
|
||||||
|
|
||||||
|
const defaultForm = {
|
||||||
|
record_id: null,
|
||||||
|
username: null,
|
||||||
|
person_name: null,
|
||||||
|
record_time: null,
|
||||||
|
device_code: null,
|
||||||
|
device_action: null
|
||||||
|
}
|
||||||
|
export default {
|
||||||
|
name: 'DeviceOperation',
|
||||||
|
components: { pagination, crudOperation, rrOperation, udOperation },
|
||||||
|
mixins: [presenter(), header(), form(defaultForm), crud()],
|
||||||
|
cruds() {
|
||||||
|
return CRUD({
|
||||||
|
title: '设备动作操作记录',
|
||||||
|
dicts: ['device_action'],
|
||||||
|
url: 'api/dasDeviceOperationRecord',
|
||||||
|
idField: 'record_id',
|
||||||
|
sort: 'record_id,desc',
|
||||||
|
crudMethod: { ...crudDasDeviceOperationRecord },
|
||||||
|
optShow: {
|
||||||
|
add: false,
|
||||||
|
edit: false,
|
||||||
|
del: false,
|
||||||
|
download: false,
|
||||||
|
reset: false
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
permission: {
|
||||||
|
},
|
||||||
|
rules: {
|
||||||
|
} }
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// 钩子:在获取表格数据之前执行,false 则代表不获取数据
|
||||||
|
[CRUD.HOOK.beforeRefresh]() {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user