增加 调拨
parent
e625217982
commit
2279184199
@ -0,0 +1,117 @@
|
||||
package org.dromara.wms.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.wms.domain.vo.WmsHppTransferVo;
|
||||
import org.dromara.wms.domain.bo.WmsHppTransferBo;
|
||||
import org.dromara.wms.service.IWmsHppTransferService;
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 半成品调拨
|
||||
* 前端访问路由地址为:/wms/hppTransfer
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/hppTransfer")
|
||||
public class WmsHppTransferController extends BaseController {
|
||||
|
||||
private final IWmsHppTransferService wmsHppTransferService;
|
||||
|
||||
/**
|
||||
* 查询半成品调拨列表
|
||||
*/
|
||||
@SaCheckPermission("wms:hppTransfer:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsHppTransferVo> list(WmsHppTransferBo bo, PageQuery pageQuery) {
|
||||
return wmsHppTransferService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出半成品调拨列表
|
||||
*/
|
||||
@SaCheckPermission("wms:hppTransfer:export")
|
||||
@Log(title = "半成品调拨", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsHppTransferBo bo, HttpServletResponse response) {
|
||||
List<WmsHppTransferVo> list = wmsHppTransferService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "半成品调拨", WmsHppTransferVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取半成品调拨详细信息
|
||||
*
|
||||
* @param transferId 主键
|
||||
*/
|
||||
@SaCheckPermission("wms:hppTransfer:query")
|
||||
@GetMapping("/{transferId}")
|
||||
public R<WmsHppTransferVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long transferId) {
|
||||
return R.ok(wmsHppTransferService.queryById(transferId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增半成品调拨
|
||||
*/
|
||||
@SaCheckPermission("wms:hppTransfer:add")
|
||||
@Log(title = "半成品调拨", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsHppTransferBo bo) {
|
||||
return toAjax(wmsHppTransferService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改半成品调拨
|
||||
*/
|
||||
@SaCheckPermission("wms:hppTransfer:edit")
|
||||
@Log(title = "半成品调拨", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsHppTransferBo bo) {
|
||||
return toAjax(wmsHppTransferService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除半成品调拨
|
||||
*
|
||||
* @param transferIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("wms:hppTransfer:remove")
|
||||
@Log(title = "半成品调拨", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{transferIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] transferIds) {
|
||||
return toAjax(wmsHppTransferService.deleteWithValidByIds(List.of(transferIds), true));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 下拉框查询半成品调拨列表
|
||||
*/
|
||||
|
||||
@GetMapping("/getWmsHppTransferList")
|
||||
public R<List<WmsHppTransferVo>> getWmsHppTransferList(WmsHppTransferBo bo) {
|
||||
List<WmsHppTransferVo> list = wmsHppTransferService.queryList(bo);
|
||||
return R.ok(list);
|
||||
}
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
package org.dromara.wms.domain;
|
||||
|
||||
import org.dromara.common.tenant.core.TenantEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
|
||||
/**
|
||||
* 半成品调拨对象 wms_hpp_transfer
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("wms_hpp_transfer")
|
||||
public class WmsHppTransfer extends TenantEntity {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 表主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long transferId;
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
*/
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 流水卡号
|
||||
*/
|
||||
private String cardNo;
|
||||
|
||||
/**
|
||||
* 工装架子号
|
||||
*/
|
||||
private String shelfNo;
|
||||
|
||||
/**
|
||||
* 库位编码
|
||||
*/
|
||||
private String storePlaceCode;
|
||||
|
||||
/**
|
||||
* 调拨库位
|
||||
*/
|
||||
private String transferPlaceCode;
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package org.dromara.wms.domain.bo;
|
||||
|
||||
import org.dromara.wms.domain.WmsHppTransfer;
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
/**
|
||||
* 半成品调拨业务对象 wms_hpp_transfer
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = WmsHppTransfer.class, reverseConvertGenerate = false)
|
||||
public class WmsHppTransferBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
*/
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 流水卡号
|
||||
*/
|
||||
private String cardNo;
|
||||
|
||||
/**
|
||||
* 工装架子号
|
||||
*/
|
||||
private String shelfNo;
|
||||
|
||||
/**
|
||||
* 库位编码
|
||||
*/
|
||||
private String storePlaceCode;
|
||||
|
||||
/**
|
||||
* 调拨库位
|
||||
*/
|
||||
private String transferPlaceCode;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
package org.dromara.wms.domain.vo;
|
||||
|
||||
import org.dromara.wms.domain.WmsHppTransfer;
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 半成品调拨视图对象 wms_hpp_transfer
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = WmsHppTransfer.class)
|
||||
public class WmsHppTransferVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 表主键
|
||||
*/
|
||||
@ExcelProperty(value = "表主键")
|
||||
private Long transferId;
|
||||
|
||||
/**
|
||||
* 物料ID
|
||||
*/
|
||||
@ExcelProperty(value = "物料ID")
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 流水卡号
|
||||
*/
|
||||
@ExcelProperty(value = "流水卡号")
|
||||
private String cardNo;
|
||||
|
||||
/**
|
||||
* 工装架子号
|
||||
*/
|
||||
@ExcelProperty(value = "工装架子号")
|
||||
private String shelfNo;
|
||||
|
||||
/**
|
||||
* 库位编码
|
||||
*/
|
||||
@ExcelProperty(value = "库位编码")
|
||||
private String storePlaceCode;
|
||||
|
||||
/**
|
||||
* 调拨库位
|
||||
*/
|
||||
@ExcelProperty(value = "调拨库位")
|
||||
private String transferPlaceCode;
|
||||
|
||||
/**
|
||||
* 创建人
|
||||
*/
|
||||
@ExcelProperty(value = "创建人")
|
||||
private Long createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@ExcelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
package org.dromara.wms.mapper;
|
||||
|
||||
import org.dromara.wms.domain.WmsHppTransfer;
|
||||
import org.dromara.wms.domain.vo.WmsHppTransferVo;
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
/**
|
||||
* 半成品调拨Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@Repository
|
||||
public interface WmsHppTransferMapper extends BaseMapperPlus<WmsHppTransfer, WmsHppTransferVo> {
|
||||
|
||||
}
|
@ -0,0 +1,68 @@
|
||||
package org.dromara.wms.service;
|
||||
|
||||
import org.dromara.wms.domain.vo.WmsHppTransferVo;
|
||||
import org.dromara.wms.domain.bo.WmsHppTransferBo;
|
||||
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-04-03
|
||||
*/
|
||||
public interface IWmsHppTransferService {
|
||||
|
||||
/**
|
||||
* 查询半成品调拨
|
||||
*
|
||||
* @param transferId 主键
|
||||
* @return 半成品调拨
|
||||
*/
|
||||
WmsHppTransferVo queryById(Long transferId);
|
||||
|
||||
/**
|
||||
* 分页查询半成品调拨列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 半成品调拨分页列表
|
||||
*/
|
||||
TableDataInfo<WmsHppTransferVo> queryPageList(WmsHppTransferBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的半成品调拨列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 半成品调拨列表
|
||||
*/
|
||||
List<WmsHppTransferVo> queryList(WmsHppTransferBo bo);
|
||||
|
||||
/**
|
||||
* 新增半成品调拨
|
||||
*
|
||||
* @param bo 半成品调拨
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(WmsHppTransferBo bo);
|
||||
|
||||
/**
|
||||
* 修改半成品调拨
|
||||
*
|
||||
* @param bo 半成品调拨
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(WmsHppTransferBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除半成品调拨信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,129 @@
|
||||
package org.dromara.wms.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 lombok.RequiredArgsConstructor;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.dromara.wms.domain.bo.WmsHppTransferBo;
|
||||
import org.dromara.wms.domain.vo.WmsHppTransferVo;
|
||||
import org.dromara.wms.domain.WmsHppTransfer;
|
||||
import org.dromara.wms.mapper.WmsHppTransferMapper;
|
||||
import org.dromara.wms.service.IWmsHppTransferService;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 半成品调拨Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2025-04-03
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsHppTransferServiceImpl implements IWmsHppTransferService {
|
||||
|
||||
private final WmsHppTransferMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询半成品调拨
|
||||
*
|
||||
* @param transferId 主键
|
||||
* @return 半成品调拨
|
||||
*/
|
||||
@Override
|
||||
public WmsHppTransferVo queryById(Long transferId){
|
||||
return baseMapper.selectVoById(transferId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询半成品调拨列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 半成品调拨分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsHppTransferVo> queryPageList(WmsHppTransferBo bo, PageQuery pageQuery) {
|
||||
MPJLambdaWrapper<WmsHppTransfer> lqw = buildQueryWrapper(bo);
|
||||
Page<WmsHppTransferVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的半成品调拨列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 半成品调拨列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsHppTransferVo> queryList(WmsHppTransferBo bo) {
|
||||
MPJLambdaWrapper<WmsHppTransfer> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
private MPJLambdaWrapper<WmsHppTransfer> buildQueryWrapper(WmsHppTransferBo bo) {
|
||||
// Map<String, Object> params = bo.getParams();
|
||||
return JoinWrappers.lambda(WmsHppTransfer.class)
|
||||
.selectAll(WmsHppTransfer.class)
|
||||
.eq(bo.getMaterialId() != null, WmsHppTransfer::getMaterialId, bo.getMaterialId())
|
||||
.eq(StringUtils.isNotBlank(bo.getCardNo()), WmsHppTransfer::getCardNo, bo.getCardNo())
|
||||
.eq(StringUtils.isNotBlank(bo.getShelfNo()), WmsHppTransfer::getShelfNo, bo.getShelfNo())
|
||||
.eq(StringUtils.isNotBlank(bo.getStorePlaceCode()), WmsHppTransfer::getStorePlaceCode, bo.getStorePlaceCode())
|
||||
.eq(StringUtils.isNotBlank(bo.getTransferPlaceCode()), WmsHppTransfer::getTransferPlaceCode, bo.getTransferPlaceCode())
|
||||
.orderByDesc(WmsHppTransfer::getCreateTime);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增半成品调拨
|
||||
*
|
||||
* @param bo 半成品调拨
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsHppTransferBo bo) {
|
||||
WmsHppTransfer add = MapstructUtils.convert(bo, WmsHppTransfer.class);
|
||||
// validEntityBeforeSave(add);
|
||||
return baseMapper.insert(add) > 0;
|
||||
// if (flag) {
|
||||
// bo.setTransferId(add.getTransferId());
|
||||
// }
|
||||
// return flag;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改半成品调拨
|
||||
*
|
||||
* @param bo 半成品调拨
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsHppTransferBo bo) {
|
||||
WmsHppTransfer update = MapstructUtils.convert(bo, WmsHppTransfer.class);
|
||||
// validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 校验并批量删除半成品调拨信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
/* if(isValid){
|
||||
|
||||
}*/
|
||||
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.wms.mapper.WmsHppTransferMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue