wms新增物料base_material_info模块

master
maxw@mesnac.com 2 weeks ago
parent fe41ac0388
commit 2c1c2ff7ad

@ -0,0 +1,114 @@
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.BaseMaterialInfo;
import org.dromara.wms.domain.bo.BaseMaterialInfoBo;
import org.dromara.wms.domain.vo.BaseMaterialInfoVo;
import org.dromara.wms.service.IBaseMaterialInfoService;
import org.dromara.wms.utils.BarcodePrintUtils;
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;
/**
*
* 访:/mes/baseMaterialInfo
*
* @author zangch
* @date 2025-01-07
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/baseMaterialInfo")
public class BaseMaterialInfoController extends BaseController {
private final IBaseMaterialInfoService baseMaterialInfoService;
/**
*
*/
@SaCheckPermission("mes:baseMaterialInfo:list")
@GetMapping("/list")
public TableDataInfo<BaseMaterialInfoVo> list(BaseMaterialInfoBo bo, PageQuery pageQuery) {
return baseMaterialInfoService.queryPageList(bo, pageQuery);
}
/**
*
*/
@SaCheckPermission("mes:baseMaterialInfo:export")
@Log(title = "物料信息", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(BaseMaterialInfoBo bo, HttpServletResponse response) {
List<BaseMaterialInfoVo> list = baseMaterialInfoService.queryList(bo);
ExcelUtil.exportExcel(list, "物料信息", BaseMaterialInfoVo.class, response);
}
/**
*
*
* @param materialId
*/
@SaCheckPermission("mes:baseMaterialInfo:query")
@GetMapping("/{materialId}")
public R<BaseMaterialInfoVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long materialId) {
return R.ok(baseMaterialInfoService.queryById(materialId));
}
/**
*
*/
@SaCheckPermission("mes:baseMaterialInfo:add")
@Log(title = "物料信息", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody BaseMaterialInfoBo bo) {
return toAjax(baseMaterialInfoService.insertByBo(bo));
}
/**
*
*/
@SaCheckPermission("mes:baseMaterialInfo:edit")
@Log(title = "物料信息", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody BaseMaterialInfoBo bo) {
return toAjax(baseMaterialInfoService.updateByBo(bo));
}
/**
*
*
* @param materialIds
*/
@SaCheckPermission("mes:baseMaterialInfo:remove")
@Log(title = "物料信息", businessType = BusinessType.DELETE)
@DeleteMapping("/{materialIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] materialIds) {
return toAjax(baseMaterialInfoService.deleteWithValidByIds(List.of(materialIds), true));
}
@GetMapping("materialList")
public R<List<BaseMaterialInfoVo>> materialList(BaseMaterialInfo materialInfo){
// BarcodePrintUtils.print();
return R.ok(baseMaterialInfoService.materialList(materialInfo));
}
}

@ -0,0 +1,267 @@
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.util.Date;
import java.io.Serial;
/**
* base_material_info
*
* @author zangch
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("base_material_info")
public class BaseMaterialInfo extends TenantEntity {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@TableId(type = IdType.AUTO)
private Long materialId;
/**
* ERP
*/
private String erpId;
/**
*
*/
private String materialCode;
/**
*
*/
private String oldMaterialCode;
/**
*
*/
private String materialName;
/**
* ID
*/
private Long materialTypeId;
/**
* (1 2 3)
*/
private String materialCategories;
/**
*
*/
private String materialSubclass;
/**
* (0 1)
*/
private String batchFlag;
/**
*
*/
private Long batchAmount;
/**
* ID
*/
private Long materialUnitId;
/**
*
*/
private String materialUnit;
/**
*
*/
private String materialMatkl;
/**
*
*/
private String materialSpec;
/**
*
*/
private Long netWeight;
/**
*
*/
private Long grossWeight;
/**
* (1 0)
*/
private String alwaysFlag;
/**
*
*/
private Long factoryId;
/**
*
*/
private Long createOrgId;
/**
* 使
*/
private Long useOrgId;
/**
* 线
*/
private Long prodLineId;
/**
* 1 0
*/
private String activeFlag;
/**
* (0 1)
*/
private String deletedFlag;
/**
*
*/
private Long purchasePriceUnitId;
/**
*
*/
private Date approveDate;
/**
* erp
*/
private Date erpModifyDate;
/**
*
*/
private Long maxStockAmount;
/**
*
*/
private Long minStockAmount;
/**
*
*/
private Long safeStockAmount;
/**
* (1 0)
*/
private String applyFlag;
/**
* 1ERP 2 3MES
*/
private String materialClassfication;
/**
* (1 0)
*/
private String autoOutstockFlag;
/**
* (1 0)
*/
private String accessoriesFlag;
/**
* (1 0)
*/
private String lowValueConsumableFlag;
/**
*
*/
private String brand;
/**
*
*/
private String plyrating;
/**
*
*/
private String pattern;
/**
*
*/
private String speedLevel;
/**
*
*/
private String load;
/**
* 1 2 3
*/
private String tireMarkings;
/**
*
*/
private Long minParkingTime;
/**
*
*/
private Long maxParkingTime;
/**
*
*/
private Long standardWeight;
/**
*
*/
private Long weightUpperLimit;
/**
*
*/
private Long weightLowerLimit;
/**
* (0 1)
*/
private String innerTubeFlag;
/**
* (0 1)
*/
private String saleType;
/**
*
*/
private String remark;
}

