1.0.4 add计量单位、物料、关联销售物料
parent
10adecd9e7
commit
a6ce138bac
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.base.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.oa.base.domain.vo.BaseMaterielInfoVo;
|
||||
import org.dromara.oa.base.domain.bo.BaseMaterielInfoBo;
|
||||
import org.dromara.oa.base.service.IBaseMaterielInfoService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* SAP物料信息
|
||||
* 前端访问路由地址为:/oa/base/materielInfo
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/base/materielInfo")
|
||||
public class BaseMaterielInfoController extends BaseController {
|
||||
|
||||
private final IBaseMaterielInfoService baseMaterielInfoService;
|
||||
|
||||
/**
|
||||
* 查询SAP物料信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/base:materielInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BaseMaterielInfoVo> list(BaseMaterielInfoBo bo, PageQuery pageQuery) {
|
||||
return baseMaterielInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出SAP物料信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/base:materielInfo:export")
|
||||
@Log(title = "SAP物料信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseMaterielInfoBo bo, HttpServletResponse response) {
|
||||
List<BaseMaterielInfoVo> list = baseMaterielInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "SAP物料信息", BaseMaterielInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取SAP物料信息详细信息
|
||||
*
|
||||
* @param materielId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/base:materielInfo:query")
|
||||
@GetMapping("/{materielId}")
|
||||
public R<BaseMaterielInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("materielId") Long materielId) {
|
||||
return R.ok(baseMaterielInfoService.queryById(materielId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增SAP物料信息
|
||||
*/
|
||||
@SaCheckPermission("oa/base:materielInfo:add")
|
||||
@Log(title = "SAP物料信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseMaterielInfoBo bo) {
|
||||
return toAjax(baseMaterielInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改SAP物料信息
|
||||
*/
|
||||
@SaCheckPermission("oa/base:materielInfo:edit")
|
||||
@Log(title = "SAP物料信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseMaterielInfoBo bo) {
|
||||
return toAjax(baseMaterielInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除SAP物料信息
|
||||
*
|
||||
* @param materielIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/base:materielInfo:remove")
|
||||
@Log(title = "SAP物料信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{materielIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("materielIds") Long[] materielIds) {
|
||||
return toAjax(baseMaterielInfoService.deleteWithValidByIds(List.of(materielIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询SAP物料信息列表
|
||||
*/
|
||||
@GetMapping("/getBaseMaterielInfoList")
|
||||
public R<List<BaseMaterielInfoVo>> getBaseMaterielInfoList(BaseMaterielInfoBo bo) {
|
||||
List<BaseMaterielInfoVo> list = baseMaterielInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.base.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.oa.base.domain.vo.BaseRelationMaterielVo;
|
||||
import org.dromara.oa.base.domain.bo.BaseRelationMaterielBo;
|
||||
import org.dromara.oa.base.service.IBaseRelationMaterielService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 关联销售物料信息
|
||||
* 前端访问路由地址为:/oa/base/relationMateriel
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/base/relationMateriel")
|
||||
public class BaseRelationMaterielController extends BaseController {
|
||||
|
||||
private final IBaseRelationMaterielService baseRelationMaterielService;
|
||||
|
||||
/**
|
||||
* 查询关联销售物料信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/base:relationMateriel:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BaseRelationMaterielVo> list(BaseRelationMaterielBo bo, PageQuery pageQuery) {
|
||||
return baseRelationMaterielService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出关联销售物料信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/base:relationMateriel:export")
|
||||
@Log(title = "关联销售物料信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseRelationMaterielBo bo, HttpServletResponse response) {
|
||||
List<BaseRelationMaterielVo> list = baseRelationMaterielService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "关联销售物料信息", BaseRelationMaterielVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取关联销售物料信息详细信息
|
||||
*
|
||||
* @param relationMaterielId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/base:relationMateriel:query")
|
||||
@GetMapping("/{relationMaterielId}")
|
||||
public R<BaseRelationMaterielVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("relationMaterielId") Long relationMaterielId) {
|
||||
return R.ok(baseRelationMaterielService.queryById(relationMaterielId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增关联销售物料信息
|
||||
*/
|
||||
@SaCheckPermission("oa/base:relationMateriel:add")
|
||||
@Log(title = "关联销售物料信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseRelationMaterielBo bo) {
|
||||
return toAjax(baseRelationMaterielService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改关联销售物料信息
|
||||
*/
|
||||
@SaCheckPermission("oa/base:relationMateriel:edit")
|
||||
@Log(title = "关联销售物料信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseRelationMaterielBo bo) {
|
||||
return toAjax(baseRelationMaterielService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除关联销售物料信息
|
||||
*
|
||||
* @param relationMaterielIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/base:relationMateriel:remove")
|
||||
@Log(title = "关联销售物料信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{relationMaterielIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("relationMaterielIds") Long[] relationMaterielIds) {
|
||||
return toAjax(baseRelationMaterielService.deleteWithValidByIds(List.of(relationMaterielIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询关联销售物料信息列表
|
||||
*/
|
||||
@GetMapping("/getBaseRelationMaterielList")
|
||||
public R<List<BaseRelationMaterielVo>> getBaseRelationMaterielList(BaseRelationMaterielBo bo) {
|
||||
List<BaseRelationMaterielVo> list = baseRelationMaterielService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,116 @@
|
||||
package org.dromara.oa.base.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.oa.base.domain.vo.BaseUnitInfoVo;
|
||||
import org.dromara.oa.base.domain.bo.BaseUnitInfoBo;
|
||||
import org.dromara.oa.base.service.IBaseUnitInfoService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 计量单位信息
|
||||
* 前端访问路由地址为:/oa/base/unitInfo
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/base/unitInfo")
|
||||
public class BaseUnitInfoController extends BaseController {
|
||||
|
||||
private final IBaseUnitInfoService baseUnitInfoService;
|
||||
|
||||
/**
|
||||
* 查询计量单位信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/base:unitInfo:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<BaseUnitInfoVo> list(BaseUnitInfoBo bo, PageQuery pageQuery) {
|
||||
return baseUnitInfoService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出计量单位信息列表
|
||||
*/
|
||||
@SaCheckPermission("oa/base:unitInfo:export")
|
||||
@Log(title = "计量单位信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(BaseUnitInfoBo bo, HttpServletResponse response) {
|
||||
List<BaseUnitInfoVo> list = baseUnitInfoService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "计量单位信息", BaseUnitInfoVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取计量单位信息详细信息
|
||||
*
|
||||
* @param unitId 主键
|
||||
*/
|
||||
@SaCheckPermission("oa/base:unitInfo:query")
|
||||
@GetMapping("/{unitId}")
|
||||
public R<BaseUnitInfoVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable("unitId") Long unitId) {
|
||||
return R.ok(baseUnitInfoService.queryById(unitId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计量单位信息
|
||||
*/
|
||||
@SaCheckPermission("oa/base:unitInfo:add")
|
||||
@Log(title = "计量单位信息", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseUnitInfoBo bo) {
|
||||
return toAjax(baseUnitInfoService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计量单位信息
|
||||
*/
|
||||
@SaCheckPermission("oa/base:unitInfo:edit")
|
||||
@Log(title = "计量单位信息", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseUnitInfoBo bo) {
|
||||
return toAjax(baseUnitInfoService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除计量单位信息
|
||||
*
|
||||
* @param unitIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("oa/base:unitInfo:remove")
|
||||
@Log(title = "计量单位信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{unitIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable("unitIds") Long[] unitIds) {
|
||||
return toAjax(baseUnitInfoService.deleteWithValidByIds(List.of(unitIds), true));
|
||||
}
|
||||
|
||||
/**
|
||||
* 下拉框查询计量单位信息列表
|
||||
*/
|
||||
@GetMapping("/getBaseUnitInfoList")
|
||||
public R<List<BaseUnitInfoVo>> getBaseUnitInfoList(BaseUnitInfoBo bo) {
|
||||
List<BaseUnitInfoVo> list = baseUnitInfoService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package org.dromara.oa.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.oa.base.domain.BaseMaterielInfo;
|
||||
import org.dromara.oa.base.domain.vo.BaseMaterielInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* SAP物料信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
public interface BaseMaterielInfoMapper extends BaseMapperPlus<BaseMaterielInfo, BaseMaterielInfoVo> {
|
||||
|
||||
/**
|
||||
* 查询SAP物料信息列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 条件
|
||||
* @return SAP物料信息集合
|
||||
*/
|
||||
public Page<BaseMaterielInfoVo> selectCustomBaseMaterielInfoVoList(@Param("page") Page<BaseMaterielInfoVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<BaseMaterielInfo> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询SAP物料信息列表
|
||||
*
|
||||
* @param queryWrapper 条件
|
||||
* @return SAP物料信息集合
|
||||
*/
|
||||
public List<BaseMaterielInfoVo> selectCustomBaseMaterielInfoVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<BaseMaterielInfo> queryWrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package org.dromara.oa.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.oa.base.domain.BaseRelationMateriel;
|
||||
import org.dromara.oa.base.domain.vo.BaseRelationMaterielVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 关联销售物料信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
public interface BaseRelationMaterielMapper extends BaseMapperPlus<BaseRelationMateriel, BaseRelationMaterielVo> {
|
||||
|
||||
/**
|
||||
* 查询关联销售物料信息列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 条件
|
||||
* @return 关联销售物料信息集合
|
||||
*/
|
||||
public Page<BaseRelationMaterielVo> selectCustomBaseRelationMaterielVoList(@Param("page") Page<BaseRelationMaterielVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<BaseRelationMateriel> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询关联销售物料信息列表
|
||||
*
|
||||
* @param queryWrapper 条件
|
||||
* @return 关联销售物料信息集合
|
||||
*/
|
||||
public List<BaseRelationMaterielVo> selectCustomBaseRelationMaterielVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<BaseRelationMateriel> queryWrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,38 @@
|
||||
package org.dromara.oa.base.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.github.yulichang.wrapper.MPJLambdaWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Constants;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.dromara.oa.base.domain.BaseUnitInfo;
|
||||
import org.dromara.oa.base.domain.vo.BaseUnitInfoVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
|
||||
/**
|
||||
* 计量单位信息Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
public interface BaseUnitInfoMapper extends BaseMapperPlus<BaseUnitInfo, BaseUnitInfoVo> {
|
||||
|
||||
/**
|
||||
* 查询计量单位信息列表
|
||||
*
|
||||
* @param page 分页
|
||||
* @param queryWrapper 条件
|
||||
* @return 计量单位信息集合
|
||||
*/
|
||||
public Page<BaseUnitInfoVo> selectCustomBaseUnitInfoVoList(@Param("page") Page<BaseUnitInfoVo> page, @Param(Constants.WRAPPER) MPJLambdaWrapper<BaseUnitInfo> queryWrapper);
|
||||
|
||||
/**
|
||||
* 查询计量单位信息列表
|
||||
*
|
||||
* @param queryWrapper 条件
|
||||
* @return 计量单位信息集合
|
||||
*/
|
||||
public List<BaseUnitInfoVo> selectCustomBaseUnitInfoVoList(@Param(Constants.WRAPPER) MPJLambdaWrapper<BaseUnitInfo> queryWrapper);
|
||||
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.oa.base.service;
|
||||
|
||||
import org.dromara.oa.base.domain.BaseMaterielInfo;
|
||||
import org.dromara.oa.base.domain.vo.BaseMaterielInfoVo;
|
||||
import org.dromara.oa.base.domain.bo.BaseMaterielInfoBo;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* SAP物料信息Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
public interface IBaseMaterielInfoService {
|
||||
|
||||
/**
|
||||
* 查询SAP物料信息
|
||||
*
|
||||
* @param materielId 主键
|
||||
* @return SAP物料信息
|
||||
*/
|
||||
BaseMaterielInfoVo queryById(Long materielId);
|
||||
|
||||
/**
|
||||
* 分页查询SAP物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return SAP物料信息分页列表
|
||||
*/
|
||||
TableDataInfo<BaseMaterielInfoVo> queryPageList(BaseMaterielInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的SAP物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return SAP物料信息列表
|
||||
*/
|
||||
List<BaseMaterielInfoVo> queryList(BaseMaterielInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增SAP物料信息
|
||||
*
|
||||
* @param bo SAP物料信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BaseMaterielInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改SAP物料信息
|
||||
*
|
||||
* @param bo SAP物料信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BaseMaterielInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除SAP物料信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.oa.base.service;
|
||||
|
||||
import org.dromara.oa.base.domain.BaseRelationMateriel;
|
||||
import org.dromara.oa.base.domain.vo.BaseRelationMaterielVo;
|
||||
import org.dromara.oa.base.domain.bo.BaseRelationMaterielBo;
|
||||
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 Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
public interface IBaseRelationMaterielService {
|
||||
|
||||
/**
|
||||
* 查询关联销售物料信息
|
||||
*
|
||||
* @param relationMaterielId 主键
|
||||
* @return 关联销售物料信息
|
||||
*/
|
||||
BaseRelationMaterielVo queryById(Long relationMaterielId);
|
||||
|
||||
/**
|
||||
* 分页查询关联销售物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 关联销售物料信息分页列表
|
||||
*/
|
||||
TableDataInfo<BaseRelationMaterielVo> queryPageList(BaseRelationMaterielBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的关联销售物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 关联销售物料信息列表
|
||||
*/
|
||||
List<BaseRelationMaterielVo> queryList(BaseRelationMaterielBo bo);
|
||||
|
||||
/**
|
||||
* 新增关联销售物料信息
|
||||
*
|
||||
* @param bo 关联销售物料信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BaseRelationMaterielBo bo);
|
||||
|
||||
/**
|
||||
* 修改关联销售物料信息
|
||||
*
|
||||
* @param bo 关联销售物料信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BaseRelationMaterielBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除关联销售物料信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,69 @@
|
||||
package org.dromara.oa.base.service;
|
||||
|
||||
import org.dromara.oa.base.domain.BaseUnitInfo;
|
||||
import org.dromara.oa.base.domain.vo.BaseUnitInfoVo;
|
||||
import org.dromara.oa.base.domain.bo.BaseUnitInfoBo;
|
||||
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 Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
public interface IBaseUnitInfoService {
|
||||
|
||||
/**
|
||||
* 查询计量单位信息
|
||||
*
|
||||
* @param unitId 主键
|
||||
* @return 计量单位信息
|
||||
*/
|
||||
BaseUnitInfoVo queryById(Long unitId);
|
||||
|
||||
/**
|
||||
* 分页查询计量单位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 计量单位信息分页列表
|
||||
*/
|
||||
TableDataInfo<BaseUnitInfoVo> queryPageList(BaseUnitInfoBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的计量单位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 计量单位信息列表
|
||||
*/
|
||||
List<BaseUnitInfoVo> queryList(BaseUnitInfoBo bo);
|
||||
|
||||
/**
|
||||
* 新增计量单位信息
|
||||
*
|
||||
* @param bo 计量单位信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(BaseUnitInfoBo bo);
|
||||
|
||||
/**
|
||||
* 修改计量单位信息
|
||||
*
|
||||
* @param bo 计量单位信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(BaseUnitInfoBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除计量单位信息信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
||||
@ -0,0 +1,143 @@
|
||||
package org.dromara.oa.base.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.oa.base.domain.BaseUnitInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.oa.base.domain.bo.BaseMaterielInfoBo;
|
||||
import org.dromara.oa.base.domain.vo.BaseMaterielInfoVo;
|
||||
import org.dromara.oa.base.domain.BaseMaterielInfo;
|
||||
import org.dromara.oa.base.mapper.BaseMaterielInfoMapper;
|
||||
import org.dromara.oa.base.service.IBaseMaterielInfoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* SAP物料信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BaseMaterielInfoServiceImpl implements IBaseMaterielInfoService {
|
||||
|
||||
private final BaseMaterielInfoMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询SAP物料信息
|
||||
*
|
||||
* @param materielId 主键
|
||||
* @return SAP物料信息
|
||||
*/
|
||||
@Override
|
||||
public BaseMaterielInfoVo queryById(Long materielId) {
|
||||
return baseMapper.selectVoById(materielId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询SAP物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return SAP物料信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BaseMaterielInfoVo> queryPageList(BaseMaterielInfoBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<BaseMaterielInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<BaseMaterielInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的SAP物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return SAP物料信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BaseMaterielInfoVo> queryList(BaseMaterielInfoBo bo) {
|
||||
MPJLambdaWrapper<BaseMaterielInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BaseMaterielInfo> buildQueryWrapper(BaseMaterielInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BaseMaterielInfo> lqw = JoinWrappers.lambda(BaseMaterielInfo.class)
|
||||
.selectAll(BaseMaterielInfo.class)
|
||||
.select(BaseUnitInfo::getUnitName)
|
||||
.leftJoin(BaseUnitInfo.class, BaseUnitInfo::getUnitId, BaseMaterielInfo::getUnitId)
|
||||
.like(StringUtils.isNotBlank(bo.getMaterielCode()), BaseMaterielInfo::getMaterielCode, bo.getMaterielCode())
|
||||
.like(StringUtils.isNotBlank(bo.getMaterielName()), BaseMaterielInfo::getMaterielName, bo.getMaterielName())
|
||||
.like(StringUtils.isNotBlank(bo.getMaterielBrand()), BaseMaterielInfo::getMaterielBrand, bo.getMaterielBrand())
|
||||
.like(StringUtils.isNotBlank(bo.getMaterielModel()), BaseMaterielInfo::getMaterielModel, bo.getMaterielModel())
|
||||
.eq(bo.getUnitId() != null, BaseMaterielInfo::getUnitId, bo.getUnitId())
|
||||
.like(StringUtils.isNotBlank(bo.getMaterialParameter()), BaseMaterielInfo::getMaterialParameter, bo.getMaterialParameter())
|
||||
.eq(bo.getPurchasePrice() != null, BaseMaterielInfo::getPurchasePrice, bo.getPurchasePrice())
|
||||
.eq(bo.getForeignPrice() != null, BaseMaterielInfo::getForeignPrice, bo.getForeignPrice())
|
||||
.eq(bo.getStockingPeriod() != null, BaseMaterielInfo::getStockingPeriod, bo.getStockingPeriod())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), BaseMaterielInfo::getActiveFlag, bo.getActiveFlag());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增SAP物料信息
|
||||
*
|
||||
* @param bo SAP物料信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BaseMaterielInfoBo bo) {
|
||||
BaseMaterielInfo add = MapstructUtils.convert(bo, BaseMaterielInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setMaterielId(add.getMaterielId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改SAP物料信息
|
||||
*
|
||||
* @param bo SAP物料信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BaseMaterielInfoBo bo) {
|
||||
BaseMaterielInfo update = MapstructUtils.convert(bo, BaseMaterielInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BaseMaterielInfo entity) {
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除SAP物料信息信息
|
||||
*
|
||||
* @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,144 @@
|
||||
package org.dromara.oa.base.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.oa.base.domain.BaseMaterielInfo;
|
||||
import org.dromara.oa.crm.domain.CrmCustomerInfo;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.oa.base.domain.bo.BaseRelationMaterielBo;
|
||||
import org.dromara.oa.base.domain.vo.BaseRelationMaterielVo;
|
||||
import org.dromara.oa.base.domain.BaseRelationMateriel;
|
||||
import org.dromara.oa.base.mapper.BaseRelationMaterielMapper;
|
||||
import org.dromara.oa.base.service.IBaseRelationMaterielService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 关联销售物料信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BaseRelationMaterielServiceImpl implements IBaseRelationMaterielService {
|
||||
|
||||
private final BaseRelationMaterielMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询关联销售物料信息
|
||||
*
|
||||
* @param relationMaterielId 主键
|
||||
* @return 关联销售物料信息
|
||||
*/
|
||||
@Override
|
||||
public BaseRelationMaterielVo queryById(Long relationMaterielId) {
|
||||
return baseMapper.selectVoById(relationMaterielId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询关联销售物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 关联销售物料信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BaseRelationMaterielVo> queryPageList(BaseRelationMaterielBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<BaseRelationMateriel> lqw = buildQueryWrapper(bo);
|
||||
Page<BaseRelationMaterielVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的关联销售物料信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 关联销售物料信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BaseRelationMaterielVo> queryList(BaseRelationMaterielBo bo) {
|
||||
MPJLambdaWrapper<BaseRelationMateriel> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BaseRelationMateriel> buildQueryWrapper(BaseRelationMaterielBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BaseRelationMateriel> lqw = JoinWrappers.lambda(BaseRelationMateriel.class)
|
||||
.selectAll(BaseRelationMateriel.class)
|
||||
.select(BaseMaterielInfo::getMaterielCode)
|
||||
.select(BaseMaterielInfo::getMaterielName)
|
||||
.select(CrmCustomerInfo::getCustomerName)
|
||||
.leftJoin(BaseMaterielInfo.class, BaseMaterielInfo::getMaterielId, BaseRelationMateriel::getMaterielId)
|
||||
.leftJoin(CrmCustomerInfo.class, CrmCustomerInfo::getCustomerId, BaseRelationMateriel::getCustomerId)
|
||||
.eq(bo.getMaterielId() != null, BaseRelationMateriel::getMaterielId, bo.getMaterielId())
|
||||
.eq(bo.getCustomerId() != null, BaseRelationMateriel::getCustomerId, bo.getCustomerId())
|
||||
.like(StringUtils.isNotBlank(bo.getMaterielCode()), BaseMaterielInfo::getMaterielCode, bo.getMaterielCode())
|
||||
.like(StringUtils.isNotBlank(bo.getMaterielName()), BaseMaterielInfo::getMaterielName, bo.getMaterielName())
|
||||
.like(StringUtils.isNotBlank(bo.getCustomerName()), CrmCustomerInfo::getCustomerName, bo.getCustomerName())
|
||||
.like(StringUtils.isNotBlank(bo.getSaleMaterielName()), BaseRelationMateriel::getSaleMaterielName, bo.getSaleMaterielName())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), BaseRelationMateriel::getActiveFlag, bo.getActiveFlag());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增关联销售物料信息
|
||||
*
|
||||
* @param bo 关联销售物料信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BaseRelationMaterielBo bo) {
|
||||
BaseRelationMateriel add = MapstructUtils.convert(bo, BaseRelationMateriel.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setRelationMaterielId(add.getRelationMaterielId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改关联销售物料信息
|
||||
*
|
||||
* @param bo 关联销售物料信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BaseRelationMaterielBo bo) {
|
||||
BaseRelationMateriel update = MapstructUtils.convert(bo, BaseRelationMateriel.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BaseRelationMateriel 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,134 @@
|
||||
package org.dromara.oa.base.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.oa.base.domain.bo.BaseUnitInfoBo;
|
||||
import org.dromara.oa.base.domain.vo.BaseUnitInfoVo;
|
||||
import org.dromara.oa.base.domain.BaseUnitInfo;
|
||||
import org.dromara.oa.base.mapper.BaseUnitInfoMapper;
|
||||
import org.dromara.oa.base.service.IBaseUnitInfoService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 计量单位信息Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-09-28
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class BaseUnitInfoServiceImpl implements IBaseUnitInfoService {
|
||||
|
||||
private final BaseUnitInfoMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询计量单位信息
|
||||
*
|
||||
* @param unitId 主键
|
||||
* @return 计量单位信息
|
||||
*/
|
||||
@Override
|
||||
public BaseUnitInfoVo queryById(Long unitId) {
|
||||
return baseMapper.selectVoById(unitId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询计量单位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 计量单位信息分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<BaseUnitInfoVo> queryPageList(BaseUnitInfoBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<BaseUnitInfo> lqw = buildQueryWrapper(bo);
|
||||
Page<BaseUnitInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的计量单位信息列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 计量单位信息列表
|
||||
*/
|
||||
@Override
|
||||
public List<BaseUnitInfoVo> queryList(BaseUnitInfoBo bo) {
|
||||
MPJLambdaWrapper<BaseUnitInfo> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<BaseUnitInfo> buildQueryWrapper(BaseUnitInfoBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
MPJLambdaWrapper<BaseUnitInfo> lqw = JoinWrappers.lambda(BaseUnitInfo.class)
|
||||
.selectAll(BaseUnitInfo.class)
|
||||
.eq(StringUtils.isNotBlank(bo.getUnitCode()), BaseUnitInfo::getUnitCode, bo.getUnitCode())
|
||||
.like(StringUtils.isNotBlank(bo.getUnitName()), BaseUnitInfo::getUnitName, bo.getUnitName())
|
||||
.eq(StringUtils.isNotBlank(bo.getUnitType()), BaseUnitInfo::getUnitType, bo.getUnitType())
|
||||
.eq(StringUtils.isNotBlank(bo.getActiveFlag()), BaseUnitInfo::getActiveFlag, bo.getActiveFlag());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增计量单位信息
|
||||
*
|
||||
* @param bo 计量单位信息
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(BaseUnitInfoBo bo) {
|
||||
BaseUnitInfo add = MapstructUtils.convert(bo, BaseUnitInfo.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setUnitId(add.getUnitId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改计量单位信息
|
||||
*
|
||||
* @param bo 计量单位信息
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(BaseUnitInfoBo bo) {
|
||||
BaseUnitInfo update = MapstructUtils.convert(bo, BaseUnitInfo.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(BaseUnitInfo 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,33 @@
|
||||
<?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.oa.base.mapper.BaseMaterielInfoMapper">
|
||||
<resultMap type="org.dromara.oa.base.domain.vo.BaseMaterielInfoVo" id="BaseMaterielInfoResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomBaseMaterielInfoVoList" resultMap="BaseMaterielInfoResult">
|
||||
select materiel_id,
|
||||
tenant_id,
|
||||
materiel_code,
|
||||
materiel_name,
|
||||
materiel_brand,
|
||||
materiel_model,
|
||||
unit_id,
|
||||
material_parameter,
|
||||
purchase_price,
|
||||
foreign_price,
|
||||
stocking_period,
|
||||
remark,
|
||||
active_flag,
|
||||
del_flag,
|
||||
create_dept,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from base_materiel_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,14 @@
|
||||
<?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.oa.base.mapper.BaseRelationMaterielMapper">
|
||||
<resultMap type="org.dromara.oa.base.domain.vo.BaseRelationMaterielVo" id="BaseRelationMaterielResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomBaseRelationMaterielVoList" resultMap="BaseRelationMaterielResult">
|
||||
select relation_materiel_id, tenant_id, materiel_id, customer_id, sale_materiel_name, remark, active_flag, del_flag, create_dept, create_by, create_time, update_by, update_time from base_relation_materiel t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
@ -0,0 +1,27 @@
|
||||
<?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.oa.base.mapper.BaseUnitInfoMapper">
|
||||
<resultMap type="org.dromara.oa.base.domain.vo.BaseUnitInfoVo" id="BaseUnitInfoResult">
|
||||
</resultMap>
|
||||
|
||||
<select id="selectCustomBaseUnitInfoVoList" resultMap="BaseUnitInfoResult">
|
||||
select unit_id,
|
||||
tenant_id,
|
||||
unit_code,
|
||||
unit_name,
|
||||
unit_type,
|
||||
remark,
|
||||
active_flag,
|
||||
del_flag,
|
||||
create_dept,
|
||||
create_by,
|
||||
create_time,
|
||||
update_by,
|
||||
update_time
|
||||
from base_unit_info t
|
||||
${ew.getCustomSqlSegment}
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue