设备代码提交

dev2.0
郑明梁 2 years ago
parent 4a8fb12b43
commit 70483edee8

@ -1,8 +1,9 @@
package com.glxp.api.constant;
//设备任务状态
public class DeviceStatus {
//设备任务状态
public static final int DEVICE_STATUS_TEMP_SAVE = 0; //草稿
public static final int DEVICE_STATUS_TEMP_UNDISTRIBUTTED = 1; //未分配
@ -14,5 +15,20 @@ public class DeviceStatus {
public static final int DEVICE_STATUS_TEMP_INSPECTED = 4; //已巡检
//设备状态
public static final int DEVICE_STATUS_NORMAL = 1; //正常
public static final int DEVICE_STATUS_REPAIRS = 2; //报修
public static final int DEVICE_STATUS_INSPECTION = 3; //巡检中
public static final int DEVICE_STATUS_MAINTAIN = 4; //维修中
public static final int DEVICE_STATUS_SCRAP = 5; //报废
public static final int DEVICE_STATUS_USE = 6; //使用中
public static final int DEVICE_STATUS_LEISURE = 7; //空闲
}

@ -1,15 +1,19 @@
package com.glxp.api.controller.inv;
import com.github.pagehelper.PageInfo;
import com.github.xiaoymin.knife4j.core.util.StrUtil;
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.basic.UdiEntity;
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 com.glxp.api.util.CustomUtil;
import com.glxp.api.util.udi.FilterUdiUtils;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
@ -17,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
/**
@ -37,7 +42,34 @@ public class DeptDeviceDetailController {
*/
@GetMapping("/udiwms/inv/deptDevice/filter")
public BaseResponse filterList(FilterDeptDeviceRequest filterDeptDeviceRequest) {
List<DeptDeviceDetailResponse> list = deptDeviceDetailService.filterList(filterDeptDeviceRequest);
List<DeptDeviceDetailResponse> list = new ArrayList<>();
if (StrUtil.isNotBlank(filterDeptDeviceRequest.getUdiCode())) {
filterDeptDeviceRequest =new FilterDeptDeviceRequest();
//用唯一编码查询
filterDeptDeviceRequest.setCode(filterDeptDeviceRequest.getUdiCode());
list = deptDeviceDetailService.filterList(filterDeptDeviceRequest);
if (CustomUtil.isEmpty(list)) {
//用设备udi码查询
filterDeptDeviceRequest.setCode(null);
filterDeptDeviceRequest.setOriginCode(filterDeptDeviceRequest.getUdiCode());
list = deptDeviceDetailService.filterList(filterDeptDeviceRequest);
if (CustomUtil.isEmpty(list)) {
//用DI/物资编码查询
filterDeptDeviceRequest.setOriginCode(null);
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterDeptDeviceRequest.getUdiCode());
filterDeptDeviceRequest.setNameCode(udiEntity.getUdi());
filterDeptDeviceRequest.setBatchNo(udiEntity.getBatchNo());
filterDeptDeviceRequest.setProductionDate(udiEntity.getProduceDate());
filterDeptDeviceRequest.setExpireDate(udiEntity.getExpireDate());
filterDeptDeviceRequest.setSerialNo(udiEntity.getSerialNo());
list = deptDeviceDetailService.filterList(filterDeptDeviceRequest);
}
}
} else {
list = deptDeviceDetailService.filterList(filterDeptDeviceRequest);
}
PageInfo<DeptDeviceDetailResponse> pageInfo = new PageInfo<>(list);
return ResultVOUtils.page(pageInfo);
}

@ -184,4 +184,7 @@ public class DeptDeviceDetailEntity {
@TableField(value = "detailLocation")
private String detailLocation;
@TableField(value = "nameCode")
private String nameCode;
}