@ -0,0 +1,269 @@
package org.dromara.wms.domain.bo;
import org.dromara.wms.domain.BaseMaterialInfo;
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 java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* base_material_info
*
* @author zangch
* @date 2025-01-07
*/
@Data
@EqualsAndHashCode(callSuper = true)
@AutoMapper(target = BaseMaterialInfo.class, reverseConvertGenerate = false)
public class BaseMaterialInfoBo extends BaseEntity {
/**
*
*/
private Long materialId;
/**
* ERP
*/
@NotBlank(message = "ERP信息不能为空", groups = { AddGroup.class, EditGroup.class })
private String erpId;
/**
*
*/
@NotBlank(message = "物料编码不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialCode;
/**
*
*/
private String oldMaterialCode;
/**
*
*/
@NotBlank(message = "物料名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String materialName;
/**
* ID
*/
private Long materialTypeId;
/**
* (1 2 3)
*/
private String materialCategories;
/**
*
*/
private String materialSubclass;
/**
* (0 1)
*/
private String batchFlag;
/**
*
*/
private Long batchAmount;
/**
* ID
*/
private Long materialUnitId;
/**
*
*/
private String materialUnit;
/**
*
*/
private String materialMatkl;
/**
*
*/
private String materialSpec;
/**
*
*/
private Long netWeight;
/**
*
*/
private Long grossWeight;
/**
* (1 0)
*/
private String alwaysFlag;
/**
*
*/
private Long factoryId;
/**
*
*/
private Long createOrgId;
/**
* 使
*/
private Long useOrgId;
/**
* 线
*/
private Long prodLineId;
/**
* 1 0
*/
private String activeFlag;
/**
* (0 1)
*/
private String deletedFlag;
/**
*
*/
private Long purchasePriceUnitId;
/**
*
*/
private Date approveDate;
/**
* erp
*/
private Date erpModifyDate;
/**
*
*/
private Long maxStockAmount;
/**
*
*/
private Long minStockAmount;
/**
*
*/
private Long safeStockAmount;
/**
* (1 0)
*/
private String applyFlag;
/**
* 1ERP 2 3MES
*/
private String materialClassfication;
/**
* (1 0)
*/
private String autoOutstockFlag;
/**
* (1 0)
*/
private String accessoriesFlag;
/**
* (1 0)
*/
private String lowValueConsumableFlag;
/**
*
*/
private String brand;
/**
*
*/
private String plyrating;
/**
*
*/
private String pattern;
/**
*
*/
private String speedLevel;
/**
*
*/
private String load;
/**
* 1 2 3
*/
private String tireMarkings;
/**
*
*/
private Long minParkingTime;
/**
*
*/
private Long maxParkingTime;
/**
*
*/
private Long standardWeight;
/**
*
*/
private Long weightUpperLimit;
/**
*
*/
private Long weightLowerLimit;
/**
* (0 1)
*/
private String innerTubeFlag;
/**
* (0 1)
*/
private String saleType;
/**
*
*/
private String remark;
}

@ -0,0 +1,373 @@
package org.dromara.wms.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.dromara.wms.domain.BaseMaterialInfo;
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 java.io.Serial;
import java.io.Serializable;
import java.util.Date;
/**
* base_material_info
*
* @author zangch
* @date 2025-01-07
*/
@Data
@ExcelIgnoreUnannotated
@AutoMapper(target = BaseMaterialInfo.class)
public class BaseMaterialInfoVo implements Serializable {
@Serial
private static final long serialVersionUID = 1L;
/**
*
*/
@ExcelProperty(value = "主键标识")
private Long materialId;
/**
*
*/
@ExcelProperty(value = "租户编号")
private String tenantId;
/**
* ERP
*/
@ExcelProperty(value = "ERP信息")
private String erpId;
/**
*
*/
@ExcelProperty(value = "物料编码")
private String materialCode;
/**
*
*/
@ExcelProperty(value = "旧物料编码")
private String oldMaterialCode;
/**
*
*/
@ExcelProperty(value = "物料名称")
private String materialName;
/**
* ID
*/
@ExcelProperty(value = "物料类型ID")
private Long materialTypeId;
/**
* (1 2 3)
*/
@ExcelProperty(value = "物料大类(1原材料 2半成品 3成品)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_material_categories")
private String materialCategories;
/**
*
*/
@ExcelProperty(value = "物料小类")
private String materialSubclass;
/**
* (0 1)
*/
@ExcelProperty(value = "批次标识(0否 1是)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_batch_flag")
private String batchFlag;
/**
*
*/
@ExcelProperty(value = "小批次数量")
private Long batchAmount;
/**
* ID
*/
@ExcelProperty(value = "计量单位ID")
private Long materialUnitId;
/**
*
*/
@ExcelProperty(value = "计量单位名称")
private String materialUnit;
/**
*
*/
@ExcelProperty(value = "物料组")
private String materialMatkl;
/**
*
*/
@ExcelProperty(value = "物料规格")
private String materialSpec;
/**
*
*/
@ExcelProperty(value = "净重")
private Long netWeight;
/**
*
*/
@ExcelProperty(value = "毛重")
private Long grossWeight;
/**
* (1 0)
*/
@ExcelProperty(value = "绑定标识(1是 0否)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "always_flag")
private String alwaysFlag;
/**
*
*/
@ExcelProperty(value = "所属工厂")
private Long factoryId;
/**
*
*/
@ExcelProperty(value = "创建组织")
private Long createOrgId;
/**
* 使
*/
@ExcelProperty(value = "使用组织")
private Long useOrgId;
/**
* 线
*/
@ExcelProperty(value = "所属产线")
private Long prodLineId;
/**
* 1 0
*/
@ExcelProperty(value = "激活标识", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "active_flag")
private String activeFlag;
/**
* (0 1)
*/
@ExcelProperty(value = "删除标识(0否 1是)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "deleted_flag")
private String deletedFlag;
/**
*
*/
@ExcelProperty(value = "采购计价单位")
private Long purchasePriceUnitId;
/**
*
*/
@ExcelProperty(value = "审核日期")
private Date approveDate;
/**
* erp
*/
@ExcelProperty(value = "erp最后更新日期")
private Date erpModifyDate;
/**
*
*/
@ExcelProperty(value = "最大库存数量")
private Long maxStockAmount;
/**
*
*/
@ExcelProperty(value = "最小库存数量")
private Long minStockAmount;
/**
*
*/
@ExcelProperty(value = "安全库存数量")
private Long safeStockAmount;
/**
* (1 0)
*/
@ExcelProperty(value = "申请标识(1是 0否)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "apply_flag")
private String applyFlag;
/**
* 1ERP 2 3MES
*/
@ExcelProperty(value = "物料分类", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "material_classfication")
private String materialClassfication;
/**
* (1 0)
*/
@ExcelProperty(value = "自动出库标识(1是 0否)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "auto_outstock_flag")
private String autoOutstockFlag;
/**
* (1 0)
*/
@ExcelProperty(value = "辅料标识(1是 0否)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_accessories_flag")
private String accessoriesFlag;
/**
* (1 0)
*/
@ExcelProperty(value = "低值易耗品标识(1是 0否)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "mes_low_value_consumable_flag")
private String lowValueConsumableFlag;
/**
*
*/
@ExcelProperty(value = "品牌")
private String brand;
/**
*
*/
@ExcelProperty(value = "层级")
private String plyrating;
/**
*
*/
@ExcelProperty(value = "花纹")
private String pattern;
/**
*
*/
@ExcelProperty(value = "速度级别")
private String speedLevel;
/**
*
*/
@ExcelProperty(value = "负荷载重")
private String load;
/**
* 1 2 3
*/
@ExcelProperty(value = "轮胎标记", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "tire_markings")
private String tireMarkings;
/**
*
*/
@ExcelProperty(value = "最小停放时间", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "秒=")
private Long minParkingTime;
/**
*
*/
@ExcelProperty(value = "最大停放时间", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "秒=")
private Long maxParkingTime;
/**
*
*/
@ExcelProperty(value = "标准重量")
private Long standardWeight;
/**
*
*/
@ExcelProperty(value = "标准重量上限")
private Long weightUpperLimit;
/**
*
*/
@ExcelProperty(value = "标准重量下限")
private Long weightLowerLimit;
/**
* (0 1)
*/
@ExcelProperty(value = "内胎标记(0无 1有)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "inner_tube_flag")
private String innerTubeFlag;
/**
* (0 1)
*/
@ExcelProperty(value = "销售类型(0内销 1外销)", converter = ExcelDictConvert.class)
@ExcelDictFormat(dictType = "sale_type")
private String saleType;
/**
*
*/
@ExcelProperty(value = "备注")
private String remark;
/**
*
*/
@ExcelProperty(value = "创建部门")
private Long createDept;
/**
*
*/
@ExcelProperty(value = "创建人")
private Long createBy;
/**
*
*/
@ExcelProperty(value = "创建时间")
private Date createTime;
/**
*
*/
@ExcelProperty(value = "更新人")
private Long updateBy;
/**
*
*/
@ExcelProperty(value = "更新时间")
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.BaseMaterialInfo;
import org.dromara.wms.domain.vo.BaseMaterialInfoVo;
/**
* Mapper
*
* @author zangch
* @date 2025-01-07
*/
public interface BaseMaterialInfoMapper extends BaseMapperPlus<BaseMaterialInfo, BaseMaterialInfoVo> {
}

@ -0,0 +1,72 @@
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.BaseMaterialInfo;
import org.dromara.wms.domain.bo.BaseMaterialInfoBo;
import org.dromara.wms.domain.vo.BaseMaterialInfoVo;
import java.util.Collection;
import java.util.List;
/**
* Service
*
* @author zangch
* @date 2025-01-07
*/
public interface IBaseMaterialInfoService {
/**
*
*
* @param materialId
* @return
*/
BaseMaterialInfoVo queryById(Long materialId);
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
TableDataInfo<BaseMaterialInfoVo> queryPageList(BaseMaterialInfoBo bo, PageQuery pageQuery);
/**
*
*
* @param bo
* @return
*/
List<BaseMaterialInfoVo> queryList(BaseMaterialInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean insertByBo(BaseMaterialInfoBo bo);
/**
*
*
* @param bo
* @return
*/
Boolean updateByBo(BaseMaterialInfoBo bo);
/**
*
*
* @param ids
* @param isValid
* @return
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
List<BaseMaterialInfoVo> materialList(BaseMaterialInfo materialInfo);
}

@ -0,0 +1,180 @@
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.BaseMaterialInfo;
import org.dromara.wms.domain.bo.BaseMaterialInfoBo;
import org.dromara.wms.domain.vo.BaseMaterialInfoVo;
import org.dromara.wms.mapper.BaseMaterialInfoMapper;
import org.dromara.wms.service.IBaseMaterialInfoService;
import org.springframework.stereotype.Service;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* Service
*
* @author zangch
* @date 2025-01-07
*/
@RequiredArgsConstructor
@Service
public class BaseMaterialInfoServiceImpl implements IBaseMaterialInfoService {
private final BaseMaterialInfoMapper baseMapper;
/**
*
*
* @param materialId
* @return
*/
@Override
public BaseMaterialInfoVo queryById(Long materialId){
return baseMapper.selectVoById(materialId);
}
/**
*
*
* @param bo
* @param pageQuery
* @return
*/
@Override
public TableDataInfo<BaseMaterialInfoVo> queryPageList(BaseMaterialInfoBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<BaseMaterialInfo> lqw = buildQueryWrapper(bo);
Page<BaseMaterialInfoVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
*
*
* @param bo
* @return
*/
@Override
public List<BaseMaterialInfoVo> queryList(BaseMaterialInfoBo bo) {
LambdaQueryWrapper<BaseMaterialInfo> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<BaseMaterialInfo> buildQueryWrapper(BaseMaterialInfoBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<BaseMaterialInfo> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getMaterialId() != null, BaseMaterialInfo::getMaterialId, bo.getMaterialId());
lqw.eq(StringUtils.isNotBlank(bo.getErpId()), BaseMaterialInfo::getErpId, bo.getErpId());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCode()), BaseMaterialInfo::getMaterialCode, bo.getMaterialCode());
lqw.eq(StringUtils.isNotBlank(bo.getOldMaterialCode()), BaseMaterialInfo::getOldMaterialCode, bo.getOldMaterialCode());
lqw.like(StringUtils.isNotBlank(bo.getMaterialName()), BaseMaterialInfo::getMaterialName, bo.getMaterialName());
lqw.eq(bo.getMaterialTypeId() != null, BaseMaterialInfo::getMaterialTypeId, bo.getMaterialTypeId());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialCategories()), BaseMaterialInfo::getMaterialCategories, bo.getMaterialCategories());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialSubclass()), BaseMaterialInfo::getMaterialSubclass, bo.getMaterialSubclass());
lqw.eq(StringUtils.isNotBlank(bo.getBatchFlag()), BaseMaterialInfo::getBatchFlag, bo.getBatchFlag());
lqw.eq(bo.getBatchAmount() != null, BaseMaterialInfo::getBatchAmount, bo.getBatchAmount());
lqw.eq(bo.getMaterialUnitId() != null, BaseMaterialInfo::getMaterialUnitId, bo.getMaterialUnitId());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialUnit()), BaseMaterialInfo::getMaterialUnit, bo.getMaterialUnit());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialMatkl()), BaseMaterialInfo::getMaterialMatkl, bo.getMaterialMatkl());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialSpec()), BaseMaterialInfo::getMaterialSpec, bo.getMaterialSpec());
lqw.eq(bo.getNetWeight() != null, BaseMaterialInfo::getNetWeight, bo.getNetWeight());
lqw.eq(bo.getGrossWeight() != null, BaseMaterialInfo::getGrossWeight, bo.getGrossWeight());
lqw.eq(StringUtils.isNotBlank(bo.getAlwaysFlag()), BaseMaterialInfo::getAlwaysFlag, bo.getAlwaysFlag());
lqw.eq(bo.getFactoryId() != null, BaseMaterialInfo::getFactoryId, bo.getFactoryId());
lqw.eq(bo.getCreateOrgId() != null, BaseMaterialInfo::getCreateOrgId, bo.getCreateOrgId());
lqw.eq(bo.getUseOrgId() != null, BaseMaterialInfo::getUseOrgId, bo.getUseOrgId());
lqw.eq(bo.getProdLineId() != null, BaseMaterialInfo::getProdLineId, bo.getProdLineId());
lqw.eq(StringUtils.isNotBlank(bo.getActiveFlag()), BaseMaterialInfo::getActiveFlag, bo.getActiveFlag());
lqw.eq(StringUtils.isNotBlank(bo.getDeletedFlag()), BaseMaterialInfo::getDeletedFlag, bo.getDeletedFlag());
lqw.eq(bo.getPurchasePriceUnitId() != null, BaseMaterialInfo::getPurchasePriceUnitId, bo.getPurchasePriceUnitId());
lqw.between(params.get("beginApproveDate") != null && params.get("endApproveDate") != null,
BaseMaterialInfo::getApproveDate ,params.get("beginApproveDate"), params.get("endApproveDate"));
lqw.eq(bo.getErpModifyDate() != null, BaseMaterialInfo::getErpModifyDate, bo.getErpModifyDate());
lqw.eq(bo.getMaxStockAmount() != null, BaseMaterialInfo::getMaxStockAmount, bo.getMaxStockAmount());
lqw.eq(bo.getMinStockAmount() != null, BaseMaterialInfo::getMinStockAmount, bo.getMinStockAmount());
lqw.eq(bo.getSafeStockAmount() != null, BaseMaterialInfo::getSafeStockAmount, bo.getSafeStockAmount());
lqw.eq(StringUtils.isNotBlank(bo.getApplyFlag()), BaseMaterialInfo::getApplyFlag, bo.getApplyFlag());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialClassfication()), BaseMaterialInfo::getMaterialClassfication, bo.getMaterialClassfication());
lqw.eq(StringUtils.isNotBlank(bo.getAutoOutstockFlag()), BaseMaterialInfo::getAutoOutstockFlag, bo.getAutoOutstockFlag());
lqw.eq(StringUtils.isNotBlank(bo.getAccessoriesFlag()), BaseMaterialInfo::getAccessoriesFlag, bo.getAccessoriesFlag());
lqw.eq(StringUtils.isNotBlank(bo.getLowValueConsumableFlag()), BaseMaterialInfo::getLowValueConsumableFlag, bo.getLowValueConsumableFlag());
lqw.eq(StringUtils.isNotBlank(bo.getBrand()), BaseMaterialInfo::getBrand, bo.getBrand());
lqw.eq(StringUtils.isNotBlank(bo.getPlyrating()), BaseMaterialInfo::getPlyrating, bo.getPlyrating());
lqw.eq(StringUtils.isNotBlank(bo.getPattern()), BaseMaterialInfo::getPattern, bo.getPattern());
lqw.eq(StringUtils.isNotBlank(bo.getSpeedLevel()), BaseMaterialInfo::getSpeedLevel, bo.getSpeedLevel());
lqw.eq(StringUtils.isNotBlank(bo.getLoad()), BaseMaterialInfo::getLoad, bo.getLoad());
lqw.eq(StringUtils.isNotBlank(bo.getTireMarkings()), BaseMaterialInfo::getTireMarkings, bo.getTireMarkings());
lqw.eq(bo.getMinParkingTime() != null, BaseMaterialInfo::getMinParkingTime, bo.getMinParkingTime());
lqw.eq(bo.getMaxParkingTime() != null, BaseMaterialInfo::getMaxParkingTime, bo.getMaxParkingTime());
lqw.eq(bo.getStandardWeight() != null, BaseMaterialInfo::getStandardWeight, bo.getStandardWeight());
lqw.eq(bo.getWeightUpperLimit() != null, BaseMaterialInfo::getWeightUpperLimit, bo.getWeightUpperLimit());
lqw.eq(bo.getWeightLowerLimit() != null, BaseMaterialInfo::getWeightLowerLimit, bo.getWeightLowerLimit());
lqw.eq(StringUtils.isNotBlank(bo.getInnerTubeFlag()), BaseMaterialInfo::getInnerTubeFlag, bo.getInnerTubeFlag());
lqw.eq(StringUtils.isNotBlank(bo.getSaleType()), BaseMaterialInfo::getSaleType, bo.getSaleType());
return lqw;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean insertByBo(BaseMaterialInfoBo bo) {
BaseMaterialInfo add = MapstructUtils.convert(bo, BaseMaterialInfo.class);
validEntityBeforeSave(add);
return true;
}
/**
*
*
* @param bo
* @return
*/
@Override
public Boolean updateByBo(BaseMaterialInfoBo bo) {
BaseMaterialInfo update = MapstructUtils.convert(bo, BaseMaterialInfo.class);
validEntityBeforeSave(update);
return true;
}
/**
*
*/
private void validEntityBeforeSave(BaseMaterialInfo entity){
//TODO 做一些数据校验,如唯一约束
}
@Override
public List<BaseMaterialInfoVo> materialList(BaseMaterialInfo materialInfo) {
LambdaQueryWrapper<BaseMaterialInfo> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(BaseMaterialInfo::getMaterialCategories,materialInfo.getMaterialCategories());
return baseMapper.selectVoList(wrapper);
}
/**
*
*
* @param ids
* @param isValid
* @return
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return true;
}
}

@ -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.BaseMaterialInfoMapper">
</mapper>
Loading…
Cancel
Save