You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.8 KiB
Java
88 lines
2.8 KiB
Java
package com.glxp.api.controller.inv;
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.glxp.api.common.enums.ResultEnum;
|
|
import com.glxp.api.common.res.BaseResponse;
|
|
import com.glxp.api.common.util.ResultVOUtils;
|
|
import com.glxp.api.entity.inv.DeptDeviceDetailEntity;
|
|
import com.glxp.api.req.inv.AddDeptDeviceRequest;
|
|
import com.glxp.api.req.inv.FilterDeptDeviceRequest;
|
|
import com.glxp.api.req.system.DeleteRequest;
|
|
import com.glxp.api.res.inv.DeptDeviceDetailResponse;
|
|
import com.glxp.api.service.inv.DeptDeviceDetailService;
|
|
import lombok.extern.slf4j.Slf4j;
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
import javax.annotation.Resource;
|
|
import java.util.List;
|
|
|
|
/**
|
|
* 部门设备明细接口
|
|
*/
|
|
@Slf4j
|
|
@RestController
|
|
public class DeptDeviceDetailController {
|
|
|
|
@Resource
|
|
private DeptDeviceDetailService deptDeviceDetailService;
|
|
|
|
/**
|
|
* 查询部门设备明细列表
|
|
*
|
|
* @param filterDeptDeviceRequest
|
|
* @return
|
|
*/
|
|
@GetMapping("/udiwms/inv/deptDevice/filter")
|
|
public BaseResponse filterList(FilterDeptDeviceRequest filterDeptDeviceRequest) {
|
|
List<DeptDeviceDetailResponse> list = deptDeviceDetailService.filterList(filterDeptDeviceRequest);
|
|
PageInfo<DeptDeviceDetailResponse> pageInfo = new PageInfo<>(list);
|
|
return ResultVOUtils.page(pageInfo);
|
|
}
|
|
|
|
/**
|
|
* 添加设备信息
|
|
*
|
|
* @param addDeptDeviceRequest
|
|
* @return
|
|
*/
|
|
@PostMapping("/udiwms/inv/deptDevice/add")
|
|
public BaseResponse addDevice(@RequestBody AddDeptDeviceRequest addDeptDeviceRequest) {
|
|
if (null == addDeptDeviceRequest) {
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
}
|
|
return deptDeviceDetailService.addDevice(addDeptDeviceRequest);
|
|
}
|
|
|
|
/**
|
|
* 更新设备信息
|
|
*
|
|
* @param deptDeviceDetail
|
|
* @return
|
|
*/
|
|
@PostMapping("/udiwms/inv/deptDevice/update")
|
|
public BaseResponse updateDevice(@RequestBody DeptDeviceDetailEntity deptDeviceDetail) {
|
|
if (null == deptDeviceDetail) {
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
}
|
|
return deptDeviceDetailService.updateDevice(deptDeviceDetail);
|
|
}
|
|
|
|
/**
|
|
* 删除设备信息
|
|
*
|
|
* @param deleteRequest
|
|
* @return
|
|
*/
|
|
@PostMapping("/udiwms/inv/deptDevice/delete")
|
|
public BaseResponse deleteDevice(@RequestBody DeleteRequest deleteRequest) {
|
|
if (null == deleteRequest || null == deleteRequest.getId()) {
|
|
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
|
|
}
|
|
return deptDeviceDetailService.deleteDevice(deleteRequest.getId());
|
|
}
|
|
|
|
}
|