@ -1,5 +1,6 @@
package com.glxp.api.req.inv;
import com.baomidou.mybatisplus.annotation.TableField;
import com.glxp.api.util.page.ListPageRequest;
import lombok.Data;
@ -56,4 +57,25 @@ public class FilterDeptDeviceRequest extends ListPageRequest {
private Integer id;
private String udiCode;
private String nameCode;
private String manufactory;
private String zczbhhzbapzbh;
private String supName;
private String productionDate;
private String expireDate;
private String serialNo;
private String manager;
}

@ -153,4 +153,6 @@ public class DeptDeviceDetailResponse {
private String invName;
private String orderIdFk;
private String nameCode;
}

@ -7,6 +7,7 @@ import com.github.pagehelper.PageHelper;
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.constant.DeviceStatus;
import com.glxp.api.dao.inv.DeptDeviceDetailDao;
import com.glxp.api.dao.inv.DeviceReceiveOrderDao;
import com.glxp.api.dao.inv.DeviceReceiveOrderDetailDao;
@ -70,6 +71,7 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService {
deviceDetail.setRelId(receiveOrderDetailResponse.getRelId());
deviceDetail.setDeviceName(receiveOrderDetailResponse.getProductName());
deviceDetail.setGgxh(receiveOrderDetailResponse.getGgxh());
deviceDetail.setNameCode(receiveOrderDetailResponse.getNameCode());
deviceDetail.setBatchNo(receiveOrderDetailResponse.getBatchNo());
deviceDetail.setSerialNo(receiveOrderDetailResponse.getSerialNo());
deviceDetail.setProductionDate(receiveOrderDetailResponse.getProductionDate());
@ -80,7 +82,7 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService {
deviceDetail.setSupId(receiveOrderDetailResponse.getSupId());
deviceDetail.setSupName(receiveOrderDetailResponse.getSupName());
deviceDetail.setManager(receiveOrderEntity.getReceiveUser());
deviceDetail.setStatus(1);
deviceDetail.setStatus(DeviceStatus.DEVICE_STATUS_NORMAL);
deviceDetail.setAddType(1);
deviceDetail.setCreateUser(receiveOrderEntity.getAuditUser());
// deviceDetail.setCreateTime(date);

@ -16,6 +16,7 @@
t.deviceName,
t.ggxh,
t.batchNo,
t.nameCode,
t.serialNo,
t.productionDate,
t.expireDate,
@ -58,6 +59,27 @@
<if test="batchNo != null and batchNo != ''">
AND t.batchNo like concat('%', #{batchNo}, '%')
</if>
<if test="manager != null and manager != ''">
AND t.manager like concat('%', #{manager}, '%')
</if>
<if test="nameCode != null and nameCode != ''">
AND t.nameCode like concat('%', #{nameCode}, '%')
</if>
<if test="manufactory != null and manufactory != ''">
AND t.manufactory like concat('%', #{manufactory}, '%')
</if>
<if test="zczbhhzbapzbh != null and zczbhhzbapzbh != ''">
AND t.zczbhhzbapzbh like concat('%', #{zczbhhzbapzbh}, '%')
</if>
<if test="serialNo != null and serialNo != ''">
AND t.serialNo = #{serialNo}
</if>
<if test="productionDate != null and productionDate != ''">
AND t.productionDate = #{productionDate}
</if>
<if test="expireDate != null and expireDate != ''">
AND t.expireDate = #{expireDate}
</if>
<if test="status != null">
AND t.status = #{status}
</if>

@ -260,6 +260,7 @@ CREATE TABLE IF NOT EXISTS `device_asset_usage`
CALL Pro_Temp_ColumnWork('dept_device_detail', 'curUser', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('dept_device_detail', 'location', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('dept_device_detail', 'detailLocation', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('dept_device_detail', 'nameCode', 'varchar(255)', 1);
CALL Pro_Temp_ColumnWork('device_inspect_plan', 'executeCount', 'int', 1);
CALL Pro_Temp_ColumnWork('device_inspect_plan', 'useFrequency', 'int', 1);

Loading…
Cancel
Save