feat:使用记录明细
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,40 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import lombok.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import com.zt.plat.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static com.zt.plat.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备-使用记录明细分页 Request VO")
|
||||
@Data
|
||||
public class DeviceUseRecordDetailPageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "使用记录ID", example = "14073")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "任务单编号")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "任务单ID", example = "71")
|
||||
private Long taskId;
|
||||
|
||||
@Schema(description = "样品名称", example = "王五")
|
||||
private String sampleName;
|
||||
|
||||
@Schema(description = "样品编号")
|
||||
private String sampleCode;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备-使用记录明细 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceUseRecordDetailRespVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11040")
|
||||
@ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "使用记录ID", example = "14073")
|
||||
@ExcelProperty("使用记录ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "任务单编号")
|
||||
@ExcelProperty("任务单编号")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "任务单ID", example = "71")
|
||||
@ExcelProperty("任务单ID")
|
||||
private Long taskId;
|
||||
|
||||
@Schema(description = "样品名称", example = "王五")
|
||||
@ExcelProperty("样品名称")
|
||||
private String sampleName;
|
||||
|
||||
@Schema(description = "样品编号")
|
||||
@ExcelProperty("样品编号")
|
||||
private String sampleCode;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
@ExcelProperty("所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,34 @@
|
||||
package com.zt.plat.module.qms.resource.device.controller.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备-使用记录明细新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceUseRecordDetailSaveReqVO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "11040")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "使用记录ID", example = "14073")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "任务单编号")
|
||||
private String taskNo;
|
||||
|
||||
@Schema(description = "任务单ID", example = "71")
|
||||
private Long taskId;
|
||||
|
||||
@Schema(description = "样品名称", example = "王五")
|
||||
private String sampleName;
|
||||
|
||||
@Schema(description = "样品编号")
|
||||
private String sampleCode;
|
||||
|
||||
@Schema(description = "所属部门")
|
||||
private String systemDepartmentCode;
|
||||
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -59,4 +59,8 @@ public class DeviceUseRecordSaveReqVO {
|
||||
@Schema(description = "备注")
|
||||
private String remark;
|
||||
|
||||
//扩展字段
|
||||
@Schema(description = "使用记录明细列表")
|
||||
List<DeviceUseRecordDetailSaveReqVO> detailList;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,67 @@
|
||||
package com.zt.plat.module.qms.resource.device.dal.dataobject;
|
||||
|
||||
import lombok.*;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.zt.plat.framework.mybatis.core.dataobject.BusinessBaseDO;
|
||||
/**
|
||||
* 设备-使用记录明细 DO
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@TableName("t_dev_use_rcd_dtl")
|
||||
@KeySequence("t_dev_use_rcd_dtl_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
/**
|
||||
* 支持业务基类继承:isBusiness=true 时继承 BusinessBaseDO,否则继承 BaseDO
|
||||
*/
|
||||
public class DeviceUseRecordDetailDO extends BusinessBaseDO {
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 主键
|
||||
*/
|
||||
@TableId(type = IdType.ASSIGN_ID)
|
||||
private Long id;
|
||||
/**
|
||||
* 使用记录ID
|
||||
*/
|
||||
@TableField("PRN_ID")
|
||||
private Long parentId;
|
||||
/**
|
||||
* 任务单编号
|
||||
*/
|
||||
@TableField("TSK_NO")
|
||||
private String taskNo;
|
||||
/**
|
||||
* 任务单ID
|
||||
*/
|
||||
@TableField("TSK_ID")
|
||||
private Long taskId;
|
||||
/**
|
||||
* 样品名称
|
||||
*/
|
||||
@TableField("SMP_NAME")
|
||||
private String sampleName;
|
||||
/**
|
||||
* 样品编号
|
||||
*/
|
||||
@TableField("SMP_CD")
|
||||
private String sampleCode;
|
||||
/**
|
||||
* 所属部门
|
||||
*/
|
||||
@TableField("SYS_DEPT_CD")
|
||||
private String systemDepartmentCode;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
@TableField("RMK")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
package com.zt.plat.module.qms.resource.device.dal.mapper;
|
||||
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
import com.zt.plat.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import com.zt.plat.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceUseRecordDetailDO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceUseRecordDetailPageReqVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
/**
|
||||
* 设备-使用记录明细 Mapper
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceUseRecordDetailMapper extends BaseMapperX<DeviceUseRecordDetailDO> {
|
||||
|
||||
default PageResult<DeviceUseRecordDetailDO> selectPage(DeviceUseRecordDetailPageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceUseRecordDetailDO>()
|
||||
.eqIfPresent(DeviceUseRecordDetailDO::getParentId, reqVO.getParentId())
|
||||
.eqIfPresent(DeviceUseRecordDetailDO::getTaskNo, reqVO.getTaskNo())
|
||||
.eqIfPresent(DeviceUseRecordDetailDO::getTaskId, reqVO.getTaskId())
|
||||
.likeIfPresent(DeviceUseRecordDetailDO::getSampleName, reqVO.getSampleName())
|
||||
.eqIfPresent(DeviceUseRecordDetailDO::getSampleCode, reqVO.getSampleCode())
|
||||
.eqIfPresent(DeviceUseRecordDetailDO::getSystemDepartmentCode, reqVO.getSystemDepartmentCode())
|
||||
.eqIfPresent(DeviceUseRecordDetailDO::getRemark, reqVO.getRemark())
|
||||
.betweenIfPresent(DeviceUseRecordDetailDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByDesc(DeviceUseRecordDetailDO::getId));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,68 @@
|
||||
package com.zt.plat.module.qms.resource.device.service;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceUseRecordDetailPageReqVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceUseRecordDetailRespVO;
|
||||
import com.zt.plat.module.qms.resource.device.controller.vo.DeviceUseRecordDetailSaveReqVO;
|
||||
import jakarta.validation.*;
|
||||
import com.zt.plat.module.qms.resource.device.dal.dataobject.DeviceUseRecordDetailDO;
|
||||
import com.zt.plat.framework.common.pojo.PageResult;
|
||||
|
||||
/**
|
||||
* 设备-使用记录明细 Service 接口
|
||||
*
|
||||
* @author 后台管理
|
||||
*/
|
||||
public interface DeviceUseRecordDetailService {
|
||||
|
||||
List<DeviceUseRecordDetailDO> getListByParentId(Long parentId);
|
||||
|
||||
void saveList(Long parentId, List<DeviceUseRecordDetailSaveReqVO> list);
|
||||
|
||||
/**
|
||||
* 创建设备-使用记录明细
|
||||
*
|
||||
* @param createReqVO 创建信息
|
||||
* @return 编号
|
||||
*/
|
||||
DeviceUseRecordDetailRespVO createDeviceUseRecordDetail(@Valid DeviceUseRecordDetailSaveReqVO createReqVO);
|
||||
|
||||
/**
|
||||
* 更新设备-使用记录明细
|
||||
*
|
||||
* @param updateReqVO 更新信息
|
||||
*/
|
||||
void updateDeviceUseRecordDetail(@Valid DeviceUseRecordDetailSaveReqVO updateReqVO);
|
||||
|
||||
/**
|
||||
* 删除设备-使用记录明细
|
||||
*
|
||||
* @param id 编号
|
||||
*/
|
||||
void deleteDeviceUseRecordDetail(Long id);
|
||||
|
||||
/**
|
||||
* 批量删除设备-使用记录明细
|
||||
*
|
||||
* @param ids 编号
|
||||
*/
|
||||
void deleteDeviceUseRecordDetailListByIds(List<Long> ids);
|
||||
|
||||
/**
|
||||
* 获得设备-使用记录明细
|
||||
*
|
||||
* @param id 编号
|
||||
* @return 设备-使用记录明细
|
||||
*/
|
||||
DeviceUseRecordDetailDO getDeviceUseRecordDetail(Long id);
|
||||
|
||||
/**
|
||||
* 获得设备-使用记录明细分页
|
||||
*
|
||||
* @param pageReqVO 分页查询
|
||||
* @return 设备-使用记录明细分页
|
||||
*/
|
||||
PageResult<DeviceUseRecordDetailDO> getDeviceUseRecordDetailPage(DeviceUseRecordDetailPageReqVO pageReqVO);
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -38,6 +38,7 @@ public class DeviceUseRecordServiceImpl implements DeviceUseRecordService {
|
||||
@Resource private DeviceInfomationService deviceInfomationService;
|
||||
@Resource private DeviceProductService deviceProductService;
|
||||
@Resource private DeviceUseRecordMapper deviceUseRecordMapper;
|
||||
@Resource private DeviceUseRecordDetailService deviceUseRecordDetailService;
|
||||
|
||||
@Override
|
||||
public PageResult<DeviceInfomationWithProductVO> queryPageListWithCount(DeviceUseRecordPageReqVO reqVO) {
|
||||
@@ -73,6 +74,7 @@ public class DeviceUseRecordServiceImpl implements DeviceUseRecordService {
|
||||
deviceInfomationService.updateDeviceInUseFlag(deviceId, 1);
|
||||
else
|
||||
deviceInfomationService.updateDeviceInUseFlag(deviceId, 0);
|
||||
deviceUseRecordDetailService.saveList(deviceUseRecord.getId(), reqVO.getDetailList());
|
||||
// 返回
|
||||
DeviceUseRecordRespVO respVO = BeanUtils.toBean(deviceUseRecord, DeviceUseRecordRespVO.class);
|
||||
return success(respVO);
|
||||
@@ -88,6 +90,7 @@ public class DeviceUseRecordServiceImpl implements DeviceUseRecordService {
|
||||
deviceInfomationService.updateDeviceInUseFlag(deviceId, 1);
|
||||
else
|
||||
deviceInfomationService.updateDeviceInUseFlag(deviceId, 0);
|
||||
deviceUseRecordDetailService.saveList(reqVO.getId(), reqVO.getDetailList());
|
||||
// 更新
|
||||
DeviceUseRecordDO updateObj = BeanUtils.toBean(reqVO, DeviceUseRecordDO.class);
|
||||
deviceUseRecordMapper.updateById(updateObj);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user