feat:添加设备台账产线相关接口及扫码器菜单字段
parent
110ed1e424
commit
a5698d1449
@ -0,0 +1,210 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.deviceline;
|
||||
|
||||
import cn.iocoder.yudao.module.common.enums.QrcodeBizTypeEnum;
|
||||
import cn.iocoder.yudao.module.common.service.qrcordrecord.QrcodeRecordService;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import javax.annotation.Resource;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import io.swagger.v3.oas.annotations.Parameter;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
import javax.validation.*;
|
||||
import javax.servlet.http.*;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.*;
|
||||
import java.io.IOException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
|
||||
import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
|
||||
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
|
||||
|
||||
import cn.iocoder.yudao.framework.excel.core.util.ExcelUtils;
|
||||
|
||||
import cn.iocoder.yudao.framework.apilog.core.annotation.ApiAccessLog;
|
||||
import static cn.iocoder.yudao.framework.apilog.core.enums.OperateTypeEnum.*;
|
||||
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.deviceline.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceline.DeviceLineDO;
|
||||
import cn.iocoder.yudao.module.mes.service.deviceline.DeviceLineService;
|
||||
|
||||
@Tag(name = "管理后台 - 设备产线")
|
||||
@RestController
|
||||
@RequestMapping("/mes/device-line")
|
||||
@Validated
|
||||
public class DeviceLineController {
|
||||
|
||||
@Resource
|
||||
private DeviceLineService deviceLineService;
|
||||
@Resource
|
||||
private QrcodeRecordService qrcodeService;
|
||||
|
||||
@PostMapping("/create")
|
||||
@Operation(summary = "创建设备产线")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:create')")
|
||||
public CommonResult<Long> createDeviceLine(@Valid @RequestBody DeviceLineSaveReqVO createReqVO) throws UnsupportedEncodingException {
|
||||
return success(deviceLineService.createDeviceLine(createReqVO));
|
||||
}
|
||||
|
||||
@PutMapping("/update")
|
||||
@Operation(summary = "更新设备产线")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:update')")
|
||||
public CommonResult<Boolean> updateDeviceLine(@Valid @RequestBody DeviceLineSaveReqVO updateReqVO) {
|
||||
deviceLineService.updateDeviceLine(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete")
|
||||
@Operation(summary = "删除设备产线")
|
||||
@Parameter(name = "id", description = "编号", required = true)
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceLine(@RequestParam("id") Long id) {
|
||||
deviceLineService.deleteDeviceLine(id);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@DeleteMapping("/delete-batch")
|
||||
@Operation(summary = "批量删除设备产线")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:delete')")
|
||||
public CommonResult<Boolean> deleteDeviceLineBatch(@RequestParam("ids") List<Long> ids) {
|
||||
deviceLineService.deleteDeviceLineBatch(ids);
|
||||
return success(true);
|
||||
}
|
||||
|
||||
@GetMapping("/get")
|
||||
@Operation(summary = "获得设备产线")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:query')")
|
||||
public CommonResult<DeviceLineRespVO> getDeviceLine(@RequestParam("id") Long id) {
|
||||
DeviceLineDO deviceLine = deviceLineService.getDeviceLine(id);
|
||||
DeviceLineRespVO deviceLineRespVO = BeanUtils.toBean(deviceLine, DeviceLineRespVO.class);
|
||||
String qrcodeUrl = qrcodeService.selectQrcodeUrlByIdAndCode(QrcodeBizTypeEnum.DEVICE_LINE.getCode(),id,deviceLine.getCode());
|
||||
deviceLineRespVO.setQrcodeUrl(qrcodeUrl);
|
||||
return success(deviceLineRespVO);
|
||||
}
|
||||
|
||||
@GetMapping("/page")
|
||||
@Operation(summary = "获得设备产线分页")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:query')")
|
||||
public CommonResult<PageResult<DeviceLineRespVO>> getDeviceLinePage(@Valid DeviceLinePageReqVO pageReqVO) {
|
||||
PageResult<DeviceLineDO> pageResult = deviceLineService.getDeviceLinePage(pageReqVO);
|
||||
PageResult<DeviceLineRespVO> respVOPageResult = BeanUtils.toBean(pageResult, DeviceLineRespVO.class);
|
||||
//添加二维码和打印模板
|
||||
// if (respVOPageResult.getList() != null && !respVOPageResult.getList().isEmpty()) {
|
||||
// String template = deviceLineService.selectPrintTemplate();
|
||||
// Map<Long, String> qrcodeUrlMap = qrcodeService.selectQrcodeUrlMapByBizTypeAndIds(
|
||||
// QrcodeBizTypeEnum.DEVICE_LINE.getCode(),
|
||||
// respVOPageResult.getList().stream().map(DeviceLineRespVO::getId).collect(Collectors.toList()));
|
||||
// for (DeviceLineRespVO deviceLineRespVO : respVOPageResult.getList()) {
|
||||
// deviceLineRespVO.setQrcodeUrl(qrcodeUrlMap.get(deviceLineRespVO.getId()));
|
||||
// deviceLineRespVO.setTemplateJson(template);
|
||||
// }
|
||||
// }
|
||||
return success(respVOPageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/list")
|
||||
@Operation(summary = "获得设备产线列表")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:query')")
|
||||
public CommonResult<List<DeviceLineRespVO>> getDeviceLineList(@Valid DeviceLineListReqVO listReqVO) {
|
||||
List<DeviceLineDO> list = deviceLineService.getDeviceLineList(listReqVO);
|
||||
return success(BeanUtils.toBean(list, DeviceLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/tree")
|
||||
@Operation(summary = "获得设备产线树")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:query')")
|
||||
public CommonResult<List<DeviceLineTreeRespVO>> getDeviceLineTree(@Valid DeviceLineListReqVO pageReqVO) {
|
||||
List<DeviceLineTreeRespVO> tree = deviceLineService.getDeviceLineTree(pageReqVO);
|
||||
|
||||
if (tree != null && !tree.isEmpty()) {
|
||||
String template = deviceLineService.selectPrintTemplate();
|
||||
List<DeviceLineTreeRespVO> allNodes = new ArrayList<>(tree);
|
||||
for (int i = 0; i < allNodes.size(); i++) {
|
||||
List<DeviceLineTreeRespVO> children = allNodes.get(i).getChildren();
|
||||
if (children != null && !children.isEmpty()) {
|
||||
allNodes.addAll(children);
|
||||
}
|
||||
}
|
||||
|
||||
List<Long> ids = allNodes.stream().map(DeviceLineRespVO::getId).collect(Collectors.toList());
|
||||
Map<Long, String> qrcodeUrlMap = qrcodeService.selectQrcodeUrlMapByBizTypeAndIds(
|
||||
QrcodeBizTypeEnum.DEVICE_LINE.getCode(),
|
||||
ids);
|
||||
for (DeviceLineTreeRespVO deviceLineRespVO : allNodes) {
|
||||
deviceLineRespVO.setQrcodeUrl(qrcodeUrlMap.get(deviceLineRespVO.getId()));
|
||||
deviceLineRespVO.setTemplateJson(template);
|
||||
}
|
||||
}
|
||||
|
||||
return success(tree);
|
||||
}
|
||||
|
||||
@GetMapping("/children")
|
||||
@Operation(summary = "获得子设备产线列表")
|
||||
@Parameter(name = "parentId", description = "父级ID", required = true, example = "0")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:query')")
|
||||
public CommonResult<List<DeviceLineRespVO>> getChildrenDeviceLines(@RequestParam("parentId") Long parentId) {
|
||||
List<DeviceLineDO> list = deviceLineService.getChildrenDeviceLines(parentId);
|
||||
return success(BeanUtils.toBean(list, DeviceLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/ancestors")
|
||||
@Operation(summary = "获得祖先设备产线列表")
|
||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:query')")
|
||||
public CommonResult<List<DeviceLineRespVO>> getAncestorDeviceLines(@RequestParam("id") Long id) {
|
||||
List<DeviceLineDO> list = deviceLineService.getAncestorDeviceLines(id);
|
||||
return success(BeanUtils.toBean(list, DeviceLineRespVO.class));
|
||||
}
|
||||
|
||||
@GetMapping("/export-excel")
|
||||
@Operation(summary = "导出设备产线 Excel")
|
||||
@PreAuthorize("@ss.hasPermission('mes:device-line:export')")
|
||||
@ApiAccessLog(operateType = EXPORT)
|
||||
public void exportDeviceLineExcel(@Valid DeviceLineListReqVO pageReqVO,
|
||||
HttpServletResponse response) throws IOException {
|
||||
|
||||
List<DeviceLineDO> deviceLineList = deviceLineService.getDeviceLineList(pageReqVO);
|
||||
List<DeviceLineRespVO> deviceLineRespVOList = BeanUtils.toBean(deviceLineList, DeviceLineRespVO.class);
|
||||
Map<Long, String> idToNameMap = deviceLineList.stream()
|
||||
.collect(Collectors.toMap(
|
||||
DeviceLineDO::getId,
|
||||
DeviceLineDO::getName,
|
||||
(v1, v2) -> v1
|
||||
));
|
||||
|
||||
for (DeviceLineRespVO deviceLineRespVO : deviceLineRespVOList) {
|
||||
if (deviceLineRespVO.getParentId() != null && deviceLineRespVO.getParentId() > 0) {
|
||||
deviceLineRespVO.setParentName(idToNameMap.getOrDefault(deviceLineRespVO.getParentId(), ""));
|
||||
} else {
|
||||
deviceLineRespVO.setParentName("顶级分类");
|
||||
}
|
||||
}
|
||||
|
||||
response.setContentType("application/vnd.ms-excel;charset=UTF-8");
|
||||
response.setHeader("Content-Disposition",
|
||||
"attachment;filename=" + URLEncoder.encode("设备产线.xls", "UTF-8"));
|
||||
response.setHeader("Content-Encoding", "identity");
|
||||
String fileName = String.format("设备产线_%s.xls", LocalDateTime.now().format(DateTimeFormatter.ofPattern("yyyyMMddHHmmss")));
|
||||
ExcelUtils.write(response, fileName, "数据", DeviceLineRespVO.class, deviceLineRespVOList);
|
||||
}
|
||||
|
||||
|
||||
@PostMapping("/regenerate-code")
|
||||
public CommonResult<Boolean> regenerateCode(@RequestParam("id") Long id,
|
||||
@RequestParam("code") String code) throws UnsupportedEncodingException {
|
||||
deviceLineService.regenerateCode(id, code);
|
||||
return success(true);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.deviceline.vo;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Schema(description = "管理后台 - 设备产线列表 Request VO")
|
||||
public class DeviceLineListReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "父级ID")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "父级链")
|
||||
private String parentChain;
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "开始创建时间")
|
||||
private String createStartTime;
|
||||
|
||||
@Schema(description = "结束创建时间")
|
||||
private String createEndTime;
|
||||
}
|
||||
@ -0,0 +1,40 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.deviceline.vo;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageParam;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
import static cn.iocoder.yudao.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - 设备产线分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class DeviceLinePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", example = "李四")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
|
||||
@Schema(description = "父id", example = "22428")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "父级路径")
|
||||
private String parentChain;
|
||||
|
||||
}
|
||||
@ -0,0 +1,58 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.deviceline.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import java.time.LocalDateTime;
|
||||
import com.alibaba.excel.annotation.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备产线 Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class DeviceLineRespVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13899")
|
||||
@ExcelProperty("id")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("编码")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@ExcelProperty("名称")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
@ExcelProperty("备注")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "排序")
|
||||
@ExcelProperty("排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "父id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22428")
|
||||
@ExcelProperty("父id")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "父级名称", example = "顶级分类")
|
||||
@ExcelProperty("父级名称")
|
||||
private String parentName;
|
||||
|
||||
@Schema(description = "父级路径", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("父级路径")
|
||||
private String parentChain;
|
||||
|
||||
@Schema(description = "二维码")
|
||||
private String qrcodeUrl;
|
||||
|
||||
@Schema(description = "打印模板")
|
||||
private String templateJson;
|
||||
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.deviceline.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.*;
|
||||
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import java.util.*;
|
||||
|
||||
@Schema(description = "管理后台 - 设备产线新增/修改 Request VO")
|
||||
@Data
|
||||
public class DeviceLineSaveReqVO {
|
||||
|
||||
@Schema(description = "id", requiredMode = Schema.RequiredMode.REQUIRED, example = "13899")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "编码", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotEmpty(message = "编码不能为空")
|
||||
private String code;
|
||||
|
||||
@Schema(description = "名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "李四")
|
||||
@NotEmpty(message = "名称不能为空")
|
||||
private String name;
|
||||
|
||||
@Schema(description = "备注", example = "你猜")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Schema(description = "父id", requiredMode = Schema.RequiredMode.REQUIRED, example = "22428")
|
||||
@NotNull(message = "父id不能为空")
|
||||
private Long parentId;
|
||||
|
||||
@Schema(description = "父级路径", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @NotEmpty(message = "父级路径不能为空")
|
||||
private String parentChain;
|
||||
|
||||
@Schema(description = "二维码")
|
||||
private String qrcodeUrl;
|
||||
|
||||
@Schema(description = "条形码")
|
||||
private String barcodeUrl;
|
||||
|
||||
}
|
||||
@ -0,0 +1,19 @@
|
||||
package cn.iocoder.yudao.module.mes.controller.admin.deviceline.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "管理后台 - 设备产线树形结构 Response VO")
|
||||
public class DeviceLineTreeRespVO extends DeviceLineRespVO {
|
||||
|
||||
@Schema(description = "子设备产线列表")
|
||||
private List<DeviceLineTreeRespVO> children;
|
||||
|
||||
@Schema(description = "是否叶子节点", example = "true")
|
||||
private Boolean leaf = true;
|
||||
}
|
||||
@ -0,0 +1,61 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.dataobject.deviceline;
|
||||
|
||||
import lombok.*;
|
||||
import java.util.*;
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.LocalDateTime;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.dataobject.BaseDO;
|
||||
|
||||
/**
|
||||
* 设备产线 DO
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
@TableName("mes_device_line")
|
||||
@KeySequence("mes_device_line_seq") // 用于 Oracle、PostgreSQL、Kingbase、DB2、H2 数据库的主键自增。如果是 MySQL 等数据库,可不写。
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
public class DeviceLineDO extends BaseDO {
|
||||
|
||||
/**
|
||||
* id
|
||||
*/
|
||||
@TableId
|
||||
private Long id;
|
||||
/**
|
||||
* 编码
|
||||
*/
|
||||
private String code;
|
||||
/**
|
||||
* 名称
|
||||
*/
|
||||
private String name;
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
private Integer sort;
|
||||
/**
|
||||
* 父id
|
||||
*/
|
||||
private Long parentId;
|
||||
/**
|
||||
* 父级路径
|
||||
*/
|
||||
private String parentChain;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String qrcodeUrl;
|
||||
|
||||
@TableField(exist = false)
|
||||
private String barcodeUrl;
|
||||
|
||||
}
|
||||
@ -0,0 +1,45 @@
|
||||
package cn.iocoder.yudao.module.mes.dal.mysql.deviceline;
|
||||
|
||||
import java.util.*;
|
||||
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceline.DeviceLineDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.deviceline.vo.*;
|
||||
|
||||
/**
|
||||
* 设备产线 Mapper
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
@Mapper
|
||||
public interface DeviceLineMapper extends BaseMapperX<DeviceLineDO> {
|
||||
|
||||
default PageResult<DeviceLineDO> selectPage(DeviceLinePageReqVO reqVO) {
|
||||
return selectPage(reqVO, new LambdaQueryWrapperX<DeviceLineDO>()
|
||||
.eqIfPresent(DeviceLineDO::getParentId, reqVO.getParentId())
|
||||
.likeIfPresent(DeviceLineDO::getParentChain, reqVO.getParentChain())
|
||||
.eqIfPresent(DeviceLineDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(DeviceLineDO::getName, reqVO.getName())
|
||||
.eqIfPresent(DeviceLineDO::getRemark, reqVO.getRemark())
|
||||
.eqIfPresent(DeviceLineDO::getSort, reqVO.getSort())
|
||||
.betweenIfPresent(DeviceLineDO::getCreateTime, reqVO.getCreateTime())
|
||||
.orderByAsc(DeviceLineDO::getSort)
|
||||
.orderByDesc(DeviceLineDO::getId));
|
||||
}
|
||||
|
||||
default List<DeviceLineDO> selectList(DeviceLineListReqVO reqVO) {
|
||||
return selectList(new LambdaQueryWrapperX<DeviceLineDO>()
|
||||
.eqIfPresent(DeviceLineDO::getParentId, reqVO.getParentId())
|
||||
.likeIfPresent(DeviceLineDO::getParentChain, reqVO.getParentChain())
|
||||
.likeIfPresent(DeviceLineDO::getCode, reqVO.getCode())
|
||||
.likeIfPresent(DeviceLineDO::getName, reqVO.getName())
|
||||
.betweenIfPresent(DeviceLineDO::getCreateTime, reqVO.getCreateStartTime(), reqVO.getCreateEndTime())
|
||||
.orderByAsc(DeviceLineDO::getSort)
|
||||
.orderByDesc(DeviceLineDO::getId));
|
||||
}
|
||||
|
||||
String selectPrintTemplate();
|
||||
}
|
||||
@ -0,0 +1,41 @@
|
||||
package cn.iocoder.yudao.module.mes.service.deviceline;
|
||||
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.util.*;
|
||||
import cn.iocoder.yudao.module.mes.controller.admin.deviceline.vo.*;
|
||||
import cn.iocoder.yudao.module.mes.dal.dataobject.deviceline.DeviceLineDO;
|
||||
import cn.iocoder.yudao.framework.common.pojo.PageResult;
|
||||
|
||||
import javax.validation.Valid;
|
||||
|
||||
/**
|
||||
* 设备产线 Service 接口
|
||||
*
|
||||
* @author 必硕智能
|
||||
*/
|
||||
public interface DeviceLineService {
|
||||
|
||||
Long createDeviceLine(@Valid DeviceLineSaveReqVO createReqVO) throws UnsupportedEncodingException;
|
||||
|
||||
void updateDeviceLine(@Valid DeviceLineSaveReqVO updateReqVO);
|
||||
|
||||
void deleteDeviceLine(Long id);
|
||||
|
||||
void deleteDeviceLineBatch(List<Long> ids);
|
||||
|
||||
DeviceLineDO getDeviceLine(Long id);
|
||||
|
||||
PageResult<DeviceLineDO> getDeviceLinePage(DeviceLinePageReqVO pageReqVO);
|
||||
|
||||
List<DeviceLineDO> getDeviceLineList(DeviceLineListReqVO listReqVO);
|
||||
|
||||
List<DeviceLineTreeRespVO> getDeviceLineTree(DeviceLineListReqVO listReqVO);
|
||||
|
||||
List<DeviceLineDO> getChildrenDeviceLines(Long parentId);
|
||||
|
||||
List<DeviceLineDO> getAncestorDeviceLines(Long id);
|
||||
|
||||
void regenerateCode(Long id, String code) throws UnsupportedEncodingException;
|
||||
|
||||
String selectPrintTemplate();
|
||||
}
|
||||
Loading…
Reference in New Issue