diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/controller/device/PdmBiDeviceController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/controller/device/PdmBiDeviceController.java index decc1cc0..c9ca3d46 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/controller/device/PdmBiDeviceController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/controller/device/PdmBiDeviceController.java @@ -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; /** - *

- * 生产设备基础信息表 前端控制器 - *

- * - * @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 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 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 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 delete(@RequestBody String[] ids) { + deviceService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } + + @GetMapping("/getWorkprocedure") + @Log("工序下拉") + @ApiOperation("工序下拉") + //@PreAuthorize("@el.check('device:list')") + public ResponseEntity getWorkprocedure(){ + return new ResponseEntity<>(deviceService.getWorkprocedure(),HttpStatus.OK); + } + + @GetMapping("/getDeviceList") + @Log("设备下拉框") + @ApiOperation("设备下拉框") + //@PreAuthorize("@el.check('device:list')") + public ResponseEntity getDeviceList(){ + return new ResponseEntity<>(deviceService.getDeviceList(),HttpStatus.OK); + } } - diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/pdm.xls b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/pdm.xls index 8aeca089..78870a96 100644 Binary files a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/pdm.xls and b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/pdm.xls differ diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/device/dao/PdmBiDevice.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/device/dao/PdmBiDevice.java index 690c0017..1b0a47c1 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/device/dao/PdmBiDevice.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/service/device/dao/PdmBiDevice.java @@ -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; /** diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/rest/DeviceController.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/rest/DeviceController.java index cd028e6f..7d083a4c 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/rest/DeviceController.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/product_manage/备份pdm/rest/DeviceController.java @@ -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 { diff --git a/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/user/dao/SysUser.java b/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/user/dao/SysUser.java index cb805293..9e74e6fc 100644 --- a/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/user/dao/SysUser.java +++ b/mes/hd/nladmin-system/src/main/java/org/nl/wms/system_manage/service/user/dao/SysUser.java @@ -37,7 +37,7 @@ public class SysUser implements Serializable { */ private String username; - /** + /**fperson_name * 姓名 */ private String person_name; diff --git a/mes/hd/nladmin-system/src/main/resources/config/application-dev.yml b/mes/hd/nladmin-system/src/main/resources/config/application-dev.yml index 413b4ddd..33a2a28d 100644 --- a/mes/hd/nladmin-system/src/main/resources/config/application-dev.yml +++ b/mes/hd/nladmin-system/src/main/resources/config/application-dev.yml @@ -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 diff --git a/mes/hd/nladmin-system/src/main/resources/config/application-dev3.yml b/mes/hd/nladmin-system/src/main/resources/config/application-dev3.yml index b1296e0a..2182437d 100644 --- a/mes/hd/nladmin-system/src/main/resources/config/application-dev3.yml +++ b/mes/hd/nladmin-system/src/main/resources/config/application-dev3.yml @@ -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: diff --git a/mes/hd/nladmin-system/src/main/resources/config/application-prod.yml b/mes/hd/nladmin-system/src/main/resources/config/application-prod.yml index 971add56..b5894b99 100644 --- a/mes/hd/nladmin-system/src/main/resources/config/application-prod.yml +++ b/mes/hd/nladmin-system/src/main/resources/config/application-prod.yml @@ -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: diff --git a/mes/hd/nladmin-system/src/main/resources/logback-spring.xml b/mes/hd/nladmin-system/src/main/resources/logback-spring.xml index ae30a148..df9bf5a1 100644 --- a/mes/hd/nladmin-system/src/main/resources/logback-spring.xml +++ b/mes/hd/nladmin-system/src/main/resources/logback-spring.xml @@ -18,7 +18,7 @@ https://juejin.cn/post/6844903775631572999