parent
9010bcc044
commit
cc1782678a
@ -0,0 +1,8 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
@ -0,0 +1,19 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CompilerConfiguration">
|
||||
<annotationProcessing>
|
||||
<profile default="true" name="Default" enabled="true" />
|
||||
<profile name="Maven default annotation processors profile" enabled="true">
|
||||
<sourceOutputDir name="target/generated-sources/annotations" />
|
||||
<sourceTestOutputDir name="target/generated-test-sources/test-annotations" />
|
||||
<outputRelativeToContentRoot value="true" />
|
||||
<module name="device" />
|
||||
</profile>
|
||||
</annotationProcessing>
|
||||
</component>
|
||||
<component name="JavacSettings">
|
||||
<option name="ADDITIONAL_OPTIONS_OVERRIDE">
|
||||
<module name="device" options="-parameters" />
|
||||
</option>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="file://$PROJECT_DIR$/src/main/java" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,20 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="RemoteRepositoriesConfiguration">
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Central Repository" />
|
||||
<option name="url" value="https://repo.maven.apache.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="central" />
|
||||
<option name="name" value="Maven Central repository" />
|
||||
<option name="url" value="https://repo1.maven.org/maven2" />
|
||||
</remote-repository>
|
||||
<remote-repository>
|
||||
<option name="id" value="jboss.community" />
|
||||
<option name="name" value="JBoss Community repository" />
|
||||
<option name="url" value="https://repository.jboss.org/nexus/content/repositories/public/" />
|
||||
</remote-repository>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ExternalStorageConfigurationManager" enabled="true" />
|
||||
<component name="MavenProjectsManager">
|
||||
<option name="originalFiles">
|
||||
<list>
|
||||
<option value="$PROJECT_DIR$/pom.xml" />
|
||||
</list>
|
||||
</option>
|
||||
</component>
|
||||
<component name="ProjectRootManager" version="2" languageLevel="JDK_11" default="true" project-jdk-name="1.8" project-jdk-type="JavaSDK">
|
||||
<output url="file://$PROJECT_DIR$/out" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Palette2">
|
||||
<group name="Swing">
|
||||
<item class="com.intellij.uiDesigner.HSpacer" tooltip-text="Horizontal Spacer" icon="/com/intellij/uiDesigner/icons/hspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="1" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="com.intellij.uiDesigner.VSpacer" tooltip-text="Vertical Spacer" icon="/com/intellij/uiDesigner/icons/vspacer.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="1" anchor="0" fill="2" />
|
||||
</item>
|
||||
<item class="javax.swing.JPanel" icon="/com/intellij/uiDesigner/icons/panel.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollPane" icon="/com/intellij/uiDesigner/icons/scrollPane.svg" removable="false" auto-create-binding="false" can-attach-label="true">
|
||||
<default-constraints vsize-policy="7" hsize-policy="7" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JButton" icon="/com/intellij/uiDesigner/icons/button.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="0" fill="1" />
|
||||
<initial-values>
|
||||
<property name="text" value="Button" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JRadioButton" icon="/com/intellij/uiDesigner/icons/radioButton.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="RadioButton" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JCheckBox" icon="/com/intellij/uiDesigner/icons/checkBox.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="3" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="CheckBox" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JLabel" icon="/com/intellij/uiDesigner/icons/label.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="8" fill="0" />
|
||||
<initial-values>
|
||||
<property name="text" value="Label" />
|
||||
</initial-values>
|
||||
</item>
|
||||
<item class="javax.swing.JTextField" icon="/com/intellij/uiDesigner/icons/textField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JPasswordField" icon="/com/intellij/uiDesigner/icons/passwordField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JFormattedTextField" icon="/com/intellij/uiDesigner/icons/formattedTextField.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1">
|
||||
<preferred-size width="150" height="-1" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextArea" icon="/com/intellij/uiDesigner/icons/textArea.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTextPane" icon="/com/intellij/uiDesigner/icons/textPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JEditorPane" icon="/com/intellij/uiDesigner/icons/editorPane.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JComboBox" icon="/com/intellij/uiDesigner/icons/comboBox.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="2" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JTable" icon="/com/intellij/uiDesigner/icons/table.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JList" icon="/com/intellij/uiDesigner/icons/list.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="2" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTree" icon="/com/intellij/uiDesigner/icons/tree.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3">
|
||||
<preferred-size width="150" height="50" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JTabbedPane" icon="/com/intellij/uiDesigner/icons/tabbedPane.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSplitPane" icon="/com/intellij/uiDesigner/icons/splitPane.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="3" hsize-policy="3" anchor="0" fill="3">
|
||||
<preferred-size width="200" height="200" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JSpinner" icon="/com/intellij/uiDesigner/icons/spinner.svg" removable="false" auto-create-binding="true" can-attach-label="true">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSlider" icon="/com/intellij/uiDesigner/icons/slider.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="8" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JSeparator" icon="/com/intellij/uiDesigner/icons/separator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="6" anchor="0" fill="3" />
|
||||
</item>
|
||||
<item class="javax.swing.JProgressBar" icon="/com/intellij/uiDesigner/icons/progressbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar" icon="/com/intellij/uiDesigner/icons/toolbar.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="6" anchor="0" fill="1">
|
||||
<preferred-size width="-1" height="20" />
|
||||
</default-constraints>
|
||||
</item>
|
||||
<item class="javax.swing.JToolBar$Separator" icon="/com/intellij/uiDesigner/icons/toolbarSeparator.svg" removable="false" auto-create-binding="false" can-attach-label="false">
|
||||
<default-constraints vsize-policy="0" hsize-policy="0" anchor="0" fill="1" />
|
||||
</item>
|
||||
<item class="javax.swing.JScrollBar" icon="/com/intellij/uiDesigner/icons/scrollbar.svg" removable="false" auto-create-binding="true" can-attach-label="false">
|
||||
<default-constraints vsize-policy="6" hsize-policy="0" anchor="0" fill="2" />
|
||||
</item>
|
||||
</group>
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
|
||||
<groupId>org.example</groupId>
|
||||
<artifactId>device</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.12.RELEASE</version>
|
||||
</parent>
|
||||
<properties>
|
||||
<maven.compiler.source>8</maven.compiler.source>
|
||||
<maven.compiler.target>8</maven.compiler.target>
|
||||
</properties>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>cn.hutool</groupId>
|
||||
<artifactId>hutool-all</artifactId>
|
||||
<version>5.0.7</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-boot-starter</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
<!-- MP代码生成器依赖 -->
|
||||
<dependency>
|
||||
<groupId>com.baomidou</groupId>
|
||||
<artifactId>mybatis-plus-generator</artifactId>
|
||||
<version>3.5.1</version>
|
||||
</dependency>
|
||||
<!-- 模板引擎依赖 -->
|
||||
<dependency>
|
||||
<groupId>org.apache.velocity</groupId>
|
||||
<artifactId>velocity-engine-core</artifactId>
|
||||
<version>2.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!-- 对JDBC的支持 -->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--mysql驱动 -->
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
</dependency>
|
||||
|
||||
<!--aop的相关依赖 包括后续的声明式事务需要用到此依赖-->
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-aop</artifactId>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
|
||||
|
||||
</project>
|
@ -0,0 +1,14 @@
|
||||
package com;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.mapper")
|
||||
public class DeviceApplication {
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DeviceApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.commons;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.DbType;
|
||||
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
|
||||
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
@Configuration
|
||||
public class MyBatisPlusConfig {
|
||||
@Bean
|
||||
public MybatisPlusInterceptor paginationInterceptor() {
|
||||
MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
|
||||
//指定数据库方言
|
||||
interceptor.addInnerInterceptor(new PaginationInnerInterceptor(DbType.MYSQL));
|
||||
return interceptor;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
package com.commons;
|
||||
|
||||
/*
|
||||
* 用于统一返回
|
||||
*/
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Result<T> {
|
||||
private Integer code;//业务状态码
|
||||
private Boolean flag;//描述业务是否成功
|
||||
private String message;//本次操作的描述信息
|
||||
private T data;//实际携带到前端的数据
|
||||
|
||||
public static Result success(Integer code,String message,Object data){
|
||||
Result r = new Result<>();
|
||||
r.setFlag(true);
|
||||
r.setCode(code);
|
||||
r.setMessage(message);
|
||||
r.setData(data);
|
||||
return r;
|
||||
}
|
||||
|
||||
public static Result fail(Integer code,String message){
|
||||
Result r = new Result<>();
|
||||
r.setFlag(false);
|
||||
r.setCode(code);
|
||||
r.setMessage(message);
|
||||
return r;
|
||||
}
|
||||
}
|
@ -0,0 +1,60 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.commons.Result;
|
||||
import com.controller.from.findDevicePageFrom;
|
||||
import com.entity.Device;
|
||||
import com.service.DeviceService;
|
||||
import com.service.dto.devicePageDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/device")
|
||||
public class DeviceController {
|
||||
|
||||
@Autowired
|
||||
DeviceService deviceService;
|
||||
@PostMapping("/devicePage")
|
||||
public Result devicePage(@RequestBody findDevicePageFrom map) throws Exception{
|
||||
|
||||
IPage<devicePageDto> devicePageDtoIPage = deviceService.devicePage(map);
|
||||
return Result.success(200,"查询成功",devicePageDtoIPage);
|
||||
}
|
||||
|
||||
@PostMapping("/addDevice")
|
||||
public Result addDevice(@RequestBody Device map) throws Exception{
|
||||
|
||||
deviceService.addDevice(map);
|
||||
return Result.success(200,"添加成功",null);
|
||||
}
|
||||
@PostMapping("/modifyDevice")
|
||||
public Result modifyDevice(@RequestBody Device map) throws Exception{
|
||||
|
||||
deviceService.modifyDevice(map);
|
||||
return Result.success(200,"维护成功",null);
|
||||
}
|
||||
@PostMapping("/delDevice")
|
||||
public Result delDevice(@RequestBody HashMap<String,String> map) throws Exception{
|
||||
String id = map.get("id");
|
||||
deviceService.delDevice(id);
|
||||
return Result.success(200,"报废",null);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,46 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.commons.Result;
|
||||
import com.controller.from.findDevicePageFrom;
|
||||
import com.entity.Devicecategory;
|
||||
import com.mapper.DevicecategoryMapper;
|
||||
import com.service.DeviceService;
|
||||
import com.service.dto.devicePageDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/devicecategory")
|
||||
public class DevicecategoryController {
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
DevicecategoryMapper devicecategoryMapper;
|
||||
@PostMapping("/devicecategoryAll")
|
||||
public Result devicecategoryAll() throws Exception{
|
||||
|
||||
List<Devicecategory> devicecategories = devicecategoryMapper.selectList(new QueryWrapper<>());
|
||||
return Result.success(200,"查询成功",devicecategories);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,39 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.commons.Result;
|
||||
import com.entity.Devicecategory;
|
||||
import com.entity.Location;
|
||||
import com.mapper.DevicecategoryMapper;
|
||||
import com.mapper.LocationMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/location")
|
||||
public class LocationController {
|
||||
|
||||
@Autowired
|
||||
LocationMapper locationMapper;
|
||||
@PostMapping("/locationAll")
|
||||
public Result locationAll() throws Exception{
|
||||
|
||||
List<Location> locations = locationMapper.selectList(new QueryWrapper<>());
|
||||
return Result.success(200,"查询成功",locations);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.commons.Result;
|
||||
import com.controller.from.findDevicePageFrom;
|
||||
import com.entity.Maintenancerecord;
|
||||
import com.service.DeviceService;
|
||||
import com.service.MaintenancerecordService;
|
||||
import com.service.dto.devicePageDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/maintenancerecord")
|
||||
public class MaintenancerecordController {
|
||||
@Autowired
|
||||
MaintenancerecordService maintenancerecordService;
|
||||
@PostMapping("/maintenancerecordPage")
|
||||
public Result maintenancerecordPage(@RequestBody HashMap<String,String> map) throws Exception{
|
||||
|
||||
Page<Maintenancerecord> objectPage = new Page<>(Integer.valueOf(map.get("current")),Integer.valueOf(map.get("size")));
|
||||
IPage<Maintenancerecord> maintenancerecordPage = maintenancerecordService.page(objectPage);
|
||||
return Result.success(200,"查询成功",maintenancerecordPage);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.commons.Result;
|
||||
import com.entity.Maintenancerecord;
|
||||
import com.entity.Operationlog;
|
||||
import com.service.MaintenancerecordService;
|
||||
import com.service.OperationlogService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/operationlog")
|
||||
public class OperationlogController {
|
||||
|
||||
|
||||
@Autowired
|
||||
OperationlogService maintenancerecordService;
|
||||
@PostMapping("/OperationlogPage")
|
||||
public Result OperationlogPage(@RequestBody HashMap<String,String> map) throws Exception{
|
||||
|
||||
Page<Operationlog> objectPage = new Page<>(Integer.valueOf(map.get("current")),Integer.valueOf(map.get("size")));
|
||||
IPage<Operationlog> maintenancerecordPage = maintenancerecordService.page(objectPage);
|
||||
return Result.success(200,"查询成功",maintenancerecordPage);
|
||||
}
|
||||
}
|
||||
|
@ -0,0 +1,21 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/role")
|
||||
public class RoleController {
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.commons.Result;
|
||||
import com.entity.Maintenancerecord;
|
||||
import com.entity.Scraprecord;
|
||||
import com.service.MaintenancerecordService;
|
||||
import com.service.ScraprecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/scraprecord")
|
||||
public class ScraprecordController {
|
||||
|
||||
@Autowired
|
||||
ScraprecordService maintenancerecordService;
|
||||
@PostMapping("/maintenancerecordPage")
|
||||
public Result maintenancerecordPage(@RequestBody HashMap<String,String> map) throws Exception{
|
||||
|
||||
Page<Scraprecord> objectPage = new Page<>(Integer.valueOf(map.get("current")),Integer.valueOf(map.get("size")));
|
||||
IPage<Scraprecord> maintenancerecordPage = maintenancerecordService.page(objectPage);
|
||||
return Result.success(200,"查询成功",maintenancerecordPage);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,43 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.commons.Result;
|
||||
import com.entity.Maintenancerecord;
|
||||
import com.entity.Supplier;
|
||||
import com.service.MaintenancerecordService;
|
||||
import com.service.SupplierService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/supplier")
|
||||
public class SupplierController {
|
||||
|
||||
@Autowired
|
||||
SupplierService maintenancerecordService;
|
||||
@PostMapping("/maintenancerecordPage")
|
||||
public Result maintenancerecordPage(@RequestBody HashMap<String,String> map) throws Exception{
|
||||
|
||||
Page<Supplier> objectPage = new Page<>(Integer.valueOf(map.get("current")),Integer.valueOf(map.get("size")));
|
||||
IPage<Supplier> maintenancerecordPage = maintenancerecordService.page(objectPage);
|
||||
return Result.success(200,"查询成功",maintenancerecordPage);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,55 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.commons.Result;
|
||||
import com.entity.Maintenancerecord;
|
||||
import com.entity.Usagerecord;
|
||||
import com.entity.User;
|
||||
import com.mapper.UserMapper;
|
||||
import com.service.MaintenancerecordService;
|
||||
import com.service.UsagerecordService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/usagerecord")
|
||||
public class UsagerecordController {
|
||||
|
||||
@Autowired
|
||||
UsagerecordService usagerecordService;
|
||||
@Autowired
|
||||
UserMapper userMapper;
|
||||
@PostMapping("/usagerecordPage")
|
||||
public Result maintenancerecordPage(@RequestBody HashMap<String,String> map) throws Exception{
|
||||
|
||||
Page<Usagerecord> objectPage = new Page<>(Integer.valueOf(map.get("current")),Integer.valueOf(map.get("size")));
|
||||
IPage<Usagerecord> maintenancerecordPage = usagerecordService.page(objectPage);
|
||||
for (int i=0; i< maintenancerecordPage.getRecords().size();i++){
|
||||
|
||||
User user = userMapper.selectById(maintenancerecordPage.getRecords().get(i).getUserID());
|
||||
maintenancerecordPage.getRecords().get(i).setUsageType(user.getUserName());
|
||||
|
||||
}
|
||||
|
||||
|
||||
return Result.success(200,"查询成功",maintenancerecordPage);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,73 @@
|
||||
package com.controller;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.commons.Result;
|
||||
import com.controller.from.findDevicePageFrom;
|
||||
import com.entity.Usagerecord;
|
||||
import com.entity.User;
|
||||
import com.mapper.UsagerecordMapper;
|
||||
import com.mapper.UserMapper;
|
||||
import com.service.DeviceService;
|
||||
import com.service.dto.devicePageDto;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import java.time.ZoneId;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 前端控制器
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/user")
|
||||
public class UserController {
|
||||
|
||||
@Autowired
|
||||
UserMapper userMapper;
|
||||
@Autowired
|
||||
UsagerecordMapper usagerecordMapper;
|
||||
|
||||
@PostMapping("/login")
|
||||
public Result login(@RequestBody HashMap<String,String> map) throws Exception{
|
||||
String username = map.get("username");
|
||||
String password = map.get("password");
|
||||
|
||||
|
||||
User userName = userMapper.selectOne(new QueryWrapper<User>().eq("UserName", username));
|
||||
if (userName == null) {
|
||||
return Result.success(500,"用户不存在",null);
|
||||
}
|
||||
if (!userName.getPassword().equals(password)) {
|
||||
Usagerecord usagerecord = new Usagerecord();
|
||||
usagerecord.setUserID(userName.getUserID());
|
||||
usagerecord.setUsageDate(LocalDate.now());
|
||||
usagerecord.setUsageTime(LocalTime.now(ZoneId.of("UTC")));
|
||||
usagerecord.setUsageDesc("登录失败");
|
||||
usagerecordMapper.insert(usagerecord);
|
||||
return Result.success(500,"密码不对",null);
|
||||
}
|
||||
|
||||
Usagerecord usagerecord = new Usagerecord();
|
||||
usagerecord.setUserID(userName.getUserID());
|
||||
usagerecord.setUsageDate(LocalDate.now());
|
||||
usagerecord.setUsageTime(LocalTime.now(ZoneId.of("UTC")));
|
||||
usagerecord.setUsageDesc("登录成功");
|
||||
usagerecordMapper.insert(usagerecord);
|
||||
return Result.success(200,"登录成功",userName);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,15 @@
|
||||
package com.controller.from;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import lombok.Data;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
@Data
|
||||
public class findDevicePageFrom {
|
||||
private Long size;
|
||||
private Long current;
|
||||
private String deviceName;
|
||||
private Integer deviceType;
|
||||
private Integer location;
|
||||
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("device")
|
||||
public class Device implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "DeviceID", type = IdType.AUTO)
|
||||
private Integer deviceID;
|
||||
|
||||
@TableField("DeviceName")
|
||||
private String deviceName;
|
||||
|
||||
@TableField("DeviceType")
|
||||
private Integer deviceType;
|
||||
|
||||
@TableField("Model")
|
||||
private String model;
|
||||
|
||||
@TableField("PurchaseDate")
|
||||
private LocalDate purchaseDate;
|
||||
|
||||
@TableField("Status")
|
||||
private String status;
|
||||
|
||||
@TableField("Location")
|
||||
private Integer location;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("devicecategory")
|
||||
public class Devicecategory implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "CategoryID", type = IdType.AUTO)
|
||||
private Integer categoryID;
|
||||
|
||||
@TableField("CategoryName")
|
||||
private String categoryName;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("location")
|
||||
public class Location implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "LocationID", type = IdType.AUTO)
|
||||
private Integer locationID;
|
||||
|
||||
@TableField("LocationName")
|
||||
private String locationName;
|
||||
|
||||
@TableField("LocationDescription")
|
||||
private String locationDescription;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,55 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("maintenancerecord")
|
||||
public class Maintenancerecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "MaintenanceID", type = IdType.AUTO)
|
||||
private Integer maintenanceID;
|
||||
|
||||
@TableField("DeviceID")
|
||||
private Integer deviceID;
|
||||
|
||||
@TableField("MaintenanceType")
|
||||
private String maintenanceType;
|
||||
|
||||
@TableField("MaintenanceDate")
|
||||
private LocalDate maintenanceDate;
|
||||
|
||||
@TableField("Technician")
|
||||
private String technician;
|
||||
|
||||
@TableField("MaintenanceDetails")
|
||||
private String maintenanceDetails;
|
||||
|
||||
@TableField("MaintenanceCost")
|
||||
private BigDecimal maintenanceCost;
|
||||
|
||||
@TableField("NextMaintenanceDate")
|
||||
private LocalDate nextMaintenanceDate;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("operationlog")
|
||||
public class Operationlog implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "LogID", type = IdType.AUTO)
|
||||
private Integer logID;
|
||||
|
||||
@TableField("OperationType")
|
||||
private String operationType;
|
||||
|
||||
@TableField("OperationTime")
|
||||
private LocalDate operationTime;
|
||||
|
||||
@TableField("OperationDescription")
|
||||
private String operationDescription;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("role")
|
||||
public class Role implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "RoleID", type = IdType.AUTO)
|
||||
private Integer roleID;
|
||||
|
||||
@TableField("RoleName")
|
||||
private String roleName;
|
||||
|
||||
@TableField("PermissionDescription")
|
||||
private String permissionDescription;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("scraprecord")
|
||||
public class Scraprecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "ScrapID", type = IdType.AUTO)
|
||||
private Integer scrapID;
|
||||
|
||||
@TableField("DeviceID")
|
||||
private Integer deviceID;
|
||||
|
||||
@TableField("ScrapDate")
|
||||
private LocalDate scrapDate;
|
||||
|
||||
@TableField("ScrapReason")
|
||||
private String scrapReason;
|
||||
|
||||
@TableField("DisposalMethod")
|
||||
private String disposalMethod;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("supplier")
|
||||
public class Supplier implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "SupplierID", type = IdType.AUTO)
|
||||
private Integer supplierID;
|
||||
|
||||
@TableField("SupplierName")
|
||||
private String supplierName;
|
||||
|
||||
@TableField("ContactPerson")
|
||||
private String contactPerson;
|
||||
|
||||
@TableField("ContactPhone")
|
||||
private String contactPhone;
|
||||
|
||||
@TableField("Address")
|
||||
private String address;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,52 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalTime;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("usagerecord")
|
||||
public class Usagerecord implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "UsageID", type = IdType.AUTO)
|
||||
private Integer usageID;
|
||||
|
||||
@TableField("DeviceID")
|
||||
private Integer deviceID;
|
||||
|
||||
@TableField("UserID")
|
||||
private Integer userID;
|
||||
|
||||
@TableField("UsageDate")
|
||||
private LocalDate usageDate;
|
||||
|
||||
@TableField("UsageTime")
|
||||
private LocalTime usageTime;
|
||||
|
||||
@TableField("UsageType")
|
||||
private String usageType;
|
||||
|
||||
@TableField("UsageDesc")
|
||||
private String usageDesc;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
package com.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import java.io.Serializable;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
*
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
@Accessors(chain = true)
|
||||
@TableName("user")
|
||||
public class User implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@TableId(value = "UserID", type = IdType.AUTO)
|
||||
private Integer userID;
|
||||
|
||||
@TableField("UserName")
|
||||
private String userName;
|
||||
|
||||
@TableField("Password")
|
||||
private String password;
|
||||
|
||||
@TableField("Role")
|
||||
private Integer role;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Device;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceMapper extends BaseMapper<Device> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Devicecategory;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface DevicecategoryMapper extends BaseMapper<Devicecategory> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Location;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface LocationMapper extends BaseMapper<Location> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Maintenancerecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface MaintenancerecordMapper extends BaseMapper<Maintenancerecord> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Operationlog;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface OperationlogMapper extends BaseMapper<Operationlog> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Role;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface RoleMapper extends BaseMapper<Role> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Scraprecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface ScraprecordMapper extends BaseMapper<Scraprecord> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Supplier;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface SupplierMapper extends BaseMapper<Supplier> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.Usagerecord;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface UsagerecordMapper extends BaseMapper<Usagerecord> {
|
||||
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
package com.mapper;
|
||||
|
||||
import com.entity.User;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Mapper
|
||||
public interface UserMapper extends BaseMapper<User> {
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package com.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.controller.from.findDevicePageFrom;
|
||||
import com.entity.Device;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.service.dto.devicePageDto;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface DeviceService extends IService<Device> {
|
||||
|
||||
IPage<devicePageDto> devicePage(findDevicePageFrom map);
|
||||
|
||||
void delDevice(String id);
|
||||
|
||||
void addDevice(Device map);
|
||||
|
||||
void modifyDevice(Device map);
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.Devicecategory;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface DevicecategoryService extends IService<Devicecategory> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.Location;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface LocationService extends IService<Location> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.Maintenancerecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface MaintenancerecordService extends IService<Maintenancerecord> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.Operationlog;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface OperationlogService extends IService<Operationlog> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.Role;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface RoleService extends IService<Role> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.Scraprecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface ScraprecordService extends IService<Scraprecord> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.Supplier;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface SupplierService extends IService<Supplier> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.Usagerecord;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface UsagerecordService extends IService<Usagerecord> {
|
||||
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.service;
|
||||
|
||||
import com.entity.User;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
public interface UserService extends IService<User> {
|
||||
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
package com.service.dto;
|
||||
|
||||
import com.entity.Device;
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class devicePageDto extends Device {
|
||||
String type;
|
||||
String locationName;
|
||||
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.controller.from.findDevicePageFrom;
|
||||
import com.entity.*;
|
||||
import com.mapper.*;
|
||||
import com.service.DeviceService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.service.dto.devicePageDto;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class DeviceServiceImpl extends ServiceImpl<DeviceMapper, Device> implements DeviceService {
|
||||
@Autowired
|
||||
DeviceMapper deviceMapper;
|
||||
@Autowired
|
||||
DevicecategoryMapper devicecategoryMapper;
|
||||
@Autowired
|
||||
LocationMapper locationMapper;
|
||||
@Autowired
|
||||
ScraprecordMapper scraprecordMapper;
|
||||
@Autowired
|
||||
OperationlogMapper operationlogMapper;
|
||||
@Autowired
|
||||
MaintenancerecordMapper maintenancerecordMapper;
|
||||
|
||||
@Override
|
||||
public IPage<devicePageDto> devicePage(findDevicePageFrom map) {
|
||||
Page<Device> objectPage = new Page<>(map.getCurrent(),map.getSize());
|
||||
QueryWrapper<Device> objectQueryWrapper = new QueryWrapper<>();
|
||||
objectQueryWrapper.eq("Status",0);
|
||||
if (map.getDeviceType()!=null){
|
||||
objectQueryWrapper.eq("DeviceType",map.getDeviceType());
|
||||
}
|
||||
if (map.getLocation()!=null){
|
||||
objectQueryWrapper.eq("Location",map.getLocation());
|
||||
}
|
||||
IPage<Device> deviceIPage = deviceMapper.selectPage(objectPage, objectQueryWrapper);
|
||||
List<Device> records = deviceIPage.getRecords();
|
||||
List<devicePageDto> devicePageDtos = new ArrayList<>();
|
||||
for (Device record : records) {
|
||||
devicePageDto devicePageDto = new devicePageDto();
|
||||
BeanUtils.copyProperties(record,devicePageDto);
|
||||
Devicecategory devicecategory = devicecategoryMapper.selectById(record.getDeviceType());
|
||||
devicePageDto.setType(devicecategory.getCategoryName());
|
||||
Location location = locationMapper.selectById(record.getLocation());
|
||||
devicePageDto.setLocationName(location.getLocationName());
|
||||
|
||||
devicePageDtos.add(devicePageDto);
|
||||
}
|
||||
IPage<devicePageDto> devicePageDtoIPage = new Page<>();
|
||||
BeanUtils.copyProperties(deviceIPage,devicePageDtoIPage);
|
||||
devicePageDtoIPage.setRecords(devicePageDtos);
|
||||
return devicePageDtoIPage;
|
||||
}
|
||||
@Override
|
||||
public void addDevice(Device map) {
|
||||
map.setPurchaseDate(LocalDate.now());
|
||||
deviceMapper.insert(map);
|
||||
Operationlog operationlog = new Operationlog();
|
||||
operationlog.setOperationType("运行");
|
||||
// 获取当前日期
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
operationlog.setOperationTime(currentDate);
|
||||
operationlog.setOperationDescription("成功");
|
||||
operationlogMapper.insert(operationlog);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void modifyDevice(Device map) {
|
||||
deviceMapper.updateById(map);
|
||||
Maintenancerecord maintenancerecord = new Maintenancerecord();
|
||||
maintenancerecord.setDeviceID(map.getDeviceID());
|
||||
maintenancerecord.setMaintenanceType("日常维护");
|
||||
maintenancerecord.setMaintenanceDate(LocalDate.now());
|
||||
maintenancerecord.setMaintenanceDetails("成功");
|
||||
maintenancerecord.setMaintenanceCost(new BigDecimal(100));
|
||||
maintenancerecord.setTechnician("admin");
|
||||
maintenancerecord.setTechnician("admin");
|
||||
LocalDate currentDate = LocalDate.now();
|
||||
LocalDate datePlusOneMonth = currentDate.plusMonths(1);
|
||||
maintenancerecord.setNextMaintenanceDate(datePlusOneMonth);
|
||||
maintenancerecordMapper.insert(maintenancerecord);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void delDevice(String id) {
|
||||
deviceMapper.update(null,new UpdateWrapper<Device>().eq("DeviceID",id).set("Status",1));
|
||||
|
||||
Scraprecord scraprecord = new Scraprecord();
|
||||
scraprecord.setDeviceID(Integer.valueOf(id));
|
||||
scraprecord.setScrapReason("日常报废");
|
||||
scraprecord.setDisposalMethod("设备到期");
|
||||
scraprecord.setScrapDate(LocalDate.now());
|
||||
scraprecordMapper.insert(scraprecord);
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.Devicecategory;
|
||||
import com.mapper.DevicecategoryMapper;
|
||||
import com.service.DevicecategoryService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class DevicecategoryServiceImpl extends ServiceImpl<DevicecategoryMapper, Devicecategory> implements DevicecategoryService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.Location;
|
||||
import com.mapper.LocationMapper;
|
||||
import com.service.LocationService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> implements LocationService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.Maintenancerecord;
|
||||
import com.mapper.MaintenancerecordMapper;
|
||||
import com.service.MaintenancerecordService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class MaintenancerecordServiceImpl extends ServiceImpl<MaintenancerecordMapper, Maintenancerecord> implements MaintenancerecordService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.Operationlog;
|
||||
import com.mapper.OperationlogMapper;
|
||||
import com.service.OperationlogService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class OperationlogServiceImpl extends ServiceImpl<OperationlogMapper, Operationlog> implements OperationlogService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.Role;
|
||||
import com.mapper.RoleMapper;
|
||||
import com.service.RoleService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class RoleServiceImpl extends ServiceImpl<RoleMapper, Role> implements RoleService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.Scraprecord;
|
||||
import com.mapper.ScraprecordMapper;
|
||||
import com.service.ScraprecordService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class ScraprecordServiceImpl extends ServiceImpl<ScraprecordMapper, Scraprecord> implements ScraprecordService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.Supplier;
|
||||
import com.mapper.SupplierMapper;
|
||||
import com.service.SupplierService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> implements SupplierService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.Usagerecord;
|
||||
import com.mapper.UsagerecordMapper;
|
||||
import com.service.UsagerecordService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class UsagerecordServiceImpl extends ServiceImpl<UsagerecordMapper, Usagerecord> implements UsagerecordService {
|
||||
|
||||
}
|
@ -0,0 +1,20 @@
|
||||
package com.service.impl;
|
||||
|
||||
import com.entity.User;
|
||||
import com.mapper.UserMapper;
|
||||
import com.service.UserService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 刘宇豪
|
||||
* @since 2024年12月28日
|
||||
*/
|
||||
@Service
|
||||
public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements UserService {
|
||||
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/a?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||
username: "root"
|
||||
password: "013013"
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
mybatis-plus:
|
||||
mapperLocations: classpath:/mapper/*Mapper.xml
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
server:
|
||||
port: 80
|
||||
tomcat:
|
||||
basedir: /home/tmp
|
@ -0,0 +1,16 @@
|
||||
<?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.mapper.DevicecategoryMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.Devicecategory">
|
||||
<id column="CategoryID" property="categoryID" />
|
||||
<result column="CategoryName" property="categoryName" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
CategoryID, CategoryName
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,17 @@
|
||||
<?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.mapper.LocationMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.Location">
|
||||
<id column="LocationID" property="locationID" />
|
||||
<result column="LocationName" property="locationName" />
|
||||
<result column="LocationDescription" property="locationDescription" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
LocationID, LocationName, LocationDescription
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,22 @@
|
||||
<?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.mapper.MaintenancerecordMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.Maintenancerecord">
|
||||
<id column="MaintenanceID" property="maintenanceID" />
|
||||
<result column="DeviceID" property="deviceID" />
|
||||
<result column="MaintenanceType" property="maintenanceType" />
|
||||
<result column="MaintenanceDate" property="maintenanceDate" />
|
||||
<result column="Technician" property="technician" />
|
||||
<result column="MaintenanceDetails" property="maintenanceDetails" />
|
||||
<result column="MaintenanceCost" property="maintenanceCost" />
|
||||
<result column="NextMaintenanceDate" property="nextMaintenanceDate" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
MaintenanceID, DeviceID, MaintenanceType, MaintenanceDate, Technician, MaintenanceDetails, MaintenanceCost, NextMaintenanceDate
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +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.mapper.OperationlogMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.Operationlog">
|
||||
<id column="LogID" property="logID" />
|
||||
<result column="OperationType" property="operationType" />
|
||||
<result column="OperationTime" property="operationTime" />
|
||||
<result column="OperationDescription" property="operationDescription" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
LogID, OperationType, OperationTime, OperationDescription
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,17 @@
|
||||
<?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.mapper.RoleMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.Role">
|
||||
<id column="RoleID" property="roleID" />
|
||||
<result column="RoleName" property="roleName" />
|
||||
<result column="PermissionDescription" property="permissionDescription" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
RoleID, RoleName, PermissionDescription
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,19 @@
|
||||
<?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.mapper.ScraprecordMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.Scraprecord">
|
||||
<id column="ScrapID" property="scrapID" />
|
||||
<result column="DeviceID" property="deviceID" />
|
||||
<result column="ScrapDate" property="scrapDate" />
|
||||
<result column="ScrapReason" property="scrapReason" />
|
||||
<result column="DisposalMethod" property="disposalMethod" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
ScrapID, DeviceID, ScrapDate, ScrapReason, DisposalMethod
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,19 @@
|
||||
<?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.mapper.SupplierMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.Supplier">
|
||||
<id column="SupplierID" property="supplierID" />
|
||||
<result column="SupplierName" property="supplierName" />
|
||||
<result column="ContactPerson" property="contactPerson" />
|
||||
<result column="ContactPhone" property="contactPhone" />
|
||||
<result column="Address" property="address" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
SupplierID, SupplierName, ContactPerson, ContactPhone, Address
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,21 @@
|
||||
<?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.mapper.UsagerecordMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.Usagerecord">
|
||||
<id column="UsageID" property="usageID" />
|
||||
<result column="DeviceID" property="deviceID" />
|
||||
<result column="UserID" property="userID" />
|
||||
<result column="UsageDate" property="usageDate" />
|
||||
<result column="UsageTime" property="usageTime" />
|
||||
<result column="UsageType" property="usageType" />
|
||||
<result column="UsageDesc" property="usageDesc" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
UsageID, DeviceID, UserID, UsageDate, UsageTime, UsageType, UsageDesc
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +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.mapper.UserMapper">
|
||||
|
||||
<!-- 通用查询映射结果 -->
|
||||
<resultMap id="BaseResultMap" type="com.entity.User">
|
||||
<id column="UserID" property="userID" />
|
||||
<result column="UserName" property="userName" />
|
||||
<result column="Password" property="password" />
|
||||
<result column="Role" property="role" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
UserID, UserName, Password, Role
|
||||
</sql>
|
||||
|
||||
</mapper>
|
@ -0,0 +1,83 @@
|
||||
*{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
body{
|
||||
background-image: url("../images/bg2.jpg");
|
||||
}
|
||||
#main{
|
||||
background-color: rgba(255, 255, 255, 0.9);
|
||||
width: 400px;
|
||||
height: 500px;
|
||||
margin: 60px auto 0rem;
|
||||
border-radius: 15px;
|
||||
}
|
||||
.lo{
|
||||
width: 350px;
|
||||
height: 80px;
|
||||
border-bottom: 1px solid black;
|
||||
margin: 0 auto;
|
||||
}
|
||||
/* .lo::after{
|
||||
content: "";
|
||||
display: block;
|
||||
clear: both;
|
||||
} */
|
||||
#top{
|
||||
width: 100%;
|
||||
height: 100px;
|
||||
margin: 0 auto ;
|
||||
background-color: rgba(120, 120, 120, 0.3);
|
||||
color: aliceblue;
|
||||
font-size: 30px;
|
||||
text-align: center;
|
||||
line-height: 100px;
|
||||
}
|
||||
.bg{
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
background-image: url("../images/icon-login.png");
|
||||
float: left;
|
||||
margin-top: 45px;
|
||||
}
|
||||
.inp{
|
||||
margin-top: 45px;
|
||||
float: left;
|
||||
background-color: transparent;
|
||||
border: 0;
|
||||
outline: none;
|
||||
}
|
||||
.t1{
|
||||
background-position:-52px 0;
|
||||
}
|
||||
.t2{
|
||||
background-position:-104px 0;
|
||||
}
|
||||
#xl{
|
||||
width: 350px;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
|
||||
margin: 30px auto 0;
|
||||
display: block;
|
||||
}
|
||||
#btn{
|
||||
width: 350px;
|
||||
height: 50px;
|
||||
text-align: center;
|
||||
background-color: rgba(0, 20, 255, 0.9);
|
||||
margin: 30px auto 0;
|
||||
display: block;
|
||||
/* border: 0; */
|
||||
color: white;
|
||||
|
||||
}
|
||||
#foot{
|
||||
margin-top: 50px;
|
||||
color: white;
|
||||
text-align: center;
|
||||
}
|
||||
#a1{
|
||||
color: white;
|
||||
text-decoration: none;
|
||||
}
|
@ -0,0 +1,293 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<!-- <link rel="stylesheet" href="./css/element.css">-->
|
||||
<script src="../js/vue.js"></script>
|
||||
<script src="../js/axios.min.js"></script>
|
||||
<!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
|
||||
<script src="../js/element.js"></script>
|
||||
|
||||
<script src="../js/jquery-1.12.4.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<template>
|
||||
<el-select v-model="devicecategory" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in devicecategoryAll"
|
||||
:key="item.categoryID"
|
||||
:label="item.categoryName"
|
||||
:value="item.categoryID">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template>
|
||||
<el-select v-model="location" placeholder="请选择">
|
||||
<el-option
|
||||
v-for="item in locationAll"
|
||||
:key="item.locationID"
|
||||
:label="item.locationName"
|
||||
:value="item.locationID">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<el-button @click="devicePage()" type="primary">查找</el-button>
|
||||
<el-button v-if="use === 'admin'" @click="dialogVisible = true" type="primary">运行</el-button>
|
||||
|
||||
<template>
|
||||
<el-table
|
||||
:data="page.records"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
fixed
|
||||
prop="deviceName"
|
||||
label="设备名称"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="type"
|
||||
label="设备类型"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="model"
|
||||
label="型号"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="purchaseDate"
|
||||
label="入场时间"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="locationName"
|
||||
label="位置"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
fixed="right"
|
||||
label="操作"
|
||||
width="100">
|
||||
<template slot-scope="scope">
|
||||
<el-button v-if="use === 'admin'" @click="delDevice(scope.row.deviceID)" type="text" size="small">报废</el-button>
|
||||
<el-button v-if="use === 'admin'" @click="modifyDevice(scope.row)" type="text" size="small">维护</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<el-pagination
|
||||
small
|
||||
@current-change="handleCurrentChange"
|
||||
layout="prev, pager, next"
|
||||
:total="50">
|
||||
</el-pagination>
|
||||
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="运行设备"
|
||||
:visible.sync="dialogVisible"
|
||||
width="30%"
|
||||
>
|
||||
<el-input v-model="addDevice.deviceName" placeholder="输入设备名字"></el-input>
|
||||
<el-input v-model="addDevice.model" placeholder="输入设备型号"></el-input>
|
||||
<template>
|
||||
<el-select v-model="devicecategory" placeholder="请选择设备类型">
|
||||
<el-option
|
||||
v-for="item in devicecategoryAll"
|
||||
:key="item.categoryID"
|
||||
:label="item.categoryName"
|
||||
:value="item.categoryID">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template>
|
||||
<el-select v-model="location" placeholder="请选择设备位置">
|
||||
<el-option
|
||||
v-for="item in locationAll"
|
||||
:key="item.locationID"
|
||||
:label="item.locationName"
|
||||
:value="item.locationID">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="addDeviceOk ">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
|
||||
|
||||
<el-dialog
|
||||
title="维修设备"
|
||||
:visible.sync="dialogVisible1"
|
||||
width="30%"
|
||||
>
|
||||
<el-input v-model="modifyDevice1.deviceName" placeholder="输入设备名字"></el-input>
|
||||
<el-input v-model="modifyDevice1.model" placeholder="输入设备型号"></el-input>
|
||||
<template>
|
||||
<el-select v-model="devicecategory" placeholder="请选择设备类型">
|
||||
<el-option
|
||||
v-for="item in devicecategoryAll"
|
||||
:key="item.categoryID"
|
||||
:label="item.categoryName"
|
||||
:value="item.categoryID">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<template>
|
||||
<el-select v-model="location" placeholder="请选择设备位置">
|
||||
<el-option
|
||||
v-for="item in locationAll"
|
||||
:key="item.locationID"
|
||||
:label="item.locationName"
|
||||
:value="item.locationID">
|
||||
</el-option>
|
||||
</el-select>
|
||||
</template>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible1 = false">取 消</el-button>
|
||||
<el-button type="primary" @click="modifyDeviceOk ">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
page: {
|
||||
size: 5,
|
||||
current: 1
|
||||
},
|
||||
dialogVisible:false,
|
||||
device:[],
|
||||
use:"",
|
||||
dialogVisible1:false,
|
||||
addDevice:{},
|
||||
modifyDevice1:{},
|
||||
devicecategoryAll:[],
|
||||
devicecategory:"",
|
||||
locationAll:[],
|
||||
|
||||
location:""
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.topage(val)
|
||||
},
|
||||
topage(current) {
|
||||
this.page.current = current
|
||||
axios.post("/device/devicePage", this.page).then(resp => {
|
||||
this.page = resp.data.data
|
||||
})
|
||||
},
|
||||
devicePage() {
|
||||
this.page.deviceType=this.devicecategory
|
||||
this.page.location=this.location
|
||||
|
||||
axios.post("/device/devicePage", this.page)
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
this.page = resp.data.data
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
findDevicecategoryAll() {
|
||||
axios.post("/devicecategory/devicecategoryAll")
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
this.devicecategoryAll = resp.data.data
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
delDevice(obj){
|
||||
axios.post("/device/delDevice",{
|
||||
id:obj
|
||||
})
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
alert(resp.data.message)
|
||||
this.devicePage();
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
findLocationAll() {
|
||||
axios.post("/location/locationAll")
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
this.locationAll = resp.data.data
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
modifyDevice(obj){
|
||||
this.modifyDevice1=obj
|
||||
this.devicecategory=obj.deviceType
|
||||
this.location=obj.location
|
||||
this.dialogVisible1=true
|
||||
},
|
||||
modifyDeviceOk(obj){
|
||||
this.modifyDevice1.deviceType=this.devicecategory
|
||||
this.modifyDevice1.location=this.location
|
||||
axios.post("/device/modifyDevice",this.modifyDevice1)
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
alert(resp.data.message)
|
||||
this.dialogVisible1=false
|
||||
this.location=""
|
||||
this.devicecategory=""
|
||||
this.devicePage();
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
addDeviceOk(){
|
||||
this.addDevice.deviceType=this.devicecategory
|
||||
this.addDevice.location=this.location
|
||||
axios.post("/device/addDevice",this.addDevice)
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
alert(resp.data.message)
|
||||
this.dialogVisible=false
|
||||
this.location=""
|
||||
this.devicecategory=""
|
||||
this.devicePage();
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.devicePage();
|
||||
this.findDevicecategoryAll();
|
||||
this.findLocationAll();
|
||||
this.use = JSON.parse(sessionStorage.getItem("loginUser")).userName;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,23 @@
|
||||
|
||||
document.getElementById("username").onchange=function () {
|
||||
|
||||
let username = this.value
|
||||
let reg=new RegExp(/1[3-9][0-9]{9}/g)
|
||||
let btn = document.getElementById("btn")
|
||||
if(reg.test(username)){
|
||||
let $c=document.getElementById("checkPhone")
|
||||
$c.innerText="格式对"
|
||||
// $c.css("color","red")
|
||||
$c.style.cssText = "color:blue; font-size: 10px; ";
|
||||
btn.removeAttribute("disabled")
|
||||
}else{
|
||||
let $c=document.getElementById("checkPhone")
|
||||
$c.style.cssText = "color:red; font-size: 10px; ";
|
||||
$c.innerText="格式不对"
|
||||
// $c.css("color","blue")
|
||||
btn.setAttribute("disabled","disabled")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="../css/landc.css">
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
|
||||
<script src="../js/vue.js"></script>
|
||||
<script src="../js/axios.min.js"></script>
|
||||
<script src="https://unpkg.com/element-ui/lib/index.js"></script>
|
||||
|
||||
<script src="../js/jquery-1.12.4.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<div id="main">
|
||||
<form action="/login" id="loginForm">
|
||||
<div id="top">
|
||||
设备管理系统
|
||||
</div>
|
||||
<div class="lo">
|
||||
<div class="bg t1"></div>
|
||||
<input class="inp" id="username" name="username" v-model="user.username" type="text" placeholder="请输入用户名">
|
||||
</div>
|
||||
<div class="lo">
|
||||
<div class="bg t2"></div>
|
||||
<input class="inp" id="password" v-model="user.password" type="password" placeholder="请输入用密码">
|
||||
</div>
|
||||
<div>
|
||||
<input type="button" @click="login" value="立即登陆" id="btn">
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<p id=foot>
|
||||
©版本所有 2024期 |
|
||||
<a id=a1 href="https://www.baidu.com/">山东科技大学</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el:'#app',
|
||||
data:{
|
||||
user:{
|
||||
username:"",
|
||||
password:""
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
methods:{
|
||||
login(){
|
||||
//向后端发送请求
|
||||
axios.post("/user/login",this.user).then(resp=>{
|
||||
//sessionStrorage浏览器缓存浏览器关闭失效
|
||||
//localStrorage文件系统
|
||||
|
||||
if(resp.data.code==200){
|
||||
sessionStorage.setItem("loginUser",JSON.stringify(resp.data.data))
|
||||
|
||||
location.href="http://localhost/index.html"//通过location对象跳转
|
||||
|
||||
|
||||
}else {
|
||||
alert(resp.data.message)
|
||||
//location.reload()
|
||||
this.user.username=""
|
||||
this.user.password=""
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
<!-- <script src="../js/land.js" type="text/javascript"></script>-->
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,115 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<!-- <link rel="stylesheet" href="./css/element.css">-->
|
||||
<script src="../js/vue.js"></script>
|
||||
<script src="../js/axios.min.js"></script>
|
||||
<!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
|
||||
<script src="../js/element.js"></script>
|
||||
|
||||
<script src="../js/jquery-1.12.4.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<template>
|
||||
<el-table
|
||||
:data="page.records"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
fixed
|
||||
prop="maintenanceType"
|
||||
label="维护类型"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="maintenanceDate"
|
||||
label="维护日期"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="technician"
|
||||
label="维护人员"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="maintenanceDetails"
|
||||
label="维护详情"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="maintenanceCost"
|
||||
label="维护成本"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="nextMaintenanceDate"
|
||||
label="下次维护日期"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<el-pagination
|
||||
small
|
||||
@current-change="handleCurrentChange"
|
||||
layout="prev, pager, next"
|
||||
:total="50">
|
||||
</el-pagination>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
page: {
|
||||
size: 5,
|
||||
current: 1
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.topage(val)
|
||||
},
|
||||
topage(current) {
|
||||
this.page.current = current
|
||||
axios.post("/maintenancerecord/maintenancerecordPage", this.page).then(resp => {
|
||||
this.page = resp.data.data
|
||||
})
|
||||
},
|
||||
devicePage() {
|
||||
|
||||
|
||||
axios.post("/maintenancerecord/maintenancerecordPage", this.page)
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
this.page = resp.data.data
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
created() {
|
||||
this.devicePage();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<!-- <link rel="stylesheet" href="./css/element.css">-->
|
||||
<script src="../js/vue.js"></script>
|
||||
<script src="../js/axios.min.js"></script>
|
||||
<!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
|
||||
<script src="../js/element.js"></script>
|
||||
|
||||
<script src="../js/jquery-1.12.4.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<template>
|
||||
<el-table
|
||||
:data="page.records"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
fixed
|
||||
prop="operationType"
|
||||
label="操作类型"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operationTime"
|
||||
label="操作时间"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="operationDescription"
|
||||
label="描述"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<el-pagination
|
||||
small
|
||||
@current-change="handleCurrentChange"
|
||||
layout="prev, pager, next"
|
||||
:total="50">
|
||||
</el-pagination>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
page: {
|
||||
size: 5,
|
||||
current: 1
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.topage(val)
|
||||
},
|
||||
topage(current) {
|
||||
this.page.current = current
|
||||
axios.post("/operationlog/OperationlogPage", this.page).then(resp => {
|
||||
this.page = resp.data.data
|
||||
})
|
||||
},
|
||||
devicePage() {
|
||||
|
||||
|
||||
axios.post("/operationlog/OperationlogPage", this.page)
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
this.page = resp.data.data
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
created() {
|
||||
this.devicePage();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,100 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<!-- <link rel="stylesheet" href="./css/element.css">-->
|
||||
<script src="../js/vue.js"></script>
|
||||
<script src="../js/axios.min.js"></script>
|
||||
<!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
|
||||
<script src="../js/element.js"></script>
|
||||
|
||||
<script src="../js/jquery-1.12.4.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<template>
|
||||
<el-table
|
||||
:data="page.records"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
fixed
|
||||
prop="scrapDate"
|
||||
label="报废日期"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="scrapReason"
|
||||
label="报废愿意"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="disposalMethod"
|
||||
label="处置方法"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<el-pagination
|
||||
small
|
||||
@current-change="handleCurrentChange"
|
||||
layout="prev, pager, next"
|
||||
:total="50">
|
||||
</el-pagination>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
page: {
|
||||
size: 5,
|
||||
current: 1
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.topage(val)
|
||||
},
|
||||
topage(current) {
|
||||
this.page.current = current
|
||||
axios.post("/scraprecord/maintenancerecordPage", this.page).then(resp => {
|
||||
this.page = resp.data.data
|
||||
})
|
||||
},
|
||||
devicePage() {
|
||||
|
||||
|
||||
axios.post("/scraprecord/maintenancerecordPage", this.page)
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
this.page = resp.data.data
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
created() {
|
||||
this.devicePage();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<!-- <link rel="stylesheet" href="./css/element.css">-->
|
||||
<script src="../js/vue.js"></script>
|
||||
<script src="../js/axios.min.js"></script>
|
||||
<!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
|
||||
<script src="../js/element.js"></script>
|
||||
|
||||
<script src="../js/jquery-1.12.4.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<template>
|
||||
<el-table
|
||||
:data="page.records"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
fixed
|
||||
prop="supplierName"
|
||||
label="供应商名字"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="contactPerson"
|
||||
label="联系人"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="contactPhone"
|
||||
label="联系电话"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="address"
|
||||
label="联系地址"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<el-pagination
|
||||
small
|
||||
@current-change="handleCurrentChange"
|
||||
layout="prev, pager, next"
|
||||
:total="50">
|
||||
</el-pagination>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
page: {
|
||||
size: 5,
|
||||
current: 1
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.topage(val)
|
||||
},
|
||||
topage(current) {
|
||||
this.page.current = current
|
||||
axios.post("/supplier/maintenancerecordPage", this.page).then(resp => {
|
||||
this.page = resp.data.data
|
||||
})
|
||||
},
|
||||
devicePage() {
|
||||
|
||||
|
||||
axios.post("/supplier/maintenancerecordPage", this.page)
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
this.page = resp.data.data
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
created() {
|
||||
this.devicePage();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title></title>
|
||||
<link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
|
||||
<!-- <link rel="stylesheet" href="./css/element.css">-->
|
||||
<script src="../js/vue.js"></script>
|
||||
<script src="../js/axios.min.js"></script>
|
||||
<!-- <script src="https://unpkg.com/element-ui/lib/index.js"></script>-->
|
||||
<script src="../js/element.js"></script>
|
||||
|
||||
<script src="../js/jquery-1.12.4.js"></script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<div id="app">
|
||||
<template>
|
||||
<el-table
|
||||
:data="page.records"
|
||||
border
|
||||
style="width: 100%">
|
||||
<el-table-column
|
||||
fixed
|
||||
prop="usageType"
|
||||
label="登录人"
|
||||
width="150">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="usageDate"
|
||||
label="登录日期"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="usageTime"
|
||||
label="登录时间"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
prop="usageDesc"
|
||||
label="登录详情"
|
||||
width="120">
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</template>
|
||||
|
||||
<el-pagination
|
||||
small
|
||||
@current-change="handleCurrentChange"
|
||||
layout="prev, pager, next"
|
||||
:total="50">
|
||||
</el-pagination>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
new Vue({
|
||||
el: '#app',
|
||||
data: {
|
||||
page: {
|
||||
size: 5,
|
||||
current: 1
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
handleCurrentChange(val) {
|
||||
console.log(`当前页: ${val}`);
|
||||
this.topage(val)
|
||||
},
|
||||
topage(current) {
|
||||
this.page.current = current
|
||||
axios.post("/usagerecord/usagerecordPage", this.page).then(resp => {
|
||||
this.page = resp.data.data
|
||||
})
|
||||
},
|
||||
devicePage() {
|
||||
|
||||
|
||||
axios.post("/usagerecord/usagerecordPage", this.page)
|
||||
.then(resp => {
|
||||
if (resp.data.code == 200) {
|
||||
this.page = resp.data.data
|
||||
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
|
||||
},
|
||||
created() {
|
||||
this.devicePage();
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
@ -0,0 +1,14 @@
|
||||
spring:
|
||||
datasource:
|
||||
url: jdbc:mysql://localhost:3306/a?serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf-8
|
||||
username: "root"
|
||||
password: "013013"
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
mybatis-plus:
|
||||
mapperLocations: classpath:/mapper/*Mapper.xml
|
||||
configuration:
|
||||
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
|
||||
server:
|
||||
port: 80
|
||||
tomcat:
|
||||
basedir: /home/tmp
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue