rev:修改调度管理路径

This commit is contained in:
zhangzhiqiang
2023-05-18 19:14:38 +08:00
parent 5bce32c4e9
commit 090cd3830e
24 changed files with 125 additions and 51 deletions

View File

@@ -1,21 +1,97 @@
package org.nl.wms.product_manage.controller.device;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSONObject;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.nl.common.anno.Log;
import org.nl.common.utils.SecurityUtils;
import org.nl.wms.product_manage.service.device.IPdmBiDeviceService;
import org.nl.wms.product_manage.service.device.dao.PdmBiDevice;
import org.nl.wms.product_manage.备份pdm.service.DeviceService;
import org.nl.wms.product_manage.备份pdm.service.dto.DeviceDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.Map;
/**
* <p>
* 生产设备基础信息表 前端控制器
* </p>
*
* @author generator
* @since 2023-04-26
*/
* @author lyd
* @date 2023-03-15
**/
@RestController
@RequestMapping("/pdmBiDevice")
@Api(tags = "生产设备管理")
@RequestMapping("/api/device")
@Slf4j
public class PdmBiDeviceController {
@Autowired
private DeviceService deviceService;
@Autowired
private IPdmBiDeviceService iDeviceService;
@GetMapping
@Log("查询生产设备")
@ApiOperation("查询生产设备")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> query(@RequestParam Map whereJson, Pageable page){
return new ResponseEntity<>(deviceService.queryAll(whereJson,page),HttpStatus.OK);
}
@PostMapping
@Log("新增生产设备")
@ApiOperation("新增生产设备")
//@PreAuthorize("@el.check('device:add')")
public ResponseEntity<Object> create( @RequestBody JSONObject form){
PdmBiDevice device = form.toJavaObject(PdmBiDevice.class);
device.setCreate_id(SecurityUtils.getCurrentUserId());
device.setCreate_name(SecurityUtils.getCurrentNickName());
device.setCreate_time(DateUtil.now());
iDeviceService.save(device);
return new ResponseEntity<>(HttpStatus.CREATED);
}
@PutMapping
@Log("修改生产设备")
@ApiOperation("修改生产设备")
//@PreAuthorize("@el.check('device:edit')")
public ResponseEntity<Object> update(@Validated @RequestBody JSONObject form){
PdmBiDevice device = form.toJavaObject(PdmBiDevice.class);
device.setUpdate_id(SecurityUtils.getCurrentUserId());
device.setUpdate_name(SecurityUtils.getCurrentNickName());
device.setUpdate_time(DateUtil.now());
iDeviceService.updateById(device);
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
}
@Log("删除生产设备")
@ApiOperation("删除生产设备")
//@PreAuthorize("@el.check('device:del')")
@DeleteMapping
public ResponseEntity<Object> delete(@RequestBody String[] ids) {
deviceService.deleteAll(ids);
return new ResponseEntity<>(HttpStatus.OK);
}
@GetMapping("/getWorkprocedure")
@Log("工序下拉")
@ApiOperation("工序下拉")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> getWorkprocedure(){
return new ResponseEntity<>(deviceService.getWorkprocedure(),HttpStatus.OK);
}
@GetMapping("/getDeviceList")
@Log("设备下拉框")
@ApiOperation("设备下拉框")
//@PreAuthorize("@el.check('device:list')")
public ResponseEntity<Object> getDeviceList(){
return new ResponseEntity<>(deviceService.getDeviceList(),HttpStatus.OK);
}
}

View File

@@ -1,6 +1,8 @@
package org.nl.wms.product_manage.service.device.dao;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import lombok.Data;
@@ -24,6 +26,7 @@ public class PdmBiDevice implements Serializable {
/**
* 设备编码
*/
@TableId(value = "device_code")
private String device_code;
/**

View File

@@ -21,10 +21,8 @@ import java.util.Map;
* @author lyd
* @date 2023-03-15
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "生产设备管理")
@RequestMapping("/api/device")
@Slf4j
public class DeviceController {

View File

@@ -37,7 +37,7 @@ public class SysUser implements Serializable {
*/
private String username;
/**
/**fperson_name
* 姓名
*/
private String person_name;

View File

@@ -9,25 +9,23 @@ spring:
client:
reactive:
#endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网
# endpoints: 47.96.133.178:8200 #外网
endpoints: http://47.96.133.178:8200 #外网
# endpoints: 192.168.46.225:8200 #外网
endpoints: http://192.168.46.225:8200 #外网
elasticsearch:
rest:
#uris: 172.31.185.110:9200,172.31.154.9:9200 #内网
# uris: 47.96.133.178:8200 #外网
uris: http://47.96.133.178:8200 #外网
username: elastic
password: 123456
# uris: 192.168.46.225:8200 #外网
uris: http://192.168.46.225:9200 #外网
# username: elastic
# password: 123456
datasource:
druid:
db-type: com.alibaba.druid.pool.DruidDataSource
driverClassName: net.sf.log4jdbc.sql.jdbcapi.DriverSpy
#url: jdbc:log4jdbc:mysql://${DB_HOST:localhost}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.46.5}:${DB_PORT:3306}/${DB_NAME:hl_one_mes_test}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
# url: jdbc:log4jdbc:mysql://${DB_HOST:192.168.81.252}:${DB_PORT:3306}/${DB_NAME:hl_one_mes}?serverTimezone=Asia/Shanghai&characterEncoding=utf8&useSSL=false&useOldAliasMetadataBehavior=true&allowPublicKeyRetrieval=true&useSSL=false
username: ${DB_USER:root}
password: ${DB_PWD:Root.123456}
# username: ${DB_USER:root}
# password: ${DB_PWD:942464Yy}
password: ${DB_PWD:123456}
# 初始连接数
initial-size: 5

View File

@@ -9,13 +9,13 @@ spring:
client:
reactive:
#endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网
# endpoints: 47.96.133.178:8200 #外网
endpoints: http://47.96.133.178:8200 #外网
# endpoints: 192.168.46.225:8200 #外网
endpoints: http://192.168.46.225:8200 #外网
elasticsearch:
rest:
#uris: 172.31.185.110:9200,172.31.154.9:9200 #内网
# uris: 47.96.133.178:8200 #外网
uris: http://47.96.133.178:8200 #外网
# uris: 192.168.46.225:8200 #外网
uris: http://192.168.46.225:8200 #外网
username: elastic
password: 123456
datasource:

View File

@@ -9,13 +9,13 @@ spring:
client:
reactive:
#endpoints: 172.31.185.110:9200,172.31.154.9:9200 #内网
# endpoints: 47.96.133.178:8200 #外网
endpoints: http://47.96.133.178:8200 #外网
# endpoints: 192.168.46.225:8200 #外网
endpoints: http://192.168.46.225:8200 #外网
elasticsearch:
rest:
#uris: 172.31.185.110:9200,172.31.154.9:9200 #内网
# uris: 47.96.133.178:8200 #外网
uris: http://47.96.133.178:8200 #外网
# uris: 192.168.46.225:8200 #外网
uris: http://192.168.46.225:8200 #外网
username: elastic
password: 123456
datasource:

View File

@@ -18,7 +18,7 @@ https://juejin.cn/post/6844903775631572999
<!--引入默认的一些设置-->
<!-- <include resource="log/AutoCreateInst.xml"/>-->
<!-- <appender name="esLogAppender" class="com.internetitem.logback.elasticsearch.ElasticsearchAppender">
<url>http://47.96.133.178:8200/_bulk</url>
<url>http://192.168.46.225:8200/_bulk</url>
<index>${esIndex}</index>
<type>mes_log</type>
<loggerName>es-logger</loggerName> &lt;!&ndash; optional &ndash;&gt;