物资仓库下拉列表,DataCode枚举

This commit is contained in:
syruan 2024-10-15 13:26:33 +08:00
parent 5e999139a9
commit bd1716a2d3
18 changed files with 168 additions and 124 deletions

View File

@ -0,0 +1,26 @@
package com.bonus.common.biz.enums;
import lombok.Getter;
/**
* @author : 阮世耀
* @version : 1.0
* @PackagePath: com.bonus.common.biz.enums
* @CreateTime: 2024-10-15 10:28
* @Description: 数据状态枚举类
*/
@Getter
public enum DataCodeEnum {
NORMAL(0, "正常"),
DELETED(2, "已删除");
private final int code;
private final String msg;
DataCodeEnum(int code, String msg) {
this.code = code;
this.msg = msg;
}
}

View File

@ -1,5 +1,12 @@
package com.bonus.common.biz.enums; package com.bonus.common.biz.enums;
import lombok.Getter;
/**
* @author bonus
*/
@Getter
public enum HttpCodeEnum { public enum HttpCodeEnum {
// 成功 // 成功
SUCCESS(200, "操作成功"), SUCCESS(200, "操作成功"),
@ -20,19 +27,13 @@ public enum HttpCodeEnum {
NICKNAME_EXIST(512, "昵称已存在"), NICKNAME_EXIST(512, "昵称已存在"),
LOGIN_ERROR(505, "用户名或密码错误"), LOGIN_ERROR(505, "用户名或密码错误"),
REPEATE_ERROR(600, "不允许重复提交,请稍候再试"); REPEATE_ERROR(600, "不允许重复提交,请稍候再试");
int code;
String msg; private final int code;
private final String msg;
HttpCodeEnum(int code, String errorMessage) { HttpCodeEnum(int code, String errorMessage) {
this.code = code; this.code = code;
this.msg = errorMessage; this.msg = errorMessage;
} }
public int getCode() {
return code;
}
public String getMsg() {
return msg;
}
} }

View File

@ -57,7 +57,7 @@ public class TypeController extends BaseController {
/** /**
* 导出物资类型管理列表 * 导出物资类型管理列表
*/ */
@ApiOperation(value = "导出物资类型管理列表") @ApiOperation(value = "导出物资类型列表")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:type:export") @RequiresPermissions("ma:type:export")
@SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型") @SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型")
@ -71,7 +71,7 @@ public class TypeController extends BaseController {
/** /**
* 获取物资类型管理详细信息 * 获取物资类型管理详细信息
*/ */
@ApiOperation(value = "获取物资类型管理详细信息") @ApiOperation(value = "获取物资类型详细信息")
@RequiresPermissions("ma:type:query") @RequiresPermissions("ma:type:query")
@GetMapping(value = "/{typeId}") @GetMapping(value = "/{typeId}")
public AjaxResult getInfo(@PathVariable("typeId") Long typeId) { public AjaxResult getInfo(@PathVariable("typeId") Long typeId) {
@ -81,7 +81,7 @@ public class TypeController extends BaseController {
/** /**
* 新增物资类型管理 * 新增物资类型管理
*/ */
@ApiOperation(value = "新增物资类型管理") @ApiOperation(value = "新增物资类型")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:type:add") @RequiresPermissions("ma:type:add")
@SysLog(title = "物资类型管理", businessType = OperaType.INSERT, module = "仓储管理->新增物资类型") @SysLog(title = "物资类型管理", businessType = OperaType.INSERT, module = "仓储管理->新增物资类型")
@ -93,7 +93,7 @@ public class TypeController extends BaseController {
/** /**
* 修改物资类型管理 * 修改物资类型管理
*/ */
@ApiOperation(value = "修改物资类型管理") @ApiOperation(value = "修改物资类型")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:type:edit") @RequiresPermissions("ma:type:edit")
@SysLog(title = "物资类型管理", businessType = OperaType.UPDATE, module = "仓储管理->修改物资类型") @SysLog(title = "物资类型管理", businessType = OperaType.UPDATE, module = "仓储管理->修改物资类型")
@ -105,7 +105,7 @@ public class TypeController extends BaseController {
/** /**
* 删除物资类型管理 * 删除物资类型管理
*/ */
@ApiOperation(value = "删除物资类型管理") @ApiOperation(value = "删除物资类型")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:type:remove") @RequiresPermissions("ma:type:remove")
@SysLog(title = "物资类型管理", businessType = OperaType.DELETE, module = "仓储管理->删除物资类型") @SysLog(title = "物资类型管理", businessType = OperaType.DELETE, module = "仓储管理->删除物资类型")

View File

@ -26,15 +26,13 @@ import com.bonus.common.core.web.page.TableDataInfo;
/** /**
* 库管员配置Controller * 库管员配置Controller
* * @author bonus
* @author xsheng
* @date 2024-09-27
*/ */
@Api(tags = "库管员配置接口") @Api(tags = "库管员配置接口")
@RestController @RestController
@RequestMapping("/ma_type_keeper") @RequestMapping("/ma_type_keeper")
public class TypeKeeperController extends BaseController public class TypeKeeperController extends BaseController {
{
@Autowired @Autowired
private ITypeKeeperService typeKeeperService; private ITypeKeeperService typeKeeperService;
@ -44,8 +42,7 @@ public class TypeKeeperController extends BaseController
@ApiOperation(value = "查询库管员配置列表") @ApiOperation(value = "查询库管员配置列表")
@RequiresPermissions("ma:keeper:list") @RequiresPermissions("ma:keeper:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(TypeKeeper typeKeeper) public TableDataInfo list(TypeKeeper typeKeeper) {
{
startPage(); startPage();
List<TypeKeeper> list = typeKeeperService.selectTypeKeeperList(typeKeeper); List<TypeKeeper> list = typeKeeperService.selectTypeKeeperList(typeKeeper);
return getDataTable(list); return getDataTable(list);
@ -57,10 +54,9 @@ public class TypeKeeperController extends BaseController
@ApiOperation(value = "导出库管员配置列表") @ApiOperation(value = "导出库管员配置列表")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:keeper:export") @RequiresPermissions("ma:keeper:export")
@SysLog(title = "库管员配置", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出库管员配置") @SysLog(title = "库管员配置", businessType = OperaType.EXPORT, module = "仓储管理->导出库管员配置")
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, TypeKeeper typeKeeper) public void export(HttpServletResponse response, TypeKeeper typeKeeper) {
{
List<TypeKeeper> list = typeKeeperService.selectTypeKeeperList(typeKeeper); List<TypeKeeper> list = typeKeeperService.selectTypeKeeperList(typeKeeper);
ExcelUtil<TypeKeeper> util = new ExcelUtil<TypeKeeper>(TypeKeeper.class); ExcelUtil<TypeKeeper> util = new ExcelUtil<TypeKeeper>(TypeKeeper.class);
util.exportExcel(response, list, "库管员配置数据"); util.exportExcel(response, list, "库管员配置数据");
@ -72,8 +68,7 @@ public class TypeKeeperController extends BaseController
@ApiOperation(value = "获取库管员配置详细信息") @ApiOperation(value = "获取库管员配置详细信息")
@RequiresPermissions("ma:keeper:query") @RequiresPermissions("ma:keeper:query")
@GetMapping(value = "/{ID}") @GetMapping(value = "/{ID}")
public AjaxResult getInfo(@PathVariable("ID") Long ID) public AjaxResult getInfo(@PathVariable("ID") Long ID) {
{
return success(typeKeeperService.selectTypeKeeperByID(ID)); return success(typeKeeperService.selectTypeKeeperByID(ID));
} }
@ -83,10 +78,9 @@ public class TypeKeeperController extends BaseController
@ApiOperation(value = "新增库管员配置") @ApiOperation(value = "新增库管员配置")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:keeper:add") @RequiresPermissions("ma:keeper:add")
@SysLog(title = "库管员配置", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增库管员配置") @SysLog(title = "库管员配置", businessType = OperaType.INSERT, module = "仓储管理->新增库管员配置")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody TypeKeeper typeKeeper) public AjaxResult add(@RequestBody TypeKeeper typeKeeper) {
{
return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper)); return toAjax(typeKeeperService.insertTypeKeeper(typeKeeper));
} }
@ -96,10 +90,9 @@ public class TypeKeeperController extends BaseController
@ApiOperation(value = "修改库管员配置") @ApiOperation(value = "修改库管员配置")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:keeper:edit") @RequiresPermissions("ma:keeper:edit")
@SysLog(title = "库管员配置", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改库管员配置") @SysLog(title = "库管员配置", businessType = OperaType.UPDATE, module = "仓储管理->修改库管员配置")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody TypeKeeper typeKeeper) public AjaxResult edit(@RequestBody TypeKeeper typeKeeper) {
{
return toAjax(typeKeeperService.updateTypeKeeper(typeKeeper)); return toAjax(typeKeeperService.updateTypeKeeper(typeKeeper));
} }
@ -109,7 +102,7 @@ public class TypeKeeperController extends BaseController
@ApiOperation(value = "删除库管员配置") @ApiOperation(value = "删除库管员配置")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("ma:keeper:remove") @RequiresPermissions("ma:keeper:remove")
@SysLog(title = "库管员配置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除库管员配置") @SysLog(title = "库管员配置", businessType = OperaType.DELETE, module = "仓储管理->删除库管员配置")
@DeleteMapping("/{IDs}") @DeleteMapping("/{IDs}")
public AjaxResult remove(@PathVariable Long[] IDs) public AjaxResult remove(@PathVariable Long[] IDs)
{ {

View File

@ -3,22 +3,20 @@ package com.bonus.material.ma.domain;
import com.bonus.common.core.annotation.Excel; import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
/** /**
* 库管员配置对象 ma_type_keeper * 库管员配置对象 ma_type_keeper
*
* @author xsheng
* @date 2024-09-27
*/ */
@EqualsAndHashCode(callSuper = false)
@Data @Data
@ToString @ToString
public class TypeKeeper extends BaseEntity public class TypeKeeper extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = -5333521595576336827L;
/** 主键ID */ /** 主键ID */
private Long ID; private Long ID;
@ -27,10 +25,17 @@ public class TypeKeeper extends BaseEntity
private Long typeId; private Long typeId;
/** 用户 */ /** 用户 */
@Excel(name = "用户") @Excel(name = "用户ID")
@ApiModelProperty(value = "用户") @ApiModelProperty(value = "用户ID")
private Long userId; private Long userId;
/**
* 用户名称
*/
@Excel(name = "用户名称")
@ApiModelProperty(value = "用户名称")
private String userName;
/** 数据所属组织 */ /** 数据所属组织 */
@Excel(name = "数据所属组织") @Excel(name = "数据所属组织")
@ApiModelProperty(value = "数据所属组织") @ApiModelProperty(value = "数据所属组织")

View File

@ -9,8 +9,7 @@ import com.bonus.material.ma.domain.PartRepair;
* @author xsheng * @author xsheng
* @date 2024-09-27 * @date 2024-09-27
*/ */
public interface PartRepairMapper public interface PartRepairMapper {
{
/** /**
* 查询维修班配件配置 * 查询维修班配件配置
* *

View File

@ -2,22 +2,20 @@ package com.bonus.material.ma.mapper;
import java.util.List; import java.util.List;
import com.bonus.material.ma.domain.TypeKeeper; import com.bonus.material.ma.domain.TypeKeeper;
import org.apache.ibatis.annotations.Mapper;
/** /**
* 库管员配置Mapper接口 * 库管员配置Mapper接口
*
* @author xsheng
* @date 2024-09-27
*/ */
public interface TypeKeeperMapper @Mapper
{ public interface TypeKeeperMapper {
/** /**
* 查询库管员配置 * 查询库管员配置
* *
* @param ID 库管员配置主键 * @param ID 库管员配置主键
* @return 库管员配置 * @return 库管员配置
*/ */
public TypeKeeper selectTypeKeeperByID(Long ID); TypeKeeper selectTypeKeeperByID(Long ID);
/** /**
* 查询库管员配置列表 * 查询库管员配置列表
@ -25,7 +23,7 @@ public interface TypeKeeperMapper
* @param typeKeeper 库管员配置 * @param typeKeeper 库管员配置
* @return 库管员配置集合 * @return 库管员配置集合
*/ */
public List<TypeKeeper> selectTypeKeeperList(TypeKeeper typeKeeper); List<TypeKeeper> selectTypeKeeperList(TypeKeeper typeKeeper);
/** /**
* 新增库管员配置 * 新增库管员配置
@ -33,7 +31,7 @@ public interface TypeKeeperMapper
* @param typeKeeper 库管员配置 * @param typeKeeper 库管员配置
* @return 结果 * @return 结果
*/ */
public int insertTypeKeeper(TypeKeeper typeKeeper); int insertTypeKeeper(TypeKeeper typeKeeper);
/** /**
* 修改库管员配置 * 修改库管员配置
@ -41,7 +39,7 @@ public interface TypeKeeperMapper
* @param typeKeeper 库管员配置 * @param typeKeeper 库管员配置
* @return 结果 * @return 结果
*/ */
public int updateTypeKeeper(TypeKeeper typeKeeper); int updateTypeKeeper(TypeKeeper typeKeeper);
/** /**
* 删除库管员配置 * 删除库管员配置
@ -49,7 +47,7 @@ public interface TypeKeeperMapper
* @param ID 库管员配置主键 * @param ID 库管员配置主键
* @return 结果 * @return 结果
*/ */
public int deleteTypeKeeperByID(Long ID); int deleteTypeKeeperByID(Long ID);
/** /**
* 批量删除库管员配置 * 批量删除库管员配置
@ -57,5 +55,5 @@ public interface TypeKeeperMapper
* @param IDs 需要删除的数据主键集合 * @param IDs 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteTypeKeeperByIDs(Long[] IDs); int deleteTypeKeeperByIDs(Long[] IDs);
} }

View File

@ -5,19 +5,15 @@ import com.bonus.material.ma.domain.TypeKeeper;
/** /**
* 库管员配置Service接口 * 库管员配置Service接口
*
* @author xsheng
* @date 2024-09-27
*/ */
public interface ITypeKeeperService public interface ITypeKeeperService {
{
/** /**
* 查询库管员配置 * 查询库管员配置
* *
* @param ID 库管员配置主键 * @param ID 库管员配置主键
* @return 库管员配置 * @return 库管员配置
*/ */
public TypeKeeper selectTypeKeeperByID(Long ID); TypeKeeper selectTypeKeeperByID(Long ID);
/** /**
* 查询库管员配置列表 * 查询库管员配置列表
@ -25,7 +21,7 @@ public interface ITypeKeeperService
* @param typeKeeper 库管员配置 * @param typeKeeper 库管员配置
* @return 库管员配置集合 * @return 库管员配置集合
*/ */
public List<TypeKeeper> selectTypeKeeperList(TypeKeeper typeKeeper); List<TypeKeeper> selectTypeKeeperList(TypeKeeper typeKeeper);
/** /**
* 新增库管员配置 * 新增库管员配置
@ -33,7 +29,7 @@ public interface ITypeKeeperService
* @param typeKeeper 库管员配置 * @param typeKeeper 库管员配置
* @return 结果 * @return 结果
*/ */
public int insertTypeKeeper(TypeKeeper typeKeeper); int insertTypeKeeper(TypeKeeper typeKeeper);
/** /**
* 修改库管员配置 * 修改库管员配置
@ -41,7 +37,7 @@ public interface ITypeKeeperService
* @param typeKeeper 库管员配置 * @param typeKeeper 库管员配置
* @return 结果 * @return 结果
*/ */
public int updateTypeKeeper(TypeKeeper typeKeeper); int updateTypeKeeper(TypeKeeper typeKeeper);
/** /**
* 批量删除库管员配置 * 批量删除库管员配置
@ -49,7 +45,7 @@ public interface ITypeKeeperService
* @param IDs 需要删除的库管员配置主键集合 * @param IDs 需要删除的库管员配置主键集合
* @return 结果 * @return 结果
*/ */
public int deleteTypeKeeperByIDs(Long[] IDs); int deleteTypeKeeperByIDs(Long[] IDs);
/** /**
* 删除库管员配置信息 * 删除库管员配置信息
@ -57,5 +53,5 @@ public interface ITypeKeeperService
* @param ID 库管员配置主键 * @param ID 库管员配置主键
* @return 结果 * @return 结果
*/ */
public int deleteTypeKeeperByID(Long ID); int deleteTypeKeeperByID(Long ID);
} }

View File

@ -15,8 +15,8 @@ import com.bonus.material.ma.service.ITypeKeeperService;
* @date 2024-09-27 * @date 2024-09-27
*/ */
@Service @Service
public class TypeKeeperServiceImpl implements ITypeKeeperService public class TypeKeeperServiceImpl implements ITypeKeeperService {
{
@Autowired @Autowired
private TypeKeeperMapper typeKeeperMapper; private TypeKeeperMapper typeKeeperMapper;
@ -27,8 +27,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService
* @return 库管员配置 * @return 库管员配置
*/ */
@Override @Override
public TypeKeeper selectTypeKeeperByID(Long ID) public TypeKeeper selectTypeKeeperByID(Long ID) {
{
return typeKeeperMapper.selectTypeKeeperByID(ID); return typeKeeperMapper.selectTypeKeeperByID(ID);
} }
@ -39,8 +38,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService
* @return 库管员配置 * @return 库管员配置
*/ */
@Override @Override
public List<TypeKeeper> selectTypeKeeperList(TypeKeeper typeKeeper) public List<TypeKeeper> selectTypeKeeperList(TypeKeeper typeKeeper) {
{
return typeKeeperMapper.selectTypeKeeperList(typeKeeper); return typeKeeperMapper.selectTypeKeeperList(typeKeeper);
} }
@ -51,8 +49,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int insertTypeKeeper(TypeKeeper typeKeeper) public int insertTypeKeeper(TypeKeeper typeKeeper) {
{
typeKeeper.setCreateTime(DateUtils.getNowDate()); typeKeeper.setCreateTime(DateUtils.getNowDate());
return typeKeeperMapper.insertTypeKeeper(typeKeeper); return typeKeeperMapper.insertTypeKeeper(typeKeeper);
} }
@ -64,8 +61,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int updateTypeKeeper(TypeKeeper typeKeeper) public int updateTypeKeeper(TypeKeeper typeKeeper) {
{
typeKeeper.setUpdateTime(DateUtils.getNowDate()); typeKeeper.setUpdateTime(DateUtils.getNowDate());
return typeKeeperMapper.updateTypeKeeper(typeKeeper); return typeKeeperMapper.updateTypeKeeper(typeKeeper);
} }
@ -77,8 +73,7 @@ public class TypeKeeperServiceImpl implements ITypeKeeperService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteTypeKeeperByIDs(Long[] IDs) public int deleteTypeKeeperByIDs(Long[] IDs) {
{
return typeKeeperMapper.deleteTypeKeeperByIDs(IDs); return typeKeeperMapper.deleteTypeKeeperByIDs(IDs);
} }

View File

@ -6,6 +6,7 @@ import java.util.Objects;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import com.bonus.common.biz.domain.TreeSelect; import com.bonus.common.biz.domain.TreeSelect;
import com.bonus.common.biz.enums.DataCodeEnum;
import com.bonus.common.core.utils.DateUtils; import com.bonus.common.core.utils.DateUtils;
import com.bonus.common.core.utils.StringUtils; import com.bonus.common.core.utils.StringUtils;
import com.bonus.material.ma.vo.MaTypeListVo; import com.bonus.material.ma.vo.MaTypeListVo;
@ -49,9 +50,15 @@ public class TypeServiceImpl implements ITypeService {
*/ */
@Override @Override
public List<Type> selectTypeList(Type type) { public List<Type> selectTypeList(Type type) {
// 如果是顶级节点则查询所有子节点 if (type != null ) {
if (type != null && "0".equals(type.getLevel())) { if (type.getDelFlag() == null || type.getDelFlag().isEmpty()) {
type.setLevel(null); // 如果没赋值则默认查询正常数据状态
type.setDelFlag(String.valueOf(DataCodeEnum.NORMAL.getCode()));
}
// 如果是顶级节点则查询所有子节点
if ("0".equals(type.getLevel())) {
type.setLevel(null);
}
} }
return typeMapper.selectTypeList(type); return typeMapper.selectTypeList(type);
} }
@ -130,6 +137,10 @@ public class TypeServiceImpl implements ITypeService {
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
/**
* 通过构造函数将 Type对象 转换为 TreeSelect -- 并递归处理子节点
* @param type 要进行转换的object对象
*/
private TreeSelect convertToTreeSelect(Type type) { private TreeSelect convertToTreeSelect(Type type) {
List<TreeSelect> children = type.getChildren().stream() List<TreeSelect> children = type.getChildren().stream()
.filter(Objects::nonNull) .filter(Objects::nonNull)

View File

@ -33,8 +33,8 @@ import com.bonus.common.core.web.page.TableDataInfo;
@Api(tags = "仓库管理接口") @Api(tags = "仓库管理接口")
@RestController @RestController
@RequestMapping("/wh_house_info") @RequestMapping("/wh_house_info")
public class WhHouseInfoController extends BaseController public class WhHouseInfoController extends BaseController {
{
@Autowired @Autowired
private IWhHouseInfoService whHouseInfoService; private IWhHouseInfoService whHouseInfoService;
@ -44,13 +44,23 @@ public class WhHouseInfoController extends BaseController
@ApiOperation(value = "查询仓库管理列表") @ApiOperation(value = "查询仓库管理列表")
@RequiresPermissions("warehouse:info:list") @RequiresPermissions("warehouse:info:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo list(WhHouseInfo whHouseInfo) public TableDataInfo list(WhHouseInfo whHouseInfo) {
{
startPage(); startPage();
List<WhHouseInfo> list = whHouseInfoService.selectWhHouseInfoList(whHouseInfo); List<WhHouseInfo> list = whHouseInfoService.selectWhHouseInfoList(whHouseInfo);
return getDataTable(list); return getDataTable(list);
} }
/**
* 查询仓库列表 -- 不分页
*/
@ApiOperation(value = "查询仓库列表--不分页")
@RequiresPermissions("warehouse:info:list")
@GetMapping("/listNoPage")
public AjaxResult listNoPage(WhHouseInfo whHouseInfo) {
List<WhHouseInfo> list = whHouseInfoService.selectWhHouseInfoList(whHouseInfo);
return success(list);
}
/** /**
* 导出仓库管理列表 * 导出仓库管理列表
*/ */
@ -59,8 +69,7 @@ public class WhHouseInfoController extends BaseController
@RequiresPermissions("warehouse:info:export") @RequiresPermissions("warehouse:info:export")
@SysLog(title = "仓库管理", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出仓库管理") @SysLog(title = "仓库管理", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出仓库管理")
@PostMapping("/export") @PostMapping("/export")
public void export(HttpServletResponse response, WhHouseInfo whHouseInfo) public void export(HttpServletResponse response, WhHouseInfo whHouseInfo) {
{
List<WhHouseInfo> list = whHouseInfoService.selectWhHouseInfoList(whHouseInfo); List<WhHouseInfo> list = whHouseInfoService.selectWhHouseInfoList(whHouseInfo);
ExcelUtil<WhHouseInfo> util = new ExcelUtil<WhHouseInfo>(WhHouseInfo.class); ExcelUtil<WhHouseInfo> util = new ExcelUtil<WhHouseInfo>(WhHouseInfo.class);
util.exportExcel(response, list, "仓库管理数据"); util.exportExcel(response, list, "仓库管理数据");
@ -72,8 +81,7 @@ public class WhHouseInfoController extends BaseController
@ApiOperation(value = "获取仓库管理详细信息") @ApiOperation(value = "获取仓库管理详细信息")
@RequiresPermissions("warehouse:info:query") @RequiresPermissions("warehouse:info:query")
@GetMapping(value = "/{houseId}") @GetMapping(value = "/{houseId}")
public AjaxResult getInfo(@PathVariable("houseId") Long houseId) public AjaxResult getInfo(@PathVariable("houseId") Long houseId) {
{
return success(whHouseInfoService.selectWhHouseInfoByHouseId(houseId)); return success(whHouseInfoService.selectWhHouseInfoByHouseId(houseId));
} }
@ -85,8 +93,7 @@ public class WhHouseInfoController extends BaseController
@RequiresPermissions("warehouse:info:add") @RequiresPermissions("warehouse:info:add")
@SysLog(title = "仓库管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增仓库管理") @SysLog(title = "仓库管理", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增仓库管理")
@PostMapping @PostMapping
public AjaxResult add(@RequestBody WhHouseInfo whHouseInfo) public AjaxResult add(@RequestBody WhHouseInfo whHouseInfo) {
{
return toAjax(whHouseInfoService.insertWhHouseInfo(whHouseInfo)); return toAjax(whHouseInfoService.insertWhHouseInfo(whHouseInfo));
} }
@ -98,8 +105,7 @@ public class WhHouseInfoController extends BaseController
@RequiresPermissions("warehouse:info:edit") @RequiresPermissions("warehouse:info:edit")
@SysLog(title = "仓库管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改仓库管理") @SysLog(title = "仓库管理", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改仓库管理")
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody WhHouseInfo whHouseInfo) public AjaxResult edit(@RequestBody WhHouseInfo whHouseInfo) {
{
return toAjax(whHouseInfoService.updateWhHouseInfo(whHouseInfo)); return toAjax(whHouseInfoService.updateWhHouseInfo(whHouseInfo));
} }
@ -109,10 +115,9 @@ public class WhHouseInfoController extends BaseController
@ApiOperation(value = "删除仓库管理") @ApiOperation(value = "删除仓库管理")
@PreventRepeatSubmit @PreventRepeatSubmit
@RequiresPermissions("warehouse:info:remove") @RequiresPermissions("warehouse:info:remove")
@SysLog(title = "仓库管理", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除仓库管理") @SysLog(title = "仓库管理", businessType = OperaType.DELETE, module = "仓储管理->删除仓库管理")
@DeleteMapping("/{houseIds}") @DeleteMapping("/{houseIds}")
public AjaxResult remove(@PathVariable Long[] houseIds) public AjaxResult remove(@PathVariable Long[] houseIds) {
{
return toAjax(whHouseInfoService.deleteWhHouseInfoByHouseIds(houseIds)); return toAjax(whHouseInfoService.deleteWhHouseInfoByHouseIds(houseIds));
} }
} }

View File

@ -3,22 +3,20 @@ package com.bonus.material.warehouse.domain;
import com.bonus.common.core.annotation.Excel; import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString; import lombok.ToString;
import com.bonus.common.core.web.domain.BaseEntity; import com.bonus.common.core.web.domain.BaseEntity;
/** /**
* 仓库管理对象 wh_house_info * 仓库管理对象 wh_house_info
* * @author bonus
* @author xsheng
* @date 2024-09-27
*/ */
@EqualsAndHashCode(callSuper = false)
@Data @Data
@ToString @ToString
public class WhHouseInfo extends BaseEntity public class WhHouseInfo extends BaseEntity {
{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = -6993602646196064834L;
/** 仓库ID */ /** 仓库ID */
private Long houseId; private Long houseId;
@ -28,6 +26,16 @@ public class WhHouseInfo extends BaseEntity
@ApiModelProperty(value = "工程项目名称") @ApiModelProperty(value = "工程项目名称")
private String houseName; private String houseName;
/** 实物库名称 */
@Excel(name = "实物库名称")
@ApiModelProperty(value = "实物库名称")
private String physicalName;
/** 仓库地理位置 */
@Excel(name = "仓库地理位置")
@ApiModelProperty(value = "仓库地址位置")
private String geoLocation;
/** 上级ID */ /** 上级ID */
@Excel(name = "上级ID") @Excel(name = "上级ID")
@ApiModelProperty(value = "上级ID") @ApiModelProperty(value = "上级ID")
@ -43,11 +51,12 @@ public class WhHouseInfo extends BaseEntity
private Long deptId; private Long deptId;
/** 删除标志0代表存在 2代表删除 */ /** 删除标志0代表存在 2代表删除 */
@ApiModelProperty(value = "删除标志0存在 2代表已删除")
private String delFlag; private String delFlag;
/** 数据所属组织 */ /** 数据所属组织 */
@Excel(name = "数据所属组织") @Excel(name = "所属组织")
@ApiModelProperty(value = "数据所属组织") @ApiModelProperty(value = "所属组织")
private String companyId; private String companyId;
/** 排序 */ /** 排序 */

View File

@ -25,7 +25,7 @@ public interface WhHouseInfoMapper
* @param whHouseInfo 仓库管理 * @param whHouseInfo 仓库管理
* @return 仓库管理集合 * @return 仓库管理集合
*/ */
public List<WhHouseInfo> selectWhHouseInfoList(WhHouseInfo whHouseInfo); List<WhHouseInfo> selectWhHouseInfoList(WhHouseInfo whHouseInfo);
/** /**
* 新增仓库管理 * 新增仓库管理

View File

@ -9,15 +9,14 @@ import com.bonus.material.warehouse.domain.WhHouseInfo;
* @author xsheng * @author xsheng
* @date 2024-09-27 * @date 2024-09-27
*/ */
public interface IWhHouseInfoService public interface IWhHouseInfoService {
{
/** /**
* 查询仓库管理 * 查询仓库管理
* *
* @param houseId 仓库管理主键 * @param houseId 仓库管理主键
* @return 仓库管理 * @return 仓库管理
*/ */
public WhHouseInfo selectWhHouseInfoByHouseId(Long houseId); WhHouseInfo selectWhHouseInfoByHouseId(Long houseId);
/** /**
* 查询仓库管理列表 * 查询仓库管理列表
@ -25,7 +24,7 @@ public interface IWhHouseInfoService
* @param whHouseInfo 仓库管理 * @param whHouseInfo 仓库管理
* @return 仓库管理集合 * @return 仓库管理集合
*/ */
public List<WhHouseInfo> selectWhHouseInfoList(WhHouseInfo whHouseInfo); List<WhHouseInfo> selectWhHouseInfoList(WhHouseInfo whHouseInfo);
/** /**
* 新增仓库管理 * 新增仓库管理
@ -33,7 +32,7 @@ public interface IWhHouseInfoService
* @param whHouseInfo 仓库管理 * @param whHouseInfo 仓库管理
* @return 结果 * @return 结果
*/ */
public int insertWhHouseInfo(WhHouseInfo whHouseInfo); int insertWhHouseInfo(WhHouseInfo whHouseInfo);
/** /**
* 修改仓库管理 * 修改仓库管理
@ -41,7 +40,7 @@ public interface IWhHouseInfoService
* @param whHouseInfo 仓库管理 * @param whHouseInfo 仓库管理
* @return 结果 * @return 结果
*/ */
public int updateWhHouseInfo(WhHouseInfo whHouseInfo); int updateWhHouseInfo(WhHouseInfo whHouseInfo);
/** /**
* 批量删除仓库管理 * 批量删除仓库管理
@ -49,7 +48,7 @@ public interface IWhHouseInfoService
* @param houseIds 需要删除的仓库管理主键集合 * @param houseIds 需要删除的仓库管理主键集合
* @return 结果 * @return 结果
*/ */
public int deleteWhHouseInfoByHouseIds(Long[] houseIds); int deleteWhHouseInfoByHouseIds(Long[] houseIds);
/** /**
* 删除仓库管理信息 * 删除仓库管理信息
@ -57,5 +56,5 @@ public interface IWhHouseInfoService
* @param houseId 仓库管理主键 * @param houseId 仓库管理主键
* @return 结果 * @return 结果
*/ */
public int deleteWhHouseInfoByHouseId(Long houseId); int deleteWhHouseInfoByHouseId(Long houseId);
} }

View File

@ -39,8 +39,7 @@ public class WhHouseInfoServiceImpl implements IWhHouseInfoService
* @return 仓库管理 * @return 仓库管理
*/ */
@Override @Override
public List<WhHouseInfo> selectWhHouseInfoList(WhHouseInfo whHouseInfo) public List<WhHouseInfo> selectWhHouseInfoList(WhHouseInfo whHouseInfo) {
{
return whHouseInfoMapper.selectWhHouseInfoList(whHouseInfo); return whHouseInfoMapper.selectWhHouseInfoList(whHouseInfo);
} }

View File

@ -52,8 +52,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="typeId != null">type_id = #{typeId},</if> <if test="typeId != null">type_id = #{typeId},</if>
<if test="userId != null">user_id = #{userId},</if> <if test="userId != null">user_id = #{userId},</if>
<if test="createTime != null">create_time = #{createTime},</if> update_time = #{updateTime},
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="companyId != null">company_id = #{companyId},</if> <if test="companyId != null">company_id = #{companyId},</if>
</trim> </trim>
where ID = #{ID} where ID = #{ID}

View File

@ -67,7 +67,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="isAncuo != null and isAncuo != ''"> and is_ancuo = #{isAncuo}</if> <if test="isAncuo != null and isAncuo != ''"> and is_ancuo = #{isAncuo}</if>
<if test="facModel != null and facModel != ''"> and fac_model = #{facModel}</if> <if test="facModel != null and facModel != ''"> and fac_model = #{facModel}</if>
<if test="intelligentCode != null and intelligentCode != ''"> and intelligent_code = #{intelligentCode}</if> <if test="intelligentCode != null and intelligentCode != ''"> and intelligent_code = #{intelligentCode}</if>
and del_flag = '0' and del_flag = #{delFlag}
</where> </where>
</select> </select>

View File

@ -6,6 +6,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="com.bonus.material.warehouse.domain.WhHouseInfo" id="WhHouseInfoResult"> <resultMap type="com.bonus.material.warehouse.domain.WhHouseInfo" id="WhHouseInfoResult">
<result property="houseId" column="house_id" /> <result property="houseId" column="house_id" />
<result property="houseName" column="house_name" /> <result property="houseName" column="house_name" />
<result property="physicalName" column="physical_name" />
<result property="geoLocation" column="geo_location" />
<result property="parentId" column="parent_id" /> <result property="parentId" column="parent_id" />
<result property="status" column="status" /> <result property="status" column="status" />
<result property="deptId" column="dept_id" /> <result property="deptId" column="dept_id" />
@ -22,13 +24,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectWhHouseInfoVo"> <sql id="selectWhHouseInfoVo">
select house_id, house_name, parent_id, status, dept_id, del_flag, create_by, create_time, update_by, update_time, remark, company_id, sort, concat, phone from wh_house_info select house_id, house_name, physical_name, geo_location, parent_id, status, dept_id, del_flag, create_by, create_time, update_by, update_time, remark, company_id, sort, concat, phone from wh_house_info
</sql> </sql>
<select id="selectWhHouseInfoList" parameterType="com.bonus.material.warehouse.domain.WhHouseInfo" resultMap="WhHouseInfoResult"> <select id="selectWhHouseInfoList" parameterType="com.bonus.material.warehouse.domain.WhHouseInfo" resultMap="WhHouseInfoResult">
<include refid="selectWhHouseInfoVo"/> <include refid="selectWhHouseInfoVo"/>
<where> <where>
<if test="houseName != null and houseName != ''"> and house_name like concat('%', #{houseName}, '%')</if> <if test="houseName != null and houseName != ''"> and house_name like concat('%', #{houseName}, '%')</if>
<if test="physicalName != null and physicalName != ''"> and physical_name like concat('%', #{physicalName}, '%')</if>
<if test="parentId != null "> and parent_id = #{parentId}</if> <if test="parentId != null "> and parent_id = #{parentId}</if>
<if test="status != null and status != ''"> and status = #{status}</if> <if test="status != null and status != ''"> and status = #{status}</if>
<if test="deptId != null "> and dept_id = #{deptId}</if> <if test="deptId != null "> and dept_id = #{deptId}</if>
@ -48,6 +51,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
insert into wh_house_info insert into wh_house_info
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="houseName != null and houseName != ''">house_name,</if> <if test="houseName != null and houseName != ''">house_name,</if>
<if test="physicalName != null and physicalName != ''">physical_name,</if>
<if test="geoLocation != null and geoLocation != ''">geo_location,</if>
<if test="parentId != null">parent_id,</if> <if test="parentId != null">parent_id,</if>
<if test="status != null">status,</if> <if test="status != null">status,</if>
<if test="deptId != null">dept_id,</if> <if test="deptId != null">dept_id,</if>
@ -64,6 +69,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="houseName != null and houseName != ''">#{houseName},</if> <if test="houseName != null and houseName != ''">#{houseName},</if>
<if test="physicalName != null and physicalName != ''">#{physicalName},</if>
<if test="geoLocation != null and geoLocation != ''">#{geoLocation},</if>
<if test="parentId != null">#{parentId},</if> <if test="parentId != null">#{parentId},</if>
<if test="status != null">#{status},</if> <if test="status != null">#{status},</if>
<if test="deptId != null">#{deptId},</if> <if test="deptId != null">#{deptId},</if>
@ -84,6 +91,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
update wh_house_info update wh_house_info
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="houseName != null and houseName != ''">house_name = #{houseName},</if> <if test="houseName != null and houseName != ''">house_name = #{houseName},</if>
<if test="physicalName != null and physicalName != ''">physical_name = #{physicalName},</if>
<if test="geoLocation != null and geoLocation != ''">geo_location = #{geoLocation},</if>
<if test="parentId != null">parent_id = #{parentId},</if> <if test="parentId != null">parent_id = #{parentId},</if>
<if test="status != null">status = #{status},</if> <if test="status != null">status = #{status},</if>
<if test="deptId != null">dept_id = #{deptId},</if> <if test="deptId != null">dept_id = #{deptId},</if>
@ -102,11 +111,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</update> </update>
<delete id="deleteWhHouseInfoByHouseId" parameterType="Long"> <delete id="deleteWhHouseInfoByHouseId" parameterType="Long">
delete from wh_house_info where house_id = #{houseId} update wh_house_info set del_flag = '2' where house_id = #{houseId}
</delete> </delete>
<delete id="deleteWhHouseInfoByHouseIds" parameterType="String"> <delete id="deleteWhHouseInfoByHouseIds" parameterType="String">
delete from wh_house_info where house_id in update wh_house_info set del_flag = '2' where house_id in
<foreach item="houseId" collection="array" open="(" separator="," close=")"> <foreach item="houseId" collection="array" open="(" separator="," close=")">
#{houseId} #{houseId}
</foreach> </foreach>