feat(wms): 物料信息中添加是否高价值物料和质检要求字段,新增物料类型、物料大类和计量单位信息相关功能,修改物料信息与之关联
- 新增物料类型信息相关实体、控制器、服务、Mapper等 - 新增计量单位信息相关实体、控制器、服务、Mapper等 - 在基础物料信息中添加是否高价值物料和质检要求字段master
parent
3c097a77ce
commit
375b2956a1
@ -0,0 +1,116 @@
|
||||
package org.dromara.wms.controller;
|
||||
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.wms.domain.bo.BaseMaterialTypeBo;
|
||||
import org.dromara.wms.domain.vo.BaseMaterialTypeVo;
|
||||
import org.dromara.wms.service.IBaseMaterialTypeService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料类型信息
|
||||
* 前端访问路由地址为:/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.wms.controller;
|
||||
|
||||
import cn.dev33.satoken.annotation.SaCheckPermission;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import jakarta.validation.constraints.NotEmpty;
|
||||
import jakarta.validation.constraints.NotNull;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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.excel.utils.ExcelUtil;
|
||||
import org.dromara.common.idempotent.annotation.RepeatSubmit;
|
||||
import org.dromara.common.log.annotation.Log;
|
||||
import org.dromara.common.log.enums.BusinessType;
|
||||
import org.dromara.common.web.core.BaseController;
|
||||
import org.dromara.wms.domain.bo.BaseMeasurementUnitInfoBo;
|
||||
import org.dromara.wms.domain.vo.BaseMeasurementUnitInfoVo;
|
||||
import org.dromara.wms.service.IBaseMeasurementUnitInfoService;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 计量单位信息
|
||||
* 前端访问路由地址为:/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,15 @@
|
||||
package org.dromara.wms.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.wms.domain.BaseMaterialType;
|
||||
import org.dromara.wms.domain.vo.BaseMaterialTypeVo;
|
||||
|
||||
/**
|
||||
* 物料类型信息Mapper接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface BaseMaterialTypeMapper extends BaseMapperPlus<BaseMaterialType, BaseMaterialTypeVo> {
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.wms.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.wms.domain.BaseMeasurementUnitInfo;
|
||||
import org.dromara.wms.domain.vo.BaseMeasurementUnitInfoVo;
|
||||
|
||||
/**
|
||||
* 计量单位信息Mapper接口
|
||||
*
|
||||
* @author zangch
|
||||
* @date 2025-01-08
|
||||
*/
|
||||
public interface BaseMeasurementUnitInfoMapper extends BaseMapperPlus<BaseMeasurementUnitInfo, BaseMeasurementUnitInfoVo> {
|
||||
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package org.dromara.wms.service;
|
||||
|
||||
import org.dromara.wms.domain.bo.BaseMaterialTypeBo;
|
||||
import org.dromara.wms.domain.vo.BaseMaterialTypeVo;
|
||||
|
||||
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,58 @@
|
||||
package org.dromara.wms.service;
|
||||
|
||||
import org.dromara.wms.domain.bo.BaseMeasurementUnitInfoBo;
|
||||
import org.dromara.wms.domain.vo.BaseMeasurementUnitInfoVo;
|
||||
|
||||
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,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.wms.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.wms.mapper.BaseMeasurementUnitInfoMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue