add(dms): 生成保养项目、保养标准、保养部位、保养计划、保养计划明细与保养部位关联项目,没有完善逻辑
parent
d538b3b74c
commit
13e40554da
@ -0,0 +1,117 @@
|
||||
package org.dromara.dms.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintProjectVo;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintProjectBo;
|
||||
import org.dromara.dms.service.IDmsBaseMaintProjectService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 保养项目信息
|
||||
* 前端访问路由地址为:/dms/dmsBaseMaintProject
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dmsBaseMaintProject")
|
||||
public class DmsBaseMaintProjectController extends BaseController {
|
||||
|
||||
private final IDmsBaseMaintProjectService dmsBaseMaintProjectService;
|
||||
|
||||
/**
|
||||
* 查询保养项目信息列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintProject:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DmsBaseMaintProjectVo> list(DmsBaseMaintProjectBo bo, PageQuery pageQuery) {
|
||||
return dmsBaseMaintProjectService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出保养项目信息列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintProject:export")
|
||||
@Log(title = "保养项目信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(DmsBaseMaintProjectBo bo, HttpServletResponse response) {
|
||||
List<DmsBaseMaintProjectVo> list = dmsBaseMaintProjectService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "保养项目信息", DmsBaseMaintProjectVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保养项目信息详细信息
|
||||
*
|
||||
* @param maintProjectId 主键
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintProject:query")
|
||||
@GetMapping("/{maintProjectId}")
|
||||
public R<DmsBaseMaintProjectVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long maintProjectId) {
|
||||
return R.ok(dmsBaseMaintProjectService.queryById(maintProjectId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养项目信息
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintProject:add")
|
||||
@Log(title = "保养项目信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DmsBaseMaintProjectBo bo) {
|
||||
return toAjax(dmsBaseMaintProjectService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养项目信息
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintProject:edit")
|
||||
@Log(title = "保养项目信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DmsBaseMaintProjectBo bo) {
|
||||
return toAjax(dmsBaseMaintProjectService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保养项目信息
|
||||
*
|
||||
* @param maintProjectIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintProject:remove")
|
||||
@Log(title = "保养项目信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{maintProjectIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] maintProjectIds) {
|
||||
return toAjax(dmsBaseMaintProjectService.deleteWithValidByIds(List.of(maintProjectIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询保养项目信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("/getDmsBaseMaintProjectList")
|
||||
public R<List<DmsBaseMaintProjectVo>> getDmsBaseMaintProjectList(DmsBaseMaintProjectBo bo) {
|
||||
List<DmsBaseMaintProjectVo> list = dmsBaseMaintProjectService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.dms.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintStandardVo;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintStandardBo;
|
||||
import org.dromara.dms.service.IDmsBaseMaintStandardService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 保养标准信息
|
||||
* 前端访问路由地址为:/dms/dmsBaseMaintStandard
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dmsBaseMaintStandard")
|
||||
public class DmsBaseMaintStandardController extends BaseController {
|
||||
|
||||
private final IDmsBaseMaintStandardService dmsBaseMaintStandardService;
|
||||
|
||||
/**
|
||||
* 查询保养标准信息列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStandard:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DmsBaseMaintStandardVo> list(DmsBaseMaintStandardBo bo, PageQuery pageQuery) {
|
||||
return dmsBaseMaintStandardService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出保养标准信息列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStandard:export")
|
||||
@Log(title = "保养标准信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(DmsBaseMaintStandardBo bo, HttpServletResponse response) {
|
||||
List<DmsBaseMaintStandardVo> list = dmsBaseMaintStandardService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "保养标准信息", DmsBaseMaintStandardVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保养标准信息详细信息
|
||||
*
|
||||
* @param maintStandardId 主键
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStandard:query")
|
||||
@GetMapping("/{maintStandardId}")
|
||||
public R<DmsBaseMaintStandardVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long maintStandardId) {
|
||||
return R.ok(dmsBaseMaintStandardService.queryById(maintStandardId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养标准信息
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStandard:add")
|
||||
@Log(title = "保养标准信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DmsBaseMaintStandardBo bo) {
|
||||
return toAjax(dmsBaseMaintStandardService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养标准信息
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStandard:edit")
|
||||
@Log(title = "保养标准信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DmsBaseMaintStandardBo bo) {
|
||||
return toAjax(dmsBaseMaintStandardService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保养标准信息
|
||||
*
|
||||
* @param maintStandardIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStandard:remove")
|
||||
@Log(title = "保养标准信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{maintStandardIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] maintStandardIds) {
|
||||
return toAjax(dmsBaseMaintStandardService.deleteWithValidByIds(List.of(maintStandardIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询保养标准信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("/getDmsBaseMaintStandardList")
|
||||
public R<List<DmsBaseMaintStandardVo>> getDmsBaseMaintStandardList(DmsBaseMaintStandardBo bo) {
|
||||
List<DmsBaseMaintStandardVo> list = dmsBaseMaintStandardService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.dms.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintStationVo;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintStationBo;
|
||||
import org.dromara.dms.service.IDmsBaseMaintStationService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 保养部位信息
|
||||
* 前端访问路由地址为:/dms/dmsBaseMaintStation
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dmsBaseMaintStation")
|
||||
public class DmsBaseMaintStationController extends BaseController {
|
||||
|
||||
private final IDmsBaseMaintStationService dmsBaseMaintStationService;
|
||||
|
||||
/**
|
||||
* 查询保养部位信息列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStation:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DmsBaseMaintStationVo> list(DmsBaseMaintStationBo bo, PageQuery pageQuery) {
|
||||
return dmsBaseMaintStationService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出保养部位信息列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStation:export")
|
||||
@Log(title = "保养部位信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(DmsBaseMaintStationBo bo, HttpServletResponse response) {
|
||||
List<DmsBaseMaintStationVo> list = dmsBaseMaintStationService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "保养部位信息", DmsBaseMaintStationVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保养部位信息详细信息
|
||||
*
|
||||
* @param maintStationId 主键
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStation:query")
|
||||
@GetMapping("/{maintStationId}")
|
||||
public R<DmsBaseMaintStationVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long maintStationId) {
|
||||
return R.ok(dmsBaseMaintStationService.queryById(maintStationId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养部位信息
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStation:add")
|
||||
@Log(title = "保养部位信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DmsBaseMaintStationBo bo) {
|
||||
return toAjax(dmsBaseMaintStationService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养部位信息
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStation:edit")
|
||||
@Log(title = "保养部位信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DmsBaseMaintStationBo bo) {
|
||||
return toAjax(dmsBaseMaintStationService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保养部位信息
|
||||
*
|
||||
* @param maintStationIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsBaseMaintStation:remove")
|
||||
@Log(title = "保养部位信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{maintStationIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] maintStationIds) {
|
||||
return toAjax(dmsBaseMaintStationService.deleteWithValidByIds(List.of(maintStationIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询保养部位信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("/getDmsBaseMaintStationList")
|
||||
public R<List<DmsBaseMaintStationVo>> getDmsBaseMaintStationList(DmsBaseMaintStationBo bo) {
|
||||
List<DmsBaseMaintStationVo> list = dmsBaseMaintStationService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.dms.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.dms.domain.vo.DmsBaseStationProjectVo;
|
||||
import org.dromara.dms.domain.bo.DmsBaseStationProjectBo;
|
||||
import org.dromara.dms.service.IDmsBaseStationProjectService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 保养部位关联项目信息
|
||||
* 前端访问路由地址为:/dms/dmsBaseStationProject
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dmsBaseStationProject")
|
||||
public class DmsBaseStationProjectController extends BaseController {
|
||||
|
||||
private final IDmsBaseStationProjectService dmsBaseStationProjectService;
|
||||
|
||||
/**
|
||||
* 查询保养部位关联项目信息列表
|
||||
*/
|
||||
/* @SaCheckPermission("dms:dmsBaseStationProject:list")*/
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DmsBaseStationProjectVo> list(DmsBaseStationProjectBo bo, PageQuery pageQuery) {
|
||||
return dmsBaseStationProjectService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出保养部位关联项目信息列表
|
||||
*/
|
||||
/* @SaCheckPermission("dms:dmsBaseStationProject:export")*/
|
||||
@Log(title = "保养部位关联项目信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(DmsBaseStationProjectBo bo, HttpServletResponse response) {
|
||||
List<DmsBaseStationProjectVo> list = dmsBaseStationProjectService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "保养部位关联项目信息", DmsBaseStationProjectVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保养部位关联项目信息详细信息
|
||||
*
|
||||
* @param maintStationId 主键
|
||||
*/
|
||||
/* @SaCheckPermission("dms:dmsBaseStationProject:query")*/
|
||||
@GetMapping("/{maintStationId}")
|
||||
public R<DmsBaseStationProjectVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long maintStationId) {
|
||||
return R.ok(dmsBaseStationProjectService.queryById(maintStationId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养部位关联项目信息
|
||||
*/
|
||||
/* @SaCheckPermission("dms:dmsBaseStationProject:add")*/
|
||||
@Log(title = "保养部位关联项目信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DmsBaseStationProjectBo bo) {
|
||||
return toAjax(dmsBaseStationProjectService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养部位关联项目信息
|
||||
*/
|
||||
/* @SaCheckPermission("dms:dmsBaseStationProject:edit")*/
|
||||
@Log(title = "保养部位关联项目信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DmsBaseStationProjectBo bo) {
|
||||
return toAjax(dmsBaseStationProjectService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保养部位关联项目信息
|
||||
*
|
||||
* @param maintStationIds 主键串
|
||||
*/
|
||||
/* @SaCheckPermission("dms:dmsBaseStationProject:remove")*/
|
||||
@Log(title = "保养部位关联项目信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{maintStationIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] maintStationIds) {
|
||||
return toAjax(dmsBaseStationProjectService.deleteWithValidByIds(List.of(maintStationIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询保养部位关联项目信息列表
|
||||
*/
|
||||
|
||||
/* @GetMapping("/getDmsBaseStationProjectList")*/
|
||||
public R<List<DmsBaseStationProjectVo>> getDmsBaseStationProjectList(DmsBaseStationProjectBo bo) {
|
||||
List<DmsBaseStationProjectVo> list = dmsBaseStationProjectService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.dms.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.dms.domain.vo.DmsPlanMaintVo;
|
||||
import org.dromara.dms.domain.bo.DmsPlanMaintBo;
|
||||
import org.dromara.dms.service.IDmsPlanMaintService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 保养计划信息
|
||||
* 前端访问路由地址为:/dms/dmsPlanMaint
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dmsPlanMaint")
|
||||
public class DmsPlanMaintController extends BaseController {
|
||||
|
||||
private final IDmsPlanMaintService dmsPlanMaintService;
|
||||
|
||||
/**
|
||||
* 查询保养计划信息列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaint:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DmsPlanMaintVo> list(DmsPlanMaintBo bo, PageQuery pageQuery) {
|
||||
return dmsPlanMaintService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出保养计划信息列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaint:export")
|
||||
@Log(title = "保养计划信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(DmsPlanMaintBo bo, HttpServletResponse response) {
|
||||
List<DmsPlanMaintVo> list = dmsPlanMaintService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "保养计划信息", DmsPlanMaintVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保养计划信息详细信息
|
||||
*
|
||||
* @param planMaintId 主键
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaint:query")
|
||||
@GetMapping("/{planMaintId}")
|
||||
public R<DmsPlanMaintVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long planMaintId) {
|
||||
return R.ok(dmsPlanMaintService.queryById(planMaintId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养计划信息
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaint:add")
|
||||
@Log(title = "保养计划信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DmsPlanMaintBo bo) {
|
||||
return toAjax(dmsPlanMaintService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养计划信息
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaint:edit")
|
||||
@Log(title = "保养计划信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DmsPlanMaintBo bo) {
|
||||
return toAjax(dmsPlanMaintService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保养计划信息
|
||||
*
|
||||
* @param planMaintIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaint:remove")
|
||||
@Log(title = "保养计划信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planMaintIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] planMaintIds) {
|
||||
return toAjax(dmsPlanMaintService.deleteWithValidByIds(List.of(planMaintIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询保养计划信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("/getDmsPlanMaintList")
|
||||
public R<List<DmsPlanMaintVo>> getDmsPlanMaintList(DmsPlanMaintBo bo) {
|
||||
List<DmsPlanMaintVo> list = dmsPlanMaintService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.dms.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.*;
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.common.core.domain.R;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.excel.utils.ExcelUtil;
|
||||
import org.dromara.dms.domain.vo.DmsPlanMaintDetailVo;
|
||||
import org.dromara.dms.domain.bo.DmsPlanMaintDetailBo;
|
||||
import org.dromara.dms.service.IDmsPlanMaintDetailService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 保养计划明细
|
||||
* 前端访问路由地址为:/dms/dmsPlanMaintDetail
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/dmsPlanMaintDetail")
|
||||
public class DmsPlanMaintDetailController extends BaseController {
|
||||
|
||||
private final IDmsPlanMaintDetailService dmsPlanMaintDetailService;
|
||||
|
||||
/**
|
||||
* 查询保养计划明细列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaintDetail:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<DmsPlanMaintDetailVo> list(DmsPlanMaintDetailBo bo, PageQuery pageQuery) {
|
||||
return dmsPlanMaintDetailService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出保养计划明细列表
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaintDetail:export")
|
||||
@Log(title = "保养计划明细", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(DmsPlanMaintDetailBo bo, HttpServletResponse response) {
|
||||
List<DmsPlanMaintDetailVo> list = dmsPlanMaintDetailService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "保养计划明细", DmsPlanMaintDetailVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取保养计划明细详细信息
|
||||
*
|
||||
* @param planMaintDetailId 主键
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaintDetail:query")
|
||||
@GetMapping("/{planMaintDetailId}")
|
||||
public R<DmsPlanMaintDetailVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long planMaintDetailId) {
|
||||
return R.ok(dmsPlanMaintDetailService.queryById(planMaintDetailId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养计划明细
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaintDetail:add")
|
||||
@Log(title = "保养计划明细", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody DmsPlanMaintDetailBo bo) {
|
||||
return toAjax(dmsPlanMaintDetailService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养计划明细
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaintDetail:edit")
|
||||
@Log(title = "保养计划明细", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody DmsPlanMaintDetailBo bo) {
|
||||
return toAjax(dmsPlanMaintDetailService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除保养计划明细
|
||||
*
|
||||
* @param planMaintDetailIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("dms:dmsPlanMaintDetail:remove")
|
||||
@Log(title = "保养计划明细", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planMaintDetailIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] planMaintDetailIds) {
|
||||
return toAjax(dmsPlanMaintDetailService.deleteWithValidByIds(List.of(planMaintDetailIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询保养计划明细列表
|
||||
*/
|
||||
|
||||
@GetMapping("/getDmsPlanMaintDetailList")
|
||||
public R<List<DmsPlanMaintDetailVo>> getDmsPlanMaintDetailList(DmsPlanMaintDetailBo bo) {
|
||||
List<DmsPlanMaintDetailVo> list = dmsPlanMaintDetailService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
package org.dromara.dms.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 保养部位关联项目信息对象 dms_base_station_project
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("dms_base_station_project")
|
||||
public class DmsBaseStationProject extends BaseEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 保养部位ID
|
||||
*/
|
||||
private Long maintStationId;
|
||||
|
||||
/**
|
||||
* 保养项目ID
|
||||
*/
|
||||
private Long maintProjectId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
package org.dromara.dms.domain.bo;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseStationProject;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* 保养部位关联项目信息业务对象 dms_base_station_project
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = DmsBaseStationProject.class, reverseConvertGenerate = false)
|
||||
public class DmsBaseStationProjectBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 保养部位ID
|
||||
*/
|
||||
@NotNull(message = "保养部位ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long maintStationId;
|
||||
|
||||
/**
|
||||
* 保养项目ID
|
||||
*/
|
||||
@NotNull(message = "保养项目ID不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long maintProjectId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
package org.dromara.dms.domain.vo;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseStationProject;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保养部位关联项目信息视图对象 dms_base_station_project
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = DmsBaseStationProject.class)
|
||||
public class DmsBaseStationProjectVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 保养部位ID
|
||||
*/
|
||||
@ExcelProperty(value = "保养部位ID")
|
||||
private Long maintStationId;
|
||||
|
||||
/**
|
||||
* 保养项目ID
|
||||
*/
|
||||
@ExcelProperty(value = "保养项目ID")
|
||||
private Long maintProjectId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.dms.mapper;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseMaintProject;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintProjectVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 保养项目信息Mapper接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface DmsBaseMaintProjectMapper extends BaseMapperPlus<DmsBaseMaintProject, DmsBaseMaintProjectVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.dms.mapper;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseMaintStandard;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintStandardVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 保养标准信息Mapper接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface DmsBaseMaintStandardMapper extends BaseMapperPlus<DmsBaseMaintStandard, DmsBaseMaintStandardVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.dms.mapper;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseMaintStation;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintStationVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 保养部位信息Mapper接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface DmsBaseMaintStationMapper extends BaseMapperPlus<DmsBaseMaintStation, DmsBaseMaintStationVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.dms.mapper;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseStationProject;
|
||||
import org.dromara.dms.domain.vo.DmsBaseStationProjectVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 保养部位关联项目信息Mapper接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface DmsBaseStationProjectMapper extends BaseMapperPlus<DmsBaseStationProject, DmsBaseStationProjectVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.dms.mapper;
|
||||
|
||||
import org.dromara.dms.domain.DmsPlanMaintDetail;
|
||||
import org.dromara.dms.domain.vo.DmsPlanMaintDetailVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 保养计划明细Mapper接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface DmsPlanMaintDetailMapper extends BaseMapperPlus<DmsPlanMaintDetail, DmsPlanMaintDetailVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.dms.mapper;
|
||||
|
||||
import org.dromara.dms.domain.DmsPlanMaint;
|
||||
import org.dromara.dms.domain.vo.DmsPlanMaintVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 保养计划信息Mapper接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface DmsPlanMaintMapper extends BaseMapperPlus<DmsPlanMaint, DmsPlanMaintVo> {
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.dms.service;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseMaintProject;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintProjectVo;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintProjectBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保养项目信息Service接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface IDmsBaseMaintProjectService {
|
||||
|
||||
/**
|
||||
* 查询保养项目信息
|
||||
*
|
||||
* @param maintProjectId 主键
|
||||
* @return 保养项目信息
|
||||
*/
|
||||
DmsBaseMaintProjectVo queryById(Long maintProjectId);
|
||||
|
||||
/**
|
||||
* 分页查询保养项目信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养项目信息分页列表
|
||||
*/
|
||||
TableDataInfo<DmsBaseMaintProjectVo> queryPageList(DmsBaseMaintProjectBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养项目信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养项目信息列表
|
||||
*/
|
||||
List<DmsBaseMaintProjectVo> queryList(DmsBaseMaintProjectBo bo);
|
||||
|
||||
/**
|
||||
* 新增保养项目信息
|
||||
*
|
||||
* @param bo 保养项目信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(DmsBaseMaintProjectBo bo);
|
||||
|
||||
/**
|
||||
* 修改保养项目信息
|
||||
*
|
||||
* @param bo 保养项目信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(DmsBaseMaintProjectBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养项目信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.dms.service;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseMaintStandard;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintStandardVo;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintStandardBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保养标准信息Service接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface IDmsBaseMaintStandardService {
|
||||
|
||||
/**
|
||||
* 查询保养标准信息
|
||||
*
|
||||
* @param maintStandardId 主键
|
||||
* @return 保养标准信息
|
||||
*/
|
||||
DmsBaseMaintStandardVo queryById(Long maintStandardId);
|
||||
|
||||
/**
|
||||
* 分页查询保养标准信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养标准信息分页列表
|
||||
*/
|
||||
TableDataInfo<DmsBaseMaintStandardVo> queryPageList(DmsBaseMaintStandardBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养标准信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养标准信息列表
|
||||
*/
|
||||
List<DmsBaseMaintStandardVo> queryList(DmsBaseMaintStandardBo bo);
|
||||
|
||||
/**
|
||||
* 新增保养标准信息
|
||||
*
|
||||
* @param bo 保养标准信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(DmsBaseMaintStandardBo bo);
|
||||
|
||||
/**
|
||||
* 修改保养标准信息
|
||||
*
|
||||
* @param bo 保养标准信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(DmsBaseMaintStandardBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养标准信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.dms.service;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseMaintStation;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintStationVo;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintStationBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保养部位信息Service接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface IDmsBaseMaintStationService {
|
||||
|
||||
/**
|
||||
* 查询保养部位信息
|
||||
*
|
||||
* @param maintStationId 主键
|
||||
* @return 保养部位信息
|
||||
*/
|
||||
DmsBaseMaintStationVo queryById(Long maintStationId);
|
||||
|
||||
/**
|
||||
* 分页查询保养部位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养部位信息分页列表
|
||||
*/
|
||||
TableDataInfo<DmsBaseMaintStationVo> queryPageList(DmsBaseMaintStationBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养部位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养部位信息列表
|
||||
*/
|
||||
List<DmsBaseMaintStationVo> queryList(DmsBaseMaintStationBo bo);
|
||||
|
||||
/**
|
||||
* 新增保养部位信息
|
||||
*
|
||||
* @param bo 保养部位信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(DmsBaseMaintStationBo bo);
|
||||
|
||||
/**
|
||||
* 修改保养部位信息
|
||||
*
|
||||
* @param bo 保养部位信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(DmsBaseMaintStationBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养部位信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.dms.service;
|
||||
|
||||
import org.dromara.dms.domain.DmsBaseStationProject;
|
||||
import org.dromara.dms.domain.vo.DmsBaseStationProjectVo;
|
||||
import org.dromara.dms.domain.bo.DmsBaseStationProjectBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保养部位关联项目信息Service接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface IDmsBaseStationProjectService {
|
||||
|
||||
/**
|
||||
* 查询保养部位关联项目信息
|
||||
*
|
||||
* @param maintStationId 主键
|
||||
* @return 保养部位关联项目信息
|
||||
*/
|
||||
DmsBaseStationProjectVo queryById(Long maintStationId);
|
||||
|
||||
/**
|
||||
* 分页查询保养部位关联项目信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养部位关联项目信息分页列表
|
||||
*/
|
||||
TableDataInfo<DmsBaseStationProjectVo> queryPageList(DmsBaseStationProjectBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养部位关联项目信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养部位关联项目信息列表
|
||||
*/
|
||||
List<DmsBaseStationProjectVo> queryList(DmsBaseStationProjectBo bo);
|
||||
|
||||
/**
|
||||
* 新增保养部位关联项目信息
|
||||
*
|
||||
* @param bo 保养部位关联项目信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(DmsBaseStationProjectBo bo);
|
||||
|
||||
/**
|
||||
* 修改保养部位关联项目信息
|
||||
*
|
||||
* @param bo 保养部位关联项目信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(DmsBaseStationProjectBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养部位关联项目信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.dms.service;
|
||||
|
||||
import org.dromara.dms.domain.DmsPlanMaintDetail;
|
||||
import org.dromara.dms.domain.vo.DmsPlanMaintDetailVo;
|
||||
import org.dromara.dms.domain.bo.DmsPlanMaintDetailBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保养计划明细Service接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface IDmsPlanMaintDetailService {
|
||||
|
||||
/**
|
||||
* 查询保养计划明细
|
||||
*
|
||||
* @param planMaintDetailId 主键
|
||||
* @return 保养计划明细
|
||||
*/
|
||||
DmsPlanMaintDetailVo queryById(Long planMaintDetailId);
|
||||
|
||||
/**
|
||||
* 分页查询保养计划明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养计划明细分页列表
|
||||
*/
|
||||
TableDataInfo<DmsPlanMaintDetailVo> queryPageList(DmsPlanMaintDetailBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养计划明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养计划明细列表
|
||||
*/
|
||||
List<DmsPlanMaintDetailVo> queryList(DmsPlanMaintDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增保养计划明细
|
||||
*
|
||||
* @param bo 保养计划明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(DmsPlanMaintDetailBo bo);
|
||||
|
||||
/**
|
||||
* 修改保养计划明细
|
||||
*
|
||||
* @param bo 保养计划明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(DmsPlanMaintDetailBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养计划明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.dms.service;
|
||||
|
||||
import org.dromara.dms.domain.DmsPlanMaint;
|
||||
import org.dromara.dms.domain.vo.DmsPlanMaintVo;
|
||||
import org.dromara.dms.domain.bo.DmsPlanMaintBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 保养计划信息Service接口
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
public interface IDmsPlanMaintService {
|
||||
|
||||
/**
|
||||
* 查询保养计划信息
|
||||
*
|
||||
* @param planMaintId 主键
|
||||
* @return 保养计划信息
|
||||
*/
|
||||
DmsPlanMaintVo queryById(Long planMaintId);
|
||||
|
||||
/**
|
||||
* 分页查询保养计划信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养计划信息分页列表
|
||||
*/
|
||||
TableDataInfo<DmsPlanMaintVo> queryPageList(DmsPlanMaintBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养计划信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养计划信息列表
|
||||
*/
|
||||
List<DmsPlanMaintVo> queryList(DmsPlanMaintBo bo);
|
||||
|
||||
/**
|
||||
* 新增保养计划信息
|
||||
*
|
||||
* @param bo 保养计划信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(DmsPlanMaintBo bo);
|
||||
|
||||
/**
|
||||
* 修改保养计划信息
|
||||
*
|
||||
* @param bo 保养计划信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(DmsPlanMaintBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养计划信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,135 @@
|
||||
package org.dromara.dms.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintProjectBo;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintProjectVo;
|
||||
import org.dromara.dms.domain.DmsBaseMaintProject;
|
||||
import org.dromara.dms.mapper.DmsBaseMaintProjectMapper;
|
||||
import org.dromara.dms.service.IDmsBaseMaintProjectService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 保养项目信息Service业务层处理
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DmsBaseMaintProjectServiceImpl implements IDmsBaseMaintProjectService {
|
||||
|
||||
private final DmsBaseMaintProjectMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询保养项目信息
|
||||
*
|
||||
* @param maintProjectId 主键
|
||||
* @return 保养项目信息
|
||||
*/
|
||||
@Override
|
||||
public DmsBaseMaintProjectVo queryById(Long maintProjectId){
|
||||
return baseMapper.selectVoById(maintProjectId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询保养项目信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养项目信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DmsBaseMaintProjectVo> queryPageList(DmsBaseMaintProjectBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<DmsBaseMaintProject> lqw = buildQueryWrapper(bo);
|
||||
Page<DmsBaseMaintProjectVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养项目信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养项目信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<DmsBaseMaintProjectVo> queryList(DmsBaseMaintProjectBo bo) {
|
||||
MPJLambdaWrapper<DmsBaseMaintProject> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<DmsBaseMaintProject> buildQueryWrapper(DmsBaseMaintProjectBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<DmsBaseMaintProject> lqw = JoinWrappers.lambda(DmsBaseMaintProject.class)
|
||||
.selectAll(DmsBaseMaintProject.class)
|
||||
.eq(bo.getMaintProjectId() != null, DmsBaseMaintProject::getMaintProjectId, bo.getMaintProjectId())
|
||||
.like(StringUtils.isNotBlank(bo.getMaintProjectName()), DmsBaseMaintProject::getMaintProjectName, bo.getMaintProjectName())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaintProjectDesc()), DmsBaseMaintProject::getMaintProjectDesc, bo.getMaintProjectDesc())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), DmsBaseMaintProject::getActiveFlag, bo.getActiveFlag())
|
||||
.orderByDesc(DmsBaseMaintProject::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养项目信息
|
||||
*
|
||||
* @param bo 保养项目信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DmsBaseMaintProjectBo bo) {
|
||||
DmsBaseMaintProject add = MapstructUtils.convert(bo, DmsBaseMaintProject.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMaintProjectId(add.getMaintProjectId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养项目信息
|
||||
*
|
||||
* @param bo 保养项目信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DmsBaseMaintProjectBo bo) {
|
||||
DmsBaseMaintProject update = MapstructUtils.convert(bo, DmsBaseMaintProject.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DmsBaseMaintProject entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养项目信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
package org.dromara.dms.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.dms.domain.DmsBaseDeviceType;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintStandardBo;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintStandardVo;
|
||||
import org.dromara.dms.domain.DmsBaseMaintStandard;
|
||||
import org.dromara.dms.mapper.DmsBaseMaintStandardMapper;
|
||||
import org.dromara.dms.service.IDmsBaseMaintStandardService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 保养标准信息Service业务层处理
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DmsBaseMaintStandardServiceImpl implements IDmsBaseMaintStandardService {
|
||||
|
||||
private final DmsBaseMaintStandardMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询保养标准信息
|
||||
*
|
||||
* @param maintStandardId 主键
|
||||
* @return 保养标准信息
|
||||
*/
|
||||
@Override
|
||||
public DmsBaseMaintStandardVo queryById(Long maintStandardId){
|
||||
return baseMapper.selectVoById(maintStandardId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询保养标准信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养标准信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DmsBaseMaintStandardVo> queryPageList(DmsBaseMaintStandardBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<DmsBaseMaintStandard> lqw = buildQueryWrapper(bo);
|
||||
Page<DmsBaseMaintStandardVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养标准信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养标准信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<DmsBaseMaintStandardVo> queryList(DmsBaseMaintStandardBo bo) {
|
||||
MPJLambdaWrapper<DmsBaseMaintStandard> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<DmsBaseMaintStandard> buildQueryWrapper(DmsBaseMaintStandardBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<DmsBaseMaintStandard> lqw = JoinWrappers.lambda(DmsBaseMaintStandard.class)
|
||||
.selectAll(DmsBaseMaintStandard.class)
|
||||
|
||||
//关联查询设备类型
|
||||
.select(DmsBaseDeviceType::getDeviceTypeName)
|
||||
.leftJoin(DmsBaseDeviceType.class, DmsBaseDeviceType::getDeviceTypeId,DmsBaseMaintStandard::getDeviceTypeId)
|
||||
|
||||
.eq(bo.getMaintStandardId() != null, DmsBaseMaintStandard::getMaintStandardId, bo.getMaintStandardId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaintStandardCode()), DmsBaseMaintStandard::getMaintStandardCode, bo.getMaintStandardCode())
|
||||
.eq(bo.getDeviceTypeId() != null, DmsBaseMaintStandard::getDeviceTypeId, bo.getDeviceTypeId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaintProtocol()), DmsBaseMaintStandard::getMaintProtocol, bo.getMaintProtocol())
|
||||
.eq(StringUtils.isNotBlank(bo.getOperationDescription()), DmsBaseMaintStandard::getOperationDescription, bo.getOperationDescription())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), DmsBaseMaintStandard::getActiveFlag, bo.getActiveFlag())
|
||||
.orderByDesc(DmsBaseMaintStandard::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养标准信息
|
||||
*
|
||||
* @param bo 保养标准信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DmsBaseMaintStandardBo bo) {
|
||||
DmsBaseMaintStandard add = MapstructUtils.convert(bo, DmsBaseMaintStandard.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMaintStandardId(add.getMaintStandardId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养标准信息
|
||||
*
|
||||
* @param bo 保养标准信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DmsBaseMaintStandardBo bo) {
|
||||
DmsBaseMaintStandard update = MapstructUtils.convert(bo, DmsBaseMaintStandard.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DmsBaseMaintStandard entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养标准信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,148 @@
|
||||
package org.dromara.dms.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.dms.domain.DmsBaseDeviceType;
|
||||
import org.dromara.dms.domain.DmsBaseMaintStandard;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.dms.domain.bo.DmsBaseMaintStationBo;
|
||||
import org.dromara.dms.domain.vo.DmsBaseMaintStationVo;
|
||||
import org.dromara.dms.domain.DmsBaseMaintStation;
|
||||
import org.dromara.dms.mapper.DmsBaseMaintStationMapper;
|
||||
import org.dromara.dms.service.IDmsBaseMaintStationService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 保养部位信息Service业务层处理
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DmsBaseMaintStationServiceImpl implements IDmsBaseMaintStationService {
|
||||
|
||||
private final DmsBaseMaintStationMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询保养部位信息
|
||||
*
|
||||
* @param maintStationId 主键
|
||||
* @return 保养部位信息
|
||||
*/
|
||||
@Override
|
||||
public DmsBaseMaintStationVo queryById(Long maintStationId){
|
||||
return baseMapper.selectVoById(maintStationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询保养部位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养部位信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DmsBaseMaintStationVo> queryPageList(DmsBaseMaintStationBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<DmsBaseMaintStation> lqw = buildQueryWrapper(bo);
|
||||
Page<DmsBaseMaintStationVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养部位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养部位信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<DmsBaseMaintStationVo> queryList(DmsBaseMaintStationBo bo) {
|
||||
MPJLambdaWrapper<DmsBaseMaintStation> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<DmsBaseMaintStation> buildQueryWrapper(DmsBaseMaintStationBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<DmsBaseMaintStation> lqw = JoinWrappers.lambda(DmsBaseMaintStation.class)
|
||||
.selectAll(DmsBaseMaintStation.class)
|
||||
|
||||
//关联查询设备类型信息
|
||||
.select(DmsBaseDeviceType::getDeviceTypeName)
|
||||
.leftJoin(DmsBaseDeviceType.class, DmsBaseDeviceType::getDeviceTypeId, DmsBaseMaintStation::getDeviceTypeId)
|
||||
|
||||
//关联查询保养标准信息
|
||||
.select(DmsBaseMaintStandard::getMaintStandardCode)
|
||||
.leftJoin(DmsBaseMaintStandard.class, DmsBaseMaintStandard::getMaintStandardId, DmsBaseMaintStation::getMaintStandardId)
|
||||
|
||||
.eq(bo.getMaintStationId() != null, DmsBaseMaintStation::getMaintStationId, bo.getMaintStationId())
|
||||
.eq(bo.getDeviceTypeId() != null, DmsBaseMaintStation::getDeviceTypeId, bo.getDeviceTypeId())
|
||||
.eq(bo.getMaintStandardId() != null, DmsBaseMaintStation::getMaintStandardId, bo.getMaintStandardId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaintStationCode()), DmsBaseMaintStation::getMaintStationCode, bo.getMaintStationCode())
|
||||
.like(StringUtils.isNotBlank(bo.getMaintStationName()), DmsBaseMaintStation::getMaintStationName, bo.getMaintStationName())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), DmsBaseMaintStation::getActiveFlag, bo.getActiveFlag())
|
||||
.orderByDesc(DmsBaseMaintStation::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养部位信息
|
||||
*
|
||||
* @param bo 保养部位信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DmsBaseMaintStationBo bo) {
|
||||
DmsBaseMaintStation add = MapstructUtils.convert(bo, DmsBaseMaintStation.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMaintStationId(add.getMaintStationId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养部位信息
|
||||
*
|
||||
* @param bo 保养部位信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DmsBaseMaintStationBo bo) {
|
||||
DmsBaseMaintStation update = MapstructUtils.convert(bo, DmsBaseMaintStation.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DmsBaseMaintStation entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养部位信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,133 @@
|
||||
package org.dromara.dms.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.dms.domain.bo.DmsBaseStationProjectBo;
|
||||
import org.dromara.dms.domain.vo.DmsBaseStationProjectVo;
|
||||
import org.dromara.dms.domain.DmsBaseStationProject;
|
||||
import org.dromara.dms.mapper.DmsBaseStationProjectMapper;
|
||||
import org.dromara.dms.service.IDmsBaseStationProjectService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 保养部位关联项目信息Service业务层处理
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DmsBaseStationProjectServiceImpl implements IDmsBaseStationProjectService {
|
||||
|
||||
private final DmsBaseStationProjectMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询保养部位关联项目信息
|
||||
*
|
||||
* @param maintStationId 主键
|
||||
* @return 保养部位关联项目信息
|
||||
*/
|
||||
@Override
|
||||
public DmsBaseStationProjectVo queryById(Long maintStationId){
|
||||
return baseMapper.selectVoById(maintStationId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询保养部位关联项目信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养部位关联项目信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DmsBaseStationProjectVo> queryPageList(DmsBaseStationProjectBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<DmsBaseStationProject> lqw = buildQueryWrapper(bo);
|
||||
Page<DmsBaseStationProjectVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养部位关联项目信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养部位关联项目信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<DmsBaseStationProjectVo> queryList(DmsBaseStationProjectBo bo) {
|
||||
MPJLambdaWrapper<DmsBaseStationProject> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<DmsBaseStationProject> buildQueryWrapper(DmsBaseStationProjectBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<DmsBaseStationProject> lqw = JoinWrappers.lambda(DmsBaseStationProject.class)
|
||||
.selectAll(DmsBaseStationProject.class)
|
||||
.eq(bo.getMaintStationId() != null, DmsBaseStationProject::getMaintStationId, bo.getMaintStationId())
|
||||
.eq(bo.getMaintProjectId() != null, DmsBaseStationProject::getMaintProjectId, bo.getMaintProjectId())
|
||||
.orderByDesc(DmsBaseStationProject::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养部位关联项目信息
|
||||
*
|
||||
* @param bo 保养部位关联项目信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DmsBaseStationProjectBo bo) {
|
||||
DmsBaseStationProject add = MapstructUtils.convert(bo, DmsBaseStationProject.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMaintStationId(add.getMaintStationId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养部位关联项目信息
|
||||
*
|
||||
* @param bo 保养部位关联项目信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DmsBaseStationProjectBo bo) {
|
||||
DmsBaseStationProject update = MapstructUtils.convert(bo, DmsBaseStationProject.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DmsBaseStationProject entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养部位关联项目信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,155 @@
|
||||
package org.dromara.dms.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.dms.domain.*;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.dms.domain.bo.DmsPlanMaintDetailBo;
|
||||
import org.dromara.dms.domain.vo.DmsPlanMaintDetailVo;
|
||||
import org.dromara.dms.mapper.DmsPlanMaintDetailMapper;
|
||||
import org.dromara.dms.service.IDmsPlanMaintDetailService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 保养计划明细Service业务层处理
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DmsPlanMaintDetailServiceImpl implements IDmsPlanMaintDetailService {
|
||||
|
||||
private final DmsPlanMaintDetailMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询保养计划明细
|
||||
*
|
||||
* @param planMaintDetailId 主键
|
||||
* @return 保养计划明细
|
||||
*/
|
||||
@Override
|
||||
public DmsPlanMaintDetailVo queryById(Long planMaintDetailId){
|
||||
return baseMapper.selectVoById(planMaintDetailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询保养计划明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养计划明细分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DmsPlanMaintDetailVo> queryPageList(DmsPlanMaintDetailBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<DmsPlanMaintDetail> lqw = buildQueryWrapper(bo);
|
||||
Page<DmsPlanMaintDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养计划明细列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养计划明细列表
|
||||
*/
|
||||
@Override
|
||||
public List<DmsPlanMaintDetailVo> queryList(DmsPlanMaintDetailBo bo) {
|
||||
MPJLambdaWrapper<DmsPlanMaintDetail> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<DmsPlanMaintDetail> buildQueryWrapper(DmsPlanMaintDetailBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<DmsPlanMaintDetail> lqw = JoinWrappers.lambda(DmsPlanMaintDetail.class)
|
||||
.selectAll(DmsPlanMaintDetail.class)
|
||||
|
||||
//关联查询保养部位
|
||||
.select(DmsBaseMaintStation::getMaintStationName)
|
||||
.leftJoin(DmsBaseMaintStation.class,DmsBaseMaintStation::getMaintStationId,DmsPlanMaintDetail::getMaintStationId)
|
||||
|
||||
//关联查询设备
|
||||
.select(DmsBaseMachineInfo::getMachineName)
|
||||
.leftJoin(DmsBaseMachineInfo.class,DmsBaseMachineInfo::getMachineId,DmsPlanMaintDetail::getMachineId)
|
||||
|
||||
//关联查询保养标准
|
||||
.select(DmsBaseMaintStandard::getMaintStandardCode)
|
||||
.leftJoin(DmsBaseMaintStandard.class, DmsBaseMaintStandard::getMaintStandardId,DmsPlanMaintDetail::getMaintStandardId)
|
||||
|
||||
//关联查询保养计划
|
||||
.select(DmsPlanMaint::getPlanMaintCode)
|
||||
.leftJoin(DmsPlanMaint.class, DmsPlanMaint::getPlanMaintId,DmsPlanMaintDetail::getPlanMaintId)
|
||||
|
||||
|
||||
.eq(bo.getPlanMaintDetailId() != null, DmsPlanMaintDetail::getPlanMaintDetailId, bo.getPlanMaintDetailId())
|
||||
.eq(bo.getPlanMaintId() != null, DmsPlanMaintDetail::getPlanMaintId, bo.getPlanMaintId())
|
||||
.eq(bo.getMachineId() != null, DmsPlanMaintDetail::getMachineId, bo.getMachineId())
|
||||
.eq(bo.getMaintStationId() != null, DmsPlanMaintDetail::getMaintStationId, bo.getMaintStationId())
|
||||
.eq(bo.getMaintStandardId() != null, DmsPlanMaintDetail::getMaintStandardId, bo.getMaintStandardId())
|
||||
.eq(StringUtils.isNotBlank(bo.getOperationDescription()), DmsPlanMaintDetail::getOperationDescription, bo.getOperationDescription())
|
||||
.orderByDesc(DmsPlanMaintDetail::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养计划明细
|
||||
*
|
||||
* @param bo 保养计划明细
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DmsPlanMaintDetailBo bo) {
|
||||
DmsPlanMaintDetail add = MapstructUtils.convert(bo, DmsPlanMaintDetail.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPlanMaintDetailId(add.getPlanMaintDetailId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养计划明细
|
||||
*
|
||||
* @param bo 保养计划明细
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DmsPlanMaintDetailBo bo) {
|
||||
DmsPlanMaintDetail update = MapstructUtils.convert(bo, DmsPlanMaintDetail.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DmsPlanMaintDetail entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养计划明细信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,143 @@
|
||||
package org.dromara.dms.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.github.yulichang.toolkit.JoinWrappers;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.dms.domain.bo.DmsPlanMaintBo;
|
||||
import org.dromara.dms.domain.vo.DmsPlanMaintVo;
|
||||
import org.dromara.dms.domain.DmsPlanMaint;
|
||||
import org.dromara.dms.mapper.DmsPlanMaintMapper;
|
||||
import org.dromara.dms.service.IDmsPlanMaintService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 保养计划信息Service业务层处理
|
||||
*
|
||||
* @author zch
|
||||
* @date 2025-03-21
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class DmsPlanMaintServiceImpl implements IDmsPlanMaintService {
|
||||
|
||||
private final DmsPlanMaintMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询保养计划信息
|
||||
*
|
||||
* @param planMaintId 主键
|
||||
* @return 保养计划信息
|
||||
*/
|
||||
@Override
|
||||
public DmsPlanMaintVo queryById(Long planMaintId){
|
||||
return baseMapper.selectVoById(planMaintId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询保养计划信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 保养计划信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<DmsPlanMaintVo> queryPageList(DmsPlanMaintBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<DmsPlanMaint> lqw = buildQueryWrapper(bo);
|
||||
Page<DmsPlanMaintVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的保养计划信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 保养计划信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<DmsPlanMaintVo> queryList(DmsPlanMaintBo bo) {
|
||||
MPJLambdaWrapper<DmsPlanMaint> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<DmsPlanMaint> buildQueryWrapper(DmsPlanMaintBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<DmsPlanMaint> lqw = JoinWrappers.lambda(DmsPlanMaint.class)
|
||||
.selectAll(DmsPlanMaint.class)
|
||||
.eq(bo.getPlanMaintId() != null, DmsPlanMaint::getPlanMaintId, bo.getPlanMaintId())
|
||||
.eq(StringUtils.isNotBlank(bo.getPlanMaintCode()), DmsPlanMaint::getPlanMaintCode, bo.getPlanMaintCode())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaintLevel()), DmsPlanMaint::getMaintLevel, bo.getMaintLevel())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaintGroup()), DmsPlanMaint::getMaintGroup, bo.getMaintGroup())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaintSupervisor()), DmsPlanMaint::getMaintSupervisor, bo.getMaintSupervisor())
|
||||
.eq(bo.getMaintTime() != null, DmsPlanMaint::getMaintTime, bo.getMaintTime())
|
||||
.eq(bo.getJobId() != null, DmsPlanMaint::getJobId, bo.getJobId())
|
||||
.eq(bo.getTimeLimit() != null, DmsPlanMaint::getTimeLimit, bo.getTimeLimit())
|
||||
.eq(bo.getCyclePeriod() != null, DmsPlanMaint::getCyclePeriod, bo.getCyclePeriod())
|
||||
.eq(bo.getMaintStatus() != null, DmsPlanMaint::getMaintStatus, bo.getMaintStatus())
|
||||
.eq(bo.getCreateMethod() != null, DmsPlanMaint::getCreateMethod, bo.getCreateMethod())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), DmsPlanMaint::getActiveFlag, bo.getActiveFlag())
|
||||
.orderByDesc(DmsPlanMaint::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增保养计划信息
|
||||
*
|
||||
* @param bo 保养计划信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(DmsPlanMaintBo bo) {
|
||||
DmsPlanMaint add = MapstructUtils.convert(bo, DmsPlanMaint.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setPlanMaintId(add.getPlanMaintId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改保养计划信息
|
||||
*
|
||||
* @param bo 保养计划信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(DmsPlanMaintBo bo) {
|
||||
DmsPlanMaint update = MapstructUtils.convert(bo, DmsPlanMaint.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(DmsPlanMaint entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除保养计划信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.dms.mapper.DmsBaseMaintProjectMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.dms.mapper.DmsBaseMaintStandardMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.dms.mapper.DmsBaseMaintStationMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.dms.mapper.DmsBaseStationProjectMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.dms.mapper.DmsPlanMaintDetailMapper">
|
||||
|
||||
</mapper>
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.dms.mapper.DmsPlanMaintMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue