From fd9aae06ced081078b41ce41249b1a785d83bb44 Mon Sep 17 00:00:00 2001 From: x_z Date: Tue, 28 Mar 2023 16:52:34 +0800 Subject: [PATCH] =?UTF-8?q?1.=E8=B0=83=E6=95=B4=E7=A7=91=E5=AE=A4=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E6=98=8E=E7=BB=86=EF=BC=8C=E8=AE=BE=E5=A4=87=E5=B7=A1?= =?UTF-8?q?=E6=A3=80=E8=AE=BE=E7=BD=AE=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../glxp/api/dao/inv/DeptDeviceDetailDao.java | 11 ++ .../api/res/inv/DeptDeviceDetailResponse.java | 144 ++++++++++++++++++ .../api/res/inv/DeviceInspectSetResponse.java | 2 + .../inv/impl/DeptDeviceDetailServiceImpl.java | 3 +- .../inv/impl/DeviceInspectSetServiceImpl.java | 12 +- src/main/java/com/glxp/api/util/IdUtil.java | 4 +- .../mybatis/mapper/auth/InvWarehouseDao.xml | 3 + .../mapper/inv/DeptDeviceDetailDao.xml | 13 +- .../mapper/inv/DeviceInspectSetDao.xml | 3 +- 9 files changed, 187 insertions(+), 8 deletions(-) diff --git a/src/main/java/com/glxp/api/dao/inv/DeptDeviceDetailDao.java b/src/main/java/com/glxp/api/dao/inv/DeptDeviceDetailDao.java index f5fb1fff3..d82753939 100644 --- a/src/main/java/com/glxp/api/dao/inv/DeptDeviceDetailDao.java +++ b/src/main/java/com/glxp/api/dao/inv/DeptDeviceDetailDao.java @@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.glxp.api.entity.inv.DeptDeviceDetailEntity; import com.glxp.api.req.inv.FilterDeptDeviceRequest; import com.glxp.api.res.inv.DeptDeviceDetailResponse; +import com.glxp.api.res.inv.DeviceInspectSetResponse; +import org.apache.ibatis.annotations.Param; import java.util.List; @@ -21,8 +23,17 @@ public interface DeptDeviceDetailDao extends BaseMapper /** * 查询 + * * @param filterDeptDeviceRequest * @return */ List filterList(FilterDeptDeviceRequest filterDeptDeviceRequest); + + /** + * 根据资产编码查询巡检设置信息 + * + * @param code + * @return + */ + DeviceInspectSetResponse selectInspectSet(@Param("code") String code); } \ No newline at end of file diff --git a/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java b/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java index 9f9c56b36..0bf9c1317 100644 --- a/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java +++ b/src/main/java/com/glxp/api/res/inv/DeptDeviceDetailResponse.java @@ -2,9 +2,153 @@ package com.glxp.api.res.inv; import lombok.Data; +import java.util.Date; + /** * 部门设备明细VO */ @Data public class DeptDeviceDetailResponse { + + private Integer id; + + /** + * 科室编码 + */ + private String deptCode; + + /** + * 仓库编码 + */ + private String invCode; + + /** + * 原始码 + */ + private String originCode; + + /** + * 资产编码 + */ + private String code; + + /** + * 耗材字典编码 + */ + private String relId; + + /** + * 设备名称 + */ + private String deviceName; + + /** + * 规格型号 + */ + private String ggxh; + + /** + * 批次号 + */ + private String batchNo; + + /** + * 序列号 + */ + private String serialNo; + + /** + * 生产日期 + */ + private String productionDate; + + /** + * 失效日期 + */ + private String expireDate; + + /** + * 生产厂家 + */ + private String manufactory; + + /** + * 计量单位 + */ + private String measname; + + /** + * 注册/备案凭证号 + */ + private String zczbhhzbapzbh; + + /** + * 供应商ID + */ + private String supId; + + /** + * 供应商名称 + */ + private String supName; + + /** + * 状态(1:正常;2:报修;3:养护中;4:已养护;5:已报废) + */ + private Integer status; + + /** + * 添加方式(1:领用添加;2:手动添加) + */ + private Integer addType; + + /** + * 添加人 + */ + private String createUser; + + /** + * 负责人 + */ + private String manager; + + /** + * 最后养护时间 + */ + private Date maTime; + + /** + * 添加时间 + */ + private Date createTime; + + /** + * 更新时间 + */ + private Date updateTime; + + /** + * 备注 + */ + private String remark; + + /** + * 添加人名称 + */ + private String createUserName; + + /** + * 管理人名称 + */ + private String managerName; + + /** + * 部门名称 + */ + private String deptName; + + /** + * 仓库名称 + */ + private String invName; } diff --git a/src/main/java/com/glxp/api/res/inv/DeviceInspectSetResponse.java b/src/main/java/com/glxp/api/res/inv/DeviceInspectSetResponse.java index 02046fa82..d3af8d86d 100644 --- a/src/main/java/com/glxp/api/res/inv/DeviceInspectSetResponse.java +++ b/src/main/java/com/glxp/api/res/inv/DeviceInspectSetResponse.java @@ -8,6 +8,8 @@ import lombok.Data; @Data public class DeviceInspectSetResponse { + private Integer id; + /** * 设备名称 */ diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java index 2f50335ca..460900c4d 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeptDeviceDetailServiceImpl.java @@ -65,7 +65,7 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService { if (count == 0) { DeptDeviceDetailEntity deviceDetail = new DeptDeviceDetailEntity(); deviceDetail.setDeptCode(receiveOrderEntity.getFromDeptCode()); - deviceDetail.setInvCode(receiveOrderEntity.getInvCode()); + deviceDetail.setInvCode(receiveOrderEntity.getFromInvCode()); deviceDetail.setOriginCode(receiveOrderDetailResponse.getCode()); deviceDetail.setCode(idUtil.getDeptDeviceCode()); //生成资产编号 deviceDetail.setRelId(receiveOrderDetailResponse.getRelId()); @@ -116,6 +116,7 @@ public class DeptDeviceDetailServiceImpl implements DeptDeviceDetailService { DeptDeviceDetailEntity deptDeviceDetail = new DeptDeviceDetailEntity(); BeanUtil.copyProperties(addDeptDeviceRequest, deptDeviceDetail); deptDeviceDetail.setCode(idUtil.getDeptDeviceCode()); //资产编码 + deptDeviceDetail.setStatus(1); deptDeviceDetail.setCreateUser(customerService.getUserIdStr()); deptDeviceDetail.setCreateTime(new Date()); deptDeviceDetail.setUpdateTime(new Date()); diff --git a/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectSetServiceImpl.java b/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectSetServiceImpl.java index cd7c3a3b4..dcd854fb4 100644 --- a/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectSetServiceImpl.java +++ b/src/main/java/com/glxp/api/service/inv/impl/DeviceInspectSetServiceImpl.java @@ -34,13 +34,19 @@ public class DeviceInspectSetServiceImpl implements DeviceInspectSetService { if (StrUtil.isBlank(code)) { return null; } - return deviceInspectSetDao.selectInspectSet(code); + + DeviceInspectSetResponse deviceInspectSetResponse = deviceInspectSetDao.selectInspectSet(code); + if (null == deviceInspectSetResponse) { + //此设备未配置巡检设置,查询此设备的信息 + deviceInspectSetResponse = deptDeviceDetailDao.selectInspectSet(code); + } + return deviceInspectSetResponse; } @Override public BaseResponse updateInspectSet(DeviceInspectSetEntity deviceInspectSetEntity) { DeviceInspectSetEntity inspectSetEntity = deviceInspectSetDao.selectById(deviceInspectSetEntity.getId()); - BeanUtil.copyProperties(deviceInspectSetEntity, inspectSetEntity, "id","createUser", "createTime"); + BeanUtil.copyProperties(deviceInspectSetEntity, inspectSetEntity, "id", "createUser", "createTime"); inspectSetEntity.setUpdateTime(new Date()); deviceInspectSetDao.updateById(inspectSetEntity); return ResultVOUtils.success(); @@ -57,7 +63,7 @@ public class DeviceInspectSetServiceImpl implements DeviceInspectSetService { } DeviceInspectSetEntity deviceInspectSetEntity = new DeviceInspectSetEntity(); - BeanUtil.copyProperties(addDeviceInspectSetRequest, deviceInspectSetEntity); + BeanUtil.copyProperties(addDeviceInspectSetRequest, deviceInspectSetEntity, "id"); deviceInspectSetEntity.setStatus(1); deviceInspectSetEntity.setCreateTime(new Date()); deviceInspectSetEntity.setUpdateTime(new Date()); diff --git a/src/main/java/com/glxp/api/util/IdUtil.java b/src/main/java/com/glxp/api/util/IdUtil.java index 28eb09e01..68ccb6916 100644 --- a/src/main/java/com/glxp/api/util/IdUtil.java +++ b/src/main/java/com/glxp/api/util/IdUtil.java @@ -23,10 +23,10 @@ public class IdUtil { * @return */ public String getDeptDeviceCode() { - long code = redisUtil.incr(Constant.DEPT_CACHE_CODE, 1); + Long code = redisUtil.incr(Constant.DEPT_CACHE_CODE, 1); if (code == 1) { //redis中的key不存在,重新缓存当前最大的key进去 - redisUtil.set(Constant.DEPT_CACHE_CODE, deptDeviceDetailDao.selectMaxCode()); + redisUtil.set(Constant.DEPT_CACHE_CODE, Long.valueOf(deptDeviceDetailDao.selectMaxCode())); //重新获取最新的编码 code = redisUtil.incr(Constant.DEPT_CACHE_CODE, 1); } diff --git a/src/main/resources/mybatis/mapper/auth/InvWarehouseDao.xml b/src/main/resources/mybatis/mapper/auth/InvWarehouseDao.xml index 06b68c6a5..98e6b75a7 100644 --- a/src/main/resources/mybatis/mapper/auth/InvWarehouseDao.xml +++ b/src/main/resources/mybatis/mapper/auth/InvWarehouseDao.xml @@ -362,6 +362,9 @@ AND auth_warehouse.advanceType = #{advanceType} + + AND auth_warehouse.parentId = #{deptCode} + diff --git a/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml b/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml index 06a2ed434..bb5894fc8 100644 --- a/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeptDeviceDetailDao.xml @@ -29,7 +29,9 @@ t.maTime, t.remark, (select employeeName from auth_user where id = t.createUser) creatUserName, - (select employeeName from auth_user where id = t.manager) managerName + (select employeeName from auth_user where id = t.manager) managerName, + (select `name` from auth_dept where code = t.deptCode) deptName, + (select `name` from auth_warehouse where code = t.invCode) invName from dept_device_detail t @@ -62,4 +64,13 @@ order by t.updateTime desc + + \ No newline at end of file diff --git a/src/main/resources/mybatis/mapper/inv/DeviceInspectSetDao.xml b/src/main/resources/mybatis/mapper/inv/DeviceInspectSetDao.xml index cfec3c828..5f772f523 100644 --- a/src/main/resources/mybatis/mapper/inv/DeviceInspectSetDao.xml +++ b/src/main/resources/mybatis/mapper/inv/DeviceInspectSetDao.xml @@ -2,7 +2,8 @@