add(hwmom-mes): 添加等同物料信息和物料信息相关功能,添加供应商相关功能,添加计量单位信息相关功能
parent
9de0c66d40
commit
f7e072e180
@ -0,0 +1,117 @@
|
||||
package org.dromara.mes.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.mes.domain.vo.BaseEqualMaterialInfoVo;
|
||||
import org.dromara.mes.domain.bo.BaseEqualMaterialInfoBo;
|
||||
import org.dromara.mes.service.IBaseEqualMaterialInfoService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 等同物料信息
|
||||
* 前端访问路由地址为:/mes/baseEqualMaterialInfo
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/baseEqualMaterialInfo")
|
||||
public class BaseEqualMaterialInfoController extends BaseController {
|
||||
|
||||
private final IBaseEqualMaterialInfoService baseEqualMaterialInfoService;
|
||||
|
||||
/**
|
||||
* 查询等同物料信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseEqualMaterialInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BaseEqualMaterialInfoVo> list(BaseEqualMaterialInfoBo bo, PageQuery pageQuery) {
|
||||
return baseEqualMaterialInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出等同物料信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseEqualMaterialInfo:export")
|
||||
@Log(title = "等同物料信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseEqualMaterialInfoBo bo, HttpServletResponse response) {
|
||||
List<BaseEqualMaterialInfoVo> list = baseEqualMaterialInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "等同物料信息", BaseEqualMaterialInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取等同物料信息详细信息
|
||||
*
|
||||
* @param equalMaterialInfoId 主键
|
||||
*/
|
||||
@SaCheckPermission("mes:baseEqualMaterialInfo:query")
|
||||
@GetMapping("/{equalMaterialInfoId}")
|
||||
public R<BaseEqualMaterialInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long equalMaterialInfoId) {
|
||||
return R.ok(baseEqualMaterialInfoService.queryById(equalMaterialInfoId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增等同物料信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseEqualMaterialInfo:add")
|
||||
@Log(title = "等同物料信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseEqualMaterialInfoBo bo) {
|
||||
return toAjax(baseEqualMaterialInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改等同物料信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseEqualMaterialInfo:edit")
|
||||
@Log(title = "等同物料信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseEqualMaterialInfoBo bo) {
|
||||
return toAjax(baseEqualMaterialInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除等同物料信息
|
||||
*
|
||||
* @param equalMaterialInfoIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mes:baseEqualMaterialInfo:remove")
|
||||
@Log(title = "等同物料信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{equalMaterialInfoIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] equalMaterialInfoIds) {
|
||||
return toAjax(baseEqualMaterialInfoService.deleteWithValidByIds(List.of(equalMaterialInfoIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询等同物料信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("getBaseEqualMaterialInfoList")
|
||||
public R<List<BaseEqualMaterialInfoVo>> getBaseEqualMaterialInfolist(BaseEqualMaterialInfoBo bo) {
|
||||
List<BaseEqualMaterialInfoVo> list = baseEqualMaterialInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.mes.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.mes.domain.vo.BaseMaterialInfoVo;
|
||||
import org.dromara.mes.domain.bo.BaseMaterialInfoBo;
|
||||
import org.dromara.mes.service.IBaseMaterialInfoService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物料信息
|
||||
* 前端访问路由地址为:/mes/baseMaterialInfo
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/baseMaterialInfo")
|
||||
public class BaseMaterialInfoController extends BaseController {
|
||||
|
||||
private final IBaseMaterialInfoService baseMaterialInfoService;
|
||||
|
||||
/**
|
||||
* 查询物料信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BaseMaterialInfoVo> list(BaseMaterialInfoBo bo, PageQuery pageQuery) {
|
||||
return baseMaterialInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialInfo:export")
|
||||
@Log(title = "物料信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseMaterialInfoBo bo, HttpServletResponse response) {
|
||||
List<BaseMaterialInfoVo> list = baseMaterialInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物料信息", BaseMaterialInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料信息详细信息
|
||||
*
|
||||
* @param materialId 主键
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialInfo:query")
|
||||
@GetMapping("/{materialId}")
|
||||
public R<BaseMaterialInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long materialId) {
|
||||
return R.ok(baseMaterialInfoService.queryById(materialId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialInfo:add")
|
||||
@Log(title = "物料信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseMaterialInfoBo bo) {
|
||||
return toAjax(baseMaterialInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialInfo:edit")
|
||||
@Log(title = "物料信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseMaterialInfoBo bo) {
|
||||
return toAjax(baseMaterialInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料信息
|
||||
*
|
||||
* @param materialIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialInfo:remove")
|
||||
@Log(title = "物料信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{materialIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] materialIds) {
|
||||
return toAjax(baseMaterialInfoService.deleteWithValidByIds(List.of(materialIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询物料信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("getBaseMaterialInfoList")
|
||||
public R<List<BaseMaterialInfoVo>> getBaseMaterialInfolist(BaseMaterialInfoBo bo) {
|
||||
List<BaseMaterialInfoVo> list = baseMaterialInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.mes.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.mes.domain.vo.BaseMaterialTypeVo;
|
||||
import org.dromara.mes.domain.bo.BaseMaterialTypeBo;
|
||||
import org.dromara.mes.service.IBaseMaterialTypeService;
|
||||
|
||||
/**
|
||||
* 物料类型信息
|
||||
* 前端访问路由地址为:/mes/baseMaterialType
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/baseMaterialType")
|
||||
public class BaseMaterialTypeController extends BaseController {
|
||||
|
||||
private final IBaseMaterialTypeService baseMaterialTypeService;
|
||||
|
||||
/**
|
||||
* 查询物料类型信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialType:list")
|
||||
@GetMapping("/list")
|
||||
public R<List<BaseMaterialTypeVo>> list(BaseMaterialTypeBo bo) {
|
||||
List<BaseMaterialTypeVo> list = baseMaterialTypeService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料类型信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialType:export")
|
||||
@Log(title = "物料类型信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseMaterialTypeBo bo, HttpServletResponse response) {
|
||||
List<BaseMaterialTypeVo> list = baseMaterialTypeService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "物料类型信息", BaseMaterialTypeVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料类型信息详细信息
|
||||
*
|
||||
* @param matrialTypeId 主键
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialType:query")
|
||||
@GetMapping("/{matrialTypeId}")
|
||||
public R<BaseMaterialTypeVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long matrialTypeId) {
|
||||
return R.ok(baseMaterialTypeService.queryById(matrialTypeId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料类型信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialType:add")
|
||||
@Log(title = "物料类型信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseMaterialTypeBo bo) {
|
||||
return toAjax(baseMaterialTypeService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料类型信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialType:edit")
|
||||
@Log(title = "物料类型信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseMaterialTypeBo bo) {
|
||||
return toAjax(baseMaterialTypeService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料类型信息
|
||||
*
|
||||
* @param matrialTypeIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMaterialType:remove")
|
||||
@Log(title = "物料类型信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{matrialTypeIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] matrialTypeIds) {
|
||||
return toAjax(baseMaterialTypeService.deleteWithValidByIds(List.of(matrialTypeIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询物料类型信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("getBaseMaterialTypeList")
|
||||
public R<List<BaseMaterialTypeVo>> getBaseMaterialTypelist(BaseMaterialTypeBo bo) {
|
||||
List<BaseMaterialTypeVo> list = baseMaterialTypeService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.mes.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.mes.domain.vo.BaseMeasurementUnitInfoVo;
|
||||
import org.dromara.mes.domain.bo.BaseMeasurementUnitInfoBo;
|
||||
import org.dromara.mes.service.IBaseMeasurementUnitInfoService;
|
||||
|
||||
/**
|
||||
* 计量单位信息
|
||||
* 前端访问路由地址为:/mes/baseMeasurementUnitInfo
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/baseMeasurementUnitInfo")
|
||||
public class BaseMeasurementUnitInfoController extends BaseController {
|
||||
|
||||
private final IBaseMeasurementUnitInfoService baseMeasurementUnitInfoService;
|
||||
|
||||
/**
|
||||
* 查询计量单位信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMeasurementUnitInfo:list")
|
||||
@GetMapping("/list")
|
||||
public R<List<BaseMeasurementUnitInfoVo>> list(BaseMeasurementUnitInfoBo bo) {
|
||||
List<BaseMeasurementUnitInfoVo> list = baseMeasurementUnitInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计量单位信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMeasurementUnitInfo:export")
|
||||
@Log(title = "计量单位信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseMeasurementUnitInfoBo bo, HttpServletResponse response) {
|
||||
List<BaseMeasurementUnitInfoVo> list = baseMeasurementUnitInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "计量单位信息", BaseMeasurementUnitInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计量单位信息详细信息
|
||||
*
|
||||
* @param unitId 主键
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMeasurementUnitInfo:query")
|
||||
@GetMapping("/{unitId}")
|
||||
public R<BaseMeasurementUnitInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long unitId) {
|
||||
return R.ok(baseMeasurementUnitInfoService.queryById(unitId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计量单位信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMeasurementUnitInfo:add")
|
||||
@Log(title = "计量单位信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseMeasurementUnitInfoBo bo) {
|
||||
return toAjax(baseMeasurementUnitInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计量单位信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMeasurementUnitInfo:edit")
|
||||
@Log(title = "计量单位信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseMeasurementUnitInfoBo bo) {
|
||||
return toAjax(baseMeasurementUnitInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计量单位信息
|
||||
*
|
||||
* @param unitIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mes:baseMeasurementUnitInfo:remove")
|
||||
@Log(title = "计量单位信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{unitIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] unitIds) {
|
||||
return toAjax(baseMeasurementUnitInfoService.deleteWithValidByIds(List.of(unitIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询计量单位信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("getBaseMeasurementUnitInfoList")
|
||||
public R<List<BaseMeasurementUnitInfoVo>> getBaseMeasurementUnitInfolist(BaseMeasurementUnitInfoBo bo) {
|
||||
List<BaseMeasurementUnitInfoVo> list = baseMeasurementUnitInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,117 @@
|
||||
package org.dromara.mes.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.mes.domain.vo.BaseSupplierInfoVo;
|
||||
import org.dromara.mes.domain.bo.BaseSupplierInfoBo;
|
||||
import org.dromara.mes.service.IBaseSupplierInfoService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 供应商信息
|
||||
* 前端访问路由地址为:/mes/baseSupplierInfo
|
||||
*
|
||||
* @author ZangCH
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/baseSupplierInfo")
|
||||
public class BaseSupplierInfoController extends BaseController {
|
||||
|
||||
private final IBaseSupplierInfoService baseSupplierInfoService;
|
||||
|
||||
/**
|
||||
* 查询供应商信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseSupplierInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BaseSupplierInfoVo> list(BaseSupplierInfoBo bo, PageQuery pageQuery) {
|
||||
return baseSupplierInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出供应商信息列表
|
||||
*/
|
||||
@SaCheckPermission("mes:baseSupplierInfo:export")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseSupplierInfoBo bo, HttpServletResponse response) {
|
||||
List<BaseSupplierInfoVo> list = baseSupplierInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "供应商信息", BaseSupplierInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取供应商信息详细信息
|
||||
*
|
||||
* @param supplierId 主键
|
||||
*/
|
||||
@SaCheckPermission("mes:baseSupplierInfo:query")
|
||||
@GetMapping("/{supplierId}")
|
||||
public R<BaseSupplierInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long supplierId) {
|
||||
return R.ok(baseSupplierInfoService.queryById(supplierId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseSupplierInfo:add")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseSupplierInfoBo bo) {
|
||||
return toAjax(baseSupplierInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*/
|
||||
@SaCheckPermission("mes:baseSupplierInfo:edit")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseSupplierInfoBo bo) {
|
||||
return toAjax(baseSupplierInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除供应商信息
|
||||
*
|
||||
* @param supplierIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("mes:baseSupplierInfo:remove")
|
||||
@Log(title = "供应商信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{supplierIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] supplierIds) {
|
||||
return toAjax(baseSupplierInfoService.deleteWithValidByIds(List.of(supplierIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询供应商信息列表
|
||||
*/
|
||||
|
||||
@GetMapping("getBaseSupplierInfoList")
|
||||
public R<List<BaseSupplierInfoVo>> getBaseSupplierInfolist(BaseSupplierInfoBo bo) {
|
||||
List<BaseSupplierInfoVo> list = baseSupplierInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.mes.mapper;
|
||||
|
||||
import org.dromara.mes.domain.BaseEqualMaterialInfo;
|
||||
import org.dromara.mes.domain.vo.BaseEqualMaterialInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 等同物料信息Mapper接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface BaseEqualMaterialInfoMapper extends BaseMapperPlus<BaseEqualMaterialInfo, BaseEqualMaterialInfoVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.mes.mapper;
|
||||
|
||||
import org.dromara.mes.domain.BaseMaterialInfo;
|
||||
import org.dromara.mes.domain.vo.BaseMaterialInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物料信息Mapper接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface BaseMaterialInfoMapper extends BaseMapperPlus<BaseMaterialInfo, BaseMaterialInfoVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.mes.mapper;
|
||||
|
||||
import org.dromara.mes.domain.BaseMaterialType;
|
||||
import org.dromara.mes.domain.vo.BaseMaterialTypeVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 物料类型信息Mapper接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface BaseMaterialTypeMapper extends BaseMapperPlus<BaseMaterialType, BaseMaterialTypeVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.mes.mapper;
|
||||
|
||||
import org.dromara.mes.domain.BaseMeasurementUnitInfo;
|
||||
import org.dromara.mes.domain.vo.BaseMeasurementUnitInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 计量单位信息Mapper接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
public interface BaseMeasurementUnitInfoMapper extends BaseMapperPlus<BaseMeasurementUnitInfo, BaseMeasurementUnitInfoVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.mes.mapper;
|
||||
|
||||
import org.dromara.mes.domain.BaseSupplierInfo;
|
||||
import org.dromara.mes.domain.vo.BaseSupplierInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 供应商信息Mapper接口
|
||||
*
|
||||
* @author ZangCH
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface BaseSupplierInfoMapper extends BaseMapperPlus<BaseSupplierInfo, BaseSupplierInfoVo> {
|
||||
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.mes.service;
|
||||
|
||||
import org.dromara.mes.domain.BaseEqualMaterialInfo;
|
||||
import org.dromara.mes.domain.vo.BaseEqualMaterialInfoVo;
|
||||
import org.dromara.mes.domain.bo.BaseEqualMaterialInfoBo;
|
||||
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 zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface IBaseEqualMaterialInfoService {
|
||||
|
||||
/**
|
||||
* 查询等同物料信息
|
||||
*
|
||||
* @param equalMaterialInfoId 主键
|
||||
* @return 等同物料信息
|
||||
*/
|
||||
BaseEqualMaterialInfoVo queryById(Long equalMaterialInfoId);
|
||||
|
||||
/**
|
||||
* 分页查询等同物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 等同物料信息分页列表
|
||||
*/
|
||||
TableDataInfo<BaseEqualMaterialInfoVo> queryPageList(BaseEqualMaterialInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的等同物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 等同物料信息列表
|
||||
*/
|
||||
List<BaseEqualMaterialInfoVo> queryList(BaseEqualMaterialInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增等同物料信息
|
||||
*
|
||||
* @param bo 等同物料信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BaseEqualMaterialInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改等同物料信息
|
||||
*
|
||||
* @param bo 等同物料信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BaseEqualMaterialInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除等同物料信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.mes.service;
|
||||
|
||||
import org.dromara.mes.domain.BaseMaterialInfo;
|
||||
import org.dromara.mes.domain.vo.BaseMaterialInfoVo;
|
||||
import org.dromara.mes.domain.bo.BaseMaterialInfoBo;
|
||||
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 zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface IBaseMaterialInfoService {
|
||||
|
||||
/**
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param materialId 主键
|
||||
* @return 物料信息
|
||||
*/
|
||||
BaseMaterialInfoVo queryById(Long materialId);
|
||||
|
||||
/**
|
||||
* 分页查询物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物料信息分页列表
|
||||
*/
|
||||
TableDataInfo<BaseMaterialInfoVo> queryPageList(BaseMaterialInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物料信息列表
|
||||
*/
|
||||
List<BaseMaterialInfoVo> queryList(BaseMaterialInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增物料信息
|
||||
*
|
||||
* @param bo 物料信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BaseMaterialInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改物料信息
|
||||
*
|
||||
* @param bo 物料信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BaseMaterialInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物料信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package org.dromara.mes.service;
|
||||
|
||||
import org.dromara.mes.domain.BaseMaterialType;
|
||||
import org.dromara.mes.domain.vo.BaseMaterialTypeVo;
|
||||
import org.dromara.mes.domain.bo.BaseMaterialTypeBo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料类型信息Service接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface IBaseMaterialTypeService {
|
||||
|
||||
/**
|
||||
* 查询物料类型信息
|
||||
*
|
||||
* @param matrialTypeId 主键
|
||||
* @return 物料类型信息
|
||||
*/
|
||||
BaseMaterialTypeVo queryById(Long matrialTypeId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的物料类型信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物料类型信息列表
|
||||
*/
|
||||
List<BaseMaterialTypeVo> queryList(BaseMaterialTypeBo bo);
|
||||
|
||||
/**
|
||||
* 新增物料类型信息
|
||||
*
|
||||
* @param bo 物料类型信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BaseMaterialTypeBo bo);
|
||||
|
||||
/**
|
||||
* 修改物料类型信息
|
||||
*
|
||||
* @param bo 物料类型信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BaseMaterialTypeBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除物料类型信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package org.dromara.mes.service;
|
||||
|
||||
import org.dromara.mes.domain.BaseMeasurementUnitInfo;
|
||||
import org.dromara.mes.domain.vo.BaseMeasurementUnitInfoVo;
|
||||
import org.dromara.mes.domain.bo.BaseMeasurementUnitInfoBo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计量单位信息Service接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
public interface IBaseMeasurementUnitInfoService {
|
||||
|
||||
/**
|
||||
* 查询计量单位信息
|
||||
*
|
||||
* @param unitId 主键
|
||||
* @return 计量单位信息
|
||||
*/
|
||||
BaseMeasurementUnitInfoVo queryById(Long unitId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的计量单位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 计量单位信息列表
|
||||
*/
|
||||
List<BaseMeasurementUnitInfoVo> queryList(BaseMeasurementUnitInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增计量单位信息
|
||||
*
|
||||
* @param bo 计量单位信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BaseMeasurementUnitInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改计量单位信息
|
||||
*
|
||||
* @param bo 计量单位信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BaseMeasurementUnitInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除计量单位信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,69 @@
|
||||
package org.dromara.mes.service;
|
||||
|
||||
import org.dromara.mes.domain.BaseSupplierInfo;
|
||||
import org.dromara.mes.domain.vo.BaseSupplierInfoVo;
|
||||
import org.dromara.mes.domain.bo.BaseSupplierInfoBo;
|
||||
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 ZangCH
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface IBaseSupplierInfoService {
|
||||
|
||||
/**
|
||||
* 查询供应商信息
|
||||
*
|
||||
* @param supplierId 主键
|
||||
* @return 供应商信息
|
||||
*/
|
||||
BaseSupplierInfoVo queryById(Long supplierId);
|
||||
|
||||
/**
|
||||
* 分页查询供应商信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 供应商信息分页列表
|
||||
*/
|
||||
TableDataInfo<BaseSupplierInfoVo> queryPageList(BaseSupplierInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的供应商信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 供应商信息列表
|
||||
*/
|
||||
List<BaseSupplierInfoVo> queryList(BaseSupplierInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*
|
||||
* @param bo 供应商信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BaseSupplierInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*
|
||||
* @param bo 供应商信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BaseSupplierInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除供应商信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,141 @@
|
||||
package org.dromara.mes.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.mes.domain.BaseMaterialInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.mes.domain.bo.BaseEqualMaterialInfoBo;
|
||||
import org.dromara.mes.domain.vo.BaseEqualMaterialInfoVo;
|
||||
import org.dromara.mes.domain.BaseEqualMaterialInfo;
|
||||
import org.dromara.mes.mapper.BaseEqualMaterialInfoMapper;
|
||||
import org.dromara.mes.service.IBaseEqualMaterialInfoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 等同物料信息Service业务层处理
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BaseEqualMaterialInfoServiceImpl implements IBaseEqualMaterialInfoService {
|
||||
|
||||
private final BaseEqualMaterialInfoMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询等同物料信息
|
||||
*
|
||||
* @param equalMaterialInfoId 主键
|
||||
* @return 等同物料信息
|
||||
*/
|
||||
@Override
|
||||
public BaseEqualMaterialInfoVo queryById(Long equalMaterialInfoId){
|
||||
return baseMapper.selectVoById(equalMaterialInfoId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询等同物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 等同物料信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BaseEqualMaterialInfoVo> queryPageList(BaseEqualMaterialInfoBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<BaseEqualMaterialInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<BaseEqualMaterialInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的等同物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 等同物料信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BaseEqualMaterialInfoVo> queryList(BaseEqualMaterialInfoBo bo) {
|
||||
MPJLambdaWrapper<BaseEqualMaterialInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BaseEqualMaterialInfo> buildQueryWrapper(BaseEqualMaterialInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BaseEqualMaterialInfo> lqw = JoinWrappers.lambda(BaseEqualMaterialInfo.class)
|
||||
.selectAll(BaseEqualMaterialInfo.class)
|
||||
|
||||
//关联查询物料名称
|
||||
.select(BaseMaterialInfo::getMaterialName)
|
||||
.leftJoin(BaseMaterialInfo.class, BaseMaterialInfo::getMaterialId, BaseEqualMaterialInfo::getMaterialId)
|
||||
|
||||
.eq(bo.getEqualMaterialInfoId() != null, BaseEqualMaterialInfo::getEqualMaterialInfoId, bo.getEqualMaterialInfoId())
|
||||
.eq(bo.getMaterialId() != null, BaseEqualMaterialInfo::getMaterialId, bo.getMaterialId())
|
||||
.eq(bo.getEqualMaterialId() != null, BaseEqualMaterialInfo::getEqualMaterialId, bo.getEqualMaterialId())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), BaseEqualMaterialInfo::getActiveFlag, bo.getActiveFlag())
|
||||
.orderByDesc(BaseEqualMaterialInfo::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增等同物料信息
|
||||
*
|
||||
* @param bo 等同物料信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BaseEqualMaterialInfoBo bo) {
|
||||
BaseEqualMaterialInfo add = MapstructUtils.convert(bo, BaseEqualMaterialInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setEqualMaterialInfoId(add.getEqualMaterialInfoId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改等同物料信息
|
||||
*
|
||||
* @param bo 等同物料信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BaseEqualMaterialInfoBo bo) {
|
||||
BaseEqualMaterialInfo update = MapstructUtils.convert(bo, BaseEqualMaterialInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BaseEqualMaterialInfo 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,185 @@
|
||||
package org.dromara.mes.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.mes.domain.ProdBaseFactoryInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.mes.domain.bo.BaseMaterialInfoBo;
|
||||
import org.dromara.mes.domain.vo.BaseMaterialInfoVo;
|
||||
import org.dromara.mes.domain.BaseMaterialInfo;
|
||||
import org.dromara.mes.mapper.BaseMaterialInfoMapper;
|
||||
import org.dromara.mes.service.IBaseMaterialInfoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物料信息Service业务层处理
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService {
|
||||
|
||||
private final BaseMaterialInfoMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物料信息
|
||||
*
|
||||
* @param materialId 主键
|
||||
* @return 物料信息
|
||||
*/
|
||||
@Override
|
||||
public BaseMaterialInfoVo queryById(Long materialId){
|
||||
return baseMapper.selectVoById(materialId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 物料信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BaseMaterialInfoVo> queryPageList(BaseMaterialInfoBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<BaseMaterialInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<BaseMaterialInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物料信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMaterialInfoVo> queryList(BaseMaterialInfoBo bo) {
|
||||
MPJLambdaWrapper<BaseMaterialInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BaseMaterialInfo> buildQueryWrapper(BaseMaterialInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BaseMaterialInfo> lqw = JoinWrappers.lambda(BaseMaterialInfo.class)
|
||||
.selectAll(BaseMaterialInfo.class)
|
||||
|
||||
.select(ProdBaseFactoryInfo::getFactoryName)
|
||||
.leftJoin(ProdBaseFactoryInfo.class, ProdBaseFactoryInfo::getFactoryId, BaseMaterialInfo::getFactoryId)
|
||||
|
||||
|
||||
.eq(bo.getMaterialId() != null, BaseMaterialInfo::getMaterialId, bo.getMaterialId())
|
||||
.eq(StringUtils.isNotBlank(bo.getErpId()), BaseMaterialInfo::getErpId, bo.getErpId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialCode()), BaseMaterialInfo::getMaterialCode, bo.getMaterialCode())
|
||||
.eq(StringUtils.isNotBlank(bo.getOldMaterialCode()), BaseMaterialInfo::getOldMaterialCode, bo.getOldMaterialCode())
|
||||
.like(StringUtils.isNotBlank(bo.getMaterialName()), BaseMaterialInfo::getMaterialName, bo.getMaterialName())
|
||||
.eq(bo.getMaterialTypeId() != null, BaseMaterialInfo::getMaterialTypeId, bo.getMaterialTypeId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), BaseMaterialInfo::getMaterialCategories, bo.getMaterialCategories())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialSubclass()), BaseMaterialInfo::getMaterialSubclass, bo.getMaterialSubclass())
|
||||
.eq(StringUtils.isNotBlank(bo.getBatchFlag()), BaseMaterialInfo::getBatchFlag, bo.getBatchFlag())
|
||||
.eq(bo.getBatchAmount() != null, BaseMaterialInfo::getBatchAmount, bo.getBatchAmount())
|
||||
.eq(bo.getMaterialUnitId() != null, BaseMaterialInfo::getMaterialUnitId, bo.getMaterialUnitId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialUnit()), BaseMaterialInfo::getMaterialUnit, bo.getMaterialUnit())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialMatkl()), BaseMaterialInfo::getMaterialMatkl, bo.getMaterialMatkl())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialSpec()), BaseMaterialInfo::getMaterialSpec, bo.getMaterialSpec())
|
||||
.eq(bo.getNetWeight() != null, BaseMaterialInfo::getNetWeight, bo.getNetWeight())
|
||||
.eq(bo.getGrossWeight() != null, BaseMaterialInfo::getGrossWeight, bo.getGrossWeight())
|
||||
.eq(StringUtils.isNotBlank(bo.getAlwaysFlag()), BaseMaterialInfo::getAlwaysFlag, bo.getAlwaysFlag())
|
||||
.eq(bo.getFactoryId() != null, BaseMaterialInfo::getFactoryId, bo.getFactoryId())
|
||||
.eq(bo.getCreateOrgId() != null, BaseMaterialInfo::getCreateOrgId, bo.getCreateOrgId())
|
||||
.eq(bo.getUseOrgId() != null, BaseMaterialInfo::getUseOrgId, bo.getUseOrgId())
|
||||
.eq(bo.getProdLineId() != null, BaseMaterialInfo::getProdLineId, bo.getProdLineId())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), BaseMaterialInfo::getActiveFlag, bo.getActiveFlag())
|
||||
.eq(StringUtils.isNotBlank(bo.getDeletedFlag()), BaseMaterialInfo::getDeletedFlag, bo.getDeletedFlag())
|
||||
.eq(bo.getPurchasePriceUnitId() != null, BaseMaterialInfo::getPurchasePriceUnitId, bo.getPurchasePriceUnitId())
|
||||
.between(params.get("beginApproveDate") != null && params.get("endApproveDate") != null,
|
||||
BaseMaterialInfo::getApproveDate ,params.get("beginApproveDate"), params.get("endApproveDate"))
|
||||
.eq(bo.getErpModifyDate() != null, BaseMaterialInfo::getErpModifyDate, bo.getErpModifyDate())
|
||||
.eq(bo.getMaxStockAmount() != null, BaseMaterialInfo::getMaxStockAmount, bo.getMaxStockAmount())
|
||||
.eq(bo.getMinStockAmount() != null, BaseMaterialInfo::getMinStockAmount, bo.getMinStockAmount())
|
||||
.eq(bo.getSafeStockAmount() != null, BaseMaterialInfo::getSafeStockAmount, bo.getSafeStockAmount())
|
||||
.eq(StringUtils.isNotBlank(bo.getApplyFlag()), BaseMaterialInfo::getApplyFlag, bo.getApplyFlag())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialClassfication()), BaseMaterialInfo::getMaterialClassfication, bo.getMaterialClassfication())
|
||||
.eq(StringUtils.isNotBlank(bo.getAutoOutstockFlag()), BaseMaterialInfo::getAutoOutstockFlag, bo.getAutoOutstockFlag())
|
||||
.eq(StringUtils.isNotBlank(bo.getAccessoriesFlag()), BaseMaterialInfo::getAccessoriesFlag, bo.getAccessoriesFlag())
|
||||
.eq(StringUtils.isNotBlank(bo.getLowValueConsumableFlag()), BaseMaterialInfo::getLowValueConsumableFlag, bo.getLowValueConsumableFlag())
|
||||
.eq(StringUtils.isNotBlank(bo.getBrand()), BaseMaterialInfo::getBrand, bo.getBrand())
|
||||
.eq(StringUtils.isNotBlank(bo.getPlyrating()), BaseMaterialInfo::getPlyrating, bo.getPlyrating())
|
||||
.eq(StringUtils.isNotBlank(bo.getPattern()), BaseMaterialInfo::getPattern, bo.getPattern())
|
||||
.eq(StringUtils.isNotBlank(bo.getSpeedLevel()), BaseMaterialInfo::getSpeedLevel, bo.getSpeedLevel())
|
||||
.eq(StringUtils.isNotBlank(bo.getLoad()), BaseMaterialInfo::getLoad, bo.getLoad())
|
||||
.eq(StringUtils.isNotBlank(bo.getTireMarkings()), BaseMaterialInfo::getTireMarkings, bo.getTireMarkings())
|
||||
.eq(bo.getMinParkingTime() != null, BaseMaterialInfo::getMinParkingTime, bo.getMinParkingTime())
|
||||
.eq(bo.getMaxParkingTime() != null, BaseMaterialInfo::getMaxParkingTime, bo.getMaxParkingTime())
|
||||
.eq(bo.getStandardWeight() != null, BaseMaterialInfo::getStandardWeight, bo.getStandardWeight())
|
||||
.eq(bo.getWeightUpperLimit() != null, BaseMaterialInfo::getWeightUpperLimit, bo.getWeightUpperLimit())
|
||||
.eq(bo.getWeightLowerLimit() != null, BaseMaterialInfo::getWeightLowerLimit, bo.getWeightLowerLimit())
|
||||
.eq(StringUtils.isNotBlank(bo.getInnerTubeFlag()), BaseMaterialInfo::getInnerTubeFlag, bo.getInnerTubeFlag())
|
||||
.eq(StringUtils.isNotBlank(bo.getSaleType()), BaseMaterialInfo::getSaleType, bo.getSaleType())
|
||||
.orderByDesc(BaseMaterialInfo::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料信息
|
||||
*
|
||||
* @param bo 物料信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BaseMaterialInfoBo bo) {
|
||||
BaseMaterialInfo add = MapstructUtils.convert(bo, BaseMaterialInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMaterialId(add.getMaterialId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料信息
|
||||
*
|
||||
* @param bo 物料信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BaseMaterialInfoBo bo) {
|
||||
BaseMaterialInfo update = MapstructUtils.convert(bo, BaseMaterialInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BaseMaterialInfo 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,130 @@
|
||||
package org.dromara.mes.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
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.mes.domain.ProdBaseProcessInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.mes.domain.bo.BaseMaterialTypeBo;
|
||||
import org.dromara.mes.domain.vo.BaseMaterialTypeVo;
|
||||
import org.dromara.mes.domain.BaseMaterialType;
|
||||
import org.dromara.mes.mapper.BaseMaterialTypeMapper;
|
||||
import org.dromara.mes.service.IBaseMaterialTypeService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 物料类型信息Service业务层处理
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BaseMaterialTypeServiceImpl implements IBaseMaterialTypeService {
|
||||
|
||||
private final BaseMaterialTypeMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询物料类型信息
|
||||
*
|
||||
* @param matrialTypeId 主键
|
||||
* @return 物料类型信息
|
||||
*/
|
||||
@Override
|
||||
public BaseMaterialTypeVo queryById(Long matrialTypeId){
|
||||
return baseMapper.selectVoById(matrialTypeId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的物料类型信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 物料类型信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMaterialTypeVo> queryList(BaseMaterialTypeBo bo) {
|
||||
MPJLambdaWrapper<BaseMaterialType> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BaseMaterialType> buildQueryWrapper(BaseMaterialTypeBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BaseMaterialType> lqw = JoinWrappers.lambda(BaseMaterialType.class)
|
||||
|
||||
// 关联查询工序名称
|
||||
.select(ProdBaseProcessInfo::getProcessName)
|
||||
.leftJoin(ProdBaseProcessInfo.class, ProdBaseProcessInfo::getProcessId, BaseMaterialType::getProcessId)
|
||||
|
||||
.selectAll(BaseMaterialType.class)
|
||||
.eq(bo.getMatrialTypeId() != null, BaseMaterialType::getMatrialTypeId, bo.getMatrialTypeId())
|
||||
.eq(bo.getParentId() != null, BaseMaterialType::getParentId, bo.getParentId())
|
||||
.eq(StringUtils.isNotBlank(bo.getMatrialTypeCode()), BaseMaterialType::getMatrialTypeCode, bo.getMatrialTypeCode())
|
||||
.like(StringUtils.isNotBlank(bo.getMatrialTypeName()), BaseMaterialType::getMatrialTypeName, bo.getMatrialTypeName())
|
||||
.eq(StringUtils.isNotBlank(bo.getAncestors()), BaseMaterialType::getAncestors, bo.getAncestors())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), BaseMaterialType::getMaterialCategories, bo.getMaterialCategories())
|
||||
.eq(StringUtils.isNotBlank(bo.getMaterialSubclass()), BaseMaterialType::getMaterialSubclass, bo.getMaterialSubclass())
|
||||
.eq(bo.getProcessId() != null, BaseMaterialType::getProcessId, bo.getProcessId())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), BaseMaterialType::getActiveFlag, bo.getActiveFlag())
|
||||
.orderByDesc(BaseMaterialType::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料类型信息
|
||||
*
|
||||
* @param bo 物料类型信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BaseMaterialTypeBo bo) {
|
||||
BaseMaterialType add = MapstructUtils.convert(bo, BaseMaterialType.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMatrialTypeId(add.getMatrialTypeId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料类型信息
|
||||
*
|
||||
* @param bo 物料类型信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BaseMaterialTypeBo bo) {
|
||||
BaseMaterialType update = MapstructUtils.convert(bo, BaseMaterialType.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BaseMaterialType 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,123 @@
|
||||
package org.dromara.mes.service.impl;
|
||||
|
||||
import org.dromara.common.core.utils.MapstructUtils;
|
||||
import org.dromara.common.core.utils.StringUtils;
|
||||
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.mes.domain.bo.BaseMeasurementUnitInfoBo;
|
||||
import org.dromara.mes.domain.vo.BaseMeasurementUnitInfoVo;
|
||||
import org.dromara.mes.domain.BaseMeasurementUnitInfo;
|
||||
import org.dromara.mes.mapper.BaseMeasurementUnitInfoMapper;
|
||||
import org.dromara.mes.service.IBaseMeasurementUnitInfoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 计量单位信息Service业务层处理
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BaseMeasurementUnitInfoServiceImpl implements IBaseMeasurementUnitInfoService {
|
||||
|
||||
private final BaseMeasurementUnitInfoMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询计量单位信息
|
||||
*
|
||||
* @param unitId 主键
|
||||
* @return 计量单位信息
|
||||
*/
|
||||
@Override
|
||||
public BaseMeasurementUnitInfoVo queryById(Long unitId){
|
||||
return baseMapper.selectVoById(unitId);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 查询符合条件的计量单位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 计量单位信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMeasurementUnitInfoVo> queryList(BaseMeasurementUnitInfoBo bo) {
|
||||
MPJLambdaWrapper<BaseMeasurementUnitInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BaseMeasurementUnitInfo> buildQueryWrapper(BaseMeasurementUnitInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BaseMeasurementUnitInfo> lqw = JoinWrappers.lambda(BaseMeasurementUnitInfo.class)
|
||||
.selectAll(BaseMeasurementUnitInfo.class)
|
||||
.eq(bo.getUnitId() != null, BaseMeasurementUnitInfo::getUnitId, bo.getUnitId())
|
||||
.eq(bo.getParentId() != null, BaseMeasurementUnitInfo::getParentId, bo.getParentId())
|
||||
.eq(StringUtils.isNotBlank(bo.getUnitCode()), BaseMeasurementUnitInfo::getUnitCode, bo.getUnitCode())
|
||||
.like(StringUtils.isNotBlank(bo.getUnitName()), BaseMeasurementUnitInfo::getUnitName, bo.getUnitName())
|
||||
.eq(bo.getUnitConversion() != null, BaseMeasurementUnitInfo::getUnitConversion, bo.getUnitConversion())
|
||||
.eq(StringUtils.isNotBlank(bo.getAncestors()), BaseMeasurementUnitInfo::getAncestors, bo.getAncestors())
|
||||
.eq(StringUtils.isNotBlank(bo.getUnitType()), BaseMeasurementUnitInfo::getUnitType, bo.getUnitType())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), BaseMeasurementUnitInfo::getActiveFlag, bo.getActiveFlag())
|
||||
.orderByDesc(BaseMeasurementUnitInfo::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计量单位信息
|
||||
*
|
||||
* @param bo 计量单位信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BaseMeasurementUnitInfoBo bo) {
|
||||
BaseMeasurementUnitInfo add = MapstructUtils.convert(bo, BaseMeasurementUnitInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setUnitId(add.getUnitId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计量单位信息
|
||||
*
|
||||
* @param bo 计量单位信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BaseMeasurementUnitInfoBo bo) {
|
||||
BaseMeasurementUnitInfo update = MapstructUtils.convert(bo, BaseMeasurementUnitInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BaseMeasurementUnitInfo 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,140 @@
|
||||
package org.dromara.mes.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.mes.domain.bo.BaseSupplierInfoBo;
|
||||
import org.dromara.mes.domain.vo.BaseSupplierInfoVo;
|
||||
import org.dromara.mes.domain.BaseSupplierInfo;
|
||||
import org.dromara.mes.mapper.BaseSupplierInfoMapper;
|
||||
import org.dromara.mes.service.IBaseSupplierInfoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 供应商信息Service业务层处理
|
||||
*
|
||||
* @author ZangCH
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BaseSupplierInfoServiceImpl implements IBaseSupplierInfoService {
|
||||
|
||||
private final BaseSupplierInfoMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询供应商信息
|
||||
*
|
||||
* @param supplierId 主键
|
||||
* @return 供应商信息
|
||||
*/
|
||||
@Override
|
||||
public BaseSupplierInfoVo queryById(Long supplierId){
|
||||
return baseMapper.selectVoById(supplierId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询供应商信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 供应商信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BaseSupplierInfoVo> queryPageList(BaseSupplierInfoBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<BaseSupplierInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<BaseSupplierInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的供应商信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 供应商信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BaseSupplierInfoVo> queryList(BaseSupplierInfoBo bo) {
|
||||
MPJLambdaWrapper<BaseSupplierInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BaseSupplierInfo> buildQueryWrapper(BaseSupplierInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BaseSupplierInfo> lqw = JoinWrappers.lambda(BaseSupplierInfo.class)
|
||||
.selectAll(BaseSupplierInfo.class)
|
||||
.eq(bo.getSupplierId() != null, BaseSupplierInfo::getSupplierId, bo.getSupplierId())
|
||||
.eq(StringUtils.isNotBlank(bo.getSupplierCode()), BaseSupplierInfo::getSupplierCode, bo.getSupplierCode())
|
||||
.like(StringUtils.isNotBlank(bo.getSupplierName()), BaseSupplierInfo::getSupplierName, bo.getSupplierName())
|
||||
.eq(bo.getErpId() != null, BaseSupplierInfo::getErpId, bo.getErpId())
|
||||
.eq(StringUtils.isNotBlank(bo.getSupplierStatus()), BaseSupplierInfo::getSupplierStatus, bo.getSupplierStatus())
|
||||
.between(params.get("beginAuditDate") != null && params.get("endAuditDate") != null,
|
||||
BaseSupplierInfo::getAuditDate ,params.get("beginAuditDate"), params.get("endAuditDate"))
|
||||
.between(params.get("beginErpModifyDate") != null && params.get("endErpModifyDate") != null,
|
||||
BaseSupplierInfo::getErpModifyDate ,params.get("beginErpModifyDate"), params.get("endErpModifyDate"))
|
||||
.orderByDesc(BaseSupplierInfo::getCreateTime);
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增供应商信息
|
||||
*
|
||||
* @param bo 供应商信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BaseSupplierInfoBo bo) {
|
||||
BaseSupplierInfo add = MapstructUtils.convert(bo, BaseSupplierInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setSupplierId(add.getSupplierId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改供应商信息
|
||||
*
|
||||
* @param bo 供应商信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BaseSupplierInfoBo bo) {
|
||||
BaseSupplierInfo update = MapstructUtils.convert(bo, BaseSupplierInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BaseSupplierInfo 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.mes.mapper.BaseEqualMaterialInfoMapper">
|
||||
|
||||
</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.mes.mapper.BaseMaterialInfoMapper">
|
||||
|
||||
</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.mes.mapper.BaseMaterialTypeMapper">
|
||||
|
||||
</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.mes.mapper.BaseMeasurementUnitInfoMapper">
|
||||
|
||||
</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.mes.mapper.BaseSupplierInfoMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue