刘力
3 years ago
9 changed files with 185 additions and 18 deletions
-
24storeroom/src/main/java/com/storeroom/config/CallbackEnum.java
-
24storeroom/src/main/java/com/storeroom/config/LinkageEnum.java
-
50storeroom/src/main/java/com/storeroom/modules/device/controller/DeseCabinetController.java
-
11storeroom/src/main/java/com/storeroom/modules/device/domain/DeseCabinet.java
-
10storeroom/src/main/java/com/storeroom/modules/device/domain/DeviceArchivesTag.java
-
26storeroom/src/main/java/com/storeroom/modules/device/service/DeseCabinetService.java
-
6storeroom/src/main/java/com/storeroom/modules/device/service/dto/DeseCabinetDto.java
-
2storeroom/src/main/java/com/storeroom/modules/device/service/dto/DeviceInfoDto.java
-
50storeroom/src/main/java/com/storeroom/modules/device/service/impl/DenseCabinetImpl.java
@ -0,0 +1,24 @@ |
|||||
|
package com.storeroom.config; |
||||
|
|
||||
|
|
||||
|
import lombok.Getter; |
||||
|
|
||||
|
/** |
||||
|
* 回调确认 |
||||
|
*/ |
||||
|
@Getter |
||||
|
public enum CallbackEnum { |
||||
|
|
||||
|
LEND(1, "借出"), |
||||
|
BORROW(2, "归还"), |
||||
|
INBOUND(3, "入库"), |
||||
|
OUTBOUND(4, "出库"); |
||||
|
|
||||
|
private final Integer code; |
||||
|
private final String msg; |
||||
|
|
||||
|
CallbackEnum(Integer code, String msg) { |
||||
|
this.code = code; |
||||
|
this.msg = msg; |
||||
|
} |
||||
|
} |
@ -0,0 +1,24 @@ |
|||||
|
package com.storeroom.config; |
||||
|
|
||||
|
|
||||
|
import lombok.Getter; |
||||
|
|
||||
|
/** |
||||
|
* 联动操作 |
||||
|
*/ |
||||
|
@Getter |
||||
|
public enum LinkageEnum { |
||||
|
|
||||
|
LEND(1, "借出"), |
||||
|
BORROW(2, "归还"), |
||||
|
INBOUND(3, "入库"), |
||||
|
OUTBOUND(4, "出库"); |
||||
|
|
||||
|
private final Integer code; |
||||
|
private final String msg; |
||||
|
|
||||
|
LinkageEnum(Integer code, String msg) { |
||||
|
this.code = code; |
||||
|
this.msg = msg; |
||||
|
} |
||||
|
} |
@ -0,0 +1,50 @@ |
|||||
|
package com.storeroom.modules.device.controller; |
||||
|
|
||||
|
|
||||
|
import com.storeroom.annotaion.rest.AnonymousPostMapping; |
||||
|
import com.storeroom.exception.BaseException; |
||||
|
import com.storeroom.modules.device.service.DeseCabinetService; |
||||
|
import com.storeroom.modules.device.service.DeviceService; |
||||
|
import com.storeroom.modules.device.service.dto.DeseCabinetDto; |
||||
|
import com.storeroom.utils.ApiResponse; |
||||
|
import com.storeroom.utils.StringUtils; |
||||
|
import com.storeroom.utils.enums.ResponseStatus; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.RequiredArgsConstructor; |
||||
|
import org.springframework.web.bind.annotation.RequestBody; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.RestController; |
||||
|
|
||||
|
@RestController |
||||
|
@RequiredArgsConstructor |
||||
|
@Api(tags = "密集架控制器") |
||||
|
@RequestMapping("/api/desecabinet/") |
||||
|
public class DeseCabinetController { |
||||
|
|
||||
|
|
||||
|
private final DeseCabinetService deseCabinetService; |
||||
|
|
||||
|
@ApiOperation("新增密集架") |
||||
|
@AnonymousPostMapping("create") |
||||
|
public ApiResponse<Object> create(@RequestBody DeseCabinetDto deseCabinetDto) { |
||||
|
if (!StringUtils.isEmpty(deseCabinetDto.getId())) { |
||||
|
throw new BaseException("id不为空"); |
||||
|
} |
||||
|
if (deseCabinetDto.getAreaNo() != null |
||||
|
&& deseCabinetDto.getRowNo() != null |
||||
|
&& deseCabinetDto.getSumColumnNo() != null |
||||
|
&& deseCabinetDto.getFirstColumnNo() != null |
||||
|
&& deseCabinetDto.getPartNo() != null |
||||
|
&& StringUtils.isEmpty(deseCabinetDto.getDeviceInfo().getDeviceName()) |
||||
|
&& StringUtils.isEmpty(deseCabinetDto.getDeviceInfo().getStoreroomId().getId()) |
||||
|
&& StringUtils.isEmpty(deseCabinetDto.getDeviceInfo().getDeviceIp()) |
||||
|
&& deseCabinetDto.getDeviceInfo().getDevicePort() != null |
||||
|
) { |
||||
|
throw new BaseException("必填字段不能为空"); |
||||
|
} |
||||
|
deseCabinetService.create(deseCabinetDto); |
||||
|
return ApiResponse.success(ResponseStatus.SUCCESS); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,26 @@ |
|||||
|
package com.storeroom.modules.device.service; |
||||
|
|
||||
|
import com.storeroom.modules.device.service.dto.DeseCabinetDto; |
||||
|
|
||||
|
public interface DeseCabinetService { |
||||
|
/** |
||||
|
* 设备新增 |
||||
|
*/ |
||||
|
void create(DeseCabinetDto deseCabinetDto); |
||||
|
|
||||
|
/** |
||||
|
* 设备修改 |
||||
|
*/ |
||||
|
void update(DeseCabinetDto deseCabinetDto); |
||||
|
|
||||
|
/** |
||||
|
* 删除 |
||||
|
*/ |
||||
|
void delete(String id); |
||||
|
|
||||
|
/** |
||||
|
* 获取状态 |
||||
|
* @return / |
||||
|
*/ |
||||
|
Boolean getState(); |
||||
|
} |
Write
Preview
Loading…
Cancel
Save
Reference in new issue