新增成品入库页面及下钻明细页面

master
maxw@mesnac.com 3 months ago
parent be476567ed
commit 693029ad41

@ -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.dromara.wms.domain.bo.WmsPsmInStockBo;
import org.dromara.wms.domain.vo.WmsPsmInStockVo;
import org.dromara.wms.service.IWmsPsmInStockService;
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/psmInStock
*
* @author LionLi
* @date 2025-01-15
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/psmInStock")
public class WmsPsmInStockController extends BaseController {
private final IWmsPsmInStockService wmsPsmInStockService;
/**
*
*/
@SaCheckPermission("system:psmInStock:list")
@GetMapping("/list")
public TableDataInfo<WmsPsmInStockVo> list(WmsPsmInStockBo bo, PageQuery pageQuery) {
return wmsPsmInStockService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("system:psmInStock:export")
@Log(title = "成品入库记录", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsPsmInStockBo bo, HttpServletResponse response) {
List<WmsPsmInStockVo> list = wmsPsmInStockService.queryList(bo);
ExcelUtil.exportExcel(list, "成品入库记录", WmsPsmInStockVo.class, response);
}
/**
*
*
* @param inStockId
*/
@SaCheckPermission("system:psmInStock:query")
@GetMapping("/{inStockId}")
public R<WmsPsmInStockVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long inStockId) {
return R.ok(wmsPsmInStockService.queryById(inStockId));
}
/**
*
*/
@SaCheckPermission("system:psmInStock:add")
@Log(title = "成品入库记录", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody WmsPsmInStockBo bo) {
return toAjax(wmsPsmInStockService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("system:psmInStock:edit")
@Log(title = "成品入库记录", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsPsmInStockBo bo) {
return toAjax(wmsPsmInStockService.updateByBo(bo));
}
/**
*
*
* @param inStockIds
*/
@SaCheckPermission("system:psmInStock:remove")
@Log(title = "成品入库记录", businessType = BusinessType.DELETE)
@DeleteMapping("/{inStockIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] inStockIds) {
return toAjax(wmsPsmInStockService.deleteWithValidByIds(List.of(inStockIds), true));
}
/**
*
*/
@GetMapping("getWmsPsmInStockList")
public R<List<WmsPsmInStockVo>> getWmsPsmInStocklist(WmsPsmInStockBo bo) {
List<WmsPsmInStockVo> list = wmsPsmInStockService.queryList(bo);
return R.ok(list);
}
}

@ -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.dromara.wms.domain.bo.WmsPsmInStockDetailBo;
import org.dromara.wms.domain.vo.WmsPsmInStockDetailVo;
import org.dromara.wms.service.IWmsPsmInStockDetailService;
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/psmInStockDetail
*
* @author LionLi
* @date 2025-01-15
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/psmInStockDetail")
public class WmsPsmInStockDetailController extends BaseController {
private final IWmsPsmInStockDetailService wmsPsmInStockDetailService;
/**
*
*/
@SaCheckPermission("system:psmInStockDetail:list")
@GetMapping("/list")
public TableDataInfo<WmsPsmInStockDetailVo> list(WmsPsmInStockDetailBo bo, PageQuery pageQuery) {
return wmsPsmInStockDetailService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("system:psmInStockDetail:export")
@Log(title = "成品入库", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(WmsPsmInStockDetailBo bo, HttpServletResponse response) {
List<WmsPsmInStockDetailVo> list = wmsPsmInStockDetailService.queryList(bo);
ExcelUtil.exportExcel(list, "成品入库", WmsPsmInStockDetailVo.class, response);
}
/**
*
*
* @param objid
*/
@SaCheckPermission("system:psmInStockDetail:query")
@GetMapping("/{objid}")
public R<WmsPsmInStockDetailVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long objid) {
return R.ok(wmsPsmInStockDetailService.queryById(objid));
}
/**
*
*/
@SaCheckPermission("system:psmInStockDetail:add")
@Log(title = "成品入库", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@RequestBody WmsPsmInStockDetailBo bo) {
return toAjax(wmsPsmInStockDetailService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("system:psmInStockDetail:edit")
@Log(title = "成品入库", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@RequestBody WmsPsmInStockDetailBo bo) {
return toAjax(wmsPsmInStockDetailService.updateByBo(bo));
}
/**
*
*
* @param objids
*/
@SaCheckPermission("system:psmInStockDetail:remove")
@Log(title = "成品入库", businessType = BusinessType.DELETE)
@DeleteMapping("/{objids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] objids) {
return toAjax(wmsPsmInStockDetailService.deleteWithValidByIds(List.of(objids), true));
}
/**
*
*/
@GetMapping("getWmsPsmInStockDetailList")
public R<List<WmsPsmInStockDetailVo>> getWmsPsmInStockDetaillist(WmsPsmInStockDetailBo bo) {
List<WmsPsmInStockDetailVo> list = wmsPsmInStockDetailService.queryList(bo);
return R.ok(list);
}
}

@ -0,0 +1,100 @@
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;
import java.util.Date;
/**
* wms_psm_in_stock
*
* @author LionLi
* @date 2025-01-15
*/
@Data
@TableName("wms_psm_in_stock")
public class WmsPsmInStock{
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Long inStockId;
/**
*
*/
private String inClass;
/**
*
*/
private String inShift;
/**
*
*/
private Long inAmount;
/**
*
*/
private String storeName;
/**
*
*/
private String storePlaceCode;
/**
*
*/
private String toolingBarcode;
/**
* ID
*/
private Long materialId;
/**
*
*/
private String materialSpe;
/**
*
*/
private String checkGradeCode;
/**
* id
*/
private String tenantId;
@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;
}

@ -0,0 +1,79 @@
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;
import java.util.Date;
/**
* wms_psm_in_stock_detail
*
* @author LionLi
* @date 2025-01-15
*/
@Data
@TableName("wms_psm_in_stock_detail")
public class WmsPsmInStockDetail{
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
private Long objid;
/**
* in_loadid
*/
private Long inStockId;
/**
* id
*/
private Long materialId;
/**
*
*/
private String materialSpe;
/**
*
*/
private String tyreNo;
/**
*
*/
private String checkGradeCode;
/**
* id
*/
private String tenantId;
@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;
}

@ -0,0 +1,87 @@
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.WmsPsmInStock;
/**
* wms_psm_in_stock
*
* @author LionLi
* @date 2025-01-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsPsmInStock.class, reverseConvertGenerate = false)
public class WmsPsmInStockBo extends BaseEntity {
/**
*
*/
@NotNull(message = "表主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long inStockId;
/**
*
*/
@NotBlank(message = "入库班组不能为空", groups = { AddGroup.class, EditGroup.class })
private String inClass;
/**
*
*/
@NotBlank(message = "入库班次不能为空", groups = { AddGroup.class, EditGroup.class })
private String inShift;
/**
*
*/
@NotNull(message = "入库数量不能为空", groups = { AddGroup.class, EditGroup.class })
private Long inAmount;
/**
*
*/
@NotBlank(message = "仓库名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String storeName;
/**
*
*/
@NotBlank(message = "库位条码不能为空", groups = { AddGroup.class, EditGroup.class })
private String storePlaceCode;
/**
*
*/
@NotBlank(message = "工装条码不能为空", groups = { AddGroup.class, EditGroup.class })
private String toolingBarcode;
/**
* ID
*/
@NotNull(message = "物料ID不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialId;
/**
*
*/
@NotBlank(message = "轮胎规格不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialSpe;
/**
*
*/
@NotBlank(message = "品级编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String checkGradeCode;
/**
* id
*/
private String tenantId;
}

@ -0,0 +1,65 @@
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.WmsPsmInStockDetail;
/**
* wms_psm_in_stock_detail
*
* @author LionLi
* @date 2025-01-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = WmsPsmInStockDetail.class, reverseConvertGenerate = false)
public class WmsPsmInStockDetailBo extends BaseEntity {
/**
*
*/
@NotNull(message = "主键不能为空", groups = { AddGroup.class, EditGroup.class })
private Long objid;
/**
* in_loadid
*/
@NotNull(message = "外键关联in_load表主键id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long inStockId;
/**
* id
*/
@NotNull(message = "物料id不能为空", groups = { AddGroup.class, EditGroup.class })
private Long materialId;
/**
*
*/
@NotBlank(message = "物料规格不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialSpe;
/**
*
*/
@NotBlank(message = "硫化条码不能为空", groups = { AddGroup.class, EditGroup.class })
private String tyreNo;
/**
*
*/
@NotBlank(message = "品级编号不能为空", groups = { AddGroup.class, EditGroup.class })
private String checkGradeCode;
/**
* id
*/
private String tenantId;
}

@ -0,0 +1,95 @@
package org.dromara.wms.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
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.WmsPsmInStockDetail;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* wms_psm_in_stock_detail
*
* @author LionLi
* @date 2025-01-15
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsPsmInStockDetail.class)
public class WmsPsmInStockDetailVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键")
private Long objid;
/**
* in_loadid
*/
@ExcelProperty(value = "外键关联in_load表主键id")
private Long inStockId;
/**
* id
*/
@ExcelProperty(value = "物料id")
private Long materialId;
/**
*
*/
@ExcelProperty(value = "物料规格")
private String materialSpe;
/**
*
*/
@ExcelProperty(value = "硫化条码")
private String tyreNo;
/**
*
*/
@ExcelProperty(value = "品级编号")
private String checkGradeCode;
/**
* id
*/
private String tenantId;
@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;
}

@ -0,0 +1,119 @@
package org.dromara.wms.domain.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
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.WmsPsmInStock;
import java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* wms_psm_in_stock
*
* @author LionLi
* @date 2025-01-15
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = WmsPsmInStock.class)
public class WmsPsmInStockVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "表主键")
private Long inStockId;
/**
*
*/
@ExcelProperty(value = "入库班组")
private String inClass;
/**
*
*/
@ExcelProperty(value = "入库班次")
private String inShift;
/**
*
*/
@ExcelProperty(value = "入库数量")
private Long inAmount;
/**
*
*/
@ExcelProperty(value = "仓库名称")
private String storeName;
/**
*
*/
@ExcelProperty(value = "库位条码")
private String storePlaceCode;
/**
*
*/
@ExcelProperty(value = "工装条码")
private String toolingBarcode;
/**
* ID
*/
@ExcelProperty(value = "物料ID")
private Long materialId;
/**
*
*/
@ExcelProperty(value = "轮胎规格")
private String materialSpe;
/**
*
*/
@ExcelProperty(value = "品级编号")
private String checkGradeCode;
/**
* id
*/
private String tenantId;
@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;
}

@ -0,0 +1,15 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsPsmInStockDetail;
import org.dromara.wms.domain.vo.WmsPsmInStockDetailVo;
/**
* Mapper
*
* @author LionLi
* @date 2025-01-15
*/
public interface WmsPsmInStockDetailMapper extends BaseMapperPlus<WmsPsmInStockDetail, WmsPsmInStockDetailVo> {
}

@ -0,0 +1,15 @@
package org.dromara.wms.mapper;
import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
import org.dromara.wms.domain.WmsPsmInStock;
import org.dromara.wms.domain.vo.WmsPsmInStockVo;
/**
* Mapper
*
* @author LionLi
* @date 2025-01-15
*/
public interface WmsPsmInStockMapper extends BaseMapperPlus<WmsPsmInStock, WmsPsmInStockVo> {
}

@ -0,0 +1,68 @@
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.bo.WmsPsmInStockDetailBo;
import org.dromara.wms.domain.vo.WmsPsmInStockDetailVo;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author LionLi
* @date 2025-01-15
*/
public interface IWmsPsmInStockDetailService {
/**
*
*
* @param objid
* @return
*/
WmsPsmInStockDetailVo queryById(Long objid);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<WmsPsmInStockDetailVo> queryPageList(WmsPsmInStockDetailBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsPsmInStockDetailVo> queryList(WmsPsmInStockDetailBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(WmsPsmInStockDetailBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(WmsPsmInStockDetailBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,68 @@
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.bo.WmsPsmInStockBo;
import org.dromara.wms.domain.vo.WmsPsmInStockVo;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author LionLi
* @date 2025-01-15
*/
public interface IWmsPsmInStockService {
/**
*
*
* @param inStockId
* @return
*/
WmsPsmInStockVo queryById(Long inStockId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<WmsPsmInStockVo> queryPageList(WmsPsmInStockBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<WmsPsmInStockVo> queryList(WmsPsmInStockBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(WmsPsmInStockBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(WmsPsmInStockBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

@ -0,0 +1,137 @@
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 com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.wms.domain.WmsPsmInStockDetail;
import org.dromara.wms.domain.bo.WmsPsmInStockDetailBo;
import org.dromara.wms.domain.vo.WmsPsmInStockDetailVo;
import org.dromara.wms.mapper.WmsPsmInStockDetailMapper;
import org.dromara.wms.service.IWmsPsmInStockDetailService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author LionLi
* @date 2025-01-15
*/
@RequiredArgsConstructor
@Service
public class WmsPsmInStockDetailServiceImpl implements IWmsPsmInStockDetailService {
private final WmsPsmInStockDetailMapper baseMapper;
/**
*
*
* @param objid
* @return
*/
@Override
public WmsPsmInStockDetailVo queryById(Long objid){
return baseMapper.selectVoById(objid);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<WmsPsmInStockDetailVo> queryPageList(WmsPsmInStockDetailBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<WmsPsmInStockDetail> lqw = buildQueryWrapper(bo);
Page<WmsPsmInStockDetailVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsPsmInStockDetailVo> queryList(WmsPsmInStockDetailBo bo) {
MPJLambdaWrapper<WmsPsmInStockDetail> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsPsmInStockDetail> buildQueryWrapper(WmsPsmInStockDetailBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsPsmInStockDetail> lqw = JoinWrappers.lambda(WmsPsmInStockDetail.class)
.selectAll(WmsPsmInStockDetail.class)
.eq(bo.getObjid() != null, WmsPsmInStockDetail::getObjid, bo.getObjid())
.eq(bo.getInStockId() != null, WmsPsmInStockDetail::getInStockId, bo.getInStockId())
.eq(bo.getMaterialId() != null, WmsPsmInStockDetail::getMaterialId, bo.getMaterialId())
.eq(StringUtils.isNotBlank(bo.getMaterialSpe()), WmsPsmInStockDetail::getMaterialSpe, bo.getMaterialSpe())
.eq(StringUtils.isNotBlank(bo.getTyreNo()), WmsPsmInStockDetail::getTyreNo, bo.getTyreNo())
.eq(StringUtils.isNotBlank(bo.getCheckGradeCode()), WmsPsmInStockDetail::getCheckGradeCode, bo.getCheckGradeCode())
.orderByDesc(WmsPsmInStockDetail::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(WmsPsmInStockDetailBo bo) {
WmsPsmInStockDetail add = MapstructUtils.convert(bo, WmsPsmInStockDetail.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setObjid(add.getObjid());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(WmsPsmInStockDetailBo bo) {
WmsPsmInStockDetail update = MapstructUtils.convert(bo, WmsPsmInStockDetail.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsPsmInStockDetail 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,141 @@
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 com.baomidou.mybatisplus.core.toolkit.Wrappers;
import lombok.RequiredArgsConstructor;
import org.dromara.wms.domain.WmsPsmInStock;
import org.dromara.wms.domain.bo.WmsPsmInStockBo;
import org.dromara.wms.domain.vo.WmsPsmInStockVo;
import org.dromara.wms.mapper.WmsPsmInStockMapper;
import org.dromara.wms.service.IWmsPsmInStockService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author LionLi
* @date 2025-01-15
*/
@RequiredArgsConstructor
@Service
public class WmsPsmInStockServiceImpl implements IWmsPsmInStockService {
private final WmsPsmInStockMapper baseMapper;
/**
*
*
* @param inStockId
* @return
*/
@Override
public WmsPsmInStockVo queryById(Long inStockId){
return baseMapper.selectVoById(inStockId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<WmsPsmInStockVo> queryPageList(WmsPsmInStockBo bo, PageQuery pageQuery) {
MPJLambdaWrapper<WmsPsmInStock> lqw = buildQueryWrapper(bo);
Page<WmsPsmInStockVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<WmsPsmInStockVo> queryList(WmsPsmInStockBo bo) {
MPJLambdaWrapper<WmsPsmInStock> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private MPJLambdaWrapper<WmsPsmInStock> buildQueryWrapper(WmsPsmInStockBo bo) {
Map<String, Object> params = bo.getParams();
MPJLambdaWrapper<WmsPsmInStock> lqw = JoinWrappers.lambda(WmsPsmInStock.class)
.selectAll(WmsPsmInStock.class)
.eq(bo.getInStockId() != null, WmsPsmInStock::getInStockId, bo.getInStockId())
.eq(StringUtils.isNotBlank(bo.getInClass()), WmsPsmInStock::getInClass, bo.getInClass())
.eq(StringUtils.isNotBlank(bo.getInShift()), WmsPsmInStock::getInShift, bo.getInShift())
.eq(bo.getInAmount() != null, WmsPsmInStock::getInAmount, bo.getInAmount())
.like(StringUtils.isNotBlank(bo.getStoreName()), WmsPsmInStock::getStoreName, bo.getStoreName())
.eq(StringUtils.isNotBlank(bo.getStorePlaceCode()), WmsPsmInStock::getStorePlaceCode, bo.getStorePlaceCode())
.eq(StringUtils.isNotBlank(bo.getToolingBarcode()), WmsPsmInStock::getToolingBarcode, bo.getToolingBarcode())
.eq(bo.getMaterialId() != null, WmsPsmInStock::getMaterialId, bo.getMaterialId())
.eq(StringUtils.isNotBlank(bo.getMaterialSpe()), WmsPsmInStock::getMaterialSpe, bo.getMaterialSpe())
.eq(StringUtils.isNotBlank(bo.getCheckGradeCode()), WmsPsmInStock::getCheckGradeCode, bo.getCheckGradeCode())
.orderByDesc(WmsPsmInStock::getCreateTime);
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(WmsPsmInStockBo bo) {
WmsPsmInStock add = MapstructUtils.convert(bo, WmsPsmInStock.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setInStockId(add.getInStockId());
}
return flag;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(WmsPsmInStockBo bo) {
WmsPsmInStock update = MapstructUtils.convert(bo, WmsPsmInStock.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
*
*/
private void validEntityBeforeSave(WmsPsmInStock 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.WmsPsmInStockMapper">
</mapper>
Loading…
Cancel
Save