wms新增物料wms_instock_print模块
parent
303a1bc364
commit
dcf6c749dd
@ -0,0 +1,112 @@
|
||||
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.dromara.wms.domain.bo.WmsInstockPrintBo;
|
||||
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
|
||||
import org.dromara.wms.service.IWmsInstockPrintService;
|
||||
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.common.mybatis.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 入库单-物料打印条码
|
||||
* 前端访问路由地址为:/system/instockPrint
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Validated
|
||||
@RequiredArgsConstructor
|
||||
@RestController
|
||||
@RequestMapping("/instockPrint")
|
||||
public class WmsInstockPrintController extends BaseController {
|
||||
|
||||
private final IWmsInstockPrintService wmsInstockPrintService;
|
||||
|
||||
/**
|
||||
* 查询入库单-物料打印条码列表
|
||||
*/
|
||||
@SaCheckPermission("system:instockPrint:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo<WmsInstockPrintVo> list(WmsInstockPrintBo bo, PageQuery pageQuery) {
|
||||
return wmsInstockPrintService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出入库单-物料打印条码列表
|
||||
*/
|
||||
@SaCheckPermission("system:instockPrint:export")
|
||||
@Log(title = "入库单-物料打印条码", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(WmsInstockPrintBo bo, HttpServletResponse response) {
|
||||
List<WmsInstockPrintVo> list = wmsInstockPrintService.queryList(bo);
|
||||
ExcelUtil.exportExcel(list, "入库单-物料打印条码", WmsInstockPrintVo.class, response);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取入库单-物料打印条码详细信息
|
||||
*
|
||||
* @param instockPrintId 主键
|
||||
*/
|
||||
@SaCheckPermission("system:instockPrint:query")
|
||||
@GetMapping("/{instockPrintId}")
|
||||
public R<WmsInstockPrintVo> getInfo(@NotNull(message = "主键不能为空")
|
||||
@PathVariable Long instockPrintId) {
|
||||
return R.ok(wmsInstockPrintService.queryById(instockPrintId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库单-物料打印条码
|
||||
*/
|
||||
@SaCheckPermission("system:instockPrint:add")
|
||||
@Log(title = "入库单-物料打印条码", businessType = BusinessType.INSERT)
|
||||
@RepeatSubmit()
|
||||
@PostMapping()
|
||||
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsInstockPrintBo bo) {
|
||||
return toAjax(wmsInstockPrintService.insertByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入库单-物料打印条码
|
||||
*/
|
||||
@SaCheckPermission("system:instockPrint:edit")
|
||||
@Log(title = "入库单-物料打印条码", businessType = BusinessType.UPDATE)
|
||||
@RepeatSubmit()
|
||||
@PutMapping()
|
||||
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsInstockPrintBo bo) {
|
||||
return toAjax(wmsInstockPrintService.updateByBo(bo));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除入库单-物料打印条码
|
||||
*
|
||||
* @param instockPrintIds 主键串
|
||||
*/
|
||||
@SaCheckPermission("system:instockPrint:remove")
|
||||
@Log(title = "入库单-物料打印条码", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{instockPrintIds}")
|
||||
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||
@PathVariable Long[] instockPrintIds) {
|
||||
return toAjax(wmsInstockPrintService.deleteWithValidByIds(List.of(instockPrintIds), true));
|
||||
}
|
||||
@PostMapping("/print")
|
||||
public R<String> print(@RequestBody WmsInstockPrintBo bo){
|
||||
List<WmsInstockPrintVo> vos = bo.getVos();
|
||||
return null;
|
||||
}
|
||||
}
|
@ -0,0 +1,112 @@
|
||||
package org.dromara.wms.domain;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 入库单-物料打印条码对象 wms_instock_print
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Data
|
||||
//@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("wms_instock_print")
|
||||
public class WmsInstockPrint{
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 入库单子表主键
|
||||
*/
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long instockPrintId;
|
||||
|
||||
/**
|
||||
* 入库单号
|
||||
*/
|
||||
private String instockCode;
|
||||
|
||||
/**
|
||||
* 批次码
|
||||
*/
|
||||
private String batchCode;
|
||||
|
||||
/**
|
||||
* 条码数量
|
||||
*/
|
||||
private Long materialQty;
|
||||
|
||||
/**
|
||||
* 分包数量
|
||||
*/
|
||||
private Long apportionQty;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
private String materialSpe;
|
||||
|
||||
/**
|
||||
* 计量单位名称
|
||||
*/
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 是否有条码
|
||||
*/
|
||||
private String codeYesNo;
|
||||
|
||||
/**
|
||||
* 物料大类
|
||||
*/
|
||||
private String materialCategories;
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private String createBy;
|
||||
|
||||
/**
|
||||
* 创建时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT)
|
||||
private Date createTime;
|
||||
|
||||
/**
|
||||
* 更新者
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private String updateBy;
|
||||
|
||||
/**
|
||||
* 更新时间
|
||||
*/
|
||||
@TableField(fill = FieldFill.INSERT_UPDATE)
|
||||
private Date updateTime;
|
||||
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,101 @@
|
||||
package org.dromara.wms.domain.bo;
|
||||
|
||||
import org.dromara.common.mybatis.core.domain.BaseEntity;
|
||||
import org.dromara.common.core.validate.AddGroup;
|
||||
import org.dromara.common.core.validate.EditGroup;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import jakarta.validation.constraints.*;
|
||||
import org.dromara.wms.domain.WmsInstockPrint;
|
||||
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入库单-物料打印条码业务对象 wms_instock_print
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@AutoMapper(target = WmsInstockPrint.class, reverseConvertGenerate = false)
|
||||
public class WmsInstockPrintBo extends BaseEntity {
|
||||
|
||||
/**
|
||||
* 入库单子表主键
|
||||
*/
|
||||
// @NotNull(message = "入库单子表主键不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long instockPrintId;
|
||||
|
||||
/**
|
||||
* 入库单号
|
||||
*/
|
||||
// @NotBlank(message = "入库单号不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String instockCode;
|
||||
|
||||
/**
|
||||
* 批次码
|
||||
*/
|
||||
// @NotBlank(message = "批次码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String batchCode;
|
||||
|
||||
/**
|
||||
* 条码数量
|
||||
*/
|
||||
// @NotNull(message = "条码数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long materialQty;
|
||||
|
||||
/**
|
||||
* 分包数量
|
||||
*/
|
||||
// @NotNull(message = "分包数量不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long apportionQty;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
// @NotNull(message = "物料id不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
// @NotBlank(message = "物料编码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
// @NotBlank(message = "物料名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
// @NotBlank(message = "物料规格不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String materialSpe;
|
||||
|
||||
/**
|
||||
* 计量单位名称
|
||||
*/
|
||||
// @NotBlank(message = "计量单位名称不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 是否有条码
|
||||
*/
|
||||
// @NotBlank(message = "是否有条码不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String codeYesNo;
|
||||
|
||||
/**
|
||||
* 物料大类
|
||||
*/
|
||||
// @NotBlank(message = "物料大类不能为空", groups = { AddGroup.class, EditGroup.class })
|
||||
private String materialCategories;
|
||||
private String tenantId;
|
||||
private List<WmsInstockPrintVo> vos;
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,110 @@
|
||||
package org.dromara.wms.domain.vo;
|
||||
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
import com.alibaba.excel.annotation.ExcelProperty;
|
||||
import org.dromara.common.excel.annotation.ExcelDictFormat;
|
||||
import org.dromara.common.excel.convert.ExcelDictConvert;
|
||||
import io.github.linpeilie.annotations.AutoMapper;
|
||||
import lombok.Data;
|
||||
import org.dromara.wms.domain.WmsInstockPrint;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 入库单-物料打印条码视图对象 wms_instock_print
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
@AutoMapper(target = WmsInstockPrint.class)
|
||||
public class WmsInstockPrintVo implements Serializable {
|
||||
|
||||
@Serial
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* 入库单子表主键
|
||||
*/
|
||||
@ExcelProperty(value = "入库单子表主键")
|
||||
private Long instockPrintId;
|
||||
|
||||
/**
|
||||
* 入库单号
|
||||
*/
|
||||
@ExcelProperty(value = "入库单号")
|
||||
private String instockCode;
|
||||
|
||||
/**
|
||||
* 批次码
|
||||
*/
|
||||
@ExcelProperty(value = "批次码")
|
||||
private String batchCode;
|
||||
|
||||
/**
|
||||
* 条码数量
|
||||
*/
|
||||
@ExcelProperty(value = "条码数量")
|
||||
private Long materialQty;
|
||||
|
||||
/**
|
||||
* 分包数量
|
||||
*/
|
||||
@ExcelProperty(value = "分包数量")
|
||||
private Long apportionQty;
|
||||
|
||||
/**
|
||||
* 物料id
|
||||
*/
|
||||
@ExcelProperty(value = "物料id")
|
||||
private Long materialId;
|
||||
|
||||
/**
|
||||
* 物料编码
|
||||
*/
|
||||
@ExcelProperty(value = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
/**
|
||||
* 物料名称
|
||||
*/
|
||||
@ExcelProperty(value = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
/**
|
||||
* 物料规格
|
||||
*/
|
||||
@ExcelProperty(value = "物料规格")
|
||||
private String materialSpe;
|
||||
|
||||
/**
|
||||
* 计量单位名称
|
||||
*/
|
||||
@ExcelProperty(value = "计量单位名称")
|
||||
private String unitName;
|
||||
|
||||
/**
|
||||
* 是否有条码
|
||||
*/
|
||||
@ExcelProperty(value = "是否有条码")
|
||||
private String codeYesNo;
|
||||
|
||||
/**
|
||||
* 物料大类
|
||||
*/
|
||||
@ExcelProperty(value = "物料大类")
|
||||
private String materialCategories;
|
||||
/**
|
||||
* 租户id
|
||||
*/
|
||||
private String tenantId;
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
package org.dromara.wms.mapper;
|
||||
|
||||
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
|
||||
import org.dromara.wms.domain.WmsInstockPrint;
|
||||
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
|
||||
|
||||
/**
|
||||
* 入库单-物料打印条码Mapper接口
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface WmsInstockPrintMapper extends BaseMapperPlus<WmsInstockPrint, WmsInstockPrintVo> {
|
||||
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
package org.dromara.wms.service;
|
||||
|
||||
import org.dromara.common.mybatis.core.page.TableDataInfo;
|
||||
import org.dromara.common.mybatis.core.page.PageQuery;
|
||||
import org.dromara.wms.domain.WmsInstockPrint;
|
||||
import org.dromara.wms.domain.bo.WmsInstockDetailBo;
|
||||
import org.dromara.wms.domain.bo.WmsInstockPrintBo;
|
||||
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 入库单-物料打印条码Service接口
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
public interface IWmsInstockPrintService {
|
||||
|
||||
/**
|
||||
* 查询入库单-物料打印条码
|
||||
*
|
||||
* @param instockPrintId 主键
|
||||
* @return 入库单-物料打印条码
|
||||
*/
|
||||
WmsInstockPrintVo queryById(Long instockPrintId);
|
||||
|
||||
/**
|
||||
* 分页查询入库单-物料打印条码列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 入库单-物料打印条码分页列表
|
||||
*/
|
||||
TableDataInfo<WmsInstockPrintVo> queryPageList(WmsInstockPrintBo bo, PageQuery pageQuery);
|
||||
|
||||
/**
|
||||
* 查询符合条件的入库单-物料打印条码列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 入库单-物料打印条码列表
|
||||
*/
|
||||
List<WmsInstockPrintVo> queryList(WmsInstockPrintBo bo);
|
||||
|
||||
long queryPrintNum(WmsInstockDetailBo bo);
|
||||
|
||||
/**
|
||||
* 新增入库单-物料打印条码
|
||||
*
|
||||
* @param bo 入库单-物料打印条码
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
Boolean insertByBo(WmsInstockPrintBo bo);
|
||||
int insertWmsInstockPrint(WmsInstockPrint wmsInstockPrint);
|
||||
|
||||
/**
|
||||
* 修改入库单-物料打印条码
|
||||
*
|
||||
* @param bo 入库单-物料打印条码
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
Boolean updateByBo(WmsInstockPrintBo bo);
|
||||
|
||||
/**
|
||||
* 校验并批量删除入库单-物料打印条码信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.dromara.wms.domain.WmsInstockDetail;
|
||||
import org.dromara.wms.domain.WmsInstockPrint;
|
||||
import org.dromara.wms.domain.bo.WmsInstockDetailBo;
|
||||
import org.dromara.wms.domain.bo.WmsInstockPrintBo;
|
||||
import org.dromara.wms.domain.vo.WmsInstockPrintVo;
|
||||
import org.dromara.wms.mapper.WmsInstockPrintMapper;
|
||||
import org.dromara.wms.service.IWmsInstockPrintService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Collection;
|
||||
|
||||
/**
|
||||
* 入库单-物料打印条码Service业务层处理
|
||||
*
|
||||
* @author LionLi
|
||||
* @date 2025-01-07
|
||||
*/
|
||||
@RequiredArgsConstructor
|
||||
@Service
|
||||
public class WmsInstockPrintServiceImpl implements IWmsInstockPrintService {
|
||||
|
||||
private final WmsInstockPrintMapper baseMapper;
|
||||
|
||||
/**
|
||||
* 查询入库单-物料打印条码
|
||||
*
|
||||
* @param instockPrintId 主键
|
||||
* @return 入库单-物料打印条码
|
||||
*/
|
||||
@Override
|
||||
public WmsInstockPrintVo queryById(Long instockPrintId){
|
||||
return baseMapper.selectVoById(instockPrintId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分页查询入库单-物料打印条码列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @param pageQuery 分页参数
|
||||
* @return 入库单-物料打印条码分页列表
|
||||
*/
|
||||
@Override
|
||||
public TableDataInfo<WmsInstockPrintVo> queryPageList(WmsInstockPrintBo bo, PageQuery pageQuery) {
|
||||
LambdaQueryWrapper<WmsInstockPrint> lqw = buildQueryWrapper(bo);
|
||||
lqw.orderByDesc(WmsInstockPrint::getCreateTime);
|
||||
Page<WmsInstockPrintVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||
return TableDataInfo.build(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询符合条件的入库单-物料打印条码列表
|
||||
*
|
||||
* @param bo 查询条件
|
||||
* @return 入库单-物料打印条码列表
|
||||
*/
|
||||
@Override
|
||||
public List<WmsInstockPrintVo> queryList(WmsInstockPrintBo bo) {
|
||||
LambdaQueryWrapper<WmsInstockPrint> lqw = buildQueryWrapper(bo);
|
||||
return baseMapper.selectVoList(lqw);
|
||||
}
|
||||
|
||||
public long queryPrintNum(WmsInstockDetailBo bo){
|
||||
LambdaQueryWrapper<WmsInstockPrint> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(WmsInstockPrint::getInstockCode,bo.getInstockCode());
|
||||
wrapper.eq(WmsInstockPrint::getMaterialCode,bo.getMaterialCode());
|
||||
return baseMapper.selectCount(wrapper);
|
||||
}
|
||||
|
||||
private LambdaQueryWrapper<WmsInstockPrint> buildQueryWrapper(WmsInstockPrintBo bo) {
|
||||
Map<String, Object> params = bo.getParams();
|
||||
LambdaQueryWrapper<WmsInstockPrint> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(bo.getInstockPrintId() != null, WmsInstockPrint::getInstockPrintId, bo.getInstockPrintId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getInstockCode()), WmsInstockPrint::getInstockCode, bo.getInstockCode());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getBatchCode()), WmsInstockPrint::getBatchCode, bo.getBatchCode());
|
||||
lqw.eq(bo.getMaterialQty() != null, WmsInstockPrint::getMaterialQty, bo.getMaterialQty());
|
||||
lqw.eq(bo.getApportionQty() != null, WmsInstockPrint::getApportionQty, bo.getApportionQty());
|
||||
lqw.eq(bo.getMaterialId() != null, WmsInstockPrint::getMaterialId, bo.getMaterialId());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCode()), WmsInstockPrint::getMaterialCode, bo.getMaterialCode());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getMaterialName()), WmsInstockPrint::getMaterialName, bo.getMaterialName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaterialSpe()), WmsInstockPrint::getMaterialSpe, bo.getMaterialSpe());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitName()), WmsInstockPrint::getUnitName, bo.getUnitName());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getCodeYesNo()), WmsInstockPrint::getCodeYesNo, bo.getCodeYesNo());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), WmsInstockPrint::getMaterialCategories, bo.getMaterialCategories());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增入库单-物料打印条码
|
||||
*
|
||||
* @param bo 入库单-物料打印条码
|
||||
* @return 是否新增成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean insertByBo(WmsInstockPrintBo bo) {
|
||||
WmsInstockPrint add = MapstructUtils.convert(bo, WmsInstockPrint.class);
|
||||
validEntityBeforeSave(add);
|
||||
boolean flag = baseMapper.insert(add) > 0;
|
||||
if (flag) {
|
||||
bo.setInstockPrintId(add.getInstockPrintId());
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
public int insertWmsInstockPrint(WmsInstockPrint wmsInstockPrint){
|
||||
return baseMapper.insert(wmsInstockPrint);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改入库单-物料打印条码
|
||||
*
|
||||
* @param bo 入库单-物料打印条码
|
||||
* @return 是否修改成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean updateByBo(WmsInstockPrintBo bo) {
|
||||
WmsInstockPrint update = MapstructUtils.convert(bo, WmsInstockPrint.class);
|
||||
validEntityBeforeSave(update);
|
||||
return baseMapper.updateById(update) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* 保存前的数据校验
|
||||
*/
|
||||
private void validEntityBeforeSave(WmsInstockPrint entity){
|
||||
//TODO 做一些数据校验,如唯一约束
|
||||
}
|
||||
|
||||
/**
|
||||
* 校验并批量删除入库单-物料打印条码信息
|
||||
*
|
||||
* @param ids 待删除的主键集合
|
||||
* @param isValid 是否进行有效性校验
|
||||
* @return 是否删除成功
|
||||
*/
|
||||
@Override
|
||||
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||
if(isValid){
|
||||
//TODO 做一些业务上的校验,判断是否需要校验
|
||||
}
|
||||
return baseMapper.deleteByIds(ids) > 0;
|
||||
}
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<!DOCTYPE mapper
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.dromara.wms.mapper.WmsInstockPrintMapper">
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue