oms出入库预约单;

This commit is contained in:
王奎兴
2026-04-27 10:45:29 +08:00
parent a76e9c4367
commit 90652840bb
55 changed files with 16826 additions and 9 deletions
@@ -0,0 +1,367 @@
package com.mhd.oms.domain.reserveInMaterialDetail.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveInMaterialDetail extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
@TableId(type = IdType.AUTO)
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("作业数量(例如:收货数量 上架数量)")
@Excel(name = "作业数量(例如:收货数量 上架数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
@Excel(name = "收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
private Integer receiptStatus;
@ApiModelProperty("上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
@Excel(name = "上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
private Integer shelvesStatus;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("抽检比例")
@Excel(name = "抽检比例")
private BigDecimal qualityInspectionRatio;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("质检结果: 1-正常 2-异常")
@Excel(name = "质检结果: 1-正常 2-异常")
private Integer qualityInspectionResults;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("上架仓库id")
private Long warehouseId;
@ApiModelProperty("上架仓库编码")
@Excel(name = "上架仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
private Long parentUniqueId;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
// ========== 报关相关明细字段 ==========
@ApiModelProperty("规格型号")
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@ApiModelProperty("SKU码")
@Excel(name = "SKU码")
private String skuCode;
@ApiModelProperty("Invoice No.")
@Excel(name = "Invoice No.")
private String invoiceNo;
@ApiModelProperty("")
@Excel(name = "")
private BigDecimal liter;
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String dimensions;
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declarationUnit;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String originCountry;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal boxCount;
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
@ApiModelProperty("入库数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "入库数量")
private BigDecimal inboundQuantity;
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalPrice;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
}
@@ -0,0 +1,68 @@
package com.mhd.oms.domain.reserveInMaterialDetail.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailBaseDO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import java.util.List;
/**
* 物料明细Service接口
*
* @author gen
* @date 2024-05-21
*/
public interface IReserveInMaterialDetailService extends IService<ReserveInMaterialDetail>
{
/**
* 分页查询物料明细列表
*/
public List<ReserveInMaterialDetailPO> queryList(ReserveInMaterialDetailDO inMaterialDetailDO);
public List<ReserveInMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
/**
* 分页查询物料明细列表
*/
public List<ReserveInMaterialDetailPO> queryListChildren(ReserveInMaterialDetailDO inMaterialDetailDO);
/**
* 新增物料明细
*/
public Boolean insert(ReserveInMaterialDetailDO inMaterialDetailDO);
/**
* 修改物料明细
*/
public Boolean update(ReserveInMaterialDetailDO inMaterialDetailDO);
/**
* 新增物料明细
*/
public Boolean batchInsert(String orderNumber, List<ReserveInMaterialDetailDO> inMaterialDetailDOList);
/**
* 修改物料明细
*/
public Boolean batchUpdate(List<ReserveInMaterialDetailDO> inMaterialDetailDOList, ReserveInMaterialDetailBaseDO inMaterialDetailBaseDO);
/**
* 批量删除物料明细
*/
public Boolean delete(Long[] materialDetailIds);
/**
* 查询物料明细
*/
public ReserveInMaterialDetailPO getInfo(Long materialDetailId);
public List<InventoryAdjustmentRecordPO> getkctzjl(Long materialBaseInfoId, String orderNumber, String adjustType);
}
@@ -0,0 +1,33 @@
package com.mhd.oms.domain.reserveInMaterialDetail.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 物料明细Mapper接口
*
* @author gen
* @date 2024-05-21
*/
public interface ReserveInMaterialDetailMapper extends BaseMapper<ReserveInMaterialDetail>
{
/**
* 查询物料明细列表
*/
public List<ReserveInMaterialDetailPO> queryList(ReserveInMaterialDetailDO inMaterialDetailDO);
/**
* 关联入库单查询物料明细列表
*/
public List<ReserveInMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
public List<InventoryAdjustmentRecordPO> getkctzjl(@Param("materialBaseInfoId") Long materialBaseInfoId, @Param("orderNumber") String orderNumber, @Param("adjustType") String adjustType);
}
@@ -0,0 +1,314 @@
package com.mhd.oms.domain.reserveInMaterialDetail.repository.persistence;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.core.utils.uuid.IdGenerator;
import com.mhd.common.security.utils.SecurityUtils;
//import com.mhd.oms.domain.reservationMaterialInventory.entity.ReserveMaterialInventory;ReserveMaterialInventory
//import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReserveMaterialInventoryService;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReservationMaterialInventoryService;
import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.facade.IReserveInMaterialDetailService;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.mapper.ReserveInMaterialDetailMapper;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailBaseDO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import com.mhd.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 物料明细Service业务层处理
*
* @author gen
* @date 2024-05-21
*/
@Service
public class ReserveInMaterialDetailImpl extends ServiceImpl<ReserveInMaterialDetailMapper, ReserveInMaterialDetail> implements IReserveInMaterialDetailService {
@Autowired
private ReserveInMaterialDetailMapper inMaterialDetailMapper;
// @Autowired
// private IMaterialBaseInfoService materialBaseInfoService;
// @Autowired
// private IMaterialGoodsRuleService materialGoodsRuleService;
// @Autowired
// private IMaterialWarehouseControlService materialWarehouseControlService;
// @Autowired
// private SystemServiceFeign systemServiceFeign;
@Autowired
private IdGenerator idGenerator;
@Autowired
private IReservationMaterialInventoryService reservationMaterialInventoryService;
/**
* 查询物料明细列表
*/
@Override
public List<ReserveInMaterialDetailPO> queryList(ReserveInMaterialDetailDO inMaterialDetailDO) {
return inMaterialDetailMapper.queryList(inMaterialDetailDO);
}
/**
* 关联入库单查询物料明细列表
*/
@Override
public List<ReserveInMaterialDetailPO> queryInOrderList(QueryOrderOverStockDO queryOrderOverStockDO) {
return inMaterialDetailMapper.queryInOrderList(queryOrderOverStockDO);
}
/**
* 查询物料明细列表
*/
@Override
public List<ReserveInMaterialDetailPO> queryListChildren(ReserveInMaterialDetailDO inMaterialDetailDO)
{
List<ReserveInMaterialDetailPO> inMaterialDetailPOList = inMaterialDetailMapper.queryList(inMaterialDetailDO);
// 获取查询的层级
List<ReserveInMaterialDetailPO> inMaterialDetailPOParentList = inMaterialDetailPOList
.stream().filter(e -> 1 == e.getLevel()).collect(Collectors.toList());
// 递归查询子集
inMaterialDetailPOParentList.forEach(materialDetailPO -> materialDetailPO.setChildren(getChildren(materialDetailPO.getUniqueId(), inMaterialDetailPOList, 2)));
return inMaterialDetailPOParentList;
}
private List<ReserveInMaterialDetailPO> getChildren(Long parentUniqueId, List<ReserveInMaterialDetailPO> inMaterialDetailPOList, Integer maxLevel){
List<ReserveInMaterialDetailPO> childrenCityList = inMaterialDetailPOList.stream().filter(materialDetailPO -> parentUniqueId.equals(materialDetailPO.getParentUniqueId())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(childrenCityList)){
childrenCityList.forEach(childrenCity -> {
if (childrenCity.getLevel() < maxLevel){
childrenCity.setChildren(getChildren(childrenCity.getUniqueId(), inMaterialDetailPOList, maxLevel));
}
});
}
return childrenCityList;
}
/**
* 新增物料明细
*/
@Override
public Boolean insert(ReserveInMaterialDetailDO inMaterialDetailDO) {
ReserveInMaterialDetail inMaterialDetail = new ReserveInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
return this.save(inMaterialDetail);
}
/**
* 修改物料明细
*/
@Override
public Boolean update(ReserveInMaterialDetailDO inMaterialDetailDO) {
ReserveInMaterialDetail inMaterialDetail = new ReserveInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
return this.updateById(inMaterialDetail);
}
/**
* @description 批量新增物流明细
* @author ZhouGY
* @date 2024/5/22 9:27
* @param inOrderNumber
* @param inMaterialDetailDOList
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean batchInsert(String inOrderNumber, List<ReserveInMaterialDetailDO> inMaterialDetailDOList) {
if (CollectionUtils.isEmpty(inMaterialDetailDOList)) {
throw new ServiceException("物料明细不能为空");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
// 批量新增或修改
List<ReserveInMaterialDetail> inMaterialDetailList = new ArrayList<>();
for (ReserveInMaterialDetailDO inMaterialDetailDO : inMaterialDetailDOList){
ReserveInMaterialDetail inMaterialDetail = new ReserveInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
inMaterialDetail.setOrganizationId(loginUser.getUserPo().getOrganizationId());
inMaterialDetail.setOrganizationName(loginUser.getUserPo().getOrganizationName());
inMaterialDetail.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
inMaterialDetail.setUniqueId(idGenerator.snowflakeId(SnowFlakeConstants.wmsId));
inMaterialDetail.setInOrderNumber(inOrderNumber);
inMaterialDetail.setLevel(1);
inMaterialDetail.setCreateBy(loginUser.getUserid());
inMaterialDetail.setCreateByName(userRealName);
inMaterialDetail.setCreateTime(new Date());
// 新增入库单明细时,如果计划数量为空,则使用入库数量作为计划数量
if (inMaterialDetail.getQuantity() == null && inMaterialDetailDO.getInboundQuantity() != null) {
inMaterialDetail.setQuantity(inMaterialDetailDO.getInboundQuantity());
}
if (inMaterialDetail.getInboundQuantity() == null && inMaterialDetailDO.getQuantity() != null) {
inMaterialDetail.setInboundQuantity(inMaterialDetailDO.getQuantity());
}
inMaterialDetailList.add(inMaterialDetail);
}
//插入库存表
putIntoInventory(inMaterialDetailList);
return saveBatch(inMaterialDetailList);
}
private void putIntoInventory(List<ReserveInMaterialDetail> inMaterialDetailList) {
for (ReserveInMaterialDetail reservationInMaterialDetail : inMaterialDetailList) {
ReservationMaterialInventory reservationMaterialInventory = new ReservationMaterialInventory();
BeanUtils.copyProperties(reservationInMaterialDetail, reservationMaterialInventory);
reservationMaterialInventory.setLotNumber(reservationInMaterialDetail.getLotNo());
UpdateWrapper<ReservationMaterialInventory> updateWrapper = new UpdateWrapper<>();
updateWrapper.lambda()
.eq(reservationMaterialInventory.getShipperId() != null,ReservationMaterialInventory::getShipperId, reservationMaterialInventory.getShipperId())
.eq(reservationMaterialInventory.getWarehouseId() != null,ReservationMaterialInventory::getWarehouseId, reservationMaterialInventory.getWarehouseId())
.eq(reservationMaterialInventory.getMaterialBaseInfoId() != null,ReservationMaterialInventory::getMaterialBaseInfoId, reservationMaterialInventory.getMaterialBaseInfoId())
.eq(reservationMaterialInventory.getInOrderNumber() != null,ReservationMaterialInventory::getInOrderNumber, reservationMaterialInventory.getInOrderNumber())
.eq(reservationMaterialInventory.getLotNumber() != null,ReservationMaterialInventory::getLotNumber, reservationMaterialInventory.getLotNumber())
.eq(reservationMaterialInventory.getBatchNumber() != null,ReservationMaterialInventory::getBatchNumber, reservationMaterialInventory.getBatchNumber())
;
reservationMaterialInventoryService.saveOrUpdate(reservationMaterialInventory,updateWrapper);
}
}
/**
* @description 批量修改物流明细
* @author ZhouGY
* @date 2024/5/22 9:27
* @param inMaterialDetailDOList
* @param inMaterialDetailBaseDO
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean batchUpdate(List<ReserveInMaterialDetailDO> inMaterialDetailDOList, ReserveInMaterialDetailBaseDO inMaterialDetailBaseDO) {
if (CollectionUtils.isEmpty(inMaterialDetailDOList)) {
throw new ServiceException("物料明细不能为空");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
// 查询所有记录(包括已删除的),用于判断是否需要恢复已删除的记录
List<ReserveInMaterialDetail> inMaterialDetailDbAllList = inMaterialDetailMapper.selectList(new QueryWrapper<ReserveInMaterialDetail>().lambda()
.eq(ReserveInMaterialDetail::getInOrderNumber, inMaterialDetailBaseDO.getInOrderNumber()));
// 查询未删除的记录,用于正常的更新逻辑
List<ReserveInMaterialDetail> inMaterialDetailDbList = inMaterialDetailDbAllList.stream()
.filter(item -> item.getDelFlag() != null && item.getDelFlag() == 1)
.collect(Collectors.toList());
Map<Long, ReserveInMaterialDetail> materialDetailMap = inMaterialDetailDbList.stream().collect(Collectors.toMap(ReserveInMaterialDetail::getMaterialDetailId, Function.identity()));
// 查询已删除的记录,用于恢复逻辑
Map<Long, ReserveInMaterialDetail> materialDetailDeletedMap = inMaterialDetailDbAllList.stream()
.filter(item -> item.getDelFlag() != null && item.getDelFlag() == 2)
.collect(Collectors.toMap(ReserveInMaterialDetail::getMaterialDetailId, Function.identity()));
//批量新增或修改物料信息
List<ReserveInMaterialDetail> inMaterialDetailList = new ArrayList<>();
//需要修改的物流明细
List<Long> materialDetailIdsByUpdate = new ArrayList<>();
for (ReserveInMaterialDetailDO inMaterialDetailDO : inMaterialDetailDOList){
//判断是否需要修改
ReserveInMaterialDetail inMaterialDetail = null;
if (inMaterialDetailDO.getMaterialDetailId() != null) {
// 先查找未删除的记录
inMaterialDetail = materialDetailMap.get(inMaterialDetailDO.getMaterialDetailId());
// 如果未删除的记录中找不到,检查是否在已删除的记录中
if (inMaterialDetail == null) {
ReserveInMaterialDetail deletedDetail = materialDetailDeletedMap.get(inMaterialDetailDO.getMaterialDetailId());
if (deletedDetail != null) {
// 恢复已删除的记录
inMaterialDetail = deletedDetail;
inMaterialDetail.setDelFlag(1); // 恢复记录
}
}
}
if (inMaterialDetail == null){
// 新增明细:清空 materialDetailId,让数据库自动生成
inMaterialDetail = new ReserveInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
inMaterialDetail.setMaterialDetailId(null); // 清空ID,确保新增
inMaterialDetail.setUniqueId(idGenerator.snowflakeId(SnowFlakeConstants.wmsId));
inMaterialDetail.setInOrderNumber(inMaterialDetailBaseDO.getInOrderNumber());
inMaterialDetail.setOrganizationId(inMaterialDetailBaseDO.getOrganizationId());
inMaterialDetail.setOrganizationName(inMaterialDetailBaseDO.getOrganizationName());
inMaterialDetail.setTopOrganizationId(inMaterialDetailBaseDO.getTopOrganizationId());
inMaterialDetail.setDelFlag(1); // 确保新增记录的delFlag为1
}else {
BeanUtils.copyProperties(inMaterialDetailDO, inMaterialDetail);
inMaterialDetail.setUpdateBy(loginUser.getUserid());
inMaterialDetail.setUpdateByName(userRealName);
inMaterialDetail.setUpdateTime(new Date());
materialDetailIdsByUpdate.add(inMaterialDetailDO.getMaterialDetailId());
}
inMaterialDetailList.add(inMaterialDetail);
}
//需修改的物料明细id集合不为空
if (!CollectionUtils.isEmpty(inMaterialDetailDbList) && !CollectionUtils.isEmpty(materialDetailIdsByUpdate)){
List<Long> materialDetailIdsByDb = inMaterialDetailDbList.stream().map(ReserveInMaterialDetail::getMaterialDetailId).collect(Collectors.toList());
//过滤需要修改的id集合
materialDetailIdsByDb.removeAll(materialDetailIdsByUpdate);
//判断是否存在需要删除的物流明细 标记删除
if (!CollectionUtils.isEmpty(materialDetailIdsByDb)){
update(new UpdateWrapper<ReserveInMaterialDetail>().lambda()
.set(ReserveInMaterialDetail::getDelFlag, 2)
.set(ReserveInMaterialDetail::getUpdateBy, loginUser.getUserid())
.set(ReserveInMaterialDetail::getUpdateByName, userRealName)
.set(ReserveInMaterialDetail::getUpdateTime, new Date())
.in(ReserveInMaterialDetail::getMaterialDetailId, materialDetailIdsByDb));
}
}
//保存物料明细信息
return saveOrUpdateBatch(inMaterialDetailList);
}
/**
* 批量删除物料明细
*/
@Override
public Boolean delete(Long[] materialDetailIds ) {
List<ReserveInMaterialDetail> list = new ArrayList<>();
for (Long id : materialDetailIds) {
ReserveInMaterialDetail inMaterialDetail = new ReserveInMaterialDetail();
inMaterialDetail.setMaterialDetailId(id);
inMaterialDetail.setDelFlag(2);
list.add(inMaterialDetail);
}
return this.updateBatchById(list);
}
/**
* 修改物料明细
*/
@Override
public ReserveInMaterialDetailPO getInfo(Long materialDetailId) {
ReserveInMaterialDetail inMaterialDetail = this.getById(materialDetailId);
ReserveInMaterialDetailPO inMaterialDetailPO = new ReserveInMaterialDetailPO();
BeanUtils.copyProperties(inMaterialDetail, inMaterialDetailPO);
return inMaterialDetailPO;
}
@Override
public List<InventoryAdjustmentRecordPO> getkctzjl(Long materialBaseInfoId, String orderNumber, String adjustType) {
return inMaterialDetailMapper.getkctzjl(materialBaseInfoId, orderNumber, adjustType);
}
}
@@ -0,0 +1,472 @@
package com.mhd.oms.domain.reserveInMaterialDetail.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
//import com.mhd.oms.domain.reservationStockInOrder.repository.po.ReserveStockInOrderBasePO;
import com.mhd.oms.domain.reserveStockInOrder.repository.po.ReserveStockInOrderBasePO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
@ApiModel(value = "物料明细对象", description = "物料明细响应对象")
public class ReserveInMaterialDetailPO extends ReserveStockInOrderBasePO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("作业数量(例如:收货数量 上架数量)")
@Excel(name = "作业数量(例如:收货数量 上架数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
@Excel(name = "收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
private Integer receiptStatus;
@ApiModelProperty("上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
@Excel(name = "上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
private Integer shelvesStatus;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("抽检比例")
@Excel(name = "抽检比例")
private BigDecimal qualityInspectionRatio;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("质检结果: 1-正常 2-异常")
@Excel(name = "质检结果: 1-正常 2-异常")
private Integer qualityInspectionResults;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("上架仓库id")
private Long warehouseId;
@ApiModelProperty("上架仓库编码")
@Excel(name = "上架仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentUniqueId;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("未收货数量")
@Excel(name = "未收货数量")
private BigDecimal waitReceiptQuantity;
@ApiModelProperty("未上架数量")
@Excel(name = "未上架数量")
private BigDecimal waitShelvesQuantity;
@ApiModelProperty("物料明细")
private List<ReserveInMaterialDetailPO> children;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
// ========== 报关相关明细字段 ==========
@ApiModelProperty("规格型号")
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@ApiModelProperty("SKU码")
@Excel(name = "SKU码")
private String skuCode;
@ApiModelProperty("Invoice No.")
@Excel(name = "Invoice No.")
private String invoiceNo;
@ApiModelProperty("")
@Excel(name = "")
private BigDecimal liter;
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String dimensions;
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declarationUnit;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String originCountry;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal boxCount;
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inboundQuantity;
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalPrice;
@ApiModelProperty("生产日期")
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date productionDate;
@ApiModelProperty("过期日期")
@Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date expiryDate;
@ApiModelProperty("存货日期")
@Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date inventoryDate;
@ApiModelProperty("扩展属性1")
@Excel(name = "扩展属性1")
private String extAttr1;
@ApiModelProperty("扩展属性2")
@Excel(name = "扩展属性2")
private String extAttr2;
@ApiModelProperty("扩展属性3")
@Excel(name = "扩展属性3")
private String extAttr3;
@ApiModelProperty("扩展属性4")
@Excel(name = "扩展属性4")
private String extAttr4;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
}
@@ -0,0 +1,42 @@
package com.mhd.oms.domain.reserveInMaterialDetail.repository.todo;
import com.mhd.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author ZhouGY
* @title StockBaseDO
* @description: TODO
* @date 2024/5/23 20:30
**/
@Data
public class ReserveInMaterialDetailBaseDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("收货单号")
@Excel(name = "收货单号")
private String receiptOrderNumber;
@ApiModelProperty("上架单号")
@Excel(name = "上架单号")
private String shelfOrderNumber;
}
@@ -0,0 +1,433 @@
package com.mhd.oms.domain.reserveInMaterialDetail.repository.todo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
//import com.mhd.oms.domain.reservationStockInOrder.repository.todo.ReserveStockInOrderBaseDO;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderBaseDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveInMaterialDetailDO extends ReserveStockInOrderBaseDO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("作业数量(例如:收货数量 上架数量)")
@Excel(name = "作业数量(例如:收货数量 上架数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
@Excel(name = "收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
private Integer receiptStatus;
@ApiModelProperty("上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
@Excel(name = "上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
private Integer shelvesStatus;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("抽检比例")
@Excel(name = "抽检比例")
private BigDecimal qualityInspectionRatio;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("质检结果: 1-正常 2-异常")
@Excel(name = "质检结果: 1-正常 2-异常")
private Integer qualityInspectionResults;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("上架仓库id")
private Long warehouseId;
@ApiModelProperty("上架仓库编码")
@Excel(name = "上架仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
private Long parentUniqueId;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("物料明细子集")
private List<ReserveInMaterialDetailDO> children;
// @ApiModelProperty("更多属性")
// private List<MaterialMoreDetailDO> materialMoreDetailList;
// @ApiModelProperty("序列号")
// private List<ReserveInMaterialDetailSerialNumberDO> materialDetailSerialNumberList;
@ApiModelProperty("入库单号集合")
@Excel(name = "入库单号集合")
private List<String> inOrderNumberList;
// ========== 报关相关明细字段 ==========
@ApiModelProperty("规格型号(选择物料后自动带出,不可编辑)")
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@ApiModelProperty("SKU码(选择物料后自动带出,不可编辑)")
@Excel(name = "SKU码")
private String skuCode;
@ApiModelProperty("Invoice No.")
@Excel(name = "Invoice No.")
private String invoiceNo;
@ApiModelProperty("升(输入大于等于0的数字,可以为小数)")
@Excel(name = "")
private BigDecimal liter;
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String dimensions;
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declarationUnit;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String originCountry;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
@ApiModelProperty("单位(数据字典下拉选择框)")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("申报数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@ApiModelProperty("箱数(输入大于等于0的数字,可以为小数)")
@Excel(name = "箱数")
private BigDecimal boxCount;
@ApiModelProperty("件数(输入大于等于0的数字,可以为小数)")
@Excel(name = "件数")
private BigDecimal pieceCount;
@ApiModelProperty("入库数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "ruku数量")
private BigDecimal inboundQuantity;
@ApiModelProperty("总净重(KG)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@ApiModelProperty("总毛重(KG)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@ApiModelProperty("总体积(CBM)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@ApiModelProperty("总面积(SQM)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("总价(输入大于等于0的数字,可以为小数)")
@Excel(name = "总价")
private BigDecimal totalPrice;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
}
@@ -0,0 +1,438 @@
package com.mhd.oms.domain.reserveInMaterialDetail.repository.todo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveInMaterialDetailDTO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("作业数量(例如:收货数量 上架数量)")
@Excel(name = "作业数量(例如:收货数量 上架数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
@Excel(name = "收货状态: 1-待收货 2-收货中 3-已收货 4-已收货(少收) 5-已收货(超收)")
private Integer receiptStatus;
@ApiModelProperty("上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
@Excel(name = "上架状态: 1-待上架 2-上架中 3-已上架 4-已上架(少上) 5-已上架(超上)")
private Integer shelvesStatus;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("是否质检管理: 1-是 2-否")
@Excel(name = "是否质检管理: 1-是 2-否")
private Integer qualityInspectionManage;
@ApiModelProperty("质检阶段: 1-收货前 2-收货后上架前")
@Excel(name = "质检阶段: 1-收货前 2-收货后上架前")
private Integer qualityInspectionStage;
@ApiModelProperty("质检规则: 1-全检 2-抽检 ")
@Excel(name = "质检规则: 1-全检 2-抽检 ")
private Integer qualityInspectionRule;
@ApiModelProperty("抽检比例")
@Excel(name = "抽检比例")
private BigDecimal qualityInspectionRatio;
@ApiModelProperty("质检项: 1-包装 2-纯度")
@Excel(name = "质检项: 1-包装 2-纯度")
private Integer qualityInspectionTerm;
@ApiModelProperty("质检结果: 1-正常 2-异常")
@Excel(name = "质检结果: 1-正常 2-异常")
private Integer qualityInspectionResults;
@ApiModelProperty("是否允许超收: 1-是 2-否")
@Excel(name = "是否允许超收: 1-是 2-否")
private Integer allowOvercharge;
@ApiModelProperty("超收比例")
@Excel(name = "超收比例")
private BigDecimal overchargeRatio;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("分配规则id")
@Excel(name = "分配规则id")
private Long distributeRuleId;
@ApiModelProperty("分配规则编码")
@Excel(name = "分配规则编码")
private String distributeRuleCode;
@ApiModelProperty("分配规则名称")
@Excel(name = "分配规则名称")
private String distributeRuleName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("上架仓库id")
private Long warehouseId;
@ApiModelProperty("上架仓库编码")
@Excel(name = "上架仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("上架库区id")
@Excel(name = "上架库区id")
private Long storageSectionId;
@ApiModelProperty("上架库区编码")
@Excel(name = "上架库区编码")
private String storageCode;
@ApiModelProperty("上架库区名称")
@Excel(name = "上架库区名称")
private String storageName;
@ApiModelProperty("上架库位id")
@Excel(name = "上架库位id")
private Long storageLocationId;
@ApiModelProperty("上架库位编码")
@Excel(name = "上架库位编码")
private String storageLocationCode;
@ApiModelProperty("上架库位名称")
@Excel(name = "上架库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentUniqueId;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
// @ApiModelProperty("更多属性")
// private List<MaterialMoreDetailDTO> materialMoreDetailList;
// @ApiModelProperty("序列号")
// private List<InMaterialDetailSerialNumberDTO> materialDetailSerialNumberList;
@ApiModelProperty("入库单号集合")
@Excel(name = "入库单号集合")
private List<String> inOrderNumberList;
@ApiModelProperty("是否是差异单")
private Integer isDifferentType;
// ========== 报关相关明细字段 ==========
@ApiModelProperty("规格型号(选择物料后自动带出,不可编辑)")
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@ApiModelProperty("SKU码(选择物料后自动带出,不可编辑)")
@Excel(name = "SKU码")
private String skuCode;
@ApiModelProperty("Invoice No.")
@Excel(name = "Invoice No.")
private String invoiceNo;
@ApiModelProperty("升(输入大于等于0的数字,可以为小数)")
@Excel(name = "")
private BigDecimal liter;
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String dimensions;
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declarationUnit;
@ApiModelProperty("Batch Ref NO's")
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@ApiModelProperty("Sheet Ref NO's")
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String originCountry;
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
@ApiModelProperty("单位(数据字典下拉选择框)")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("申报数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@ApiModelProperty("箱数(输入大于等于0的数字,可以为小数)")
@Excel(name = "箱数")
private BigDecimal boxCount;
@ApiModelProperty("件数(输入大于等于0的数字,可以为小数)")
@Excel(name = "件数")
private BigDecimal pieceCount;
@ApiModelProperty("入库数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "入库数量")
private BigDecimal inboundQuantity;
@ApiModelProperty("出库数量(输入大于等于0的数字,可以为小数)")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
@ApiModelProperty("总净重(KG)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@ApiModelProperty("总毛重(KG)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@ApiModelProperty("总体积(CBM)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@ApiModelProperty("总面积(SQM)(输入大于等于0的数字,可以为小数)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@ApiModelProperty("总价(输入大于等于0的数字,可以为小数)")
@Excel(name = "总价")
private BigDecimal totalPrice;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
}
@@ -0,0 +1,72 @@
package com.mhd.oms.domain.reserveInMaterialDetail.service;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import com.mhd.system.api.model.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 物料明细ApplicationService
*
* @author gen
* @date 2024-05-21
*/
@Service
@Slf4j
public class ReserveInMaterialDetailApplicationService {
@Autowired
private ReserveInMaterialDetailDomainService inMaterialDetailDomainService;
/**
* 分页查询物料明细列表
*/
public List<ReserveInMaterialDetailPO> queryList(ReserveInMaterialDetailDO inMaterialDetailDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
if (loginUser != null){
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
if (topOrganizationId != null && topOrganizationId != 1){
inMaterialDetailDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
}
}
return inMaterialDetailDomainService.queryList(inMaterialDetailDO);
}
/**
* 新增物料明细
*/
public Boolean insert(ReserveInMaterialDetailDO inMaterialDetailDO) {
return inMaterialDetailDomainService.insert(inMaterialDetailDO);
}
/**
* 修改物料明细
*/
public Boolean update(ReserveInMaterialDetailDO inMaterialDetailDO) {
return inMaterialDetailDomainService.update(inMaterialDetailDO);
}
/**
* 批量删除物料明细
*/
public boolean delete(Long[] materialDetailIds) {
return inMaterialDetailDomainService.delete(materialDetailIds);
}
/**
* 获取物料明细详细信息
*/
public ReserveInMaterialDetailPO getInfo(Long materialDetailId)
{
return inMaterialDetailDomainService.getInfo(materialDetailId);
}
}
@@ -0,0 +1,65 @@
package com.mhd.oms.domain.reserveInMaterialDetail.service;
import cn.hutool.core.util.ObjectUtil;
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDTO;
import com.mhd.system.api.model.LoginUser;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 物料明细Assembler
*
* @author gen
* @date 2024-05-21
*/
@Component
public class ReserveInMaterialDetailAssembler {
/**
* 转换实体
*/
public ReserveInMaterialDetailDO toDO(ReserveInMaterialDetailDTO inMaterialDetailDTO) {
ReserveInMaterialDetailDO inMaterialDetailDO = new ReserveInMaterialDetailDO();
// 拷贝
BeanUtils.copyProperties(inMaterialDetailDTO, inMaterialDetailDO, IgnoreNullUtil.getNullPropertyNames(inMaterialDetailDTO));
return inMaterialDetailDO;
}
/**
* 转换实体
*/
public ReserveInMaterialDetailDO toDOByEdit(ReserveInMaterialDetailDTO inMaterialDetailDTO) {
ReserveInMaterialDetailDO inMaterialDetailDO = new ReserveInMaterialDetailDO();
// 拷贝
BeanUtils.copyProperties(inMaterialDetailDTO, inMaterialDetailDO, IgnoreNullUtil.getNullPropertyNames(inMaterialDetailDTO));
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
String userName = loginUser.getUsername();
// 获取登录人id
Long userId = loginUser.getUserid();
if(inMaterialDetailDTO.getMaterialDetailId() != null){
inMaterialDetailDO.setUpdateBy(userId);
inMaterialDetailDO.setUpdateByName(userName);
inMaterialDetailDO.setUpdateTime(new Date());
}else {
inMaterialDetailDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
inMaterialDetailDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
inMaterialDetailDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
inMaterialDetailDO.setCreateBy(userId);
inMaterialDetailDO.setCreateByName(userName);
inMaterialDetailDO.setCreateTime(new Date());
inMaterialDetailDO.setDelFlag(1);
}
return inMaterialDetailDO;
}
}
@@ -0,0 +1,65 @@
package com.mhd.oms.domain.reserveInMaterialDetail.service;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.facade.IReserveInMaterialDetailService;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 物料明细
*
* @author gen
* @date 2024-05-21
*/
@Service
@Slf4j
public class ReserveInMaterialDetailDomainService {
@Autowired
private IReserveInMaterialDetailService materialDetailService;
/**
* 分页查询物料明细列表
*/
public List<ReserveInMaterialDetailPO> queryList(ReserveInMaterialDetailDO inMaterialDetailDO) {
return materialDetailService.queryList(inMaterialDetailDO);
}
/**
* 新增物料明细
*/
public Boolean insert(ReserveInMaterialDetailDO inMaterialDetailDO) {
return materialDetailService.insert(inMaterialDetailDO);
}
/**
* 修改物料明细
*/
public Boolean update(ReserveInMaterialDetailDO inMaterialDetailDO) {
return materialDetailService.update(inMaterialDetailDO);
}
/**
* 批量删除物料明细
*/
public Boolean delete(Long[] materialDetailIds) {
return materialDetailService.delete(materialDetailIds);
}
/**
* 获取物料明细详细信息
*/
public ReserveInMaterialDetailPO getInfo(Long materialDetailId)
{
return materialDetailService.getInfo(materialDetailId);
}
}
@@ -0,0 +1,496 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveOutMaterialDetail extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
@TableId(type = IdType.AUTO)
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("已分配数量")
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("分配仓库id")
private Long warehouseId;
@ApiModelProperty("分配仓库编码")
@Excel(name = "分配仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("分配库区id")
@Excel(name = "分配库区id")
private Long storageSectionId;
@ApiModelProperty("分配库区编码")
@Excel(name = "分配库区编码")
private String storageCode;
@ApiModelProperty("分配库区名称")
@Excel(name = "分配库区名称")
private String storageName;
@ApiModelProperty("分配库位id")
@Excel(name = "分配库位id")
private Long storageLocationId;
@ApiModelProperty("分配库位编码")
@Excel(name = "分配库位编码")
private String storageLocationCode;
@ApiModelProperty("分配库位名称")
@Excel(name = "分配库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
private Long parentUniqueId;
@ApiModelProperty("是否允许修改: 1-是 2-否 分配后 不再支持修改")
@Excel(name = "是否允许修改: 1-是 2-否")
private Integer allowModify;
@ApiModelProperty("是否生成拣货单: 1-是 2-否")
@Excel(name = "是否生成拣货单: 1-是 2-否")
private Integer genPickingOrder;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
/**
* 商品名称
*/
@ApiModelProperty("商品名称")
@Excel(name = "商品名称")
private String commodityName;
/**
* 商品编码
*/
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String commodityNo;
/**
* 料号
*/
@ApiModelProperty("料号")
@Excel(name = "料号")
private String materialNo;
/**
* 规格型号
*/
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
/**
* 商品SKU码
*/
@ApiModelProperty("商品SKU码")
@Excel(name = "商品SKU码")
private String skucode;
/**
* Invoice No
*/
@ApiModelProperty("Invoice No")
@Excel(name = "Invoice No")
private String invoiceNo;
/**
* 升
*/
@ApiModelProperty("")
@Excel(name = "")
private String liter;
/**
* 尺寸
*/
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String size;
/**
* 申报单位
*/
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declareUnit;
/**
* Batch Ref NOs
*/
@ApiModelProperty("Batch Ref NOs")
@Excel(name = "Batch Ref NOs")
private String batchRefNo;
/**
* Sheet Ref NOs
*/
@ApiModelProperty("Sheet Ref NOs")
@Excel(name = "Sheet Ref NOs")
private String sheetRefNo;
/**
* 原产国
*/
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String countryOfOrigin;
/**
* 箱号/卡板号
*/
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
/**
* 币制
*/
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
/**
* 申报数量
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declareQuantity;
/**
* 箱数
*/
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal caseCount;
/**
* 件数
*/
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
/**
* 出库数量
*/
@ApiModelProperty("出库数量")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
/**
* 总净重(KG)
*/
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
/**
* 总毛重(KG)
*/
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
/**
* 总体积(CBM)
*/
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
/**
* 总面积(SQM)
*/
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
/**
* 总价
*/
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalAmount;
/**
* 单位
*/
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("扩展属性1")
@Excel(name = "扩展属性1")
@TableField("ext_attr_1")
private String extAttr1;
@ApiModelProperty("扩展属性2")
@Excel(name = "扩展属性2")
@TableField("ext_attr_2")
private String extAttr2;
@ApiModelProperty("生产日期")
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date productionDate;
@ApiModelProperty("过期日期")
@Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expiryDate;
@ApiModelProperty("存货日期")
@Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inventoryDate;
@ApiModelProperty("扩展属性3")
@Excel(name = "扩展属性3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@TableField("ext_attr_3")
private Date extAttr3;
@ApiModelProperty("扩展属性4")
@Excel(name = "扩展属性4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
@TableField("ext_attr_4")
private Date extAttr4;
/**
* 库存数量(仅用于前端展示,从material_inventory表中带出)
*/
@ApiModelProperty("分配时库存数量")
private BigDecimal inventoryQuantity;
@TableField(exist = false)
private BigDecimal actualQuantity;
@ApiModelProperty("复核总净重(KG)")
@Excel(name = "复核总净重(KG)")
private BigDecimal checkNetWeight;
@ApiModelProperty("复核总毛重(KG)")
@Excel(name = "复核总毛重(KG)")
private BigDecimal checkGrossWeight;
@ApiModelProperty("复核总体积(CBM)")
@Excel(name = "复核总体积(CBM)")
private BigDecimal checkVolume;
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("库存单位")
@Excel(name = "库存单位")
private String stockUnit;
@ApiModelProperty("库存数量")
@Excel(name = "库存数量")
private BigDecimal stockQuantity;
}
@@ -0,0 +1,65 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.reserveOutMaterialDetail.entity.ReserveOutMaterialDetail;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailBaseDO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import java.util.List;
/**
* 物料明细Service接口
*
* @author gen
* @date 2024-05-21
*/
public interface IReserveOutMaterialDetailService extends IService<ReserveOutMaterialDetail>
{
/**
* 分页查询物料明细列表
*/
public List<ReserveOutMaterialDetailPO> queryList(ReserveOutMaterialDetailDO outMaterialDetailDO);
/**
* 关联出库单 查询物料明细列表
*/
public List<ReserveOutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
public List<ReserveOutMaterialDetailPO> queryListChildren(ReserveOutMaterialDetailDO outMaterialDetailDO);
/**
* 新增物料明细
*/
public Boolean insert(ReserveOutMaterialDetailDO outMaterialDetailDO);
/**
* 修改物料明细
*/
public Boolean update(ReserveOutMaterialDetailDO outMaterialDetailDO);
/**
* 新增物料明细
*/
public Boolean batchInsert(String orderNumber, List<ReserveOutMaterialDetailDO> outMaterialDetailDOList);
/**
* 修改物料明细
*/
public Boolean batchUpdate(List<ReserveOutMaterialDetailDO> outMaterialDetailDOList, ReserveOutMaterialDetailBaseDO outMaterialDetailBaseDO);
/**
* 批量删除物料明细
*/
public Boolean delete(Long[] materialDetailIds);
/**
* 查询物料明细
*/
public ReserveOutMaterialDetailPO getInfo(Long materialDetailId);
}
@@ -0,0 +1,56 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.reserveOutMaterialDetail.entity.ReserveOutMaterialDetail;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import java.util.List;
/**
* 物料明细Mapper接口
*
* @author gen
* @date 2024-05-21
*/
public interface ReserveOutMaterialDetailMapper extends BaseMapper<ReserveOutMaterialDetail>
{
/**
* 查询物料明细列表
*/
public List<ReserveOutMaterialDetailPO> queryList(ReserveOutMaterialDetailDO outMaterialDetailDO);
/**
* 关联出库单 查询物料明细列表
*/
public List<ReserveOutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO);
/**
* @description 批量修改指定物料明细分配数量
* @author ZhouGY
* @date 2024/6/7 14:29
* @param outMaterialDetailDO
* @return int
*/
public int batchAddAllocationQuantityByIds(ReserveOutMaterialDetailDO outMaterialDetailDO);
/**
* @description 批量修改指定物料明细拣货数量
* @author ZhouGY
* @date 2024/6/7 14:29
* @param outMaterialDetailDO
* @return int
*/
public int batchAddPickingQuantityByIds(ReserveOutMaterialDetailDO outMaterialDetailDO);
/**
* @description 批量修改指定物料明细拣货数量
* @author ZhouGY
* @date 2024/6/7 14:29
* @param outMaterialDetailDO
* @return int
*/
public int batchAddPickingQuantityByUniqueIds(ReserveOutMaterialDetailDO outMaterialDetailDO);
}
@@ -0,0 +1,264 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.repository.persistence;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.mhd.common.core.constant.SnowFlakeConstants;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.core.utils.uuid.IdGenerator;
import com.mhd.common.security.utils.SecurityUtils;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
//import com.mhd.oms.domain.reservationStockInOrder.repository.mapper.ReserveStockInOrderMapper;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.QueryOrderOverStockDO;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.entity.ReserveOutMaterialDetail;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.facade.IReserveOutMaterialDetailService;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.mapper.ReserveOutMaterialDetailMapper;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailBaseDO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper;
import com.mhd.system.api.model.LoginUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.function.Function;
import java.util.stream.Collectors;
/**
* 物料明细Service业务层处理
*
* @author gen
* @date 2024-05-21
*/
@Service
public abstract class ReserveOutMaterialDetailImpl extends ServiceImpl<ReserveOutMaterialDetailMapper, ReserveOutMaterialDetail> implements IReserveOutMaterialDetailService {
@Autowired
private ReserveOutMaterialDetailMapper outMaterialDetailMapper;
// @Autowired
// private IReserveOutMaterialDetailSerialNumberService outMaterialDetailSerialNumberService;
@Autowired
private IdGenerator idGenerator;
@Autowired
private ReserveStockInOrderMapper reservationStockInOrderMapper;
// @Autowired
// private MaterialBaseInfoMapper materialBaseInfoMapper;
/**
* 查询物料明细列表
*/
@Override
public List<ReserveOutMaterialDetailPO> queryList(ReserveOutMaterialDetailDO outMaterialDetailDO)
{
return outMaterialDetailMapper.queryList(outMaterialDetailDO);
}
/**
* 关联出库单 查询物料明细列表
*/
@Override
public List<ReserveOutMaterialDetailPO> queryOutOrderList(QueryOrderOverStockDO queryOrderOverStockDO) {
return outMaterialDetailMapper.queryOutOrderList(queryOrderOverStockDO);
}
/**
* 查询物料明细列表
*/
@Override
public List<ReserveOutMaterialDetailPO> queryListChildren(ReserveOutMaterialDetailDO outMaterialDetailDO)
{
List<ReserveOutMaterialDetailPO> outMaterialDetailPOList = outMaterialDetailMapper.queryList(outMaterialDetailDO);
// 获取查询的层级
List<ReserveOutMaterialDetailPO> outMaterialDetailParentList = outMaterialDetailPOList
.stream().filter(e -> 1 == e.getLevel()).collect(Collectors.toList());
// 递归查询子集
outMaterialDetailParentList.forEach(materialDetailPO -> materialDetailPO.setChildren(getChildren(materialDetailPO.getUniqueId(), outMaterialDetailPOList, 2)));
return outMaterialDetailParentList;
}
private List<ReserveOutMaterialDetailPO> getChildren(Long parentUniqueId, List<ReserveOutMaterialDetailPO> materialDetailPOList, Integer maxLevel){
List<ReserveOutMaterialDetailPO> childrenCityList = materialDetailPOList.stream().filter(materialDetailPO -> parentUniqueId.equals(materialDetailPO.getParentUniqueId())).collect(Collectors.toList());
if (!CollectionUtils.isEmpty(childrenCityList)){
childrenCityList.forEach(childrenCity -> {
if (childrenCity.getLevel() < maxLevel){
childrenCity.setChildren(getChildren(childrenCity.getUniqueId(), materialDetailPOList, maxLevel));
}
});
}
return childrenCityList;
}
/**
* 新增物料明细
*/
@Override
public Boolean insert(ReserveOutMaterialDetailDO outMaterialDetailDO) {
ReserveOutMaterialDetail outMaterialDetail = new ReserveOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
return this.save(outMaterialDetail);
}
/**
* 修改物料明细
*/
@Override
public Boolean update(ReserveOutMaterialDetailDO outMaterialDetailDO) {
ReserveOutMaterialDetail outMaterialDetail = new ReserveOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
return this.updateById(outMaterialDetail);
}
/**
* @description 批量新增物流明细
* @author ZhouGY
* @date 2024/5/22 9:27
* @param outOrderNumber
* @param outMaterialDetailDOList
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean batchInsert(String outOrderNumber, List<ReserveOutMaterialDetailDO> outMaterialDetailDOList) {
if (CollectionUtils.isEmpty(outMaterialDetailDOList)) {
throw new ServiceException("物料明细不能为空");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
// 批量新增或修改
// 获取用户姓名(优先从UserPo获取,如果为空则使用realname,最后使用username作为兜底)
final String userRealName = (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
&& !loginUser.getUserPo().getUserName().trim().isEmpty())
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null && !loginUser.getRealname().trim().isEmpty())
? loginUser.getRealname()
: loginUser.getUsername();
List<ReserveOutMaterialDetail> outMaterialDetailList = new ArrayList<>();
for (ReserveOutMaterialDetailDO outMaterialDetailDO : outMaterialDetailDOList){
ReserveOutMaterialDetail outMaterialDetail = new ReserveOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
outMaterialDetail.setUniqueId(idGenerator.snowflakeId(SnowFlakeConstants.wmsId));
outMaterialDetail.setOutOrderNumber(outOrderNumber);
outMaterialDetail.setTopOrganizationId(loginUser.getUserPo().getOrganizationId());
outMaterialDetail.setOrganizationId(loginUser.getUserPo().getOrganizationId());
outMaterialDetail.setOrganizationName(loginUser.getUserPo().getOrganizationName());
outMaterialDetail.setCreateBy(loginUser.getUserid());
outMaterialDetail.setCreateByName(userRealName);
outMaterialDetail.setCreateTime(new Date());
// 计划数量:接口常传 quantity;有 outboundQuantity 时与 quantity 对齐,否则用 quantity 回填 outbound
if (outMaterialDetail.getOutboundQuantity() != null) {
outMaterialDetail.setQuantity(outMaterialDetail.getOutboundQuantity());
} else if (outMaterialDetail.getQuantity() != null) {
outMaterialDetail.setOutboundQuantity(outMaterialDetail.getQuantity());
}
String materialNo = outMaterialDetail.getMaterialNo();
List<MaterialBaseInfoPO> materialBaseInfos = reservationStockInOrderMapper.getMaterialBaseInfoList(materialNo);
//List<MaterialBaseInfoPO> materialBaseInfos = materialBaseInfoMapper.selectList(new QueryWrapper<MaterialBaseInfo>().lambda().eq(MaterialBaseInfo::getMaterialCode, materialNo));
if (!CollectionUtils.isEmpty(materialBaseInfos) && materialBaseInfos.size() > 0) {
outMaterialDetail.setCommodityName(materialBaseInfos.get(0).getMaterialName());
outMaterialDetail.setBarCode(materialBaseInfos.get(0).getBarCode());
outMaterialDetail.setPackName(materialBaseInfos.get(0).getPackName());
outMaterialDetail.setPackCode(materialBaseInfos.get(0).getPackCode());
outMaterialDetail.setUnitCode(materialBaseInfos.get(0).getUnitCode());
outMaterialDetail.setUnitName(materialBaseInfos.get(0).getUnitName());
}
outMaterialDetailList.add(outMaterialDetail);
}
return saveBatch(outMaterialDetailList);
}
/**
* @description 批量修改物流明细
* @author ZhouGY
* @date 2024/5/22 9:27
* @param outMaterialDetailDOList
* @param outMaterialDetailBaseDO
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean batchUpdate(List<ReserveOutMaterialDetailDO> outMaterialDetailDOList, ReserveOutMaterialDetailBaseDO outMaterialDetailBaseDO) {
if (CollectionUtils.isEmpty(outMaterialDetailDOList)) {
throw new ServiceException("物料明细不能为空");
}
LoginUser loginUser = SecurityUtils.getLoginUser();
List<ReserveOutMaterialDetail> outMaterialDetailDbList = outMaterialDetailMapper.selectList(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, outMaterialDetailBaseDO.getOutOrderNumber()));
Map<Long, ReserveOutMaterialDetail> materialDetailMap = outMaterialDetailDbList.stream().collect(Collectors.toMap(ReserveOutMaterialDetail::getMaterialDetailId, Function.identity()));
//批量新增或修改物料信息
List<ReserveOutMaterialDetail> outMaterialDetailList = new ArrayList<>();
//需要修改的物流明细
List<Long> materialDetailIdsByUpdate = new ArrayList<>();
for (ReserveOutMaterialDetailDO outMaterialDetailDO : outMaterialDetailDOList){
//判断是否需要修改
ReserveOutMaterialDetail outMaterialDetail = materialDetailMap.get(outMaterialDetailDO.getMaterialDetailId());
if (outMaterialDetail == null){
outMaterialDetail = new ReserveOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
outMaterialDetail.setUniqueId(idGenerator.snowflakeId(SnowFlakeConstants.wmsId));
outMaterialDetail.setOutOrderNumber(outMaterialDetailBaseDO.getOutOrderNumber());
outMaterialDetail.setOrganizationId(outMaterialDetailBaseDO.getOrganizationId());
outMaterialDetail.setOrganizationName(outMaterialDetailBaseDO.getOrganizationName());
outMaterialDetail.setTopOrganizationId(outMaterialDetailBaseDO.getTopOrganizationId());
}else {
BeanUtils.copyProperties(outMaterialDetailDO, outMaterialDetail);
outMaterialDetail.setUpdateBy(loginUser.getUserid());
outMaterialDetail.setUpdateByName(loginUser.getUsername());
outMaterialDetail.setUpdateTime(new Date());
materialDetailIdsByUpdate.add(outMaterialDetailDO.getMaterialDetailId());
}
outMaterialDetailList.add(outMaterialDetail);
}
//需修改的物料明细id集合不为空
if (!CollectionUtils.isEmpty(materialDetailIdsByUpdate)){
List<Long> materialDetailIdsByDb = outMaterialDetailDbList.stream().map(ReserveOutMaterialDetail::getMaterialDetailId).collect(Collectors.toList());
//过滤需要修改的id集合
materialDetailIdsByDb.removeAll(materialDetailIdsByUpdate);
//判断是否存在需要删除的物流明细 标记删除
if (!CollectionUtils.isEmpty(materialDetailIdsByDb)){
update(new UpdateWrapper<ReserveOutMaterialDetail>().lambda()
.set(ReserveOutMaterialDetail::getDelFlag, 2)
.set(ReserveOutMaterialDetail::getUpdateBy, loginUser.getUserid())
.set(ReserveOutMaterialDetail::getUpdateByName, loginUser.getUsername())
.set(ReserveOutMaterialDetail::getUpdateTime, new Date())
.in(ReserveOutMaterialDetail::getMaterialDetailId, materialDetailIdsByDb));
}
}
//保存物料明细信息
return saveOrUpdateBatch(outMaterialDetailList);
}
/**
* 批量删除物料明细
*/
@Override
public Boolean delete(Long[] materialDetailIds ) {
List<ReserveOutMaterialDetail> list = new ArrayList<>();
for (Long id : materialDetailIds) {
ReserveOutMaterialDetail outMaterialDetail = new ReserveOutMaterialDetail();
outMaterialDetail.setMaterialDetailId(id);
outMaterialDetail.setDelFlag(2);
list.add(outMaterialDetail);
}
return this.updateBatchById(list);
}
/**
* 修改物料明细
*/
@Override
public ReserveOutMaterialDetailPO getInfo(Long materialDetailId) {
ReserveOutMaterialDetail outMaterialDetail = this.getById(materialDetailId);
ReserveOutMaterialDetailPO outMaterialDetailPO = new ReserveOutMaterialDetailPO();
BeanUtils.copyProperties(outMaterialDetail, outMaterialDetailPO);
return outMaterialDetailPO;
}
}
@@ -0,0 +1,587 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.repository.po;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
//import com.mhd.oms.domain.reservationStockOutOrder.repository.todo.ReserveStockOutOrderBaseDO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderBaseDO;
import com.mhd.system.api.domain.MaterialMoreDetailPO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
@ApiModel(value = "物料明细对象", description = "物料明细响应对象")
public class ReserveOutMaterialDetailPO extends ReserveStockOutOrderBaseDO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("已分配数量")
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("待复核数量")
@Excel(name = "待复核数量")
private BigDecimal waitCheckQuantity;
@ApiModelProperty("复核数量输入框字段,默认等于待复核数量")
@TableField(exist = false)
private BigDecimal actualQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("库存数量(仅展示)")
private BigDecimal inventoryQuantity;
@ApiModelProperty("分配仓库id")
private Long warehouseId;
@ApiModelProperty("分配仓库编码")
@Excel(name = "分配仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("分配库区id")
@Excel(name = "分配库区id")
private Long storageSectionId;
@ApiModelProperty("分配库区编码")
@Excel(name = "分配库区编码")
private String storageCode;
@ApiModelProperty("分配库区名称")
@Excel(name = "分配库区名称")
private String storageName;
@ApiModelProperty("分配库位id")
@Excel(name = "分配库位id")
private Long storageLocationId;
@ApiModelProperty("分配库位编码")
@Excel(name = "分配库位编码")
private String storageLocationCode;
@ApiModelProperty("分配库位名称")
@Excel(name = "分配库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentUniqueId;
@ApiModelProperty("是否允许修改: 1-是 2-否 分配后 不再支持修改")
@Excel(name = "是否允许修改: 1-是 2-否")
private Integer allowModify;
@ApiModelProperty("是否生成拣货单: 1-是 2-否")
@Excel(name = "是否生成拣货单: 1-是 2-否")
private Integer genPickingOrder;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("物料明细")
private List<ReserveOutMaterialDetailPO> children;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
/**
* 商品名称
*/
@ApiModelProperty("商品名称")
@Excel(name = "商品名称")
private String commodityName;
/**
* 商品编码
*/
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String commodityNo;
/**
* 料号
*/
@ApiModelProperty("料号")
@Excel(name = "料号")
private String materialNo;
/**
* 规格型号
*/
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
/**
* 商品SKU码
*/
@ApiModelProperty("商品SKU码")
@Excel(name = "商品SKU码")
private String skucode;
/**
* Invoice No
*/
@ApiModelProperty("Invoice No")
@Excel(name = "Invoice No")
private String invoiceNo;
/**
* 升
*/
@ApiModelProperty("")
@Excel(name = "")
private String liter;
/**
* 尺寸
*/
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String size;
/**
* 申报单位
*/
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declareUnit;
/**
* Batch Ref NOs
*/
@ApiModelProperty("Batch Ref NOs")
@Excel(name = "Batch Ref NOs")
private String batchRefNo;
/**
* Sheet Ref NOs
*/
@ApiModelProperty("Sheet Ref NOs")
@Excel(name = "Sheet Ref NOs")
private String sheetRefNo;
/**
* 原产国
*/
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String countryOfOrigin;
/**
* 箱号/卡板号
*/
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
/**
* 币制
*/
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
/**
* 申报数量
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declareQuantity;
/**
* 箱数
*/
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal caseCount;
/**
* 件数
*/
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
/**
* 出库数量
*/
@ApiModelProperty("出库数量")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
/**
* 总净重(KG)
*/
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
/**
* 总毛重(KG)
*/
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
/**
* 总体积(CBM)
*/
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
/**
* 总面积(SQM)
*/
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
/**
* 总价
*/
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalAmount;
/**
* 单位
*/
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("扩展字段1")
@Excel(name = "扩展字段1")
private String extAttr1;
@ApiModelProperty("扩展字段2")
@Excel(name = "扩展字段2")
private String extAttr2;
@ApiModelProperty("生产日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "生产日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date productionDate;
@ApiModelProperty("过期日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "过期日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expiryDate;
@ApiModelProperty("存货日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "存货日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date inventoryDate;
@ApiModelProperty("ExtAttr3")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "ExtAttr3", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date extAttr3;
@ApiModelProperty("ExtAttr4")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date extAttr4;
@ApiModelProperty("更多属性明细列表")
@TableField(exist = false)
private List<MaterialMoreDetailPO> materialMoreDetailList;
@ApiModelProperty("分配按钮显示类型:1-显示库存分配,2-显示取消分配")
@TableField(exist = false)
private Integer allocationButtonType;
@ApiModelProperty("复核总净重(KG)")
@Excel(name = "复核总净重(KG)")
private BigDecimal checkNetWeight;
@ApiModelProperty("复核总毛重(KG)")
@Excel(name = "复核总毛重(KG)")
private BigDecimal checkGrossWeight;
@ApiModelProperty("复核总体积(CBM)")
@Excel(name = "复核总体积(CBM)")
private BigDecimal checkVolume;
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("库存单位")
@Excel(name = "库存单位")
private String stockUnit;
@ApiModelProperty("库存数量")
@Excel(name = "库存数量")
private BigDecimal stockQuantity;
@ApiModelProperty("出库异常明细:计划数量(复核异常场景=拣货数量)")
@TableField(exist = false)
private BigDecimal abnormalPlanQuantity;
@ApiModelProperty("出库异常明细:作业数量(复核异常场景=实际复核数量)")
@TableField(exist = false)
private BigDecimal abnormalWorkQuantity;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
}
@@ -0,0 +1,34 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo;
import com.mhd.common.core.annotation.Excel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.io.Serializable;
/**
* @author ZhouGY
* @title StockBaseDO
* @description: TODO
* @date 2024/5/23 20:30
**/
@Data
public class ReserveOutMaterialDetailBaseDO implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
}
@@ -0,0 +1,532 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveOutMaterialDetailDO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("已分配数量")
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("本次分配数量")
@Excel(name = "本次分配数量")
@TableField(exist = false)
private BigDecimal nowAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("分配时库存数量(仅展示)")
private BigDecimal inventoryQuantity;
@ApiModelProperty("分配仓库id")
private Long warehouseId;
@ApiModelProperty("分配仓库编码")
@Excel(name = "分配仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("分配库区id")
@Excel(name = "分配库区id")
private Long storageSectionId;
@ApiModelProperty("分配库区编码")
@Excel(name = "分配库区编码")
private String storageCode;
@ApiModelProperty("分配库区名称")
@Excel(name = "分配库区名称")
private String storageName;
@ApiModelProperty("分配库位id")
@Excel(name = "分配库位id")
private Long storageLocationId;
@ApiModelProperty("分配库位编码")
@Excel(name = "分配库位编码")
private String storageLocationCode;
@ApiModelProperty("分配库位名称")
@Excel(name = "分配库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
private Long parentUniqueId;
@ApiModelProperty("是否允许修改: 1-是 2-否 分配后 不再支持修改")
@Excel(name = "是否允许修改: 1-是 2-否")
private Integer allowModify;
@ApiModelProperty("是否生成拣货单: 1-是 2-否")
@Excel(name = "是否生成拣货单: 1-是 2-否")
private Integer genPickingOrder;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("物料明细子集")
private List<ReserveOutMaterialDetailDO> children;
// @ApiModelProperty("序列号")
// private List<ReserveOutMaterialDetailSerialNumberDO> materialDetailSerialNumberList;
@ApiModelProperty("出单号集合")
@Excel(name = "出单号集合")
private List<String> outOrderNumberList;
@ApiModelProperty("取消分配数量")
@Excel(name = "取消分配数量")
private BigDecimal cancelAllocationQuantity;
@ApiModelProperty("订单物料明细id")
private List<Long> materialDetailIds;
@ApiModelProperty("作业数量(例如:分配数量 拣货数量 复核数量)")
@Excel(name = "作业数量(例如:分配数量 拣货数量 复核数量)")
private BigDecimal actualQuantity;
/**
* 商品名称
*/
@ApiModelProperty("商品名称")
@Excel(name = "商品名称")
private String commodityName;
/**
* 商品编码
*/
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String commodityNo;
/**
* 料号
*/
@ApiModelProperty("料号")
@Excel(name = "料号")
private String materialNo;
/**
* 规格型号
*/
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
/**
* 商品SKU码
*/
@ApiModelProperty("商品SKU码")
@Excel(name = "商品SKU码")
private String skucode;
/**
* Invoice No
*/
@ApiModelProperty("Invoice No")
@Excel(name = "Invoice No")
private String invoiceNo;
/**
* 升
*/
@ApiModelProperty("")
@Excel(name = "")
private String liter;
/**
* 尺寸
*/
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String size;
/**
* 申报单位
*/
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declareUnit;
/**
* Batch Ref NOs
*/
@ApiModelProperty("Batch Ref NOs")
@Excel(name = "Batch Ref NOs")
private String batchRefNo;
/**
* Sheet Ref NOs
*/
@ApiModelProperty("Sheet Ref NOs")
@Excel(name = "Sheet Ref NOs")
private String sheetRefNo;
/**
* 原产国
*/
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String countryOfOrigin;
/**
* 箱号/卡板号
*/
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
/**
* 币制
*/
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
/**
* 申报数量
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declareQuantity;
/**
* 箱数
*/
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal caseCount;
/**
* 件数
*/
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
/**
* 出库数量
*/
@ApiModelProperty("出库数量")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
/**
* 总净重(KG)
*/
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
/**
* 总毛重(KG)
*/
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
/**
* 总体积(CBM)
*/
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
/**
* 总面积(SQM)
*/
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
/**
* 总价
*/
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalAmount;
/**
* 单位
*/
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("复核总净重(KG)")
@Excel(name = "复核总净重(KG)")
private BigDecimal checkNetWeight;
@ApiModelProperty("复核总毛重(KG)")
@Excel(name = "复核总毛重(KG)")
private BigDecimal checkGrossWeight;
@ApiModelProperty("复核总体积(CBM)")
@Excel(name = "复核总体积(CBM)")
private BigDecimal checkVolume;
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("是否已分配")
@Excel(name = "是否已分配")
private String isAllocated;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("库存单位")
@Excel(name = "库存单位")
private String stockUnit;
@ApiModelProperty("库存数量")
@Excel(name = "库存数量")
private BigDecimal stockQuantity;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
}
@@ -0,0 +1,521 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.List;
/**
* 物料明细对象 material_detail
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveOutMaterialDetailDTO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("订单物料明细id")
private Long materialDetailId;
@ApiModelProperty("业务唯一id")
@JsonSerialize(using = ToStringSerializer.class)
private Long uniqueId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("物料基础信息id")
@Excel(name = "物料基础信息id")
private Long materialBaseInfoId;
@ApiModelProperty("物料编码")
@Excel(name = "物料编码")
private String materialCode;
@ApiModelProperty("物料名称")
@Excel(name = "物料名称")
private String materialName;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("已分配数量")
@Excel(name = "已分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("作业数量(例如:分配数量 拣货数量 复核数量 取消数量)")
@Excel(name = "作业数量(例如:分配数量 拣货数量 复核数量 取消数量)")
private BigDecimal actualQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("包装规格id")
@Excel(name = "包装规格id")
private Long packId;
@ApiModelProperty("包装规格编码")
@Excel(name = "包装规格编码")
private String packCode;
@ApiModelProperty("包装规格名称")
@Excel(name = "包装规格名称")
private String packName;
@ApiModelProperty("包装详情id")
@Excel(name = "包装详情id")
private Long packDetailId;
@ApiModelProperty("单位代码:EA IP CS PL OT")
@Excel(name = "单位代码:EA IP CS PL OT")
private String unitCode;
@ApiModelProperty("单位名称")
@Excel(name = "单位名称")
private String unitName;
@ApiModelProperty("单位数量")
@Excel(name = "单位数量")
private BigDecimal unitNumber;
@ApiModelProperty("物料仓库控制信息id")
@Excel(name = "物料仓库控制信息id")
private Long materialWarehouseControlId;
@ApiModelProperty("是否序列号管理: 1-是 2-否")
@Excel(name = "是否序列号管理: 1-是 2-否")
private Integer serialNumberManage;
@ApiModelProperty("物料库存id")
@Excel(name = "物料库存id")
private Long materialInventoryId;
@ApiModelProperty("批次号")
@Excel(name = "批次号")
private String batchNumber;
@ApiModelProperty("物料状态编码")
@Excel(name = "物料状态编码")
private String materialStatusCode;
@ApiModelProperty("物料状态名称")
@Excel(name = "物料状态名称")
private String materialStatusName;
@ApiModelProperty("物料明细子集")
private List<ReserveOutMaterialDetailDO> children;
@ApiModelProperty("容器id")
@Excel(name = "容器id")
private Long containerId;
@ApiModelProperty("容器编码")
@Excel(name = "容器编码")
private String containerCode;
@ApiModelProperty("容器类型 数据字典")
@Excel(name = "容器类型 数据字典")
private String containerType;
@ApiModelProperty("容器类型名称 数据字典")
@Excel(name = "容器类型名称 数据字典")
private String containerTypeName;
@ApiModelProperty("库存数量(仅展示)")
private BigDecimal inventoryQuantity;
@ApiModelProperty("分配仓库id")
private Long warehouseId;
@ApiModelProperty("分配仓库编码")
@Excel(name = "分配仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("分配库区id")
@Excel(name = "分配库区id")
private Long storageSectionId;
@ApiModelProperty("分配库区编码")
@Excel(name = "分配库区编码")
private String storageCode;
@ApiModelProperty("分配库区名称")
@Excel(name = "分配库区名称")
private String storageName;
@ApiModelProperty("分配库位id")
@Excel(name = "分配库位id")
private Long storageLocationId;
@ApiModelProperty("分配库位编码")
@Excel(name = "分配库位编码")
private String storageLocationCode;
@ApiModelProperty("分配库位名称")
@Excel(name = "分配库位名称")
private String storageLocationName;
@ApiModelProperty("层级深度,从一级开始递增")
private Integer level;
@ApiModelProperty("父级唯一Id")
@JsonSerialize(using = ToStringSerializer.class)
private Long parentUniqueId;
@ApiModelProperty("是否允许修改: 1-是 2-否 分配后 不再支持修改")
@Excel(name = "是否允许修改: 1-是 2-否")
private Integer allowModify;
@ApiModelProperty("是否生成拣货单: 1-是 2-否")
@Excel(name = "是否生成拣货单: 1-是 2-否")
private Integer genPickingOrder;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("物料明细子集")
private List<ReserveOutMaterialDetailDTO> materialDetailList;
// @ApiModelProperty("序列号")
// private List<OutMaterialDetailSerialNumberDTO> materialDetailSerialNumberList;
@ApiModelProperty("出单号集合")
@Excel(name = "出单号集合")
private List<String> outOrderNumberList;
@ApiModelProperty("取消分配数量")
@Excel(name = "取消分配数量")
private BigDecimal cancelAllocationQuantity;
/**
* 商品名称
*/
@ApiModelProperty("商品名称")
@Excel(name = "商品名称")
private String commodityName;
/**
* 商品编码
*/
@ApiModelProperty("商品编码")
@Excel(name = "商品编码")
private String commodityNo;
/**
* 料号
*/
@ApiModelProperty("料号")
@Excel(name = "料号")
private String materialNo;
/**
* 规格型号
*/
@ApiModelProperty("规格型号")
@Excel(name = "规格型号")
private String specificationModel;
/**
* 商品SKU码
*/
@ApiModelProperty("商品SKU码")
@Excel(name = "商品SKU码")
private String skucode;
/**
* Invoice No
*/
@ApiModelProperty("Invoice No")
@Excel(name = "Invoice No")
private String invoiceNo;
/**
* 升
*/
@ApiModelProperty("")
@Excel(name = "")
private String liter;
/**
* 尺寸
*/
@ApiModelProperty("尺寸")
@Excel(name = "尺寸")
private String size;
/**
* 申报单位
*/
@ApiModelProperty("申报单位")
@Excel(name = "申报单位")
private String declareUnit;
/**
* Batch Ref NOs
*/
@ApiModelProperty("Batch Ref NOs")
@Excel(name = "Batch Ref NOs")
private String batchRefNo;
/**
* Sheet Ref NOs
*/
@ApiModelProperty("Sheet Ref NOs")
@Excel(name = "Sheet Ref NOs")
private String sheetRefNo;
/**
* 原产国
*/
@ApiModelProperty("原产国")
@Excel(name = "原产国")
private String countryOfOrigin;
/**
* 箱号/卡板号
*/
@ApiModelProperty("箱号/卡板号")
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
/**
* 币制
*/
@ApiModelProperty("币制")
@Excel(name = "币制")
private String currency;
/**
* 申报数量
*/
@ApiModelProperty("申报数量")
@Excel(name = "申报数量")
private BigDecimal declareQuantity;
/**
* 箱数
*/
@ApiModelProperty("箱数")
@Excel(name = "箱数")
private BigDecimal caseCount;
/**
* 件数
*/
@ApiModelProperty("件数")
@Excel(name = "件数")
private BigDecimal pieceCount;
/**
* 出库数量
*/
@ApiModelProperty("出库数量")
@Excel(name = "出库数量")
private BigDecimal outboundQuantity;
/**
* 总净重(KG)
*/
@ApiModelProperty("总净重(KG)")
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
/**
* 总毛重(KG)
*/
@ApiModelProperty("总毛重(KG)")
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
/**
* 总体积(CBM)
*/
@ApiModelProperty("总体积(CBM)")
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
/**
* 总面积(SQM)
*/
@ApiModelProperty("总面积(SQM)")
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
/**
* 总价
*/
@ApiModelProperty("总价")
@Excel(name = "总价")
private BigDecimal totalAmount;
/**
* 单位
*/
@ApiModelProperty("单位")
@Excel(name = "单位")
private String unit;
@ApiModelProperty("复核总净重(KG)")
@Excel(name = "复核总净重(KG)")
private BigDecimal checkNetWeight;
@ApiModelProperty("复核总毛重(KG)")
@Excel(name = "复核总毛重(KG)")
private BigDecimal checkGrossWeight;
@ApiModelProperty("复核总体积(CBM)")
@Excel(name = "复核总体积(CBM)")
private BigDecimal checkVolume;
@ApiModelProperty("复核总面积(SQM)")
@Excel(name = "复核总面积(SQM)")
private BigDecimal checkArea;
@ApiModelProperty("合同收费")
@Excel(name = "合同收费")
private BigDecimal contractFee;
@ApiModelProperty("每月仓租")
@Excel(name = "每月仓租")
private BigDecimal monthlyWarehouseFee;
@ApiModelProperty("半月仓租")
@Excel(name = "半月仓租")
private BigDecimal halfMonthWhFee;
@ApiModelProperty("折扣(%)")
@Excel(name = "折扣(%)")
private BigDecimal discountRate;
@ApiModelProperty("单体积(CBM)")
@Excel(name = "单体积(CBM)")
private BigDecimal singleVolume;
@ApiModelProperty("单毛重(KG)")
@Excel(name = "单毛重(KG)")
private BigDecimal singleGrossWeight;
@ApiModelProperty("lot编号")
@Excel(name = "lot编号")
private String lotNo;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("库存单位")
@Excel(name = "库存单位")
private String stockUnit;
@ApiModelProperty("库存数量")
@Excel(name = "库存数量")
private BigDecimal stockQuantity;
@ApiModelProperty("调整前库存数量")
@Excel(name = "调整前库存数量")
private BigDecimal inventoryBeforeQuantity;
@ApiModelProperty("调整前可用数量")
@Excel(name = "调整前可用数量")
private BigDecimal allocationBeforeQuantity;
@ApiModelProperty("调整前冻结数量")
@Excel(name = "调整前冻结数量")
private BigDecimal freezeBeforeQuantity;
@ApiModelProperty("调整后库存数量")
@Excel(name = "调整后库存数量")
private BigDecimal inventoryAfterQuantity;
@ApiModelProperty("调整后可用数量")
@Excel(name = "调整后可用数量")
private BigDecimal allocationAfterQuantity;
@ApiModelProperty("调整后冻结数量")
@Excel(name = "调整后冻结数量")
private BigDecimal freezeAfterQuantity;
@ApiModelProperty("调整前净重(KG)")
@Excel(name = "调整前净重(KG)")
private BigDecimal netWeight;
@ApiModelProperty("调整前毛重(KG)")
@Excel(name = "调整前毛重(KG)")
private BigDecimal grossWeight;
@ApiModelProperty("调整前体积")
@Excel(name = "调整前体积")
private BigDecimal volume;
@ApiModelProperty("调整前面积")
@Excel(name = "调整前面积")
private BigDecimal area;
@ApiModelProperty("调整后净重(KG)")
@Excel(name = "调整后净重(KG)")
private BigDecimal adjustedNetWeight;
@ApiModelProperty("调整后毛重(KG)")
@Excel(name = "调整后毛重(KG)")
private BigDecimal adjustedGrossWeight;
@ApiModelProperty("调整后体积")
@Excel(name = "调整后体积")
private BigDecimal adjustedVolume;
@ApiModelProperty("调整后面积")
@Excel(name = "调整后面积")
private BigDecimal adjustedArea;
}
@@ -0,0 +1,67 @@
package com.mhd.oms.domain.reserveOutMaterialDetail.service;
//import com.mhd.wms.domain.outMaterialDetail.repository.facade.IReserveOutMaterialDetailService;
//import com.mhd.wms.domain.outMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
//import com.mhd.wms.domain.outMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.facade.IReserveOutMaterialDetailService;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 物料明细
*
* @author gen
* @date 2024-05-21
*/
@Service
@Slf4j
public class ReserveOutMaterialDetailDomainService {
@Autowired
private IReserveOutMaterialDetailService outMaterialDetailService;
/**
* 分页查询物料明细列表
*/
public List<ReserveOutMaterialDetailPO> queryList(ReserveOutMaterialDetailDO outMaterialDetailDO) {
return outMaterialDetailService.queryList(outMaterialDetailDO);
}
/**
* 新增物料明细
*/
public Boolean insert(ReserveOutMaterialDetailDO outMaterialDetailDO) {
return outMaterialDetailService.insert(outMaterialDetailDO);
}
/**
* 修改物料明细
*/
public Boolean update(ReserveOutMaterialDetailDO outMaterialDetailDO) {
return outMaterialDetailService.update(outMaterialDetailDO);
}
/**
* 批量删除物料明细
*/
public Boolean delete(Long[] materialDetailIds) {
return outMaterialDetailService.delete(materialDetailIds);
}
/**
* 获取物料明细详细信息
*/
public ReserveOutMaterialDetailPO getInfo(Long materialDetailId)
{
return outMaterialDetailService.getInfo(materialDetailId);
}
}
@@ -0,0 +1,412 @@
package com.mhd.oms.domain.reserveStockInOrder.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* 入库单对象 stock_in_order
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveStockInOrder extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("入库单id")
@TableId(type = IdType.AUTO)
private Long inOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 6-已取消 7-已关闭")
private Integer status;
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer auditStatus;
@ApiModelProperty("入库单审核备注")
@Excel(name = "入库单审核备注")
private String auditRemark;
@ApiModelProperty("入库单审核人")
@Excel(name = "入库单审核人")
private Long auditBy;
@ApiModelProperty("入库单审核人姓名")
@Excel(name = "入库单审核人姓名")
private String auditByName;
@ApiModelProperty("入库单审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库单审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("是否取消订单: 1-是 2-否")
@Excel(name = "是否取消订单: 1-是 2-否")
private Integer cancelOrder;
@ApiModelProperty("取消订单备注")
@Excel(name = "取消订单备注")
private String cancelRemark;
@ApiModelProperty("取消订单人")
@Excel(name = "取消订单人")
private Long cancelBy;
@ApiModelProperty("取消订单人姓名")
@Excel(name = "取消订单人姓名")
private String cancelByName;
@ApiModelProperty("取消订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date cancelTime;
@ApiModelProperty("是否关闭订单: 1-是 2-否")
@Excel(name = "是否关闭订单: 1-是 2-否")
private Integer closeOrder;
@ApiModelProperty("关闭订单备注")
@Excel(name = "关闭订单备注")
private String closeRemark;
@ApiModelProperty("关闭订单人")
@Excel(name = "关闭订单人")
private Long closeBy;
@ApiModelProperty("关闭订单人姓名")
@Excel(name = "关闭订单人姓名")
private String closeByName;
@ApiModelProperty("关闭订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date closeTime;
@ApiModelProperty("入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
@Excel(name = "入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
private Integer orderSource;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("调度单号")
private String mobilizeCode;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
// ========== 报关相关字段 ==========
@ApiModelProperty("To")
@Excel(name = "To")
@TableField(value = "\"TO\"")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleInfo;
@ApiModelProperty("委托编号NO")
@Excel(name = "委托编号NO")
private String consignmentNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSignature;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declarationArea;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddress;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
@ApiModelProperty("承运商")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportMethod;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionMethod;
@ApiModelProperty("海关是否查验货物")
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@ApiModelProperty("是否需要报关")
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@ApiModelProperty("是否需要运输")
@Excel(name = "是否需要运输")
private Integer needTransport;
@ApiModelProperty("入仓日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date warehouseDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completionTime;
@ApiModelProperty("下单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date orderDate;
@ApiModelProperty("业务单号")
@Excel(name = "业务单号")
private String businessOrderNo;
@ApiModelProperty("业务类型")
@Excel(name = "业务类型")
private String businessType;
@ApiModelProperty("制单人")
@Excel(name = "制单人")
private String documentCreator;
@ApiModelProperty("制单人名称")
@Excel(name = "制单人名称")
private String documentCreatorName;
@ApiModelProperty("制单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date documentDate;
@ApiModelProperty("订单状态")
@Excel(name = "订单状态")
private String orderStatus;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("入库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date storageTime;
}
@@ -0,0 +1,48 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveStockInOrder.entity.ReserveStockInOrder;
import com.mhd.oms.domain.reserveStockInOrder.repository.po.ReserveStockInOrderPO;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO;
import java.util.List;
/**
* 入库单Service接口
*
* @author gen
* @date 2024-05-21
*/
public interface IReserveStockInOrderService extends IService<ReserveStockInOrder>
{
/**
* 分页查询入库单列表
*/
public List<ReserveStockInOrderPO> queryList(ReserveStockInOrderDO stockInOrderDO);
/**
* 新增入库单
*/
public Boolean insert(ReserveStockInOrderDO stockInOrderDO);
/**
* 修改入库单
*/
public Boolean update(ReserveStockInOrderDO stockInOrderDO);
/**
* 批量删除入库单
*/
public Boolean delete(Long[] inOrderIds);
/**
* 查询入库单
*/
public ReserveStockInOrderPO getInfo(Long inOrderId);
List<ReserveStockInOrderPO> queryNoticePrint(ReserveStockInOrderDO stockInOrderDO);
List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDTO);
}
@@ -0,0 +1,39 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialGoodsRulePO;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialWarehouseControlPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveStockInOrder.entity.ReserveStockInOrder;
import com.mhd.oms.domain.reserveStockInOrder.repository.po.ReserveStockInOrderPO;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 入库单Mapper接口
*
* @author gen
* @date 2024-05-21
*/
public interface ReserveStockInOrderMapper extends BaseMapper<ReserveStockInOrder>
{
/**
* 查询入库单列表
*/
public List<ReserveStockInOrderPO> queryList(ReserveStockInOrderDO stockInOrderDO);
public MaterialBaseInfoPO getinfo(@Param("id") Long id);
public List<MaterialBaseInfoPO> getMaterialBaseInfoList(@Param("id") String id);
public MaterialWarehouseControlPO getInfoByMaterialBaseInfoIds(@Param("id") Long id);
public MaterialGoodsRulePO getGoodsInfoByMaterialBaseInfoIds(@Param("id") Long id);
List<ReserveStockInOrderPO> queryNoticePrint(ReserveStockInOrderDO stockInOrderDO);
List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO);}
@@ -0,0 +1,97 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.persistence;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveStockInOrder.entity.ReserveStockInOrder;
import com.mhd.oms.domain.reserveStockInOrder.repository.facade.IReserveStockInOrderService;
import com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper;
import com.mhd.oms.domain.reserveStockInOrder.repository.po.ReserveStockInOrderPO;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
/**
* 入库单Service业务层处理
*
* @author gen
* @date 2024-05-21
*/
@Service
public class ReserveStockInOrderImpl extends ServiceImpl<ReserveStockInOrderMapper, ReserveStockInOrder> implements IReserveStockInOrderService {
@Autowired
private ReserveStockInOrderMapper stockInOrderMapper;
/**
* 查询入库单列表
*/
@Override
public List<ReserveStockInOrderPO> queryList(ReserveStockInOrderDO stockInOrderDO)
{
return stockInOrderMapper.queryList(stockInOrderDO);
}
/**
* 新增入库单
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean insert(ReserveStockInOrderDO stockInOrderDO) {
ReserveStockInOrder stockInOrder = new ReserveStockInOrder();
BeanUtils.copyProperties(stockInOrderDO,stockInOrder);
return this.save(stockInOrder);
}
/**
* 修改入库单
*/
@Transactional(rollbackFor = Exception.class)
@Override
public Boolean update(ReserveStockInOrderDO stockInOrderDO) {
ReserveStockInOrder stockInOrder = new ReserveStockInOrder();
BeanUtils.copyProperties(stockInOrderDO,stockInOrder);
return this.updateById(stockInOrder);
}
/**
* 批量删除入库单
*/
@Override
public Boolean delete(Long[] inOrderIds ) {
List<ReserveStockInOrder> list = new ArrayList<>();
for (Long id : inOrderIds) {
ReserveStockInOrder stockInOrder = new ReserveStockInOrder();
stockInOrder.setInOrderId(id);
stockInOrder.setDelFlag(2);
list.add(stockInOrder);
}
return this.updateBatchById(list);
}
/**
* 修改入库单
*/
@Override
public ReserveStockInOrderPO getInfo(Long inOrderId) {
ReserveStockInOrder stockInOrder = this.getById(inOrderId);
ReserveStockInOrderPO stockInOrderPO = new ReserveStockInOrderPO();
BeanUtils.copyProperties(stockInOrder,stockInOrderPO);
return stockInOrderPO;
}
@Override
public List<ReserveStockInOrderPO> queryNoticePrint(ReserveStockInOrderDO stockInOrderDO) {
return stockInOrderMapper.queryNoticePrint(stockInOrderDO);
}
@Override
public List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO) {
return stockInOrderMapper.queryNoticePrintDetail(stockInOrderDO);
}
}
@@ -0,0 +1,116 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ReserveStockInOrderBasePO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主code")
@Excel(name = "货主code")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
}
@@ -0,0 +1,436 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 入库单对象 stock_in_order
*
* @author gen
* @date 2024-05-21
*/
@Data
@ApiModel(value = "入库单对象", description = "入库单响应对象")
public class ReserveStockInOrderPO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("入库单id")
private Long inOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer status;
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer auditStatus;
@ApiModelProperty("入库单审核备注")
@Excel(name = "入库单审核备注")
private String auditRemark;
@ApiModelProperty("入库单审核人")
@Excel(name = "入库单审核人")
private Long auditBy;
@ApiModelProperty("入库单审核人姓名")
@Excel(name = "入库单审核人姓名")
private String auditByName;
@ApiModelProperty("入库单审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库单审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量(原字段)")
@Excel(name = "计划数量(原字段)")
private BigDecimal quantity;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inQuantity;
/**
* 计划入库数量:取入库单明细中的入库数量汇总
*/
@ApiModelProperty("计划入库数量")
@Excel(name = "计划入库数量")
private BigDecimal planInQuantity;
/**
* 收货数量:入库单对应的收货单实际收货数量汇总
*/
@ApiModelProperty("收货数量")
@Excel(name = "收货数量")
private BigDecimal receiptQuantity;
/**
* 上架数量:入库单对应的上架单实际上架数量汇总
*/
@ApiModelProperty("上架数量")
@Excel(name = "上架数量")
private BigDecimal shelvesQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("是否取消订单: 1-是 2-否")
@Excel(name = "是否取消订单: 1-是 2-否")
private Integer cancelOrder;
@ApiModelProperty("取消订单备注")
@Excel(name = "取消订单备注")
private String cancelRemark;
@ApiModelProperty("取消订单人")
@Excel(name = "取消订单人")
private Long cancelBy;
@ApiModelProperty("取消订单人姓名")
@Excel(name = "取消订单人姓名")
private String cancelByName;
@ApiModelProperty("取消订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date cancelTime;
@ApiModelProperty("是否关闭订单: 1-是 2-否")
@Excel(name = "是否关闭订单: 1-是 2-否")
private Integer closeOrder;
@ApiModelProperty("关闭订单备注")
@Excel(name = "关闭订单备注")
private String closeRemark;
@ApiModelProperty("关闭订单人")
@Excel(name = "关闭订单人")
private Long closeBy;
@ApiModelProperty("关闭订单人姓名")
@Excel(name = "关闭订单人姓名")
private String closeByName;
@ApiModelProperty("关闭订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date closeTime;
@ApiModelProperty("入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
@Excel(name = "入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
private Integer orderSource;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("物料明细")
private List<ReserveInMaterialDetailPO> materialDetailList;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
// ========== 报关相关字段 ==========
@ApiModelProperty("To")
@Excel(name = "To")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleInfo;
@ApiModelProperty("委托编号NO")
@Excel(name = "委托编号NO")
private String consignmentNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSignature;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declarationArea;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddress;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
@ApiModelProperty("承运商")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportMethod;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionMethod;
@ApiModelProperty("海关是否查验货物")
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@ApiModelProperty("是否需要报关")
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@ApiModelProperty("是否需要运输")
@Excel(name = "是否需要运输")
private Integer needTransport;
@ApiModelProperty("入仓日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date warehouseDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completionTime;
@ApiModelProperty("下单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date orderDate;
@ApiModelProperty("业务单号")
@Excel(name = "业务单号")
private String businessOrderNo;
@ApiModelProperty("业务类型")
@Excel(name = "业务类型")
private String businessType;
@ApiModelProperty("制单人")
@Excel(name = "制单人")
private String documentCreator;
@ApiModelProperty("制单人名称")
@Excel(name = "制单人名称")
private String documentCreatorName;
@ApiModelProperty("制单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date documentDate;
@ApiModelProperty("订单状态")
@Excel(name = "订单状态")
private String orderStatus;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("业务单对象")
private List<BusinessDocumentOrder> businessDocumentOrderDOList;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("入库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date storageTime;
}
@@ -0,0 +1,111 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ReserveStockInOrderBaseDO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
}
@@ -0,0 +1,110 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ReserveStockInOrderBaseDTO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
/**
* 兼容前端使用 userName 作为货主名称字段:
* 如果请求体中只传了 userName,将在组装器中自动回填到 shipperName。
*/
@ApiModelProperty("货主名称(兼容字段:userName")
private String userName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
}
@@ -0,0 +1,434 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 入库单对象 stock_in_order
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveStockInOrderDO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("入库单id")
private Long inOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer status;
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer auditStatus;
@ApiModelProperty("入库单审核备注")
@Excel(name = "入库单审核备注")
private String auditRemark;
@ApiModelProperty("入库单审核人")
@Excel(name = "入库单审核人")
private Long auditBy;
@ApiModelProperty("入库单审核人姓名")
@Excel(name = "入库单审核人姓名")
private String auditByName;
@ApiModelProperty("入库单审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库单审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("是否取消订单: 1-是 2-否")
@Excel(name = "是否取消订单: 1-是 2-否")
private Integer cancelOrder;
@ApiModelProperty("取消订单备注")
@Excel(name = "取消订单备注")
private String cancelRemark;
@ApiModelProperty("取消订单人")
@Excel(name = "取消订单人")
private Long cancelBy;
@ApiModelProperty("取消订单人姓名")
@Excel(name = "取消订单人姓名")
private String cancelByName;
@ApiModelProperty("取消订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date cancelTime;
@ApiModelProperty("是否关闭订单: 1-是 2-否")
@Excel(name = "是否关闭订单: 1-是 2-否")
private Integer closeOrder;
@ApiModelProperty("关闭订单备注")
@Excel(name = "关闭订单备注")
private String closeRemark;
@ApiModelProperty("关闭订单人")
@Excel(name = "关闭订单人")
private Long closeBy;
@ApiModelProperty("关闭订单人姓名")
@Excel(name = "关闭订单人姓名")
private String closeByName;
@ApiModelProperty("关闭订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date closeTime;
@ApiModelProperty("入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
@Excel(name = "入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
private Integer orderSource;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("入库单id集合")
private List<Long> inOrderIds;
@ApiModelProperty("物料明细")
private List<ReserveInMaterialDetailDO> materialDetailList;
@ApiModelProperty("小于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "小于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer ltStatus;
@ApiModelProperty("大于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "大于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer gtStatus;
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer ltAuditStatus;
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer gtAuditStatus;
@ApiModelProperty("调度单号")
private String mobilizeCode;
// ========== 报关相关字段 ==========
@ApiModelProperty("To")
@Excel(name = "To")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleInfo;
@ApiModelProperty("委托编号NO")
@Excel(name = "委托编号NO")
private String consignmentNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSignature;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declarationArea;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddress;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
@ApiModelProperty("承运商(先做成输入框,待定)")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号(数据字典:20尺/40尺)")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("运输方式(数据字典:公路运输/其他运输)")
@Excel(name = "运输方式")
private String transportMethod;
@ApiModelProperty("监管方式(数据字典:一般贸易)")
@Excel(name = "监管方式")
private String supervisionMethod;
@ApiModelProperty("海关是否查验货物(默认:否)")
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@ApiModelProperty("是否需要报关(默认:是)")
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@ApiModelProperty("是否需要运输(默认:否)")
@Excel(name = "是否需要运输")
private Integer needTransport;
@ApiModelProperty("入仓日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date warehouseDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completionTime;
@ApiModelProperty("下单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date orderDate;
@ApiModelProperty("业务单号")
@Excel(name = "业务单号")
private String businessOrderNo;
@ApiModelProperty("业务类型")
@Excel(name = "业务类型")
private String businessType;
@ApiModelProperty("制单人")
@Excel(name = "制单人")
private String documentCreator;
@ApiModelProperty("制单人名称")
@Excel(name = "制单人名称")
private String documentCreatorName;
@ApiModelProperty("制单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date documentDate;
@ApiModelProperty("订单状态")
@Excel(name = "订单状态")
private String orderStatus;
@ApiModelProperty(name = "创建时间查询条件开始日期")
private String createTimeStart;
@ApiModelProperty(name = "创建时间查询条件结束日期")
private String createTimeEnd;
@ApiModelProperty("入库明细-物料名称(商品名称),模糊匹配")
private String materialName;
@ApiModelProperty("入库明细-物料编码,模糊匹配")
private String materialCode;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("入库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date storageTime;
}
@@ -0,0 +1,432 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
//import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.ReserveInMaterialDetailDTO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 入库单对象 stock_in_order
*
* @author gen
* @date 2024-05-21
*/
@Data
public class ReserveStockInOrderDTO extends ReserveStockInOrderBaseDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("入库单id")
private Long inOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer status;
@ApiModelProperty("入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer auditStatus;
@ApiModelProperty("入库单审核备注")
@Excel(name = "入库单审核备注")
private String auditRemark;
@ApiModelProperty("入库单审核人")
@Excel(name = "入库单审核人")
private Long auditBy;
@ApiModelProperty("入库单审核人姓名")
@Excel(name = "入库单审核人姓名")
private String auditByName;
@ApiModelProperty("入库单审核时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "入库单审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date auditTime;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("入库数量")
@Excel(name = "入库数量")
private BigDecimal inQuantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("是否取消订单: 1-是 2-否")
@Excel(name = "是否取消订单: 1-是 2-否")
private Integer cancelOrder;
@ApiModelProperty("取消订单备注")
@Excel(name = "取消订单备注")
private String cancelRemark;
@ApiModelProperty("取消订单人")
@Excel(name = "取消订单人")
private Long cancelBy;
@ApiModelProperty("取消订单人姓名")
@Excel(name = "取消订单人姓名")
private String cancelByName;
@ApiModelProperty("取消订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date cancelTime;
@ApiModelProperty("是否关闭订单: 1-是 2-否")
@Excel(name = "是否关闭订单: 1-是 2-否")
private Integer closeOrder;
@ApiModelProperty("关闭订单备注")
@Excel(name = "关闭订单备注")
private String closeRemark;
@ApiModelProperty("关闭订单人")
@Excel(name = "关闭订单人")
private Long closeBy;
@ApiModelProperty("关闭订单人姓名")
@Excel(name = "关闭订单人姓名")
private String closeByName;
@ApiModelProperty("关闭订单时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date closeTime;
@ApiModelProperty("入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
@Excel(name = "入库单来源: 1-正常录入 2-通知单生成 3-无单收货")
private Integer orderSource;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("入库单id集合")
private List<Long> inOrderIds;
@ApiModelProperty("物料明细")
private List<ReserveInMaterialDetailDTO> materialDetailList;
@ApiModelProperty("小于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "小于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer ltStatus;
@ApiModelProperty("大于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
@Excel(name = "大于某个入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库")
private Integer gtStatus;
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer ltAuditStatus;
@ApiModelProperty("小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "小于入库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer gtAuditStatus;
// ========== 报关相关字段 ==========
@ApiModelProperty("To")
@Excel(name = "To")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleInfo;
@ApiModelProperty("委托编号NO")
@Excel(name = "委托编号NO")
private String consignmentNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSignature;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declarationArea;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddress;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
@ApiModelProperty("承运商(先做成输入框,待定)")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号(数据字典:20尺/40尺)")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("运输方式(数据字典:公路运输/其他运输)")
@Excel(name = "运输方式")
private String transportMethod;
@ApiModelProperty("监管方式(数据字典:一般贸易)")
@Excel(name = "监管方式")
private String supervisionMethod;
@ApiModelProperty("海关是否查验货物(默认:否)")
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@ApiModelProperty("是否需要报关(默认:是)")
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@ApiModelProperty("是否需要运输(默认:否)")
@Excel(name = "是否需要运输")
private Integer needTransport;
@ApiModelProperty("入仓日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "入仓日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date warehouseDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date completionTime;
@ApiModelProperty("下单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "下单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date orderDate;
@ApiModelProperty("业务单号")
@Excel(name = "业务单号")
private String businessOrderNo;
@ApiModelProperty("业务类型")
@Excel(name = "业务类型")
private String businessType;
@ApiModelProperty("制单人")
@Excel(name = "制单人")
private String documentCreator;
@ApiModelProperty("制单人名称")
@Excel(name = "制单人名称")
private String documentCreatorName;
@ApiModelProperty("制单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date documentDate;
@ApiModelProperty("订单状态")
@Excel(name = "订单状态")
private String orderStatus;
@ApiModelProperty(name = "创建时间查询条件开始日期")
private String createTimeStart;
@ApiModelProperty(name = "创建时间查询条件结束日期")
private String createTimeEnd;
@ApiModelProperty("入库明细-物料名称(商品名称),模糊匹配,与前端参数 materialName 一致")
private String materialName;
@ApiModelProperty("入库明细-物料编码,模糊匹配,与前端参数 materialCode 一致")
private String materialCode;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("入库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date storageTime;
}
@@ -0,0 +1,211 @@
package com.mhd.oms.domain.reserveStockInOrder.repository.todo;
import com.mhd.common.core.annotation.Excel;
import lombok.Data;
import java.math.BigDecimal;
/**
* 入库单导入行DTO一个Excel行=一个明细行表头字段可重复
*
* 约定委托编号NO作为同一张入库单的分组键同一个委托编号可导入多条物料明细
*/
@Data
public class ReserveStockInOrderImportRowDTO {
// ====== 分组/表头基础字段建议在Excel中每行重复填写 ======
// @Excel(name = "仓库ID")
// private Long warehouseId;
// @Excel(name = "货主ID")
// private Long shipperId;
@Excel(name = "货主编号")
private String shipperCode;
// @Excel(name = "供应商ID")
// private Long supplierId;
// @Excel(name = "入库单据类型")
// private String orderTypeCode;
@Excel(name = "委托编号NO")
private String consignmentNo;
// ====== 表头报关字段与页面一致 ======
@Excel(name = "To")
private String to;
@Excel(name = "联系人")
private String contactPerson;
@Excel(name = "车型及车牌")
private String vehicleInfo;
@Excel(name = "Tel")
private String tel;
@Excel(name = "司机签名")
private String driverSignature;
@Excel(name = "Fax")
private String fax;
@Excel(name = "申报地关区")
private String declarationArea;
@Excel(name = "生产商")
private String manufacturer;
@Excel(name = "报关员姓名及联系方式")
private String customsBrokerInfo;
@Excel(name = "送货地址")
private String deliveryAddress;
@Excel(name = "进出境关别")
private String entryExitCustoms;
@Excel(name = "起运/运抵国(地区)")
private String originDestinationCountry;
// 客户名称只在表头中明细行不需要此字段代码会从表头读取并应用到此字段
@Excel(name = "客户名称")
private String shipperName;
@Excel(name = "承运商")
private String carrier;
@Excel(name = "柜号")
private String containerNo;
@Excel(name = "运输方式")
private String transportMethod;
@Excel(name = "监管方式")
private String supervisionMethod;
@Excel(name = "海关是否查验货物")
private Integer customsInspection;
@Excel(name = "是否需要报关")
private Integer needCustomsDeclaration;
@Excel(name = "是否需要运输")
private Integer needTransport;
@Excel(name = "入仓日期")
private String warehouseDate; // 导入先按字符串后端可根据需要转Date当前入库单服务未强制使用
@Excel(name = "完成时间")
private String completionTime;
@Excel(name = "下单日期")
private String orderDate;
@Excel(name = "备注")
private String remark;
// ====== 明细字段一个Excel行=一个明细 ======
@Excel(name = "序号")
private Integer serialNumber;
@Excel(name = "商品名称")
private String materialName;
@Excel(name = "料号")
private String materialCode;
// @Excel(name = "物料基础信息ID")
// private Long materialBaseInfoId;
// 模板中没有此字段注释掉
// @Excel(name = "计划数量")
private BigDecimal quantity;
@Excel(name = "仓库数量")
private BigDecimal warehouseQuantity;
// 支持"入库数量"列名"仓库数量"映射到同一个字段
@Excel(name = "入库数量")
private BigDecimal inboundQuantity;
@Excel(name = "规格型号/ITEM")
private String specificationModel;
@Excel(name = "商品SKU码")
private String skuCode;
@Excel(name = "Invoice No.")
private String invoiceNo;
@Excel(name = "申报数量")
private BigDecimal declaredQuantity;
@Excel(name = "申报单位")
private String declarationUnit;
@Excel(name = "")
private BigDecimal liter;
@Excel(name = "箱数")
private BigDecimal boxCount;
@Excel(name = "件数")
private BigDecimal pieceCount;
@Excel(name = "尺寸")
private String dimensions;
// @Excel(name = "出库数量")
private BigDecimal outboundQuantity;
@Excel(name = "单位")
private String unit;
// 支持多种列名格式处理换行符空格括号等
@Excel(name = "总净重(KG)")
private BigDecimal totalNetWeight;
@Excel(name = "总净重\n(KG)")
private BigDecimal totalNetWeight2;
@Excel(name = "总毛重(KG)")
private BigDecimal totalGrossWeight;
@Excel(name = "总毛重 (KG)")
private BigDecimal totalGrossWeight2;
@Excel(name = "总体积(CBM)")
private BigDecimal totalVolume;
@Excel(name = "总体积\n(CBM)")
private BigDecimal totalVolume2;
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea;
@Excel(name = "总面积(SQM)")
private BigDecimal totalArea2;
@Excel(name = "Batch Ref NO's")
private String batchRefNo;
@Excel(name = "Sheet Ref NO's")
private String sheetRefNo;
@Excel(name = "原产国")
private String originCountry;
@Excel(name = "箱号/卡板号")
private String boxPalletNo;
@Excel(name = "总价")
private BigDecimal totalPrice;
@Excel(name = "币制")
private String currency;
@Excel(name = "备注")
private String detailRemark;
}
@@ -0,0 +1,134 @@
package com.mhd.oms.domain.reserveStockInOrder.service;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDTO;
import com.mhd.system.api.model.LoginUser;
import org.springframework.stereotype.Component;
import org.springframework.util.CollectionUtils;
import java.math.BigDecimal;
import java.util.Date;
/**
* 入库单Assembler
*
* @author gen
* @date 2024-05-21
*/
@Component
public class ReserveStockInOrderAssembler {
/**
* 转换实体
*/
public ReserveStockInOrderDO toDO(ReserveStockInOrderDTO stockInOrderDTO) {
ReserveStockInOrderDO stockInOrderDO = new ReserveStockInOrderDO();
// 拷贝
BeanUtils.copyProperties(stockInOrderDTO, stockInOrderDO, IgnoreNullUtil.getNullPropertyNames(stockInOrderDTO));
// 确保查询条件字段被正确传递查询条件字段需要明确传递避免被IgnoreNullUtil忽略
stockInOrderDO.setCreateTimeStart(stockInOrderDTO.getCreateTimeStart());
stockInOrderDO.setCreateTimeEnd(stockInOrderDTO.getCreateTimeEnd());
// 列表筛选前端常传名称 (编码)展示串库内多为纯名称去掉末尾括号段再 LIKE
if (stockInOrderDTO.getMaterialName() != null && !stockInOrderDTO.getMaterialName().isEmpty()) {
String normalized = normalizeDetailMaterialNameForQuery(stockInOrderDTO.getMaterialName());
stockInOrderDO.setMaterialName(normalized.isEmpty()
? stockInOrderDTO.getMaterialName().trim()
: normalized);
}
return stockInOrderDO;
}
/**
* 转换实体
*/
public ReserveStockInOrderDO toDOByEdit(ReserveStockInOrderDTO stockInOrderDTO) {
// 兼容前端传 userName 作为货主名称字段的情况
// 如果 shipperName 为空但 userName 有值则优先回填到 shipperName
// 以保证后续 shipperParam 能根据名称正确找到货主ID
if (ObjectUtil.isNull(stockInOrderDTO.getShipperId())
&& (stockInOrderDTO.getShipperName() == null || stockInOrderDTO.getShipperName().trim().length() == 0)
&& stockInOrderDTO.getUserName() != null && stockInOrderDTO.getUserName().trim().length() > 0) {
stockInOrderDTO.setShipperName(stockInOrderDTO.getUserName().trim());
}
ReserveStockInOrderDO stockInOrderDO = JSONUtil.toBean(JSONUtil.toJsonStr(stockInOrderDTO), ReserveStockInOrderDO.class);
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
// 获取登录人id
Long userId = loginUser.getUserid();
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
String userRealName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
&& !loginUser.getUserPo().getUserName().trim().isEmpty()) {
// 优先使用UserPo中的userName用户真实姓名
userRealName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null && !loginUser.getRealname().trim().isEmpty()) {
// 其次使用realname
userRealName = loginUser.getRealname();
} else {
// 最后使用username账号作为兜底
userRealName = loginUser.getUsername();
}
if(stockInOrderDTO.getInOrderId() != null){
stockInOrderDO.setUpdateBy(userId);
stockInOrderDO.setUpdateByName(userRealName);
stockInOrderDO.setUpdateTime(new Date());
}else {
stockInOrderDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
stockInOrderDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
stockInOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
stockInOrderDO.setCreateBy(userId);
// 强制设置创建人姓名为用户真实姓名确保覆盖前端可能传递的账号
stockInOrderDO.setCreateByName(userRealName);
stockInOrderDO.setCreateTime(new Date());
stockInOrderDO.setDelFlag(1);
// 新增入库单时如果入库单类型为空默认设置为普通入库
String orderTypeCode = stockInOrderDO.getOrderTypeCode();
if (orderTypeCode == null || orderTypeCode.trim().length() == 0) {
stockInOrderDO.setOrderTypeCode("pu_tong_ru_ku");
}
String orderTypeName = stockInOrderDO.getOrderTypeName();
if (orderTypeName == null || orderTypeName.trim().length() == 0) {
stockInOrderDO.setOrderTypeName("普通入库单");
}
// 新增入库单时计划数量取所有明细行的入库数量之和
if (!CollectionUtils.isEmpty(stockInOrderDO.getMaterialDetailList())) {
BigDecimal totalInboundQuantity = stockInOrderDO.getMaterialDetailList().stream()
.map(detail -> detail.getInboundQuantity() != null ? detail.getInboundQuantity() : BigDecimal.ZERO)
.reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderDO.setQuantity(totalInboundQuantity);
}
}
return stockInOrderDO;
}
/**
* 去掉物料展示名末尾的 (xxx) / xxx便于与库内 material_name 模糊匹配
*/
private static String normalizeDetailMaterialNameForQuery(String raw) {
if (raw == null) {
return null;
}
String s = raw.trim();
// 循环去掉末尾多组括号兼容名称 (编码)或重复后缀
String next;
do {
next = s.replaceFirst("[\\s\\u3000]*[(][^)]*[)]\\s*$", "").trim();
if (next.equals(s)) {
break;
}
s = next;
} while (!s.isEmpty());
return s;
}
}
@@ -0,0 +1,934 @@
package com.mhd.oms.domain.reserveStockInOrder.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.OrderSequence;
import com.mhd.common.core.utils.StringUtils;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.businessDocumentOrder.entity.BusinessDocumentOrder;
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
import com.mhd.oms.domain.reservationInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialGoodsRulePO;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialWarehouseControlPO;
import com.mhd.oms.domain.reserveInMaterialDetail.entity.ReserveInMaterialDetail;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.facade.IReserveInMaterialDetailService;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailBaseDO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import com.mhd.oms.domain.reserveStockInOrder.entity.ReserveStockInOrder;
import com.mhd.oms.domain.reserveStockInOrder.repository.facade.IReserveStockInOrderService;
import com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper;
import com.mhd.oms.domain.reserveStockInOrder.repository.po.ReserveStockInOrderPO;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO;
import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder;
import com.mhd.oms.domain.reserveStockOutOrder.repository.facade.IReserveStockOutOrderService;
import com.mhd.system.api.SystemServiceFeign;
import com.mhd.system.api.WmsServiceFeign;
import com.mhd.system.api.domain.*;
import com.mhd.system.api.model.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 入库单
*
* @author gen
* @date 2024-05-21
*/
@Service
@Slf4j
public class ReserveStockInOrderDomainService {
@Autowired
private IReserveStockInOrderService stockInOrderService;
@Autowired
private IReserveInMaterialDetailService materialDetailService;
@Autowired
private IReserveStockOutOrderService stockOutOrderService;
// @Autowired
// private ReserveStockReceiptOrderDomainService stockReceiptOrderDomainService;
// @Autowired
// private ReserveStockShelfOrderDomainService stockShelfOrderDomainService;
// @Autowired
// private IMaterialBaseInfoService materialBaseInfoService;
// @Autowired
// private IMaterialGoodsRuleService materialGoodsRuleService;
// @Autowired
// private IMaterialWarehouseControlService materialWarehouseControlService;
@Autowired
private SystemServiceFeign systemServiceFeign;
@Autowired
private WmsServiceFeign wmsServiceFeign;
@Autowired
private ReserveStockInOrderMapper reservationStockInOrderMapper;
@Autowired
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
// @Autowired
// private IReceiptMaterialDetailService receiptMaterialDetailService;
// @Autowired
// private IShelfMaterialDetailService shelfMaterialDetailService;
/**
* 分页查询入库单列表
*/
public List<ReserveStockInOrderPO> queryList(ReserveStockInOrderDO stockInOrderDO) {
return stockInOrderService.queryList(stockInOrderDO);
}
/**
* 新增入库单
*/
@Transactional(rollbackFor = Exception.class)
public Boolean insert(ReserveStockInOrderDO stockInOrderDO) {
if (stockInOrderDO.getInOrderNumber() == null) {
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
}
// //设置默认值
// setDefaultValues(stockInOrderDO);
// //设置物料信息
// setMaterialDetailInfo(stockInOrderDO);
// //统计总物料种数
// stockInOrderDO.setMaterialQuantity(stockInOrderDO.getMaterialDetailList().size());
// //统计总计划数
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderDO.setQuantity(quantity);
// //统计总重量
// BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
// stockInOrderDO.setWeightLimit(weightLimit);
// //统计总体积
// BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
// stockInOrderDO.setVolumeLimit(volumeLimit);
stockInOrderService.insert(stockInOrderDO);
return materialDetailService.batchInsert(stockInOrderDO.getInOrderNumber(), stockInOrderDO.getMaterialDetailList());
}
/**
* 批量新增入库单
*/
public Boolean batchInsert(List<ReserveStockInOrderDO> stockInOrderDOList) {
for (ReserveStockInOrderDO stockInOrderDO : stockInOrderDOList){
if (StringUtils.isBlank(stockInOrderDO.getInOrderNumber())){
stockInOrderDO.setInOrderNumber(OrderSequence.getOrderCode("RK"));
}
// //设置物料信息
// setMaterialDetailInfo(stockInOrderDO);
// //统计总物料种数
// stockInOrderDO.setMaterialQuantity(stockInOrderDO.getMaterialDetailList().size());
// //统计总计划数
// BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
// stockInOrderDO.setQuantity(quantity);
// //统计总重量
// BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
// stockInOrderDO.setWeightLimit(weightLimit);
// //统计总体积
// BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
// stockInOrderDO.setVolumeLimit(volumeLimit);
stockInOrderService.insert(stockInOrderDO);
materialDetailService.batchInsert(stockInOrderDO.getInOrderNumber(), stockInOrderDO.getMaterialDetailList());
}
return true;
}
/**
* 修改入库单
*/
@Transactional(rollbackFor = Exception.class)
public Boolean update(ReserveStockInOrderDO stockInOrderDO) {
ReserveStockInOrderPO stockInOrderPO = stockInOrderService.getInfo(stockInOrderDO.getInOrderId());
if (stockInOrderPO == null){
throw new ServiceException("入库单信息不存在");
}
//设置物料信息
setMaterialDetailInfo(stockInOrderDO);
//统计总物料种数
stockInOrderDO.setMaterialQuantity(stockInOrderDO.getMaterialDetailList().size());
//统计总计划数
BigDecimal quantity = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderPO.setQuantity(quantity);
stockInOrderDO.setQuantity(quantity);
//统计总重量
BigDecimal weightLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderDO.setWeightLimit(weightLimit);
//统计总体积
BigDecimal volumeLimit = stockInOrderDO.getMaterialDetailList().stream().map(ReserveInMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockInOrderDO.setVolumeLimit(volumeLimit);
stockInOrderService.update(stockInOrderDO);
ReserveInMaterialDetailBaseDO inMaterialDetailBaseDO = new ReserveInMaterialDetailBaseDO();
BeanUtils.copyProperties(stockInOrderPO, inMaterialDetailBaseDO);
inMaterialDetailBaseDO.setInOrderNumber(stockInOrderPO.getInOrderNumber());
// if (stockInOrderDO.getNeedTransport() ==0) {
// List<BusinessDocumentOrder> businessDocumentOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>().eq(BusinessDocumentOrder::getInOrderNumber, stockInOrderDO.getInOrderNumber()).notIn(BusinessDocumentOrder::getOrderStatus, 4, 5));
// if (businessDocumentOrders != null && businessDocumentOrders.size() > 0) {
// for (BusinessDocumentOrder businessDocumentOrder : businessDocumentOrders) {
// businessDocumentOrder.setOrderStatus(4L);
// String executeOrderNumber = businessDocumentOrder.getExecuteOrderNumber();
//
// if (executeOrderNumber !=null){
// throw new ServiceException("该业务单已生成执行单,取消失败");
// }
// businessDocumentOrderMapper.updateById(businessDocumentOrder);
// }
// }
// }
//
return materialDetailService.batchUpdate(stockInOrderDO.getMaterialDetailList(), inMaterialDetailBaseDO);
}
/**
* 批量删除入库单
*/
public Boolean delete(Long[] inOrderIds) {
return stockInOrderService.delete(inOrderIds);
}
/**
* 获取入库单详细信息
*/
public ReserveStockInOrderPO getInfo(Long inOrderId)
{
ReserveStockInOrderPO stockInOrderPO = stockInOrderService.getInfo(inOrderId);
ReserveInMaterialDetailDO inMaterialDetailDO = new ReserveInMaterialDetailDO();
String inOrderNumber = stockInOrderPO.getInOrderNumber();
List<BusinessDocumentOrder> businessDocumentOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>().eq(BusinessDocumentOrder::getInOrderNumber, inOrderNumber).notIn(BusinessDocumentOrder::getOrderStatus,4,5));
stockInOrderPO.setBusinessDocumentOrderDOList(businessDocumentOrders);
inMaterialDetailDO.setInOrderNumber(inOrderNumber);
inMaterialDetailDO.setLevel(1);
List<ReserveInMaterialDetailPO> inMaterialDetailPOList = materialDetailService.queryList(inMaterialDetailDO);
// 先通过入库单号查询收货单列表
// StockReceiptOrderDO stockReceiptOrderDO = new StockReceiptOrderDO();
// stockReceiptOrderDO.setInOrderNumber(stockInOrderPO.getInOrderNumber());
// List<StockReceiptOrderPO> stockReceiptOrderPOList = stockReceiptOrderDomainService.queryList(stockReceiptOrderDO);
//
// // 先通过入库单号查询上架单列表
// StockShelfOrderDO stockShelfOrderDO = new StockShelfOrderDO();
// stockShelfOrderDO.setInOrderNumber(stockInOrderPO.getInOrderNumber());
// List<StockShelfOrderPO> stockShelfOrderPOList = stockShelfOrderDomainService.queryList(stockShelfOrderDO);
//
// 查询收货单明细用于填充收货数量和更新毛重净重面积体积
// List<ReceiptMaterialDetailPO> receiptMaterialDetailPOList = new ArrayList<>();
// if (!CollectionUtils.isEmpty(stockReceiptOrderPOList)) {
// List<String> receiptOrderNumberList = stockReceiptOrderPOList.stream()
// .map(StockReceiptOrderPO::getReceiptOrderNumber)
// .filter(StringUtils::isNotBlank)
// .collect(Collectors.toList());
// if (!CollectionUtils.isEmpty(receiptOrderNumberList)) {
// ReceiptMaterialDetailDO receiptMaterialDetailDO = new ReceiptMaterialDetailDO();
// receiptMaterialDetailDO.setReceiptOrderNumberList(receiptOrderNumberList);
// receiptMaterialDetailPOList = receiptMaterialDetailService.queryList(receiptMaterialDetailDO);
// }
// }
// 查询上架单明细用于填充上架数量
// List<ShelfMaterialDetailPO> shelfMaterialDetailPOList = new ArrayList<>();
// if (!CollectionUtils.isEmpty(stockShelfOrderPOList)) {
// for (StockShelfOrderPO stockShelfOrderPO : stockShelfOrderPOList) {
// if (StringUtils.isNotBlank(stockShelfOrderPO.getShelfOrderNumber())) {
// ShelfMaterialDetailDO shelfMaterialDetailDO = new ShelfMaterialDetailDO();
// shelfMaterialDetailDO.setShelfOrderNumber(stockShelfOrderPO.getShelfOrderNumber());
// List<ShelfMaterialDetailPO> shelfDetails = shelfMaterialDetailService.queryList(shelfMaterialDetailDO);
// if (!CollectionUtils.isEmpty(shelfDetails)) {
// shelfMaterialDetailPOList.addAll(shelfDetails);
// }
// }
// }
// }
// materialDetailId 分组汇总收货数量和上架数量以及更新毛重净重面积体积
if (!CollectionUtils.isEmpty(inMaterialDetailPOList)) {
// materialDetailId 分组汇总收货数量实际收货数量毛重净重面积体积
// 收货数量入库单对应的收货单实际收货数量汇总
// Map<Long, ReceiptMaterialDetailPO> receiptDetailMap = new HashMap<>();
// if (!CollectionUtils.isEmpty(receiptMaterialDetailPOList)) {
// // 递归处理所有层级的收货单明细包括子明细
// for (ReceiptMaterialDetailPO receiptDetail : receiptMaterialDetailPOList) {
// processReceiptDetail(receiptDetail, receiptDetailMap);
// }
// }
// materialDetailId 分组汇总上架数量实际上架数量
// 上架数量入库单对应的上架单实际上架数量汇总
// Map<Long, BigDecimal> shelfQuantityMap = new HashMap<>();
// if (!CollectionUtils.isEmpty(shelfMaterialDetailPOList)) {
// for (ShelfMaterialDetailPO shelfDetail : shelfMaterialDetailPOList) {
// if (shelfDetail.getMaterialDetailId() != null && shelfDetail.getShelvesQuantity() != null) {
// Long materialDetailId = shelfDetail.getMaterialDetailId();
// BigDecimal shelvesQuantity = shelfQuantityMap.getOrDefault(materialDetailId, BigDecimal.ZERO);
// shelfQuantityMap.put(materialDetailId, shelvesQuantity.add(shelfDetail.getShelvesQuantity()));
// }
// }
// }
// 填充入库单明细的收货数量上架数量入库单明细 total* 保持计划值不因收货覆盖原按收货汇总 total* 已注释保留
for (ReserveInMaterialDetailPO inMaterialDetail : inMaterialDetailPOList) {
Long materialDetailId = inMaterialDetail.getMaterialDetailId();
if (materialDetailId != null) {
Long materialBaseInfoId = inMaterialDetail.getMaterialBaseInfoId();
List<InventoryAdjustmentRecordPO> inventoryAdjustmentRecordPOS = materialDetailService.getkctzjl(materialBaseInfoId, inOrderNumber, "入库");
if (inventoryAdjustmentRecordPOS != null && inventoryAdjustmentRecordPOS.size()>0) {
InventoryAdjustmentRecordPO inventoryAdjustmentRecordPO = inventoryAdjustmentRecordPOS.get(0);
inMaterialDetail.setAllocationBeforeQuantity(inventoryAdjustmentRecordPO.getAllocationBeforeQuantity());
inMaterialDetail.setAllocationAfterQuantity(inventoryAdjustmentRecordPO.getAllocationAfterQuantity());
inMaterialDetail.setFreezeAfterQuantity(inventoryAdjustmentRecordPO.getFreezeAfterQuantity());
inMaterialDetail.setFreezeBeforeQuantity(inventoryAdjustmentRecordPO.getFreezeBeforeQuantity());
inMaterialDetail.setInventoryAfterQuantity(inventoryAdjustmentRecordPO.getInventoryAfterQuantity());
inMaterialDetail.setInventoryBeforeQuantity(inventoryAdjustmentRecordPO.getInventoryBeforeQuantity());
inMaterialDetail.setNetWeight(inventoryAdjustmentRecordPO.getNetWeight());
inMaterialDetail.setGrossWeight(inventoryAdjustmentRecordPO.getGrossWeight());
inMaterialDetail.setVolume(inventoryAdjustmentRecordPO.getVolume());
inMaterialDetail.setArea(inventoryAdjustmentRecordPO.getArea());
inMaterialDetail.setAdjustedNetWeight(inventoryAdjustmentRecordPO.getAdjustedNetWeight());
inMaterialDetail.setAdjustedGrossWeight(inventoryAdjustmentRecordPO.getAdjustedGrossWeight());
inMaterialDetail.setAdjustedVolume(inventoryAdjustmentRecordPO.getAdjustedVolume());
inMaterialDetail.setAdjustedArea(inventoryAdjustmentRecordPO.getAdjustedArea());
}
// 填充收货数量入库单对应的收货单实际收货数量
//ReceiptMaterialDetailPO receiptDetail = receiptDetailMap.get(materialDetailId);
// if (receiptDetail != null) {
// 更新收货数量
// if (receiptDetail.getReceiptQuantity() != null) {
// inMaterialDetail.setReceiptQuantity(receiptDetail.getReceiptQuantity());
// }
// 更新毛重净重面积体积根据收货时所填的明细行数据更新到入库单明细中
// 将收货单明细中填写的数据汇总后更新到入库单明细
// if (receiptDetail.getTotalGrossWeight() != null) {
// inMaterialDetail.setTotalGrossWeight(receiptDetail.getTotalGrossWeight());
// }
// if (receiptDetail.getTotalNetWeight() != null) {
// inMaterialDetail.setTotalNetWeight(receiptDetail.getTotalNetWeight());
// }
// if (receiptDetail.getTotalArea() != null) {
// inMaterialDetail.setTotalArea(receiptDetail.getTotalArea());
// }
// if (receiptDetail.getTotalVolume() != null) {
// inMaterialDetail.setTotalVolume(receiptDetail.getTotalVolume());
// }
// }
// 填充上架数量入库单对应的上架单实际上架数量
// BigDecimal shelvesQuantity = shelfQuantityMap.get(materialDetailId);
// if (shelvesQuantity != null) {
// inMaterialDetail.setShelvesQuantity(shelvesQuantity);
// }
}
}
}
stockInOrderPO.setMaterialDetailList(inMaterialDetailPOList);
return stockInOrderPO;
}
/**
* 递归处理收货单明细汇总收货数量毛重/净重/面积/体积汇总已注释入库单明细 total* 不因收货覆盖
* @param receiptDetail 收货单明细
* @param receiptDetailMap 收货单明细汇总Map
*/
// private void processReceiptDetail(ReceiptMaterialDetailPO receiptDetail, Map<Long, ReceiptMaterialDetailPO> receiptDetailMap) {
// if (receiptDetail == null || receiptDetail.getMaterialDetailId() == null) {
// return;
// }
//
// Long materialDetailId = receiptDetail.getMaterialDetailId();
// ReceiptMaterialDetailPO existing = receiptDetailMap.get(materialDetailId);
//
// if (existing == null) {
// // 如果不存在直接放入Map
// receiptDetailMap.put(materialDetailId, receiptDetail);
// } else {
// // 如果已存在汇总收货数量毛重净重面积体积
// // 汇总收货数量实际收货数量
// BigDecimal receiptQuantity = existing.getReceiptQuantity() != null ? existing.getReceiptQuantity() : BigDecimal.ZERO;
// BigDecimal newReceiptQuantity = receiptDetail.getReceiptQuantity() != null ? receiptDetail.getReceiptQuantity() : BigDecimal.ZERO;
// existing.setReceiptQuantity(receiptQuantity.add(newReceiptQuantity));
//
// // 汇总毛重净重面积体积根据收货时填写的数据 入库单明细 total* 不因收货覆盖已注释保留
// // 累加所有收货单明细的毛重净重面积体积
//// BigDecimal existingGrossWeight = existing.getTotalGrossWeight() != null ? existing.getTotalGrossWeight() : BigDecimal.ZERO;
//// BigDecimal newGrossWeight = receiptDetail.getTotalGrossWeight() != null ? receiptDetail.getTotalGrossWeight() : BigDecimal.ZERO;
//// existing.setTotalGrossWeight(existingGrossWeight.add(newGrossWeight));
////
//// BigDecimal existingNetWeight = existing.getTotalNetWeight() != null ? existing.getTotalNetWeight() : BigDecimal.ZERO;
//// BigDecimal newNetWeight = receiptDetail.getTotalNetWeight() != null ? receiptDetail.getTotalNetWeight() : BigDecimal.ZERO;
//// existing.setTotalNetWeight(existingNetWeight.add(newNetWeight));
////
//// BigDecimal existingArea = existing.getTotalArea() != null ? existing.getTotalArea() : BigDecimal.ZERO;
//// BigDecimal newArea = receiptDetail.getTotalArea() != null ? receiptDetail.getTotalArea() : BigDecimal.ZERO;
//// existing.setTotalArea(existingArea.add(newArea));
////
//// BigDecimal existingVolume = existing.getTotalVolume() != null ? existing.getTotalVolume() : BigDecimal.ZERO;
//// BigDecimal newVolume = receiptDetail.getTotalVolume() != null ? receiptDetail.getTotalVolume() : BigDecimal.ZERO;
//// existing.setTotalVolume(existingVolume.add(newVolume));
// }
//
// // 递归处理子明细
// if (!CollectionUtils.isEmpty(receiptDetail.getChildren())) {
// for (ReceiptMaterialDetailPO child : receiptDetail.getChildren()) {
// processReceiptDetail(child, receiptDetailMap);
// }
// }
// }
/**
* @description 审核入库单
* @author ZhouGY
* @date 2024/5/21 13:53
* @param stockInOrderDO
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
public Boolean auditState(ReserveStockInOrderDO stockInOrderDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Integer auditStatus = stockInOrderDO.getIssueStatus();
Integer issueStatus = 0;
issueStatus = auditStatus == 2 ? 2 : 3;
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
return stockInOrderService.update(null, new UpdateWrapper<ReserveStockInOrder>().lambda()
.set(ReserveStockInOrder::getReservationAuditId, loginUser.getUserid())
.set(ReserveStockInOrder::getReservationAuditName, userRealName)
.set(ReserveStockInOrder::getReservationAuditTime, new Date())
.set(ReserveStockInOrder::getUpdateBy, loginUser.getUserid())
.set(ReserveStockInOrder::getUpdateByName, userRealName)
.set(ReserveStockInOrder::getUpdateTime, new Date())
.set(ReserveStockInOrder::getIssueStatus, issueStatus)
.in(ReserveStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
}
/**
* @description 审核入库单
* @author ZhouGY
* @date 2024/5/21 13:53
* @param stockInOrderDO
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
public Boolean issueOrder(ReserveStockInOrderDO stockInOrderDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
boolean update = stockInOrderService.update(null, new UpdateWrapper<ReserveStockInOrder>().lambda()
.set(ReserveStockInOrder::getIssueId, loginUser.getUserid())
.set(ReserveStockInOrder::getIssueName, userRealName)
.set(ReserveStockInOrder::getIssueTime, new Date())
//.set(ReserveStockInOrder::getIssueStatus, 1)
.set(ReserveStockInOrder::getUpdateBy, loginUser.getUserid())
.set(ReserveStockInOrder::getUpdateByName, userRealName)
.set(ReserveStockInOrder::getUpdateTime, new Date())
.in(ReserveStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
//todo下发推送到wms
List<Long> inOrderIds = stockInOrderDO.getInOrderIds();
for (Long inOrderId : inOrderIds) {
ReserveStockInOrder byId = stockInOrderService.getById(inOrderId);
StockInOrder stockInOrder = new StockInOrder();
BeanUtils.copyProperties(byId, stockInOrder,"inOrderId");
stockInOrder.setOmsStockInOrderId(String.valueOf(byId.getInOrderId()));
wmsServiceFeign.omsInOrderAdd(stockInOrder);
String inOrderNumber = stockInOrder.getInOrderNumber();
List<ReserveInMaterialDetail> materialDetailList = materialDetailService.list(new QueryWrapper<ReserveInMaterialDetail>().lambda().eq(ReserveInMaterialDetail::getInOrderNumber, inOrderNumber));
List<InMaterialDetail> inMaterialDetailList = new ArrayList<>();
for (ReserveInMaterialDetail reservationInMaterialDetail : materialDetailList) {
InMaterialDetail inMaterialDetail = new InMaterialDetail();
BeanUtils.copyProperties(reservationInMaterialDetail, inMaterialDetail,"materialDetailId");
inMaterialDetail.setOmsInMaterialDetail(String.valueOf(reservationInMaterialDetail.getMaterialDetailId()));
inMaterialDetailList.add(inMaterialDetail);
}
wmsServiceFeign.omsInOrderAddDetail(inMaterialDetailList);
}
return update;
}
/**
* @description 入库单返回结果
* @author ZhouGY
* @date 2024/5/21 13:53
* @param orderId
* @param status
* @param type
* @return Boolean
*/
public Boolean returnResult(String orderNumber, Long status, String type) {
LoginUser loginUser = SecurityUtils.getLoginUser();
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
if (type != null && type.equals("1")) {
return stockOutOrderService.update(null, new UpdateWrapper<ReserveStockOutOrder>().lambda()
.set(ReserveStockOutOrder::getStatus, status)
.set(ReserveStockOutOrder::getUpdateBy, loginUser.getUserid())
.set(ReserveStockOutOrder::getUpdateByName, userRealName)
.set(ReserveStockOutOrder::getUpdateTime, new Date())
.in(ReserveStockOutOrder::getOutOrderNumber, orderNumber));
} else {
return stockInOrderService.update(null, new UpdateWrapper<ReserveStockInOrder>().lambda()
.set(ReserveStockInOrder::getStatus, status)
.set(ReserveStockInOrder::getUpdateBy, loginUser.getUserid())
.set(ReserveStockInOrder::getUpdateByName, userRealName)
.set(ReserveStockInOrder::getUpdateTime, new Date())
.in(ReserveStockInOrder::getInOrderNumber, orderNumber));
}
}
/**
* @description 取消入库单
* @author ZhouGY
* @date 2024/5/21 13:53
* @param stockInOrderDO
* @return Boolean
*/
public Boolean cancelOrder(ReserveStockInOrderDO stockInOrderDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
return stockInOrderService.update(null, new UpdateWrapper<ReserveStockInOrder>().lambda()
.set(ReserveStockInOrder::getCancelOrder, 2)
.set(ReserveStockInOrder::getCancelRemark, stockInOrderDO.getCancelRemark())
.set(ReserveStockInOrder::getCancelBy, loginUser.getUserid())
.set(ReserveStockInOrder::getCancelByName, loginUser.getUsername())
.set(ReserveStockInOrder::getCancelTime, new Date())
.set(ReserveStockInOrder::getUpdateBy, loginUser.getUserid())
.set(ReserveStockInOrder::getUpdateByName, loginUser.getUsername())
.set(ReserveStockInOrder::getUpdateTime, new Date())
.in(ReserveStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
}
/**
* @description 关闭入库单
* @author ZhouGY
* @date 2024/5/21 13:53
* @param stockInOrderDO
* @return Boolean
*/
public Boolean closeOrder(ReserveStockInOrderDO stockInOrderDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
return stockInOrderService.update(null, new UpdateWrapper<ReserveStockInOrder>().lambda()
.set(ReserveStockInOrder::getCloseOrder, 1)
.set(ReserveStockInOrder::getStatus, 7)
.set(ReserveStockInOrder::getCloseRemark, stockInOrderDO.getCloseRemark())
.set(ReserveStockInOrder::getCloseBy, loginUser.getUserid())
.set(ReserveStockInOrder::getCloseByName, loginUser.getUsername())
.set(ReserveStockInOrder::getCloseTime, new Date())
.set(ReserveStockInOrder::getUpdateBy, loginUser.getUserid())
.set(ReserveStockInOrder::getUpdateByName, loginUser.getUsername())
.set(ReserveStockInOrder::getUpdateTime, new Date())
.in(ReserveStockInOrder::getInOrderId, stockInOrderDO.getInOrderIds()));
}
public Boolean pushInOrder(StockInOrderTZPD stockInOrder) {
ReserveStockInOrder reservationStockInOrder = new ReserveStockInOrder();
BeanUtils.copyProperties(stockInOrder, reservationStockInOrder);
reservationStockInOrder.setIssueStatus(4);
return stockInOrderService.save(reservationStockInOrder);
}
public Boolean pushInOrderDetail(InMaterialDetailTZPD inMaterialDetail) {
ReserveInMaterialDetail reservationInMaterialDetail = new ReserveInMaterialDetail();
BeanUtils.copyProperties(inMaterialDetail, reservationInMaterialDetail);
return materialDetailService.save(reservationInMaterialDetail);
}
/**
* @description 审核通过生成收货单
* @author ZhouGY
* @date 2024/5/22 14:48
* @param stockInOrderDO
* @return Boolean
*/
// public Boolean auditApprove(ReserveStockInOrderDO stockInOrderDO){
// ReserveStockInOrderDO stockInOrderDOByQuery = new ReserveStockInOrderDO();
// stockInOrderDOByQuery.setInOrderIds(stockInOrderDO.getInOrderIds());
// stockInOrderDOByQuery.setLtAuditStatus(3);
// List<ReserveStockInOrderPO> stockInOrderPOList = stockInOrderService.queryList(stockInOrderDOByQuery);
// if (CollectionUtils.isEmpty(stockInOrderPOList)){
// throw new ServiceException("出库单不存在或已审核通过");
// }
// List<String> inOrderNumberList = stockInOrderPOList.stream().map(ReserveStockInOrderPO::getInOrderNumber).collect(Collectors.toList());
// ReserveInMaterialDetailDO inMaterialDetailDO = new ReserveInMaterialDetailDO();
// inMaterialDetailDO.setInOrderNumberList(inOrderNumberList);
// List<ReserveInMaterialDetailPO> inMaterialDetailPOList = materialDetailService.queryListChildren(inMaterialDetailDO);
// Map<String, List<ReserveInMaterialDetailPO>> inMaterialDetailListMap = inMaterialDetailPOList.stream().collect(Collectors.groupingBy(ReserveInMaterialDetailPO::getInOrderNumber));
//
// List<StockReceiptOrderDO> stockReceiptOrderDOList = new ArrayList<>();
// stockInOrderPOList.forEach(p -> {
// StockReceiptOrderDO stockReceiptOrderDO = new StockReceiptOrderDO();
// BeanUtils.copyProperties(p, stockReceiptOrderDO);
// stockReceiptOrderDO.setReceiptOrderNumber(OrderSequence.getOrderCode("SH"));
// List<ReserveInMaterialDetailPO> inMaterialDetailPOs = inMaterialDetailListMap.get(p.getInOrderNumber());
// if (!CollectionUtils.isEmpty(inMaterialDetailPOs)){
// List<ReceiptMaterialDetailDO> receiptMaterialDetailDOList = new ArrayList<>();
// inMaterialDetailPOs.forEach(inMaterialDetailPO -> {
// ReceiptMaterialDetailDO receiptMaterialDetailDO = new ReceiptMaterialDetailDO();
// BeanUtils.copyProperties(inMaterialDetailPO, receiptMaterialDetailDO);
// receiptMaterialDetailDO.setInUniqueId(inMaterialDetailPO.getUniqueId());
//
// // 复制特定字段生产日期过期日期存货日期批次参考号单据参考号箱号/卡板号扩展属性1-4
// // 这些字段可能使用驼峰命名或下划线命名使用反射获取和设置
// copySpecialFields(inMaterialDetailPO, receiptMaterialDetailDO);
// //收货计划数量赋值
// receiptMaterialDetailDO.setQuantity(inMaterialDetailPO.getInboundQuantity());
// receiptMaterialDetailDOList.add(receiptMaterialDetailDO);
// });
// stockReceiptOrderDO.setMaterialDetailList(receiptMaterialDetailDOList);
// stockReceiptOrderDO.setMaterialQuantity(receiptMaterialDetailDOList.size());
// // 重新计算计划数量从物料明细中汇总quantity字段
// BigDecimal quantity = receiptMaterialDetailDOList.stream()
// .map(ReceiptMaterialDetailDO::getQuantity)
// .filter(Objects::nonNull)
// .reduce(BigDecimal.ZERO, BigDecimal::add);
// stockReceiptOrderDO.setQuantity(quantity);
// } else {
// // 如果没有物料明细将数量设置为0
// stockReceiptOrderDO.setQuantity(BigDecimal.ZERO);
// }
// stockReceiptOrderDOList.add(stockReceiptOrderDO);
// });
// //判断物流是否需要生成质检单
// genQualityInspection(stockReceiptOrderDOList);
// //生成收货单
// Boolean batchInsertResult = stockReceiptOrderDomainService.batchInsert(stockReceiptOrderDOList);
// if (!batchInsertResult) {
// throw new ServiceException("生成收货单失败");
// }
// //生成收货任务根据入库单号查询刚生成的收货单
// List<StockReceiptOrderPO> stockReceiptOrderPOList = new ArrayList<>();
// for (String inOrderNumber : inOrderNumberList) {
// StockReceiptOrderDO stockReceiptOrderDOQuery = new StockReceiptOrderDO();
// stockReceiptOrderDOQuery.setInOrderNumber(inOrderNumber);
// List<StockReceiptOrderPO> receiptOrderList = stockReceiptOrderDomainService.queryList(stockReceiptOrderDOQuery);
// if (!CollectionUtils.isEmpty(receiptOrderList)) {
// stockReceiptOrderPOList.addAll(receiptOrderList);
// }
// }
// if (!CollectionUtils.isEmpty(stockReceiptOrderPOList)) {
// stockReceiptOrderDomainService.genStockReceiptTaskOrder(stockReceiptOrderPOList);
// }
// return batchInsertResult;
// }
/**
* @description 设置物料信息
* @author ZhouGY
* @date 2024/5/23 14:03
* @param stockInOrderDO
*/
private void setMaterialDetailInfo(ReserveStockInOrderDO stockInOrderDO){
List<ReserveInMaterialDetailDO> inMaterialDetailDOList = stockInOrderDO.getMaterialDetailList();
inMaterialDetailDOList.forEach(inMaterialDetailDO -> {
MaterialBaseInfoPO materialBaseInfoPO = reservationStockInOrderMapper.getinfo(inMaterialDetailDO.getMaterialBaseInfoId());
//MaterialBaseInfoPO materialBaseInfoPO = materialBaseInfoService.getInfo(inMaterialDetailDO.getMaterialBaseInfoId());
if (materialBaseInfoPO == null){
throw new ServiceException("物料基础信息不存在");
}
inMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode());
inMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
inMaterialDetailDO.setBarCode(materialBaseInfoPO.getBarCode());
inMaterialDetailDO.setPackId(materialBaseInfoPO.getPackId());
inMaterialDetailDO.setPackCode(materialBaseInfoPO.getPackCode());
inMaterialDetailDO.setPackName(materialBaseInfoPO.getPackName());
//获取包装详情
AjaxResult packDetailResult = systemServiceFeign.getInfoByPackIdAndUnitCode(materialBaseInfoPO.getPackId(), "EA");
if(!"200".equals(String.valueOf(packDetailResult.get("code")))){
throw new ServiceException("获取物料单位EA信息失败");
}
PackDetailFeignPO packDetailFeignPO = JSON.parseObject(JSONObject.toJSONString(packDetailResult.get("data")), PackDetailFeignPO.class);
inMaterialDetailDO.setPackDetailId(packDetailFeignPO.getPackDetailId());
inMaterialDetailDO.setUnitCode(packDetailFeignPO.getUnitCode());
inMaterialDetailDO.setUnitName(packDetailFeignPO.getName());
inMaterialDetailDO.setUnitNumber(packDetailFeignPO.getNumber());
inMaterialDetailDO.setWeightLimit(packDetailFeignPO.getWeight());
inMaterialDetailDO.setVolumeLimit(packDetailFeignPO.getVolume());
//获取仓库控制信息
MaterialWarehouseControlPO materialWarehouseControlPO = reservationStockInOrderMapper.getInfoByMaterialBaseInfoIds(materialBaseInfoPO.getMaterialBaseInfoId());
//MaterialWarehouseControlPO materialWarehouseControlPO = materialWarehouseControlService.getInfoByMaterialBaseInfoIds(materialBaseInfoPO.getMaterialBaseInfoId());
if (materialWarehouseControlPO == null){
// throw new ServiceException("物料仓库控制信息不存在");
materialWarehouseControlPO = new MaterialWarehouseControlPO();
}
inMaterialDetailDO.setMaterialWarehouseControlId(materialWarehouseControlPO.getMaterialWarehouseControlId());
inMaterialDetailDO.setSerialNumberManage(materialWarehouseControlPO.getSerialNumberManage());
inMaterialDetailDO.setQualityInspectionManage(materialWarehouseControlPO.getQualityInspectionManage());
inMaterialDetailDO.setQualityInspectionStage(materialWarehouseControlPO.getQualityInspectionStage());
inMaterialDetailDO.setQualityInspectionRule(materialWarehouseControlPO.getQualityInspectionRule());
inMaterialDetailDO.setQualityInspectionTerm(materialWarehouseControlPO.getQualityInspectionTerm());
inMaterialDetailDO.setAllowOvercharge(materialWarehouseControlPO.getAllowOvercharge());
inMaterialDetailDO.setOverchargeRatio(materialWarehouseControlPO.getOverchargeRatio());
//获取商品规则信息
MaterialGoodsRulePO materialGoodsRulePO = reservationStockInOrderMapper.getGoodsInfoByMaterialBaseInfoIds(inMaterialDetailDO.getMaterialBaseInfoId());
//MaterialGoodsRulePO materialGoodsRulePO = materialGoodsRuleService.getInfoByMaterialBaseInfoIds(materialBaseInfoPO.getMaterialBaseInfoId());
if (materialGoodsRulePO == null){
// throw new ServiceException("物料商品规则信息不存在");
materialGoodsRulePO =new MaterialGoodsRulePO();
}
inMaterialDetailDO.setDistributeRuleId(materialGoodsRulePO.getMaterialGoodsRuleId());
inMaterialDetailDO.setDistributeRuleCode(materialGoodsRulePO.getRuleCode());
inMaterialDetailDO.setDistributeRuleName(materialGoodsRulePO.getRuleName());
//自动填充规格型号和SKU码如果物料基础信息中有相关字段且明细中未设置
//规格型号优先使用物料种类名称如果为空则使用物料类型名称
if (StringUtils.isBlank(inMaterialDetailDO.getSpecificationModel())) {
if (StringUtils.isNotBlank(materialBaseInfoPO.getMaterialTypeName())) {
inMaterialDetailDO.setSpecificationModel(materialBaseInfoPO.getMaterialTypeName());
}
}
//SKU码使用物料条形码
if (StringUtils.isBlank(inMaterialDetailDO.getSkuCode())) {
if (StringUtils.isNotBlank(materialBaseInfoPO.getBarCode())) {
inMaterialDetailDO.setSkuCode(materialBaseInfoPO.getBarCode());
}
}
});
}
/**
* @description 设置默认值
* @author gen
* @date 2026/1/16
* @param stockInOrderDO
*/
private void setDefaultValues(ReserveStockInOrderDO stockInOrderDO) {
//海关是否查验货物默认0=
if (stockInOrderDO.getCustomsInspection() == null) {
stockInOrderDO.setCustomsInspection(0);
}
//是否需要报关默认1=
if (stockInOrderDO.getNeedCustomsDeclaration() == null) {
stockInOrderDO.setNeedCustomsDeclaration(1);
}
//是否需要运输默认0=
if (stockInOrderDO.getNeedTransport() == null) {
stockInOrderDO.setNeedTransport(0);
}
}
/**
* @description 复制特定字段从入库单明细到收货明细
* 包括生产日期过期日期存货日期批次参考号单据参考号箱号/卡板号扩展属性1-4
* @author gen
* @date 2026/1/29
* @param source 源对象ReserveInMaterialDetailPO
* @param target 目标对象ReceiptMaterialDetailDO
*/
// private void copySpecialFields(ReserveInMaterialDetailPO source, ReceiptMaterialDetailDO target) {
// if (source == null || target == null) {
// return;
// }
//
// try {
// // 字段映射源字段名 -> 目标字段名支持驼峰和下划线两种命名方式
// Map<String, String> fieldMappings = new HashMap<>();
// fieldMappings.put("productionDate", "productionDate");
// fieldMappings.put("production_date", "productionDate");
// fieldMappings.put("expiryDate", "expiryDate");
// fieldMappings.put("expiry_date", "expiryDate");
// fieldMappings.put("inventoryDate", "inventoryDate");
// fieldMappings.put("inventory_date", "inventoryDate");
// fieldMappings.put("batchRefNo", "batchRefNo");
// fieldMappings.put("batch_ref_no", "batchRefNo");
// fieldMappings.put("sheetRefNo", "sheetRefNo");
// fieldMappings.put("sheet_ref_no", "sheetRefNo");
// fieldMappings.put("boxPalletNo", "boxPalletNo");
// fieldMappings.put("box_pallet_no", "boxPalletNo");
// fieldMappings.put("extAttr1", "extAttr1");
// fieldMappings.put("ext_attr_1", "extAttr1");
// fieldMappings.put("extAttr2", "extAttr2");
// fieldMappings.put("ext_attr_2", "extAttr2");
// fieldMappings.put("extAttr3", "extAttr3");
// fieldMappings.put("ext_attr_3", "extAttr3");
// fieldMappings.put("extAttr4", "extAttr4");
// fieldMappings.put("ext_attr_4", "extAttr4");
//
// // 使用反射复制字段值
// for (Map.Entry<String, String> entry : fieldMappings.entrySet()) {
// String sourceFieldName = entry.getKey();
// String targetFieldName = entry.getValue();
//
// // 尝试从源对象获取字段值支持驼峰和下划线命名
// Object value = getFieldValue(source, sourceFieldName);
// if (value != null) {
// // 设置到目标对象使用驼峰命名
// setFieldValue(target, targetFieldName, value);
// log.info("复制字段成功:{} -> {},值:{}", sourceFieldName, targetFieldName, value);
// } else {
// log.debug("源对象字段 {} 的值为 null,跳过复制", sourceFieldName);
// }
// }
// } catch (Exception e) {
// log.warn("复制特定字段时发生异常,源对象:{},目标对象:{},错误:{}",
// source.getClass().getSimpleName(), target.getClass().getSimpleName(), e.getMessage());
// }
// }
/**
* @description 使用反射获取字段值支持驼峰和下划线命名
*/
private Object getFieldValue(Object obj, String fieldName) {
if (obj == null || StringUtils.isBlank(fieldName)) {
return null;
}
try {
Class<?> clazz = obj.getClass();
Field field = null;
// 先尝试直接获取字段驼峰命名
try {
field = clazz.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
// 如果失败尝试转换为驼峰命名如果是下划线命名
if (fieldName.contains("_")) {
String camelCaseName = snakeToCamel(fieldName);
try {
field = clazz.getDeclaredField(camelCaseName);
} catch (NoSuchFieldException ex) {
// 继续查找父类
}
}
}
// 如果当前类找不到查找父类
if (field == null) {
Class<?> currentClass = clazz.getSuperclass();
while (currentClass != null && field == null) {
try {
field = currentClass.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
if (fieldName.contains("_")) {
String camelCaseName = snakeToCamel(fieldName);
try {
field = currentClass.getDeclaredField(camelCaseName);
} catch (NoSuchFieldException ex) {
// 继续查找父类
}
}
}
currentClass = currentClass.getSuperclass();
}
}
if (field != null) {
field.setAccessible(true);
return field.get(obj);
}
} catch (Exception e) {
log.debug("获取字段值失败,对象:{},字段名:{},错误:{}",
obj.getClass().getSimpleName(), fieldName, e.getMessage());
}
return null;
}
/**
* @description 使用反射设置字段值
*/
private void setFieldValue(Object obj, String fieldName, Object value) {
if (obj == null || StringUtils.isBlank(fieldName)) {
return;
}
try {
Class<?> clazz = obj.getClass();
Field field = null;
// 先尝试直接获取字段驼峰命名
try {
field = clazz.getDeclaredField(fieldName);
} catch (NoSuchFieldException e) {
// 如果失败查找父类
Class<?> currentClass = clazz.getSuperclass();
while (currentClass != null && field == null) {
try {
field = currentClass.getDeclaredField(fieldName);
} catch (NoSuchFieldException ex) {
// 继续查找父类
}
currentClass = currentClass.getSuperclass();
}
}
if (field != null) {
field.setAccessible(true);
// 类型转换如果值类型不匹配尝试转换
Class<?> fieldType = field.getType();
if (value != null && !fieldType.isAssignableFrom(value.getClass())) {
// 尝试类型转换
if (fieldType == Date.class && value instanceof String) {
// 字符串转日期简单处理实际可能需要更复杂的解析
value = null; // 暂时不转换避免解析错误
} else if (fieldType == String.class) {
value = String.valueOf(value);
}
}
if (value != null && fieldType.isAssignableFrom(value.getClass())) {
field.set(obj, value);
}
}
} catch (Exception e) {
log.debug("设置字段值失败,对象:{},字段名:{},值:{},错误:{}",
obj.getClass().getSimpleName(), fieldName, value, e.getMessage());
}
}
/**
* @description 下划线命名转驼峰命名
*/
private String snakeToCamel(String snakeCase) {
if (StringUtils.isBlank(snakeCase)) {
return snakeCase;
}
String[] parts = snakeCase.split("_");
if (parts.length == 0) {
return snakeCase;
}
StringBuilder camelCase = new StringBuilder(parts[0].toLowerCase());
for (int i = 1; i < parts.length; i++) {
if (parts[i].length() > 0) {
camelCase.append(parts[i].substring(0, 1).toUpperCase())
.append(parts[i].substring(1).toLowerCase());
}
}
return camelCase.toString();
}
public List<ReserveStockInOrderPO> queryNoticePrint(ReserveStockInOrderDO stockInOrderDO) {
return stockInOrderService.queryNoticePrint(stockInOrderDO);
}
public List<ReserveInMaterialDetailPO> queryNoticePrintDetail(ReserveStockInOrderDO stockInOrderDO) {
return stockInOrderService.queryNoticePrintDetail(stockInOrderDO);
}
}
@@ -0,0 +1,447 @@
package com.mhd.oms.domain.reserveStockOutOrder.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* 出库单对象 reservation_stock_out_order
*
* @author gen
* @date 2024-05-28
*/
@Data
public class ReserveStockOutOrder extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("出库单id")
@TableId(type = IdType.AUTO)
private Long outOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核")
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 12-已复核")
private Integer status;
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer auditStatus;
@ApiModelProperty("出库单审核备注")
@Excel(name = "出库单审核备注")
private String auditRemark;
@ApiModelProperty("出库单审核人")
@Excel(name = "出库单审核人")
private Long auditBy;
@ApiModelProperty("出库单审核人姓名")
@Excel(name = "出库单审核人姓名")
private String auditByName;
@ApiModelProperty("出库单审核时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出库单审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditTime;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("出库单类型编码")
@Excel(name = "出库单类型编码")
private String orderTypeCode;
@ApiModelProperty("出库单类型名称")
@Excel(name = "出库单类型名称")
private String orderTypeName;
@ApiModelProperty("客户id")
@Excel(name = "客户id")
private Long customerId;
@ApiModelProperty("客户编码")
@Excel(name = "客户编码")
private String customerCode;
@ApiModelProperty("客户名称")
@Excel(name = "客户名称")
private String customerName;
@ApiModelProperty("预计出货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计出货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接出库: 1-是 2-否")
@Excel(name = "是否直接出库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("是否复核: 1-是 2-否")
@Excel(name = "是否复核: 1-是 2-否")
private Integer review;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("已生成拣货单数量")
@Excel(name = "已生成拣货单分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("是否取消订单: 1-是 2-否")
@Excel(name = "是否取消订单: 1-是 2-否")
private Integer cancelOrder;
@ApiModelProperty("取消订单备注")
@Excel(name = "取消订单备注")
private String cancelRemark;
@ApiModelProperty("取消订单人")
@Excel(name = "取消订单人")
private Long cancelBy;
@ApiModelProperty("取消订单人姓名")
@Excel(name = "取消订单人姓名")
private String cancelByName;
@ApiModelProperty("取消订单时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date cancelTime;
@ApiModelProperty("是否关闭订单: 1-是 2-否")
@Excel(name = "是否关闭订单: 1-是 2-否")
private Integer closeOrder;
@ApiModelProperty("关闭订单备注")
@Excel(name = "关闭订单备注")
private String closeRemark;
@ApiModelProperty("关闭订单人")
@Excel(name = "关闭订单人")
private Long closeBy;
@ApiModelProperty("关闭订单人姓名")
@Excel(name = "关闭订单人姓名")
private String closeByName;
@ApiModelProperty("关闭订单时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date closeTime;
@ApiModelProperty("复核状态: 1-未复核 2-复核中 3-已复核")
@Excel(name = "复核状态: 1-未复核 2-复核中 3-已复核")
private Integer checkStatus;
@ApiModelProperty("复核任务是否下发: 1-是 2-否")
@Excel(name = "复核任务是否下发: 1-是 2-否")
private Integer checkTaskDistribution;
@ApiModelProperty("复核任务下发时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "复核任务下发时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTaskDistributionTime;
@ApiModelProperty("复核作业人用户ID")
@Excel(name = "复核作业人用户ID")
private Long checkOperatorsBy;
@ApiModelProperty("复核作业人姓名")
@Excel(name = "复核作业人姓名")
private String checkOperatorsName;
@ApiModelProperty("调度单号")
@Excel(name = "调度单号")
private String mobilizeCode;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
@ApiModelProperty("to")
@Excel(name = "to")
@TableField(value = "\"TO\"")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleModelPlate;
@ApiModelProperty("委托编号")
@Excel(name = "委托编号")
private String entrustNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSign;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declareCustoms;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsDeclarerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddr;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String departureArrivalCountry;
@ApiModelProperty("承运商")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("承运商名称")
@Excel(name = "承运商名称")
private String carrierName;
@ApiModelProperty("柜号")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("")
@Excel(name = "")
private String containerNoName;
@ApiModelProperty("出仓日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date outboundDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date completeTime;
@ApiModelProperty("orderDate")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "orderDate", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderDate;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportModeCode;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportModeName;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionModeCode;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionModeName;
@ApiModelProperty("海关是否查验货物")
@Excel(name = "海关是否查验货物")
private String customsInspectionFlag;
@ApiModelProperty("是否需要报关")
@Excel(name = "是否需要报关")
private String needDeclareFlag;
@ApiModelProperty("是否需要运输")
@Excel(name = "是否需要运输")
private String needTransportFlag;
@ApiModelProperty("app上传的图片")
private String pictureApp;
@ApiModelProperty("业务单号")
@Excel(name = "业务单号")
private String businessOrderNo;
@ApiModelProperty("业务类型")
@Excel(name = "业务类型")
private String businessType;
@ApiModelProperty("制单人")
@Excel(name = "制单人")
private String documentCreator;
@ApiModelProperty("制单人名称")
@Excel(name = "制单人名称")
private String documentCreatorName;
@ApiModelProperty("制单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date documentDate;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("出库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date outboundTime;
}
@@ -0,0 +1,56 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.facade;
import com.baomidou.mybatisplus.extension.service.IService;
//import com.mhd.oms.domain.reservationOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder;
import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
import java.util.List;
/**
* 出库单Service接口
*
* @author gen
* @date 2024-05-28
*/
public interface IReserveStockOutOrderService extends IService<ReserveStockOutOrder>
{
/**
* 分页查询出库单列表
*/
public List<ReserveStockOutOrderPO> queryList(ReserveStockOutOrderDO stockOutOrderDO);
/**
* 新增出库单
*/
public Boolean insert(ReserveStockOutOrderDO stockOutOrderDO);
/**
* 修改出库单
*/
public Boolean update(ReserveStockOutOrderDO stockOutOrderDO);
/**
* 批量删除出库单
*/
public Boolean delete(Long[] outOrderIds);
/**
* 查询出库单
*/
public ReserveStockOutOrderPO getInfo(Long outOrderId);
/**
* 出库单提货单打印-表头
*/
List<ReserveStockOutOrderPO> queryOutStockNoticePrint(ReserveStockOutOrderDO stockOutOrderDO);
/**
* 出库单提货单打印-明细
*/
List<ReserveOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReserveStockOutOrderDO stockOutOrderDO);
}
@@ -0,0 +1,34 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
//import com.mhd.oms.domain.reservationOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder;
import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
import java.util.List;
/**
* 出库单Mapper接口
*
* @author gen
* @date 2024-05-28
*/
public interface ReserveStockOutOrderMapper extends BaseMapper<ReserveStockOutOrder>
{
/**
* 查询出库单列表
*/
public List<ReserveStockOutOrderPO> queryList(ReserveStockOutOrderDO stockOutOrderDO);
/**
* 出库单提货单打印-表头
*/
List<ReserveStockOutOrderPO> queryOutStockNoticePrint(ReserveStockOutOrderDO stockOutOrderDO);
/**
* 出库单提货单打印-明细
*/
List<ReserveOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReserveStockOutOrderDO stockOutOrderDO);
}
@@ -0,0 +1,122 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.persistence;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
//import com.mhd.oms.domain.reservationOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder;
import com.mhd.oms.domain.reserveStockOutOrder.repository.facade.IReserveStockOutOrderService;
import com.mhd.oms.domain.reserveStockOutOrder.repository.mapper.ReserveStockOutOrderMapper;
import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
/**
* 出库单Service业务层处理
*
* @author gen
* @date 2024-05-28
*/
@Service
public class ReserveStockOutOrderImpl extends ServiceImpl<ReserveStockOutOrderMapper, ReserveStockOutOrder> implements IReserveStockOutOrderService {
@Autowired
private ReserveStockOutOrderMapper reservationStockOutOrderMapper;
/**
* 查询出库单列表
*/
@Override
public List<ReserveStockOutOrderPO> queryList(ReserveStockOutOrderDO stockOutOrderDO)
{
return reservationStockOutOrderMapper.queryList(stockOutOrderDO);
}
/**
* 新增出库单
*/
@Override
public Boolean insert(ReserveStockOutOrderDO stockOutOrderDO) {
ReserveStockOutOrder stockOutOrder = new ReserveStockOutOrder();
BeanUtils.copyProperties(stockOutOrderDO,stockOutOrder);
return this.save(stockOutOrder);
}
/**
* 修改出库单
*/
@Override
public Boolean update(ReserveStockOutOrderDO stockOutOrderDO) {
ReserveStockOutOrder stockOutOrder = new ReserveStockOutOrder();
BeanUtils.copyProperties(stockOutOrderDO,stockOutOrder);
return this.updateById(stockOutOrder);
}
/**
* 批量删除出库单
*/
@Override
public Boolean delete(Long[] outOrderIds ) {
List<ReserveStockOutOrder> list = new ArrayList<>();
for (Long id : outOrderIds) {
ReserveStockOutOrder stockOutOrder = new ReserveStockOutOrder();
stockOutOrder.setOutOrderId(id);
stockOutOrder.setDelFlag(2);
list.add(stockOutOrder);
}
return this.updateBatchById(list);
}
/**
* 修改出库单
*/
@Override
public ReserveStockOutOrderPO getInfo(Long outOrderId) {
ReserveStockOutOrder stockOutOrder = this.getById(outOrderId);
ReserveStockOutOrderPO stockOutOrderPO = new ReserveStockOutOrderPO();
BeanUtils.copyProperties(stockOutOrder,stockOutOrderPO);
return stockOutOrderPO;
}
/**
* @description 更新订单任务下发状态
* @author ZhouGY
* @date 2024/8/1 13:56
* @param deliveTaskDO
* @return Boolean
*/
// @Override
// public Boolean handleDeliveTask(DeliveTaskDO deliveTaskDO) {
// LoginUser loginUser = SecurityUtils.getLoginUser();
// //标记收货单任务已下发
// return update(null, new UpdateWrapper<ReserveStockOutOrder>().lambda()
// .set(ReserveStockOutOrder::getCheckOperatorsBy, deliveTaskDO.getOperatorsBy())
// .set(ReserveStockOutOrder::getCheckOperatorsName, deliveTaskDO.getOperatorsName())
// .set(ReserveStockOutOrder::getUpdateBy, loginUser.getUserid())
// .set(ReserveStockOutOrder::getUpdateByName, loginUser.getUsername())
// .set(ReserveStockOutOrder::getUpdateTime, new Date())
// .eq(ReserveStockOutOrder::getOutOrderNumber, deliveTaskDO.getTrackingNumber()));
// }
/**
* 出库单提货单打印-表头
*/
@Override
public List<ReserveStockOutOrderPO> queryOutStockNoticePrint(ReserveStockOutOrderDO stockOutOrderDO) {
return reservationStockOutOrderMapper.queryOutStockNoticePrint(stockOutOrderDO);
}
/**
* 出库单提货单打印-明细
*/
@Override
public List<ReserveOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReserveStockOutOrderDO stockOutOrderDO) {
return reservationStockOutOrderMapper.queryOutStockNoticePrintDetail(stockOutOrderDO);
}
}
@@ -0,0 +1,103 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ReserveStockOutOrderBasePO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("出库单类型编码")
@Excel(name = "出库单类型编码")
private String orderTypeCode;
@ApiModelProperty("出库单类型名称")
@Excel(name = "出库单类型名称")
private String orderTypeName;
@ApiModelProperty("客户id")
@Excel(name = "客户id")
private Long customerId;
@ApiModelProperty("客户编码")
@Excel(name = "客户编码")
private String customerCode;
@ApiModelProperty("客户名称")
@Excel(name = "客户名称")
private String customerName;
@ApiModelProperty("预计出货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计出货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接出库: 1-是 2-否")
@Excel(name = "是否直接出库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("是否复核: 1-是 2-否")
@Excel(name = "是否复核: 1-是 2-否")
private Integer review;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
}
@@ -0,0 +1,455 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.po;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 出库单对象 stock_out_order
*
* @author gen
* @date 2024-05-28
*/
@Data
@ApiModel(value = "出库单对象", description = "出库单响应对象")
public class ReserveStockOutOrderPO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("出库单id")
private Long outOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
private Integer status;
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer auditStatus;
@ApiModelProperty("出库单审核备注")
@Excel(name = "出库单审核备注")
private String auditRemark;
@ApiModelProperty("出库单审核人")
@Excel(name = "出库单审核人")
private Long auditBy;
@ApiModelProperty("出库单审核人姓名")
@Excel(name = "出库单审核人姓名")
private String auditByName;
@ApiModelProperty("出库单审核时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出库单审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditTime;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("出库单类型编码")
@Excel(name = "出库单类型编码")
private String orderTypeCode;
@ApiModelProperty("出库单类型名称")
@Excel(name = "出库单类型名称")
private String orderTypeName;
@ApiModelProperty("客户id")
@Excel(name = "客户id")
private Long customerId;
@ApiModelProperty("客户编码")
@Excel(name = "客户编码")
private String customerCode;
@ApiModelProperty("客户名称")
@Excel(name = "客户名称")
private String customerName;
@ApiModelProperty("预计出货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计出货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接出库: 1-是 2-否")
@Excel(name = "是否直接出库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("是否复核: 1-是 2-否")
@Excel(name = "是否复核: 1-是 2-否")
private Integer review;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("已生成拣货单数量")
@Excel(name = "已生成拣货单分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("是否取消订单: 1-是 2-否")
@Excel(name = "是否取消订单: 1-是 2-否")
private Integer cancelOrder;
@ApiModelProperty("取消订单备注")
@Excel(name = "取消订单备注")
private String cancelRemark;
@ApiModelProperty("取消订单人")
@Excel(name = "取消订单人")
private Long cancelBy;
@ApiModelProperty("取消订单人姓名")
@Excel(name = "取消订单人姓名")
private String cancelByName;
@ApiModelProperty("取消订单时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date cancelTime;
@ApiModelProperty("是否关闭订单: 1-是 2-否")
@Excel(name = "是否关闭订单: 1-是 2-否")
private Integer closeOrder;
@ApiModelProperty("关闭订单备注")
@Excel(name = "关闭订单备注")
private String closeRemark;
@ApiModelProperty("关闭订单人")
@Excel(name = "关闭订单人")
private Long closeBy;
@ApiModelProperty("关闭订单人姓名")
@Excel(name = "关闭订单人姓名")
private String closeByName;
@ApiModelProperty("关闭订单时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date closeTime;
@ApiModelProperty("复核状态: 1-未复核 2-复核中 3-已复核")
@Excel(name = "复核状态: 1-未复核 2-复核中 3-已复核")
private Integer checkStatus;
@ApiModelProperty("复核任务是否下发: 1-是 2-否")
@Excel(name = "复核任务是否下发: 1-是 2-否")
private Integer checkTaskDistribution;
@ApiModelProperty("复核任务下发时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "复核任务下发时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTaskDistributionTime;
@ApiModelProperty("复核作业人用户ID")
@Excel(name = "复核作业人用户ID")
private Long checkOperatorsBy;
@ApiModelProperty("复核作业人姓名")
@Excel(name = "复核作业人姓名")
private String checkOperatorsName;
@ApiModelProperty("调度单号")
@Excel(name = "调度单号")
private String mobilizeCode;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty("物料明细")
private List<ReserveOutMaterialDetailPO> materialDetailList;
//
// @ApiModelProperty("出库单复核统计")
// private ReserveOutMaterialCheckPO outMaterialCheckPO;
@ApiModelProperty("越库单id")
private Long overStockId;
@ApiModelProperty("越库单状态 0:无状态 1:处理中 2:越库完成")
@Excel(name = "越库单状态 0:无状态 1:处理中 2:越库完成")
private Integer overStockStatus;
@ApiModelProperty("越库类型:1-直接越库 2-分拨越库")
@Excel(name = "越库类型:1-直接越库 2-分拨越库")
private Long overStockType;
@ApiModelProperty("to")
@Excel(name = "to")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleModelPlate;
@ApiModelProperty("委托编号")
@Excel(name = "委托编号")
private String entrustNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSign;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declareCustoms;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsDeclarerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddr;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String departureArrivalCountry;
@ApiModelProperty("承运商")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("")
@Excel(name = "")
private String containerNoName;
@ApiModelProperty("出仓日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date outboundDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date completeTime;
@ApiModelProperty("orderDate")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "orderDate", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderDate;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportModeCode;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportModeName;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionModeCode;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionModeName;
@ApiModelProperty("海关是否查验货物")
@Excel(name = "海关是否查验货物")
private String customsInspectionFlag;
@ApiModelProperty("是否需要报关")
@Excel(name = "是否需要报关")
private String needDeclareFlag;
@ApiModelProperty("是否需要运输")
@Excel(name = "是否需要运输")
private String needTransportFlag;
@ApiModelProperty("出库交接图片,PDA出库交接时上传的照片,多张图片以逗号隔开")
private String pictureApp;
@ApiModelProperty("出库总数量")
private BigDecimal totalOutboundQuantity;
@ApiModelProperty("业务单号")
@Excel(name = "业务单号")
private String businessOrderNo;
@ApiModelProperty("业务类型")
@Excel(name = "业务类型")
private String businessType;
@ApiModelProperty("制单人")
@Excel(name = "制单人")
private String documentCreator;
@ApiModelProperty("制单人名称")
@Excel(name = "制单人名称")
private String documentCreatorName;
@ApiModelProperty("制单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date documentDate;
@ApiModelProperty("承运商名称")
@Excel(name = "承运商名称")
private String carrierName;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("出库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date outboundTime;
}
@@ -0,0 +1,108 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ReserveStockOutOrderBaseDO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("物料明细")
private List<ReserveOutMaterialDetailDO> materialDetailList;
}
@@ -0,0 +1,103 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
/**
* @author ZhouGY
* @title StockInOrderBasePO
* @description: TODO
* @date 2024/5/22 11:50
**/
@Data
public class ReserveStockOutOrderBaseDTO extends BaseVOEntity {
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("入库单号")
@Excel(name = "入库单号")
private String inOrderNumber;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("入库单类型编码")
@Excel(name = "入库单类型编码")
private String orderTypeCode;
@ApiModelProperty("入库单类型名称")
@Excel(name = "入库单类型名称")
private String orderTypeName;
@ApiModelProperty("供应商id")
@Excel(name = "供应商id")
private Long supplierId;
@ApiModelProperty("供应商编码")
@Excel(name = "供应商编码")
private String supplierCode;
@ApiModelProperty("供应商名称")
@Excel(name = "供应商名称")
private String supplierName;
@ApiModelProperty("预计到货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计到货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接入库: 1-是 2-否")
@Excel(name = "是否直接入库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
}
@@ -0,0 +1,493 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
import com.mhd.common.core.web.domain.BaseVOEntity;
//import com.mhd.oms.domain.reservationOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 出库单对象 stock_out_order
*
* @author gen
* @date 2024-05-28
*/
@Data
public class ReserveStockOutOrderDO extends BaseVOEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty("出库单id")
private Long outOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
private Integer status;
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer auditStatus;
@ApiModelProperty("出库单审核备注")
@Excel(name = "出库单审核备注")
private String auditRemark;
@ApiModelProperty("出库单审核人")
@Excel(name = "出库单审核人")
private Long auditBy;
@ApiModelProperty("出库单审核人姓名")
@Excel(name = "出库单审核人姓名")
private String auditByName;
@ApiModelProperty("出库单审核时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出库单审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditTime;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("出库单类型编码")
@Excel(name = "出库单类型编码")
private String orderTypeCode;
@ApiModelProperty("出库单类型名称")
@Excel(name = "出库单类型名称")
private String orderTypeName;
@ApiModelProperty("客户id")
@Excel(name = "客户id")
private Long customerId;
@ApiModelProperty("客户编码")
@Excel(name = "客户编码")
private String customerCode;
@ApiModelProperty("客户名称")
@Excel(name = "客户名称")
private String customerName;
@ApiModelProperty("预计出货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计出货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接出库: 1-是 2-否")
@Excel(name = "是否直接出库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("是否复核: 1-是 2-否")
@Excel(name = "是否复核: 1-是 2-否")
private Integer review;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("已生成拣货单数量")
@Excel(name = "已生成拣货单分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("是否取消订单: 1-是 2-否")
@Excel(name = "是否取消订单: 1-是 2-否")
private Integer cancelOrder;
@ApiModelProperty("取消订单备注")
@Excel(name = "取消订单备注")
private String cancelRemark;
@ApiModelProperty("取消订单人")
@Excel(name = "取消订单人")
private Long cancelBy;
@ApiModelProperty("取消订单人姓名")
@Excel(name = "取消订单人姓名")
private String cancelByName;
@ApiModelProperty("取消订单时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date cancelTime;
@ApiModelProperty("是否关闭订单: 1-是 2-否")
@Excel(name = "是否关闭订单: 1-是 2-否")
private Integer closeOrder;
@ApiModelProperty("关闭订单备注")
@Excel(name = "关闭订单备注")
private String closeRemark;
@ApiModelProperty("关闭订单人")
@Excel(name = "关闭订单人")
private Long closeBy;
@ApiModelProperty("关闭订单人姓名")
@Excel(name = "关闭订单人姓名")
private String closeByName;
@ApiModelProperty("关闭订单时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date closeTime;
@ApiModelProperty("复核状态: 1-未复核 2-复核中 3-已复核")
@Excel(name = "复核状态: 1-未复核 2-复核中 3-已复核")
private Integer checkStatus;
@ApiModelProperty("复核任务是否下发: 1-是 2-否")
@Excel(name = "复核任务是否下发: 1-是 2-否")
private Integer checkTaskDistribution;
@ApiModelProperty("复核任务下发时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "复核任务下发时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTaskDistributionTime;
@ApiModelProperty("复核作业人用户ID")
@Excel(name = "复核作业人用户ID")
private Long checkOperatorsBy;
@ApiModelProperty("复核作业人姓名")
@Excel(name = "复核作业人姓名")
private String checkOperatorsName;
@ApiModelProperty("调度单号")
@Excel(name = "调度单号")
private String mobilizeCode;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("出库单id集合")
private List<Long> outOrderIds;
@ApiModelProperty("物料明细")
private List<ReserveOutMaterialDetailDO> materialDetailList;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("序列号")
@Excel(name = "序列号")
private String serialNumber;
@ApiModelProperty("物料审核数量")
@Excel(name = "物料审核数量")
private BigDecimal actualQuantity;
@ApiModelProperty("波次类型编码")
private String waveOrderTypeCode;
@ApiModelProperty("出库状态大于某个状态")
private Integer gtStatus;
@ApiModelProperty("出库状态小于某个状态")
private Integer ltStatus;
@ApiModelProperty("大于复核状态: 1-未复核 2-复核中 3-已复核")
private Integer gtCheckStatus;
@ApiModelProperty("小于复核状态: 1-未复核 2-复核中 3-已复核")
private Integer ltCheckStatus;
@ApiModelProperty("PDA复核查询tab: 1-列表(待复核) 2-历史记录(已复核)")
private Integer tabType;
@ApiModelProperty("to")
@Excel(name = "to")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleModelPlate;
@ApiModelProperty("委托编号")
@Excel(name = "委托编号")
private String entrustNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSign;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declareCustoms;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsDeclarerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddr;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String departureArrivalCountry;
@ApiModelProperty("承运商")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("")
@Excel(name = "")
private String containerNoName;
@ApiModelProperty("出仓日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date outboundDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date completeTime;
@ApiModelProperty("orderDate")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "orderDate", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderDate;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportModeCode;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportModeName;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionModeCode;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionModeName;
@ApiModelProperty("海关是否查验货物")
@Excel(name = "海关是否查验货物")
private String customsInspectionFlag;
@ApiModelProperty("是否需要报关")
@Excel(name = "是否需要报关")
private String needDeclareFlag;
@ApiModelProperty("是否需要运输")
@Excel(name = "是否需要运输")
private String needTransportFlag;
@ApiModelProperty(name = "创建时间查询条件开始日期")
private String createTimeStart;
@ApiModelProperty(name = "创建时间查询条件结束日期")
private String createTimeEnd;
@ApiModelProperty(name = "审核时间查询条件开始日期")
private String auditTimeStart;
@ApiModelProperty(name = "审核时间查询条件结束日期")
private String auditTimeEnd;
@ApiModelProperty("出库明细-物料名称(商品名称),模糊匹配")
private String materialName;
@ApiModelProperty("出库明细-物料编码,模糊匹配")
private String materialCode;
@ApiModelProperty(name = "已分配数量总数量")
private BigDecimal alreadyAllocationQuantityAll;
@ApiModelProperty("业务单号")
@Excel(name = "业务单号")
private String businessOrderNo;
@ApiModelProperty("业务类型")
@Excel(name = "业务类型")
private String businessType;
@ApiModelProperty("制单人")
@Excel(name = "制单人")
private String documentCreator;
@ApiModelProperty("制单人名称")
@Excel(name = "制单人名称")
private String documentCreatorName;
@ApiModelProperty("制单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date documentDate;
@ApiModelProperty("承运商名称")
@Excel(name = "承运商名称")
private String carrierName;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("出库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date outboundTime;
}
@@ -0,0 +1,482 @@
package com.mhd.oms.domain.reserveStockOutOrder.repository.todo;
import com.fasterxml.jackson.annotation.JsonAlias;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mhd.common.core.annotation.Excel;
//import com.mhd.oms.domain.reservationOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDTO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDTO;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
/**
* 出库单对象 stock_out_order
*
* @author gen
* @date 2024-05-28
*/
@Data
public class ReserveStockOutOrderDTO extends ReserveStockOutOrderBaseDTO {
private static final long serialVersionUID = 1L;
@ApiModelProperty("出库单id")
private Long outOrderId;
@ApiModelProperty("组织表ID")
@Excel(name = "组织表ID")
private Long organizationId;
@ApiModelProperty("组织名称")
@Excel(name = "组织名称")
private String organizationName;
@ApiModelProperty("一级组织表ID")
@Excel(name = "一级组织表ID")
private Long topOrganizationId;
@ApiModelProperty("通知单号")
@Excel(name = "通知单号")
private String noticeNumber;
@ApiModelProperty("出库单号")
@Excel(name = "出库单号")
private String outOrderNumber;
@ApiModelProperty("出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
@Excel(name = "出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-波次中 6-拣货中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭")
private Integer status;
@ApiModelProperty("出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
@Excel(name = "出库单审核状态: 1-未审核 2-审核不通过 3-审核通过")
private Integer auditStatus;
@ApiModelProperty("出库单审核备注")
@Excel(name = "出库单审核备注")
private String auditRemark;
@ApiModelProperty("出库单审核人")
@Excel(name = "出库单审核人")
private Long auditBy;
@ApiModelProperty("出库单审核人姓名")
@Excel(name = "出库单审核人姓名")
private String auditByName;
@ApiModelProperty("出库单审核时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "出库单审核时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date auditTime;
@ApiModelProperty("仓库id")
@Excel(name = "仓库id")
private Long warehouseId;
@ApiModelProperty("仓库编码")
@Excel(name = "仓库编码")
private String warehouseCode;
@ApiModelProperty("仓库名称")
@Excel(name = "仓库名称")
private String warehouseName;
@ApiModelProperty("货主id")
@Excel(name = "货主id")
private Long shipperId;
@ApiModelProperty("货主编码")
@Excel(name = "货主编码")
private String shipperCode;
@ApiModelProperty("货主名称")
@Excel(name = "货主名称")
private String shipperName;
@ApiModelProperty("出库单类型编码")
@Excel(name = "出库单类型编码")
private String orderTypeCode;
@ApiModelProperty("出库单类型名称")
@Excel(name = "出库单类型名称")
private String orderTypeName;
@ApiModelProperty("客户id")
@Excel(name = "客户id")
private Long customerId;
@ApiModelProperty("客户编码")
@Excel(name = "客户编码")
private String customerCode;
@ApiModelProperty("客户名称")
@Excel(name = "客户名称")
private String customerName;
@ApiModelProperty("预计出货时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "预计出货时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date expectTime;
@ApiModelProperty("供应链订单号")
@Excel(name = "供应链订单号")
private String supplyChainNumber;
@ApiModelProperty("优先级别编码")
@Excel(name = "优先级别编码")
private String priorityLevelCode;
@ApiModelProperty("优先级别名称")
@Excel(name = "优先级别名称")
private String priorityLevelName;
@ApiModelProperty("是否直接出库: 1-是 2-否")
@Excel(name = "是否直接出库: 1-是 2-否")
private Integer directWarehouse;
@ApiModelProperty("是否复核: 1-是 2-否")
@Excel(name = "是否复核: 1-是 2-否")
private Integer review;
@ApiModelProperty("附件url")
@Excel(name = "附件url")
private String annexUrl;
@ApiModelProperty("物料种数")
@Excel(name = "物料种数")
private Integer materialQuantity;
@ApiModelProperty("计划数量")
@Excel(name = "计划数量")
private BigDecimal quantity;
@ApiModelProperty("净重 单位:千克")
@Excel(name = "净重 单位:千克")
private BigDecimal weightLimit;
@ApiModelProperty("体积 单位:立方米")
@Excel(name = "体积 单位:立方米")
private BigDecimal volumeLimit;
@ApiModelProperty("分配数量")
@Excel(name = "分配数量")
private BigDecimal allocationQuantity;
@ApiModelProperty("已生成拣货单数量")
@Excel(name = "已生成拣货单分配数量")
private BigDecimal alreadyAllocationQuantity;
@ApiModelProperty("拣货数量")
@Excel(name = "拣货数量")
private BigDecimal pickingQuantity;
@ApiModelProperty("复核数量")
@Excel(name = "复核数量")
private BigDecimal checkQuantity;
@ApiModelProperty("是否取消订单: 1-是 2-否")
@Excel(name = "是否取消订单: 1-是 2-否")
private Integer cancelOrder;
@ApiModelProperty("取消订单备注")
@Excel(name = "取消订单备注")
private String cancelRemark;
@ApiModelProperty("取消订单人")
@Excel(name = "取消订单人")
private Long cancelBy;
@ApiModelProperty("取消订单人姓名")
@Excel(name = "取消订单人姓名")
private String cancelByName;
@ApiModelProperty("取消订单时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "取消订单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date cancelTime;
@ApiModelProperty("是否关闭订单: 1-是 2-否")
@Excel(name = "是否关闭订单: 1-是 2-否")
private Integer closeOrder;
@ApiModelProperty("关闭订单备注")
@Excel(name = "关闭订单备注")
private String closeRemark;
@ApiModelProperty("关闭订单人")
@Excel(name = "关闭订单人")
private Long closeBy;
@ApiModelProperty("关闭订单人姓名")
@Excel(name = "关闭订单人姓名")
private String closeByName;
@ApiModelProperty("关闭订单时间")
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "关闭订单时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date closeTime;
@ApiModelProperty("复核状态: 1-未复核 2-复核中 3-已复核")
@Excel(name = "复核状态: 1-未复核 2-复核中 3-已复核")
private Integer checkStatus;
@ApiModelProperty("复核任务是否下发: 1-是 2-否")
@Excel(name = "复核任务是否下发: 1-是 2-否")
private Integer checkTaskDistribution;
@ApiModelProperty("复核任务下发时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "复核任务下发时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date checkTaskDistributionTime;
@ApiModelProperty("复核作业人用户ID")
@Excel(name = "复核作业人用户ID")
@JsonAlias({"checkOperatorId", "operatorId"})
private Long checkOperatorsBy;
@ApiModelProperty("复核作业人姓名")
@Excel(name = "复核作业人姓名")
private String checkOperatorsName;
@ApiModelProperty("调度单号")
@Excel(name = "调度单号")
private String mobilizeCode;
@ApiModelProperty("备注")
@Excel(name = "备注")
private String remark;
@ApiModelProperty(name = "组织ID集合")
private List<Long> organizationIdList;
@ApiModelProperty(name = "权限菜单ID")
private Long permissionMenuId;
@ApiModelProperty("出库单id集合")
private List<Long> outOrderIds;
@ApiModelProperty("物料明细")
private List<ReserveOutMaterialDetailDTO> materialDetailList;
@ApiModelProperty("物料条形码")
@Excel(name = "物料条形码")
private String barCode;
@ApiModelProperty("物料审核数量")
@Excel(name = "物料审核数量")
private BigDecimal actualQuantity;
@ApiModelProperty("波次类型编码")
private String waveOrderTypeCode;
@ApiModelProperty("大于复核状态: 1-未复核 2-复核中 3-已复核")
private Integer gtCheckStatus;
@ApiModelProperty("小于复核状态: 1-未复核 2-复核中 3-已复核")
private Integer ltCheckStatus;
@ApiModelProperty("PDA复核查询tab: 1-列表(待复核) 2-历史记录(已复核)")
private Integer tabType;
@ApiModelProperty("to")
@Excel(name = "to")
private String to;
@ApiModelProperty("联系人")
@Excel(name = "联系人")
private String contactPerson;
@ApiModelProperty("车型及车牌")
@Excel(name = "车型及车牌")
private String vehicleModelPlate;
@ApiModelProperty("委托编号")
@Excel(name = "委托编号")
private String entrustNo;
@ApiModelProperty("Tel")
@Excel(name = "Tel")
private String tel;
@ApiModelProperty("司机签名")
@Excel(name = "司机签名")
private String driverSign;
@ApiModelProperty("Fax")
@Excel(name = "Fax")
private String fax;
@ApiModelProperty("申报地关区")
@Excel(name = "申报地关区")
private String declareCustoms;
@ApiModelProperty("生产商")
@Excel(name = "生产商")
private String manufacturer;
@ApiModelProperty("报关员姓名及联系方式")
@Excel(name = "报关员姓名及联系方式")
private String customsDeclarerInfo;
@ApiModelProperty("送货地址")
@Excel(name = "送货地址")
private String deliveryAddr;
@ApiModelProperty("进出境关别")
@Excel(name = "进出境关别")
private String entryExitCustoms;
@ApiModelProperty("起运/运抵国(地区)")
@Excel(name = "起运/运抵国(地区)")
private String departureArrivalCountry;
@ApiModelProperty("承运商")
@Excel(name = "承运商")
private String carrier;
@ApiModelProperty("柜号")
@Excel(name = "柜号")
private String containerNo;
@ApiModelProperty("")
@Excel(name = "")
private String containerNoName;
@ApiModelProperty("出仓日期")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "出仓日期", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date outboundDate;
@ApiModelProperty("完成时间")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "完成时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date completeTime;
@ApiModelProperty("orderDate")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "orderDate", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date orderDate;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportModeCode;
@ApiModelProperty("运输方式")
@Excel(name = "运输方式")
private String transportModeName;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionModeCode;
@ApiModelProperty("监管方式")
@Excel(name = "监管方式")
private String supervisionModeName;
@ApiModelProperty("海关是否查验货物")
@Excel(name = "海关是否查验货物")
private String customsInspectionFlag;
@ApiModelProperty("是否需要报关")
@Excel(name = "是否需要报关")
private String needDeclareFlag;
@ApiModelProperty("是否需要运输")
@Excel(name = "是否需要运输")
private String needTransportFlag;
@ApiModelProperty(name = "创建时间查询条件开始日期")
private String createTimeStart;
@ApiModelProperty(name = "创建时间查询条件结束日期")
private String createTimeEnd;
@ApiModelProperty(name = "审核时间查询条件开始日期")
private String auditTimeStart;
@ApiModelProperty(name = "审核时间查询条件结束日期")
private String auditTimeEnd;
@ApiModelProperty("出库明细-物料名称(商品名称),模糊匹配,与前端参数 materialName 一致")
private String materialName;
@ApiModelProperty("出库明细-物料编码,模糊匹配,与前端参数 materialCode 一致")
private String materialCode;
@ApiModelProperty("出库交接图片,PDA出库交接时上传的照片,多张图片以逗号隔开")
private String pictureApp;
@ApiModelProperty("业务单号")
@Excel(name = "业务单号")
private String businessOrderNo;
@ApiModelProperty("业务类型")
@Excel(name = "业务类型")
private String businessType;
@ApiModelProperty("制单人")
@Excel(name = "制单人")
private String documentCreator;
@ApiModelProperty("制单人名称")
@Excel(name = "制单人名称")
private String documentCreatorName;
@ApiModelProperty("制单日期")
@JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
@DateTimeFormat(pattern = "yyyy-MM-dd")
@Excel(name = "制单日期", width = 30, dateFormat = "yyyy-MM-dd")
private Date documentDate;
@ApiModelProperty("承运商名称")
@Excel(name = "承运商名称")
private String carrierName;
@ApiModelProperty( "下发状态 0-无状态 1-未下发 2-已下发 ")
private Integer issueStatus;
@ApiModelProperty("下发时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date issueTime;
@ApiModelProperty("下发人id")
private Long issueId;
@ApiModelProperty("下发人")
private String issueName;
@ApiModelProperty("预约审核人id")
private Long reservationAuditId;
@ApiModelProperty("预约审核人id")
private String reservationAuditName;
@ApiModelProperty("预约审核时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date reservationAuditTime;
@ApiModelProperty("结算币种")
private String settlementCurrency;
@ApiModelProperty("业务员ID")
private String salesmanId;
@ApiModelProperty("业务员名称")
private String salesmanName;
@ApiModelProperty("tms订单号")
private String tmsOrderNumber;
@ApiModelProperty("仓库负责人")
private String directorName;
@ApiModelProperty("仓库负责人电话")
private String directorPhone;
@ApiModelProperty("仓库负责人id")
private Long directorId;
@ApiModelProperty("订单来源")
private String reservationOrderSource;
@ApiModelProperty("出库时间")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
private Date outboundTime;
}
@@ -0,0 +1,113 @@
package com.mhd.oms.domain.reserveStockOutOrder.service;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.json.JSONUtil;
import com.mhd.common.core.exception.digitalLogisticsException.DigitalLogisticsException;
import com.mhd.common.core.exception.digitalLogisticsException.UserError;
import com.mhd.common.core.utils.IgnoreNullUtil;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDTO;
import com.mhd.system.api.model.LoginUser;
import org.springframework.stereotype.Component;
import java.util.Date;
/**
* 出库单Assembler
*
* @author gen
* @date 2024-05-28
*/
@Component
public class ReserveStockOutOrderAssembler {
/**
* 转换实体
*/
public ReserveStockOutOrderDO toDO(ReserveStockOutOrderDTO stockOutOrderDTO) {
ReserveStockOutOrderDO stockOutOrderDO = new ReserveStockOutOrderDO();
// 拷贝
BeanUtils.copyProperties(stockOutOrderDTO, stockOutOrderDO, IgnoreNullUtil.getNullPropertyNames(stockOutOrderDTO));
// 确保查询条件字段被正确传递查询条件字段需要明确传递避免被IgnoreNullUtil忽略
stockOutOrderDO.setCreateTimeStart(stockOutOrderDTO.getCreateTimeStart());
stockOutOrderDO.setCreateTimeEnd(stockOutOrderDTO.getCreateTimeEnd());
stockOutOrderDO.setAuditTimeStart(stockOutOrderDTO.getAuditTimeStart());
stockOutOrderDO.setAuditTimeEnd(stockOutOrderDTO.getAuditTimeEnd());
stockOutOrderDO.setTabType(stockOutOrderDTO.getTabType());
// 列表筛选前端常传名称 (编码)展示串库内多为纯名称去掉末尾括号段再 LIKE
if (stockOutOrderDTO.getMaterialName() != null && !stockOutOrderDTO.getMaterialName().isEmpty()) {
String normalized = normalizeDetailMaterialNameForQuery(stockOutOrderDTO.getMaterialName());
stockOutOrderDO.setMaterialName(normalized.isEmpty()
? stockOutOrderDTO.getMaterialName().trim()
: normalized);
}
return stockOutOrderDO;
}
/**
* 转换实体
*/
public ReserveStockOutOrderDO toDOByEdit(ReserveStockOutOrderDTO stockOutOrderDTO) {
ReserveStockOutOrderDO stockOutOrderDO = JSONUtil.toBean(JSONUtil.toJsonStr(stockOutOrderDTO), ReserveStockOutOrderDO.class);
// 拷贝
LoginUser loginUser = SecurityUtils.getLoginUser();
if (ObjectUtil.isNull(loginUser)) {
throw new DigitalLogisticsException(UserError.TIMEOUT);
}
// 获取登录人id
Long userId = loginUser.getUserid();
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
String userRealName = null;
if (loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
&& !loginUser.getUserPo().getUserName().trim().isEmpty()) {
// 优先使用UserPo中的userName用户真实姓名
userRealName = loginUser.getUserPo().getUserName();
} else if (loginUser.getRealname() != null && !loginUser.getRealname().trim().isEmpty()) {
// 其次使用realname
userRealName = loginUser.getRealname();
} else {
// 最后使用username账号作为兜底
userRealName = loginUser.getUsername();
}
if(stockOutOrderDTO.getOutOrderId() != null){
stockOutOrderDO.setUpdateBy(userId);
stockOutOrderDO.setUpdateByName(userRealName);
stockOutOrderDO.setUpdateTime(new Date());
}else {
stockOutOrderDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
stockOutOrderDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
stockOutOrderDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
stockOutOrderDO.setCreateBy(userId);
stockOutOrderDO.setCreateByName(userRealName);
stockOutOrderDO.setCreateTime(new Date());
stockOutOrderDO.setUpdateBy(userId);
stockOutOrderDO.setUpdateByName(userRealName);
stockOutOrderDO.setUpdateTime(new Date());
stockOutOrderDO.setDelFlag(1);
}
return stockOutOrderDO;
}
/**
* 去掉物料展示名末尾的 (xxx) / xxx便于与库内 material_name 模糊匹配
*/
private static String normalizeDetailMaterialNameForQuery(String raw) {
if (raw == null) {
return null;
}
String s = raw.trim();
// 循环去掉末尾多组括号兼容名称 (编码)或重复后缀
String next;
do {
next = s.replaceFirst("[\\s\\u3000]*[(][^)]*[)]\\s*$", "").trim();
if (next.equals(s)) {
break;
}
s = next;
} while (!s.isEmpty());
return s;
}
}
@@ -0,0 +1,702 @@
package com.mhd.oms.domain.reserveStockOutOrder.service;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.mhd.common.core.exception.ServiceException;
import com.mhd.common.core.utils.OrderSequence;
import com.mhd.common.core.utils.StringUtils;
import com.mhd.common.core.utils.bean.BeanUtils;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.oms.domain.businessDocumentOrder.repository.mapper.BusinessDocumentOrderMapper;
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.entity.ReserveOutMaterialDetail;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.facade.IReserveOutMaterialDetailService;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailBaseDO;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO;
import com.mhd.oms.domain.reserveStockInOrder.repository.facade.IReserveStockInOrderService;
import com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper;
import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder;
import com.mhd.oms.domain.reserveStockOutOrder.repository.facade.IReserveStockOutOrderService;
import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
import com.mhd.system.api.SystemServiceFeign;
import com.mhd.system.api.WmsServiceFeign;
import com.mhd.system.api.domain.OutMaterialDetail;
import com.mhd.system.api.domain.OutMaterialDetailTZPD;
import com.mhd.system.api.domain.StockOutOrder;
import com.mhd.system.api.domain.StockOutOrderTZPD;
import com.mhd.system.api.model.LoginUser;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* 出库单
*
* @author gen
* @date 2024-05-28
*/
@Service
@Slf4j
public class ReserveStockOutOrderDomainService {
@Autowired
private IReserveStockOutOrderService stockOutOrderService;
@Autowired
private IReserveOutMaterialDetailService outMaterialDetailService;
@Autowired
private IReserveStockInOrderService reservationStockInOrderService;
// @Autowired
// private IHandoverTaskOrderService handoverTaskOrderService;
// @Autowired
// private IOutOrderAbnormalService outOrderAbnormalService;
// @Autowired
// private PickingOrderDomainService pickingOrderDomainService;
// @Autowired
// private ReplenishmentNoticeDomainService replenishmentNoticeDomainService;
// @Autowired
// private IMobilizeManageService iMobilizeManageService;
// @Autowired
// private IMobilizeManageDetailService iMobilizeManageDetailService;
// @Autowired
// private StockInOrderDomainService stockInOrderDomainService;
// @Autowired
// private IInventoryStandingDetailService inventoryStandingDetailService;
// @Autowired
// private IDeliveTaskService deliveTaskService;
// @Autowired
// private WaveOrderServiceFactory waveOrderServiceFactory;
// @Autowired
// private IMaterialBaseInfoService materialBaseInfoService;
@Autowired
private ReserveStockInOrderMapper reservationStockInOrderMapper;
@Autowired
private BusinessDocumentOrderMapper businessDocumentOrderMapper;
// @Autowired
// private IMaterialWarehouseControlService materialWarehouseControlService;
// @Autowired
// private IMaterialInventoryService materialInventoryService;
@Resource
private SystemServiceFeign systemServiceFeign;
@Resource
private WmsServiceFeign wmsServiceFeign;
// @Autowired
// private PushSyncBmsDomainService pushSyncBmsDomainService;
// @Autowired
// private MaterialBaseInfoMapper materialBaseInfoMapper;
// @Autowired
// private MaterialInventoryMapper materialInventoryMapper;
// @Autowired
// private IPickingMaterialDetailService pickingMaterialDetailService;
/**
* 分页查询出库单列表
*/
public List<ReserveStockOutOrderPO> queryList(ReserveStockOutOrderDO stockOutOrderDO) {
return stockOutOrderService.queryList(stockOutOrderDO);
}
/**
* 新增出库单
*/
@Transactional(rollbackFor = Exception.class)
public Boolean insert(ReserveStockOutOrderDO stockOutOrderDO) {
if (stockOutOrderDO.getOutOrderNumber() == null) {
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
}
// update / batchInsert 一致前端传计划数量为 quantity outboundQuantity
setMaterialDetailInfo(stockOutOrderDO);
stockOutOrderDO.setMaterialQuantity(stockOutOrderDO.getMaterialDetailList().size());
BigDecimal quantity = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setQuantity(quantity);
BigDecimal weightLimit = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setWeightLimit(weightLimit);
BigDecimal volumeLimit = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setVolumeLimit(volumeLimit);
// 复核下发状态默认为否2
if (stockOutOrderDO.getCheckTaskDistribution() == null) {
stockOutOrderDO.setCheckTaskDistribution(2);
}
stockOutOrderService.insert(stockOutOrderDO);
return outMaterialDetailService.batchInsert(stockOutOrderDO.getOutOrderNumber(), stockOutOrderDO.getMaterialDetailList());
}
/**
* 批量新增出库单
*/
@Transactional(rollbackFor = Exception.class)
public Boolean batchInsert(List<ReserveStockOutOrderDO> stockOutOrderDOList) {
for (ReserveStockOutOrderDO stockOutOrderDO : stockOutOrderDOList){
if (StringUtils.isBlank(stockOutOrderDO.getOutOrderNumber())){
stockOutOrderDO.setOutOrderNumber(OrderSequence.getOrderCode("CK"));
}
//设置物料信息
setMaterialDetailInfo(stockOutOrderDO);
//统计种类
stockOutOrderDO.setMaterialQuantity(stockOutOrderDO.getMaterialDetailList().size());
//统计总数量
BigDecimal quantity = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setQuantity(quantity);
//统计总重量
BigDecimal weightLimit = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setWeightLimit(weightLimit);
//统计总体积
BigDecimal volumeLimit = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setVolumeLimit(volumeLimit);
// 复核下发状态默认为否2
if (stockOutOrderDO.getCheckTaskDistribution() == null) {
stockOutOrderDO.setCheckTaskDistribution(2);
}
stockOutOrderService.insert(stockOutOrderDO);
outMaterialDetailService.batchInsert(stockOutOrderDO.getOutOrderNumber(), stockOutOrderDO.getMaterialDetailList());
}
return true;
}
/**
* 修改出库单
*/
public Boolean update(ReserveStockOutOrderDO stockOutOrderDO) {
ReserveStockOutOrderPO stockInOrderPO = stockOutOrderService.getInfo(stockOutOrderDO.getOutOrderId());
if (stockInOrderPO == null){
throw new ServiceException("出库单信息不存在");
}
//设置物料信息
setMaterialDetailInfo(stockOutOrderDO);
//统计种类
stockOutOrderDO.setMaterialQuantity(stockOutOrderDO.getMaterialDetailList().size());
//统计总数量
BigDecimal quantity = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getQuantity).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setQuantity(quantity);
//统计总重量
BigDecimal weightLimit = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getWeightLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setWeightLimit(weightLimit);
//统计总体积
BigDecimal volumeLimit = stockOutOrderDO.getMaterialDetailList().stream().map(ReserveOutMaterialDetailDO::getVolumeLimit).filter(Objects::nonNull).reduce(BigDecimal.ZERO, BigDecimal::add);
stockOutOrderDO.setVolumeLimit(volumeLimit);
stockOutOrderService.update(stockOutOrderDO);
ReserveOutMaterialDetailBaseDO outMaterialDetailBaseDO = new ReserveOutMaterialDetailBaseDO();
BeanUtils.copyProperties(stockOutOrderDO, outMaterialDetailBaseDO);
outMaterialDetailBaseDO.setOutOrderNumber(stockInOrderPO.getOutOrderNumber());
// if (stockOutOrderDO.getNeedTransportFlag() .equals("0")) {
// List<BusinessDocumentOrder> businessDocumentOrders = businessDocumentOrderMapper.selectList(new LambdaQueryWrapper<BusinessDocumentOrder>().eq(BusinessDocumentOrder::getInOrderNumber, stockOutOrderDO.getOutOrderNumber()).notIn(BusinessDocumentOrder::getOrderStatus, 4, 5));
// if (businessDocumentOrders != null && businessDocumentOrders.size() > 0) {
// for (BusinessDocumentOrder businessDocumentOrder : businessDocumentOrders) {
// businessDocumentOrder.setOrderStatus(4L);
// String executeOrderNumber = businessDocumentOrder.getExecuteOrderNumber();
//
// if (executeOrderNumber !=null){
// throw new ServiceException("该业务单已生成执行单,取消失败");
// }
// businessDocumentOrderMapper.updateById(businessDocumentOrder);
// }
// }
// }
return outMaterialDetailService.batchUpdate(stockOutOrderDO.getMaterialDetailList(), outMaterialDetailBaseDO);
}
public Boolean close(ReserveStockOutOrderDO stockOutOrderDO) {
ReserveStockOutOrderPO stockInOrderPO = stockOutOrderService.getInfo(stockOutOrderDO.getOutOrderId());
if (stockInOrderPO == null){
throw new ServiceException("出库单信息不存在");
}
if (stockInOrderPO.getStatus() != 1){
throw new ServiceException("只有已创建状态下能允许关闭出库单");
}
stockOutOrderDO.setStatus(11);
return stockOutOrderService.update(stockOutOrderDO);
}
public Boolean pushOutOrder(StockOutOrderTZPD stockOutOrder) {
ReserveStockOutOrder reservationStockOutOrder = new ReserveStockOutOrder();
BeanUtils.copyProperties(stockOutOrder, reservationStockOutOrder);
reservationStockOutOrder.setIssueStatus(4);
return stockOutOrderService.save(reservationStockOutOrder);
}
public Boolean pushOutOrderDetail(OutMaterialDetailTZPD outMaterialDetail) {
ReserveOutMaterialDetail reservationOutMaterialDetail = new ReserveOutMaterialDetail();
BeanUtils.copyProperties(outMaterialDetail, reservationOutMaterialDetail);
return outMaterialDetailService.save(reservationOutMaterialDetail);
}
/**
* @description 审核出库单
* @author ZhouGY
* @date 2024/5/21 13:53
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
public Boolean auditState(ReserveStockOutOrderDO stockOutOrderDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
Integer auditStatus = stockOutOrderDO.getIssueStatus();
Integer issueStatus = 0;
issueStatus = auditStatus == 2 ? 2 : 3;
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
return stockOutOrderService.update(null, new UpdateWrapper<ReserveStockOutOrder>().lambda()
.set(ReserveStockOutOrder::getReservationAuditId, loginUser.getUserid())
.set(ReserveStockOutOrder::getReservationAuditName, userRealName)
.set(ReserveStockOutOrder::getReservationAuditTime, new Date())
.set(ReserveStockOutOrder::getUpdateBy, loginUser.getUserid())
.set(ReserveStockOutOrder::getUpdateByName, userRealName)
.set(ReserveStockOutOrder::getUpdateTime, new Date())
.set(ReserveStockOutOrder::getIssueStatus, issueStatus)
.in(ReserveStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
}
/**
* @description 审核出库单
* @author ZhouGY
* @date 2024/5/21 13:53
* @param stockOutOrderDO
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
public Boolean issueOrder(ReserveStockOutOrderDO stockOutOrderDO) {
LoginUser loginUser = SecurityUtils.getLoginUser();
// 获取用户姓名优先从UserPo获取如果为空则使用realname最后使用username作为兜底
String userRealName = loginUser.getUserPo() != null && loginUser.getUserPo().getUserName() != null
? loginUser.getUserPo().getUserName()
: (loginUser.getRealname() != null ? loginUser.getRealname() : loginUser.getUsername());
boolean update = stockOutOrderService.update(null, new UpdateWrapper<ReserveStockOutOrder>().lambda()
.set(ReserveStockOutOrder::getIssueId, loginUser.getUserid())
.set(ReserveStockOutOrder::getIssueName, userRealName)
.set(ReserveStockOutOrder::getIssueTime, new Date())
//.set(ReserveStockOutOrder::getIssueStatus, 1)
.set(ReserveStockOutOrder::getUpdateBy, loginUser.getUserid())
.set(ReserveStockOutOrder::getUpdateByName, userRealName)
.set(ReserveStockOutOrder::getUpdateTime, new Date())
.in(ReserveStockOutOrder::getOutOrderId, stockOutOrderDO.getOutOrderIds()));
//todo下发推送到wms
List<Long> inOrderIds = stockOutOrderDO.getOutOrderIds();
for (Long inOrderId : inOrderIds) {
ReserveStockOutOrder byId = stockOutOrderService.getById(inOrderId);
StockOutOrder stockOutOrder = new StockOutOrder();
BeanUtils.copyProperties(byId, stockOutOrder,"outOrderId");
wmsServiceFeign.omsOutOrderAdd(stockOutOrder);
String inOrderNumber = stockOutOrder.getOutOrderNumber();
List<ReserveOutMaterialDetail> materialDetailList = outMaterialDetailService.list(new QueryWrapper<ReserveOutMaterialDetail>().lambda().eq(ReserveOutMaterialDetail::getOutOrderNumber, inOrderNumber));
List<OutMaterialDetail> outMaterialDetailList = new ArrayList<>();
for (ReserveOutMaterialDetail reservationOutMaterialDetail : materialDetailList) {
OutMaterialDetail outMaterialDetail = new OutMaterialDetail();
BeanUtils.copyProperties(reservationOutMaterialDetail, outMaterialDetail,"materialDetailId");
outMaterialDetailList.add(outMaterialDetail);
}
wmsServiceFeign.omsOutOrderAddDetail(outMaterialDetailList);
}
return update;
}
/**
* @description 修改出库单
* @author ZhouGY
* @date 2024/8/8 16:18
* @param stockOutOrderDb
* @param stockOutOrderPO
* @return Boolean
*/
// public Boolean updateReserveStockOutOrderByAllocation(ReserveStockOutOrder stockOutOrderDb, ReserveStockOutOrderPO stockOutOrderPO, Integer type) {
// LoginUser loginUser = SecurityUtils.getLoginUser();
// int status = judgeAllocationQuantityByManualAssign(stockOutOrderPO.getAllocationQuantity(), stockOutOrderDb.getQuantity(),type);
// BigDecimal allocationQuantity = stockOutOrderDb.getAllocationQuantity();
// BigDecimal alreadyAllocationQuantity = stockOutOrderDb.getAlreadyAllocationQuantity() != null
// ? stockOutOrderDb.getAlreadyAllocationQuantity()
// : BigDecimal.ZERO;
// if (type == 2){
// //取消分配stockOutOrderPO.getAllocationQuantity() stockOutOrderPO.getAlreadyAllocationQuantity() 都是要取消的数量
// //物料明细层面的验证已经在 batchCancelAssignUpdate 中完成这里直接使用即可
// BigDecimal cancelQuantity = stockOutOrderPO.getAllocationQuantity();
// stockOutOrderService.update(null,new UpdateWrapper<ReserveStockOutOrder>().lambda()
// .setSql("allocation_quantity = allocation_quantity - " + cancelQuantity)//取消分配减数量
// .eq(ReserveStockOutOrder::getOutOrderId, stockOutOrderDb.getOutOrderId())
// );
// BigDecimal cancelAlreadyAllocationQuantity = stockOutOrderPO.getAlreadyAllocationQuantity() != null
// ? stockOutOrderPO.getAlreadyAllocationQuantity()
// : BigDecimal.ZERO;
//
// // 取消分配减少已分配数量
// // 注意如果出库单的 alreadyAllocationQuantity 数据不一致可能为0使用 cancelAlreadyAllocationQuantity 作为参考
// // 但为了数据一致性我们仍然从当前值中减去取消的数量
// if (alreadyAllocationQuantity.compareTo(cancelAlreadyAllocationQuantity) < 0) {
// // 如果出库单的已分配数量小于要取消的数量说明数据不一致使用要取消的数量作为基准
// alreadyAllocationQuantity = cancelAlreadyAllocationQuantity;
// }
// alreadyAllocationQuantity = alreadyAllocationQuantity.subtract(cancelQuantity);
// // 确保不会变成负数
// if (alreadyAllocationQuantity.compareTo(BigDecimal.ZERO) < 0) {
// alreadyAllocationQuantity = BigDecimal.ZERO;
// }
// BigDecimal subtract = stockOutOrderPO.getAlreadyAllocationQuantity().subtract(alreadyAllocationQuantity);
// if (subtract.compareTo(BigDecimal.ZERO) == 0) {
// status = 2;
// } else {
// status = 3;
// }
//// status = judgeAllocationQuantityByManualAssign(stockOutOrderPO.getAllocationQuantity(), stockOutOrderPO.getAlreadyAllocationQuantity(),type);
//
// }else {
// allocationQuantity = stockOutOrderPO.getAllocationQuantity();//直接使用返回的分配数量
// alreadyAllocationQuantity = alreadyAllocationQuantity.add(stockOutOrderPO.getAlreadyAllocationQuantity() != null
// ? stockOutOrderPO.getAlreadyAllocationQuantity()
// : BigDecimal.ZERO);
// }
// LambdaUpdateWrapper<ReserveStockOutOrder> wrapper = new UpdateWrapper<ReserveStockOutOrder>().lambda()
// .set(ReserveStockOutOrder::getStatus, status)
// .set(ReserveStockOutOrder::getAlreadyAllocationQuantity, alreadyAllocationQuantity)
// .set(ReserveStockOutOrder::getUpdateBy, loginUser.getUserid())
// .set(ReserveStockOutOrder::getUpdateByName, loginUser.getUsername())
// .set(ReserveStockOutOrder::getUpdateTime, new Date())
// .eq(ReserveStockOutOrder::getOutOrderId, stockOutOrderDb.getOutOrderId());
// if (type != 2){
// wrapper.set(ReserveStockOutOrder::getAllocationQuantity, allocationQuantity);
// }
// return stockOutOrderService.update(null, wrapper);
// }
/**
* 批量删除出库单
*/
public Boolean delete(Long[] outOrderIds) {
return stockOutOrderService.delete(outOrderIds);
}
/**
* 获取出库单详细信息
*/
public ReserveStockOutOrderPO getInfo(Long outOrderId) {
return stockOutOrderService.getInfo(outOrderId);
}
/**
* 获取出库单详细信息
*/
public ReserveStockOutOrderPO getInfoChildren(Long outOrderId) {
ReserveStockOutOrderPO stockOutOrderPO = stockOutOrderService.getInfo(outOrderId);
ReserveOutMaterialDetailDO outMaterialDetailDO = new ReserveOutMaterialDetailDO();
outMaterialDetailDO.setOutOrderNumber(stockOutOrderPO.getOutOrderNumber());
List<ReserveOutMaterialDetailPO> materialDetailPOList = outMaterialDetailService.queryListChildren(outMaterialDetailDO);
// for (ReserveOutMaterialDetailPO outMaterialDetailPO : materialDetailPOList) {
// String materialNo = outMaterialDetailPO.getMaterialNo();
// List<MaterialBaseInfoPO> materialBaseInfos = materialBaseInfoMapper.selectList(new QueryWrapper<MaterialBaseInfoPO>().lambda().eq(MaterialBaseInfoPO::getMaterialCode, materialNo));
// if (!CollectionUtils.isEmpty(materialBaseInfos) && materialBaseInfos.size() > 0) {
// outMaterialDetailPO.setCommodityName(materialBaseInfos.get(0).getMaterialNamePO());
// outMaterialDetailPO.setMaterialCode(materialBaseInfos.get(0).getMaterialCodePO());
// outMaterialDetailPO.setMaterialName(materialBaseInfos.get(0).getMaterialNamePO());
// }
// }
stockOutOrderPO.setMaterialDetailList(materialDetailPOList);
return stockOutOrderPO;
}
/**
* 获取出库单详细信息PDA复核管理查询详情
* 复核场景下与PC端getCheckInfo保持一致返回拣货下发时的完整数据树形结构拣货汇总批次属性等
*/
// public ReserveStockOutOrderPO getInfoByApp(Long outOrderId) {
// ReserveStockOutOrder stockOutOrder = stockOutOrderService.getById(outOrderId);
// if (stockOutOrder == null) {
// throw new ServiceException("出库单不存在");
// }
// // 复核场景与PC端getCheckInfo保持一致返回拣货下发的完整数据含历史记录 status=9 已出库与列表详情一致
// if (stockOutOrder.getReview() != null && stockOutOrder.getReview() == 1
// && stockOutOrder.getStatus() != null && (stockOutOrder.getStatus() == 7 || stockOutOrder.getStatus() == 8 || stockOutOrder.getStatus() == 9)) {
// ReserveStockOutOrderDO stockOutOrderDO = new ReserveStockOutOrderDO();
// stockOutOrderDO.setOutOrderNumber(stockOutOrder.getOutOrderNumber());
// ReserveStockOutOrderPO stockOutOrderPO = getCheckInfo(stockOutOrderDO);
// // PDA端需扁平化树形结构与PC端展开后的展示条数一致父项+子项全部展开为独立行
// List<ReserveOutMaterialDetailPO> flattenedList = flattenMaterialDetailTree(stockOutOrderPO.getMaterialDetailList());
// stockOutOrderPO.setMaterialDetailList(flattenedList);
// if (stockOutOrderPO.getOutMaterialCheckPO() != null) {
// stockOutOrderPO.getOutMaterialCheckPO().setCount(flattenedList.size());
// }
// return stockOutOrderPO;
// }
// // 非复核场景保持原有逻辑
// ReserveStockOutOrderPO stockOutOrderPO = stockOutOrderService.getInfo(outOrderId);
// ReserveOutMaterialDetailDO outMaterialDetailDO = new ReserveOutMaterialDetailDO();
// outMaterialDetailDO.setOutOrderNumber(stockOutOrderPO.getOutOrderNumber());
// List<ReserveOutMaterialDetailPO> materialDetailPOList = outMaterialDetailService.queryList(outMaterialDetailDO);
// materialDetailPOList.forEach(d -> {
// if (d.getWaitCheckQuantity() != null) d.setActualQuantity(d.getWaitCheckQuantity());
// });
// stockOutOrderPO.setMaterialDetailList(materialDetailPOList);
// return stockOutOrderPO;
// }
// @Autowired
// private IMaterialBarCodeService materialBarCodeService;
/**
* 获取出库单复核详细信息
*/
// public ReserveStockOutOrderPO getCheckInfo(ReserveStockOutOrderDO stockOutOrderDO) {
// String outOrderNumber = stockOutOrderDO.getOutOrderNumber();
// ReserveStockOutOrder stockOutOrder = stockOutOrderService.getOne(new QueryWrapper<ReserveStockOutOrder>().lambda()
// .eq(ReserveStockOutOrder::getDelFlag, 1)
// .eq(ReserveStockOutOrder::getOutOrderNumber, stockOutOrderDO.getOutOrderNumber()));
// if (stockOutOrder == null){
// throw new ServiceException("出库单【" + stockOutOrderDO.getOutOrderNumber() + "】不存在");
// }
// if (stockOutOrder.getReview() != 1){
// throw new ServiceException("出库单【" + stockOutOrderDO.getOutOrderNumber() + "】不需要复核");
// }
// if (stockOutOrder.getStatus() != 7 && stockOutOrder.getStatus() != 8){
// throw new ServiceException("出库单【" + stockOutOrderDO.getOutOrderNumber() + "】状态不是拣货完成或复核中");
// }
// ReserveStockOutOrderPO stockOutOrderPO = new ReserveStockOutOrderPO();
// BeanUtils.copyProperties(stockOutOrder, stockOutOrderPO);
// ReserveOutMaterialDetailDO outMaterialDetailDO = new ReserveOutMaterialDetailDO();
// outMaterialDetailDO.setOutOrderNumber(stockOutOrderPO.getOutOrderNumber());
// List<ReserveOutMaterialDetailPO> outMaterialDetailPOList = outMaterialDetailService.queryListChildren(outMaterialDetailDO);
// for (ReserveOutMaterialDetailPO outMaterialDetailPO : outMaterialDetailPOList) {//获取物料条形码
// List<MaterialBarCodePO> materialBarCodePOList = materialBarCodeService.getInfoByMaterialBaseInfoIds(outMaterialDetailPO.getMaterialBaseInfoId());
// if (materialBarCodePOList != null && !materialBarCodePOList.isEmpty()) {
// Map<Long, MaterialBarCodePO> collect = materialBarCodePOList.stream()
// .collect(Collectors.toMap(
// MaterialBarCodePO::getMaterialBaseInfoId,
// po -> po,
// (existing, replacement) -> existing
// ));
// MaterialBarCodePO materialBarCodePO = collect.get(outMaterialDetailPO.getMaterialBaseInfoId());
// if (materialBarCodePO != null && materialBarCodePO.getBarCode() != null) {
// outMaterialDetailPO.setBarCode(materialBarCodePO.getBarCode());
// }
// }
// }
// for (ReserveOutMaterialDetailPO outMaterialDetailPO : outMaterialDetailPOList) {
// outMaterialDetailPO.setMaterialCode(outMaterialDetailPO.getMaterialNo());
// outMaterialDetailPO.setMaterialName(outMaterialDetailPO.getCommodityName());
// Long uniqueId = outMaterialDetailPO.getUniqueId();
// PickingMaterialDetailPO pickingMaterialDetailPO = pickingMaterialDetailService.queryTotalsByOutNumberAndBaseId(uniqueId);
// if (ObjectUtils.isNotEmpty(pickingMaterialDetailPO)) {
// outMaterialDetailPO.setTotalArea(pickingMaterialDetailPO.getTotalArea());
// outMaterialDetailPO.setTotalVolume(pickingMaterialDetailPO.getTotalVolume());
// outMaterialDetailPO.setTotalNetWeight(pickingMaterialDetailPO.getTotalNetWeight());
// outMaterialDetailPO.setTotalGrossWeight(pickingMaterialDetailPO.getTotalGrossWeight());
// outMaterialDetailPO.setCheckArea(pickingMaterialDetailPO.getTotalArea());
// outMaterialDetailPO.setCheckVolume(pickingMaterialDetailPO.getTotalVolume());
// outMaterialDetailPO.setCheckNetWeight(pickingMaterialDetailPO.getTotalNetWeight());
// outMaterialDetailPO.setCheckGrossWeight(pickingMaterialDetailPO.getTotalGrossWeight());
// // 拣货数量优先 picking_material_detail否则 out_material_detail
// BigDecimal pickQty = (pickingMaterialDetailPO.getPickingQuantity() != null && pickingMaterialDetailPO.getPickingQuantity().compareTo(BigDecimal.ZERO) > 0)
// ? pickingMaterialDetailPO.getPickingQuantity() : outMaterialDetailPO.getPickingQuantity();
// BigDecimal checkQty = outMaterialDetailPO.getCheckQuantity() != null ? outMaterialDetailPO.getCheckQuantity() : BigDecimal.ZERO;
// // 待复核数量 = 拣货数量 - 已复核数量复核提交后应减少
// BigDecimal waitQty = (pickQty != null ? pickQty : BigDecimal.ZERO).subtract(checkQty);
// if (waitQty.compareTo(BigDecimal.ZERO) < 0) {
// waitQty = BigDecimal.ZERO;
// }
// outMaterialDetailPO.setWaitCheckQuantity(waitQty);
// // quantity=PC下发时的拣货数量actualQuantity已复核则取checkQuantity否则取待复核数量
// if (pickQty != null) {
// outMaterialDetailPO.setQuantity(pickQty);
// }
// outMaterialDetailPO.setActualQuantity(checkQty.compareTo(BigDecimal.ZERO) > 0 ? checkQty : waitQty);
// }
// List<ReserveOutMaterialDetailPO> children = outMaterialDetailPO.getChildren();
// if (!CollectionUtils.isEmpty(children)) {
// for (ReserveOutMaterialDetailPO outMaterialDetailPOChild : children) {
// outMaterialDetailPOChild.setMaterialCode(outMaterialDetailPOChild.getMaterialNo());
// outMaterialDetailPOChild.setMaterialName(outMaterialDetailPOChild.getCommodityName());
// Long uniqueIdChild = outMaterialDetailPOChild.getUniqueId();
// PickingMaterialDetailPO pickingMaterialDetailPO1 = pickingMaterialDetailService.queryTotalsByOutNumberAndBaseId(uniqueIdChild);
// if (ObjectUtils.isNotEmpty(pickingMaterialDetailPO1)) {
// outMaterialDetailPOChild.setTotalArea(pickingMaterialDetailPO1.getTotalArea());
// outMaterialDetailPOChild.setTotalVolume(pickingMaterialDetailPO1.getTotalVolume());
// outMaterialDetailPOChild.setTotalNetWeight(pickingMaterialDetailPO1.getTotalNetWeight());
// outMaterialDetailPOChild.setTotalGrossWeight(pickingMaterialDetailPO1.getTotalGrossWeight());
// outMaterialDetailPOChild.setCheckArea(pickingMaterialDetailPO1.getTotalArea());
// outMaterialDetailPOChild.setCheckVolume(pickingMaterialDetailPO1.getTotalVolume());
// outMaterialDetailPOChild.setCheckNetWeight(pickingMaterialDetailPO1.getTotalNetWeight());
// outMaterialDetailPOChild.setCheckGrossWeight(pickingMaterialDetailPO1.getTotalGrossWeight());
// // 拣货数量优先 picking_material_detail否则 out_material_detail
// BigDecimal pickQtyChild = (pickingMaterialDetailPO1.getPickingQuantity() != null && pickingMaterialDetailPO1.getPickingQuantity().compareTo(BigDecimal.ZERO) > 0)
// ? pickingMaterialDetailPO1.getPickingQuantity() : outMaterialDetailPOChild.getPickingQuantity();
// BigDecimal checkQtyChild = outMaterialDetailPOChild.getCheckQuantity() != null ? outMaterialDetailPOChild.getCheckQuantity() : BigDecimal.ZERO;
// // 待复核数量 = 拣货数量 - 已复核数量复核提交后应减少
// BigDecimal waitQtyChild = (pickQtyChild != null ? pickQtyChild : BigDecimal.ZERO).subtract(checkQtyChild);
// if (waitQtyChild.compareTo(BigDecimal.ZERO) < 0) {
// waitQtyChild = BigDecimal.ZERO;
// }
// outMaterialDetailPOChild.setWaitCheckQuantity(waitQtyChild);
// // quantity=PC下发时的拣货数量actualQuantity已复核则取checkQuantity否则取待复核数量
// if (pickQtyChild != null) {
// outMaterialDetailPOChild.setQuantity(pickQtyChild);
// }
// outMaterialDetailPOChild.setActualQuantity(checkQtyChild.compareTo(BigDecimal.ZERO) > 0 ? checkQtyChild : waitQtyChild);
// }
// }
// }
// }
// stockOutOrderPO.setMaterialDetailList(outMaterialDetailPOList);
// BigDecimal weightLimit = BigDecimal.ZERO;
// BigDecimal volumeLimit = BigDecimal.ZERO;
// BigDecimal wantNumber = BigDecimal.ZERO;
// BigDecimal alreadyNumber = BigDecimal.ZERO;
// for (ReserveOutMaterialDetailPO outMaterialDetailPO : outMaterialDetailPOList){
// weightLimit = weightLimit.add(outMaterialDetailPO.getWeightLimit());
// volumeLimit = volumeLimit.add(outMaterialDetailPO.getVolumeLimit());
// // wantNumber=拣货数量总和alreadyNumber=已复核总和notHaveNumber=剩余待复核
// BigDecimal pickQty = (outMaterialDetailPO.getQuantity() != null ? outMaterialDetailPO.getQuantity() : outMaterialDetailPO.getPickingQuantity());
// wantNumber = wantNumber.add(pickQty != null ? pickQty : BigDecimal.ZERO);
// alreadyNumber = alreadyNumber.add(outMaterialDetailPO.getCheckQuantity() != null ? outMaterialDetailPO.getCheckQuantity() : BigDecimal.ZERO);
// }
// OutMaterialCheckPO outMaterialCheckPO = new OutMaterialCheckPO();
// outMaterialCheckPO.setCount(outMaterialDetailPOList.size());
// outMaterialCheckPO.setWeightLimit(weightLimit);
// outMaterialCheckPO.setVolumeLimit(volumeLimit);
// outMaterialCheckPO.setAlreadyNumber(alreadyNumber);
// outMaterialCheckPO.setNotHaveNumber(wantNumber.subtract(alreadyNumber));
// stockOutOrderPO.setOutMaterialCheckPO(outMaterialCheckPO);
//
// List<ReserveOutMaterialDetailPO> materialDetailList = stockOutOrderPO.getMaterialDetailList();
// // 性能优化批量获取批次属性避免N+1查询问题
// // 1. 收集所有唯一的materialBaseInfoId
// Set<Long> materialBaseInfoIdSet = materialDetailList.stream()
// .map(ReserveOutMaterialDetailPO::getMaterialBaseInfoId)
// .filter(Objects::nonNull)
// .collect(Collectors.toSet());
//
// // 2. 批量查询批次属性使用Map缓存避免重复查询相同的materialBaseInfoId
// Map<Long, List<BatchDetailFeignPO>> batchDetailMap = new HashMap<>();
// for (Long materialBaseInfoId : materialBaseInfoIdSet) {
// try {
// AjaxResult ajaxResult = systemServiceFeign.getBatchDetailListByMaterialBaseInfoId(materialBaseInfoId);
// if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))) {
// List<BatchDetailFeignPO> batchDetailFeignPOList = JSON.parseArray(
// JSONObject.toJSONString(ajaxResult.get("data")), BatchDetailFeignPO.class);
// if (!CollectionUtils.isEmpty(batchDetailFeignPOList)) {
// // 过滤isDisplay=1的属性
// List<BatchDetailFeignPO> filteredList = batchDetailFeignPOList.stream()
// .filter(batchDetail -> batchDetail.getIsDisplay() != null && batchDetail.getIsDisplay() == 1)
// .collect(Collectors.toList());
// batchDetailMap.put(materialBaseInfoId, filteredList);
// }
// }
// } catch (Exception e) {
// log.warn("获取物料批次属性失败,物料基础信息ID:{},错误:{}", materialBaseInfoId, e.getMessage());
// }
// }
//
// // 3. 为每个物料明细设置更多属性从库存表中获取值
// setMaterialMoreDetailListFromInventory(materialDetailList, batchDetailMap);
// // 过滤无拣货数量的明细pickingQuantity waitCheckQuantity 任一 >= 1 则保留waitCheckQuantity 来自 picking_material_detail 已拣货数量
// materialDetailList.removeIf(detail -> {
// BigDecimal pickQty = detail.getPickingQuantity() != null ? detail.getPickingQuantity() : BigDecimal.ZERO;
// BigDecimal waitQty = detail.getWaitCheckQuantity() != null ? detail.getWaitCheckQuantity() : BigDecimal.ZERO;
// return pickQty.compareTo(BigDecimal.ONE) < 0 && waitQty.compareTo(BigDecimal.ONE) < 0;
// });
// stockOutOrderPO.setMaterialDetailList(materialDetailList);
// return stockOutOrderPO;
// }
/**
* 将物料明细树形结构扁平化PDA端展示与PC端条数一致父项+子项全部展开为独立行
*/
private List<ReserveOutMaterialDetailPO> flattenMaterialDetailTree(List<ReserveOutMaterialDetailPO> treeList) {
if (CollectionUtils.isEmpty(treeList)) {
return new ArrayList<>();
}
List<ReserveOutMaterialDetailPO> result = new ArrayList<>();
for (ReserveOutMaterialDetailPO item : treeList) {
result.add(item);
List<ReserveOutMaterialDetailPO> children = item.getChildren();
if (!CollectionUtils.isEmpty(children)) {
List<ReserveOutMaterialDetailPO> flattenedChildren = flattenMaterialDetailTree(children);
result.addAll(flattenedChildren);
item.setChildren(null);
}
}
return result;
}
/**
* @description 修改出库单数据
* @author ZhouGY
* @date 2024/7/19 22:52
* @param stockOutOrderPO
* @param stockOutOrderDb
* @param type 1-分配 2-取消分配
* @return Boolean
*/
@Transactional(rollbackFor = Exception.class)
public Boolean updateReserveStockOutOrder(ReserveStockOutOrderPO stockOutOrderPO, ReserveStockOutOrder stockOutOrderDb, Integer type){
LoginUser loginUser = SecurityUtils.getLoginUser();
ReserveStockOutOrder stockOutOrder = new ReserveStockOutOrder();
stockOutOrder.setOutOrderId(stockOutOrderDb.getOutOrderId());
stockOutOrder.setStatus(8);
stockOutOrder.setCheckStatus(2);
if (type == 1){
stockOutOrder.setCheckQuantity(stockOutOrderDb.getCheckQuantity().add(stockOutOrderPO.getCheckQuantity()));
}else {
stockOutOrder.setCheckQuantity(stockOutOrderDb.getCheckQuantity().subtract(stockOutOrderPO.getCheckQuantity()));
}
stockOutOrder.setUpdateBy(loginUser.getUserid());
stockOutOrder.setUpdateByName(loginUser.getUsername());
stockOutOrder.setUpdateTime(new Date());
return stockOutOrderService.updateById(stockOutOrder);
}
/**
* @description 设置物料信息
* @author ZhouGY
* @date 2024/5/23 14:03
* @param stockOutOrderDO
*/
private void setMaterialDetailInfo(ReserveStockOutOrderDO stockOutOrderDO){
List<ReserveOutMaterialDetailDO> outMaterialDetailDOList = stockOutOrderDO.getMaterialDetailList();
outMaterialDetailDOList.forEach(outMaterialDetailDO -> {
// Long materialBaseInfoId = outMaterialDetailDO.getMaterialBaseInfoId();
MaterialBaseInfoPO materialBaseInfoPO = reservationStockInOrderMapper.getinfo(outMaterialDetailDO.getMaterialBaseInfoId());
if (materialBaseInfoPO == null){
throw new ServiceException("物料基础信息不存在");
}
outMaterialDetailDO.setMaterialCode(materialBaseInfoPO.getMaterialCode());
outMaterialDetailDO.setMaterialName(materialBaseInfoPO.getMaterialName());
outMaterialDetailDO.setBarCode(materialBaseInfoPO.getBarCode());
outMaterialDetailDO.setPackId(materialBaseInfoPO.getPackId());
outMaterialDetailDO.setPackCode(materialBaseInfoPO.getPackCode());
outMaterialDetailDO.setPackName(materialBaseInfoPO.getPackName());
});
}
/**
* 出库单提货单打印-表头
*/
public List<ReserveStockOutOrderPO> queryOutStockNoticePrint(ReserveStockOutOrderDO stockOutOrderDO) {
return stockOutOrderService.queryOutStockNoticePrint(stockOutOrderDO);
}
/**
* 出库单提货单打印-明细
*/
public List<ReserveOutMaterialDetailPO> queryOutStockNoticePrintDetail(ReserveStockOutOrderDO stockOutOrderDO) {
return stockOutOrderService.queryOutStockNoticePrintDetail(stockOutOrderDO);
}
}
@@ -0,0 +1,211 @@
package com.mhd.oms.interfaces.facade.ReserveStockOutOrder;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mhd.common.core.web.controller.BaseController;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.core.web.page.TableDataInfo;
import com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO;
import com.mhd.oms.domain.reserveStockOutOrder.entity.ReserveStockOutOrder;
import com.mhd.oms.domain.reserveStockOutOrder.repository.facade.IReserveStockOutOrderService;
import com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO;
import com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDTO;
import com.mhd.oms.domain.reserveStockOutOrder.service.ReserveStockOutOrderApplicationService;
import com.mhd.oms.domain.reserveStockOutOrder.service.ReserveStockOutOrderAssembler;
import com.mhd.system.api.domain.OutMaterialDetailTZPD;
import com.mhd.system.api.domain.StockOutOrderTZPD;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 出库单Api
*
* @author gen
* @date 2024-05-28
*/
@Slf4j
@RestController
@RequestMapping("/reserveStockOutOrderApi")
public class ReserveStockOutOrderApi extends BaseController {
@Autowired
private ReserveStockOutOrderApplicationService stockOutOrderApplicationService;
@Resource
private ReserveStockOutOrderAssembler stockOutOrderAssembler;
@Autowired
private IReserveStockOutOrderService stockOutOrderService;
/**
* 分页查询出库单列表
*/
@ApiOperation("查询出库单列表")
@GetMapping("/list")
public TableDataInfo list(ReserveStockOutOrderDTO stockOutOrderDTO)
{
//转换实体
ReserveStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDO(stockOutOrderDTO);
startPage();
List<ReserveStockOutOrderPO> list = stockOutOrderApplicationService.queryList(stockOutOrderDO);
return getDataTable(list);
}
/**
* 编辑出库单
*/
@ApiOperation("编辑出库单")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody ReserveStockOutOrderDTO stockOutOrderDTO)
{
//转换实体
ReserveStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDOByEdit(stockOutOrderDTO);
if(stockOutOrderDTO.getOutOrderId() != null){
return toAjax(stockOutOrderApplicationService.update(stockOutOrderDO));
}else {
return toAjax(stockOutOrderApplicationService.insert(stockOutOrderDO));
}
}
/**
* 批量删除出库单
*/
@ApiOperation("批量删除出库单")
@DeleteMapping("/deleteByIds/{outOrderIds}")
public AjaxResult delete(@PathVariable Long[] outOrderIds)
{
return toAjax(stockOutOrderApplicationService.delete(outOrderIds));
}
/**
* 获取出库单详细信息
*/
@ApiOperation("获取出库单")
@GetMapping(value = "/getInfo/{outOrderId}")
public AjaxResult getInfo(@PathVariable("outOrderId") Long outOrderId)
{
return AjaxResult.success(stockOutOrderApplicationService.getInfoChildren(outOrderId));
}
/**
* 根据出库单号获取出库单详细信息
*/
@ApiOperation("获取出库单")
@GetMapping(value = "/getInfoOutOrderNumber")
public AjaxResult getInfoOutOrderNumber(String outOrderNumber)
{
// 根据出库单号查询出库单再按出库单ID查询详情保证与出库管理页面一致
ReserveStockOutOrder stockOutOrder = stockOutOrderService.getOne(new LambdaQueryWrapper<ReserveStockOutOrder>()
.eq(ReserveStockOutOrder::getOutOrderNumber, outOrderNumber));
if (stockOutOrder == null) {
return AjaxResult.error("出库单不存在");
}
return AjaxResult.success(stockOutOrderApplicationService.getInfoChildren(stockOutOrder.getOutOrderId()));
}
/**
* 根据来源单号/出库单号(orderNumber)获取出库单详细信息
* 方便交接作业单等场景直接用 orderNumber 调用内部仍然通过 outOrderNumber 精确匹配出库单
*/
@ApiOperation("根据orderNumber获取出库单详情")
@GetMapping("/getInfoByOrderNumber")
public AjaxResult getInfoByOrderNumber(@RequestParam("orderNumber") String orderNumber) {
if (orderNumber == null || orderNumber.trim().isEmpty()) {
return AjaxResult.error("orderNumber不能为空");
}
ReserveStockOutOrder stockOutOrder = stockOutOrderService.getOne(new LambdaQueryWrapper<ReserveStockOutOrder>()
.eq(ReserveStockOutOrder::getOutOrderNumber, orderNumber));
if (stockOutOrder == null) {
return AjaxResult.error("出库单不存在");
}
return AjaxResult.success(stockOutOrderApplicationService.getInfoChildren(stockOutOrder.getOutOrderId()));
}
/**
* 审核出库单
*/
// @ApiOperation("审核出库单")
// @PostMapping(value = "/auditState")
// public AjaxResult auditState(@RequestBody ReserveStockOutOrderDTO stockOutOrderDTO) {
// ReserveStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDO(stockOutOrderDTO);
// return AjaxResult.success(stockOutOrderApplicationService.auditState(stockOutOrderDO));
// }
/**
* 获取出库单复核详细信息
*/
// @ApiOperation("获取出库单复核详细信息")
// @GetMapping(value = "/getCheckInfo")
// public AjaxResult getCheckInfo(ReserveStockOutOrderDTO stockOutOrderDTO)
// {
// //转换实体
// ReserveStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDO(stockOutOrderDTO);
// return AjaxResult.success(stockOutOrderApplicationService.getCheckInfo(stockOutOrderDO));
// }
/**
* 审核出库单
*/
@ApiOperation("审核出库单")
@PostMapping(value = "/auditState")
public AjaxResult auditState(@RequestBody ReserveStockOutOrderDTO stockOutOrderDTO) {
ReserveStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDO(stockOutOrderDTO);
return AjaxResult.success(stockOutOrderApplicationService.auditState(stockOutOrderDO));
}
/**
* 下发出库单
*/
@ApiOperation("下发出库单")
@PostMapping(value = "/issueOrder")
public AjaxResult issueOrder(@RequestBody ReserveStockOutOrderDTO stockOutOrderDTO) {
ReserveStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDO(stockOutOrderDTO);
return AjaxResult.success(stockOutOrderApplicationService.issueOrder(stockOutOrderDO));
}
@ApiOperation("关闭出库单")
@PostMapping("/close")
public AjaxResult close(@RequestBody ReserveStockOutOrderDTO stockOutOrderDTO)
{
//转换实体
ReserveStockOutOrderDO stockOutOrderDO = stockOutOrderAssembler.toDOByEdit(stockOutOrderDTO);
return toAjax(stockOutOrderApplicationService.close(stockOutOrderDO));
}
@ApiOperation("wms推送入库单")
@PostMapping(value = "/pushOutOrder")
public AjaxResult pushOutOrder(@RequestBody StockOutOrderTZPD stockOutOrder) {
return AjaxResult.success(stockOutOrderApplicationService.pushOutOrder(stockOutOrder));
}
@ApiOperation("wms推送入库单明细")
@PostMapping(value = "/pushOutOrderDetail")
public AjaxResult pushOutOrderDetail(@RequestBody OutMaterialDetailTZPD outMaterialDetail) {
return AjaxResult.success(stockOutOrderApplicationService.pushOutOrderDetail(outMaterialDetail));
}
/**
* 出库单提货单打印
*/
@ApiOperation("出库单提货单打印")
@PostMapping("/queryOutStockNoticePrint")
public AjaxResult queryOutStockNoticePrint(@RequestBody ReserveStockOutOrderDTO stockOutOrderDTO) {
List<ReserveStockOutOrderPO> headerList = stockOutOrderApplicationService.queryOutStockNoticePrint(stockOutOrderDTO);
List<ReserveOutMaterialDetailPO> detailList = stockOutOrderApplicationService.queryOutStockNoticePrintDetail(stockOutOrderDTO);
Map<String, Object> result = new HashMap<>();
if (!headerList.isEmpty()) {
result.put("header", headerList.get(0));
}
result.put("detailList", detailList);
return AjaxResult.success(result);
}
}
@@ -0,0 +1,83 @@
package com.mhd.oms.interfaces.facade.reserveInMaterialDetail;
import com.mhd.common.core.web.controller.BaseController;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.core.web.page.TableDataInfo;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDTO;
import com.mhd.oms.domain.reserveInMaterialDetail.service.ReserveInMaterialDetailApplicationService;
import com.mhd.oms.domain.reserveInMaterialDetail.service.ReserveInMaterialDetailAssembler;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* 物料明细Api
*
* @author gen
* @date 2024-05-21
*/
@RestController
@RequestMapping("/reserveMaterialDetailApi")
public class ReserveInMaterialDetailApi extends BaseController {
@Autowired
private ReserveInMaterialDetailApplicationService inMaterialDetailApplicationService;
@Resource
private ReserveInMaterialDetailAssembler inMaterialDetailAssembler;
/**
* 分页查询物料明细列表
*/
@ApiOperation("查询物料明细列表")
@GetMapping("/list")
public TableDataInfo list(ReserveInMaterialDetailDTO inMaterialDetailDTO)
{
//转换实体
ReserveInMaterialDetailDO inMaterialDetailDO = inMaterialDetailAssembler.toDO(inMaterialDetailDTO);
startPage();
List<ReserveInMaterialDetailPO> list = inMaterialDetailApplicationService.queryList(inMaterialDetailDO);
return getDataTable(list);
}
/**
* 编辑物料明细
*/
@ApiOperation("编辑物料明细")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody ReserveInMaterialDetailDTO inMaterialDetailDTO)
{
//转换实体
ReserveInMaterialDetailDO inMaterialDetailDO = inMaterialDetailAssembler.toDOByEdit(inMaterialDetailDTO);
if(inMaterialDetailDTO.getMaterialDetailId() != null){
return toAjax(inMaterialDetailApplicationService.update(inMaterialDetailDO));
}else {
return toAjax(inMaterialDetailApplicationService.insert(inMaterialDetailDO));
}
}
/**
* 批量删除物料明细
*/
@ApiOperation("批量删除物料明细")
@DeleteMapping("/deleteByIds/{materialDetailIds}")
public AjaxResult delete(@PathVariable Long[] materialDetailIds)
{
return toAjax(inMaterialDetailApplicationService.delete(materialDetailIds));
}
/**
* 获取物料明细详细信息
*/
@ApiOperation("获取物料明细")
@GetMapping(value = "/getInfo/{materialDetailId}")
public AjaxResult getInfo(@PathVariable("materialDetailId") Long materialDetailId)
{
return AjaxResult.success(inMaterialDetailApplicationService.getInfo(materialDetailId));
}
}
@@ -0,0 +1,183 @@
package com.mhd.oms.interfaces.facade.reserveStockInOrder;
import com.mhd.common.core.web.controller.BaseController;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.core.web.page.TableDataInfo;
import com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO;
import com.mhd.oms.domain.reserveStockInOrder.repository.po.ReserveStockInOrderPO;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO;
import com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDTO;
import com.mhd.oms.domain.reserveStockInOrder.service.ReserveStockInOrderApplicationService;
import com.mhd.oms.domain.reserveStockInOrder.service.ReserveStockInOrderAssembler;
import com.mhd.system.api.domain.InMaterialDetailTZPD;
import com.mhd.system.api.domain.StockInOrderTZPD;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 入库单Api
*
* @author gen
* @date 2024-05-21
*/
@RestController
@RequestMapping("/reserveStockInOrderApi")
public class ReserveStockInOrderApi extends BaseController {
@Autowired
private ReserveStockInOrderApplicationService stockInOrderApplicationService;
@Resource
private ReserveStockInOrderAssembler stockInOrderAssembler;
/**
* 分页查询入库单列表
*/
@ApiOperation("查询入库单列表")
@GetMapping("/list")
public TableDataInfo list(ReserveStockInOrderDTO stockInOrderDTO)
{
//转换实体
ReserveStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
startPage();
List<ReserveStockInOrderPO> list = stockInOrderApplicationService.queryList(stockInOrderDO);
return getDataTable(list);
}
/**
* 编辑入库单
*/
@ApiOperation("编辑入库单")
@PostMapping("/edit")
public AjaxResult edit(@RequestBody ReserveStockInOrderDTO stockInOrderDTO)
{
//转换实体
ReserveStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDOByEdit(stockInOrderDTO);
if(stockInOrderDTO.getInOrderId() != null){
return toAjax(stockInOrderApplicationService.update(stockInOrderDO));
}else {
return toAjax(stockInOrderApplicationService.insert(stockInOrderDO));
}
}
/**
* 批量删除入库单
*/
@ApiOperation("批量删除入库单")
@DeleteMapping("/deleteByIds/{inOrderIds}")
public AjaxResult delete(@PathVariable Long[] inOrderIds)
{
return toAjax(stockInOrderApplicationService.delete(inOrderIds));
}
/**
* 获取入库单详细信息
*/
@ApiOperation("获取入库单")
@GetMapping(value = "/getInfo/{inOrderId}")
public AjaxResult getInfo(@PathVariable("inOrderId") Long inOrderId)
{
return AjaxResult.success(stockInOrderApplicationService.getInfo(inOrderId));
}
/**
* 导入入库单
*/
// @ApiOperation("导入入库单")
// @PostMapping(value = "/importData")
// public AjaxResult importData(
// @RequestParam("file") MultipartFile file,
// @RequestParam("warehouseId") Long warehouseId,
// @RequestParam("warehouseCode") String warehouseCode,
// @RequestParam("warehouseName") String warehouseName)
// {
// return AjaxResult.success(stockInOrderApplicationService.importData(file, warehouseId, warehouseCode, warehouseName));
// }
/**
* 审核入库单
*/
@ApiOperation("审核入库单")
@PostMapping(value = "/auditState")
public AjaxResult auditState(@RequestBody ReserveStockInOrderDTO stockInOrderDTO) {
ReserveStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
return AjaxResult.success(stockInOrderApplicationService.auditState(stockInOrderDO));
}
/**
* 下发入库单
*/
@ApiOperation("下发入库单")
@PostMapping(value = "/issueOrder")
public AjaxResult issueOrder(@RequestBody ReserveStockInOrderDTO stockInOrderDTO) {
ReserveStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
return AjaxResult.success(stockInOrderApplicationService.issueOrder(stockInOrderDO));
}
/**
* wms回传出入库结果
*/
@ApiOperation("wms回传出入库结果")
@GetMapping(value = "/returnResult")
public AjaxResult returnResult(@RequestParam("orderNumber") String orderNumber, @RequestParam("status") Long status, @RequestParam("type") String type) {
return AjaxResult.success(stockInOrderApplicationService.returnResult(orderNumber, status, type));
}
/**
* 取消入库单
*/
@ApiOperation("取消入库单")
@PostMapping(value = "/cancelOrder")
public AjaxResult cancelOrder(@RequestBody ReserveStockInOrderDTO stockInOrderDTO) {
ReserveStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
return AjaxResult.success(stockInOrderApplicationService.cancelOrder(stockInOrderDO));
}
/**
* 关闭入库单
*/
@ApiOperation("关闭入库单")
@PostMapping(value = "/closeOrder")
public AjaxResult closeOrder(@RequestBody ReserveStockInOrderDTO stockInOrderDTO) {
ReserveStockInOrderDO stockInOrderDO = stockInOrderAssembler.toDO(stockInOrderDTO);
return AjaxResult.success(stockInOrderApplicationService.closeOrder(stockInOrderDO));
}
@ApiOperation("wms推送入库单")
@PostMapping(value = "/pushInOrder")
public AjaxResult pushInOrder(@RequestBody StockInOrderTZPD stockInOrder) {
return AjaxResult.success(stockInOrderApplicationService.pushInOrder(stockInOrder));
}
@ApiOperation("wms推送入库单明细")
@PostMapping(value = "/pushInOrderDetail")
public AjaxResult pushInOrderDetail(@RequestBody InMaterialDetailTZPD inMaterialDetail) {
return AjaxResult.success(stockInOrderApplicationService.pushInOrderDetail(inMaterialDetail));
}
/**
* 入仓通知单打印查询
*/
@ApiOperation("入仓通知单打印查询")
@PostMapping("/queryNoticePrint")
public AjaxResult queryNoticePrint(@RequestBody ReserveStockInOrderDTO stockInOrderDTO) {
List<ReserveStockInOrderPO> headerList = stockInOrderApplicationService.queryNoticePrint(stockInOrderDTO);
List<ReserveInMaterialDetailPO> detailList = stockInOrderApplicationService.queryNoticePrintDetail(stockInOrderDTO);
Map<String, Object> result = new HashMap<>();
if (!headerList.isEmpty()) {
result.put("header", headerList.get(0));
}
result.put("detailList", detailList);
return AjaxResult.success(result);
}
}
@@ -0,0 +1,343 @@
<?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="com.mhd.oms.domain.reserveInMaterialDetail.repository.mapper.ReserveInMaterialDetailMapper">
<resultMap type="com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO" id="MaterialDetailResult">
<result property="materialDetailId" column="material_detail_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="uniqueId" column="unique_id" />
<result property="materialBaseInfoId" column="material_base_info_id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="barCode" column="bar_code" />
<result property="quantity" column="quantity" />
<result property="receiptQuantity" column="receipt_quantity" />
<result property="shelvesQuantity" column="shelves_quantity" />
<result property="packId" column="pack_id" />
<result property="packCode" column="pack_code" />
<result property="packName" column="pack_name" />
<result property="packDetailId" column="pack_detail_id" jdbcType="BIGINT" />
<result property="unitCode" column="unit_code" />
<result property="unitName" column="unit_name" />
<result property="materialWarehouseControlId" column="material_warehouse_control_id" />
<result property="serialNumberManage" column="serial_number_manage" />
<result property="qualityInspectionManage" column="quality_inspection_manage" />
<result property="qualityInspectionStage" column="quality_inspection_stage" />
<result property="qualityInspectionRule" column="quality_inspection_rule" />
<result property="qualityInspectionTerm" column="quality_inspection_term" />
<result property="qualityInspectionResults" column="quality_inspection_results" />
<result property="allowOvercharge" column="allow_overcharge" />
<result property="overchargeRatio" column="overcharge_ratio" />
<result property="batchNumber" column="batch_number" />
<result property="materialStatusCode" column="material_status_code" />
<result property="materialStatusName" column="material_status_name" />
<result property="distributeRuleId" column="distribute_rule_id" />
<result property="distributeRuleCode" column="distribute_rule_code" />
<result property="distributeRuleName" column="distribute_rule_name" />
<result property="containerId" column="container_id" />
<result property="containerCode" column="container_code" />
<result property="containerType" column="container_type" />
<result property="containerTypeName" column="container_type_name" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="delFlag" column="del_flag" />
<result property="overStockId" column="over_stock_id" />
<result property="overStockStatus" column="over_stock_status" />
<result property="overStockType" column="over_stock_type" />
<result property="specificationModel" column="SPECIFICATION_MODEL" />
<result property="skuCode" column="SKU_CODE" />
<result property="invoiceNo" column="INVOICE_NO" />
<result property="liter" column="LITER" />
<result property="dimensions" column="DIMENSIONS" />
<result property="declarationUnit" column="DECLARATION_UNIT" />
<result property="batchRefNo" column="BATCH_REF_NO" />
<result property="sheetRefNo" column="SHEET_REF_NO" />
<result property="originCountry" column="ORIGIN_COUNTRY" />
<result property="boxPalletNo" column="BOX_PALLET_NO" />
<result property="currency" column="CURRENCY" />
<result property="unit" column="UNIT" />
<result property="declaredQuantity" column="DECLARED_QUANTITY" />
<result property="boxCount" column="BOX_COUNT" />
<result property="pieceCount" column="PIECE_COUNT" />
<result property="inboundQuantity" column="INBOUND_QUANTITY" />
<result property="totalNetWeight" column="TOTAL_NET_WEIGHT" />
<result property="totalGrossWeight" column="TOTAL_GROSS_WEIGHT" />
<result property="totalVolume" column="TOTAL_VOLUME" />
<result property="totalArea" column="TOTAL_AREA" />
<result property="totalPrice" column="TOTAL_PRICE" />
<result property="productionDate" column="PRODUCTION_DATE" />
<result property="expiryDate" column="EXPIRY_DATE" />
<result property="inventoryDate" column="INVENTORY_DATE" />
<result property="extAttr1" column="EXT_ATTR_1" />
<result property="extAttr2" column="EXT_ATTR_2" />
<result property="extAttr3" column="EXT_ATTR_3" />
<result property="extAttr4" column="EXT_ATTR_4" />
<result property="contractFee" column="contract_fee" />
<result property="monthlyWarehouseFee" column="monthly_warehouse_fee" />
<result property="halfMonthWhFee" column="half_month_wh_fee" />
<result property="discountRate" column="discount_rate" />
<result property="singleVolume" column="single_volume" />
<result property="singleGrossWeight" column="single_gross_weight" />
<result property="lotNo" column="lot_no" />
</resultMap>
<sql id="selectMaterialDetailPo">
a.contract_fee ,
a.monthly_warehouse_fee ,
a.half_month_wh_fee ,
a.discount_rate ,
a.single_volume ,
a.single_gross_weight ,
a.lot_no ,
a.material_detail_id, a.organization_id, a.organization_name, a.top_organization_id, a.unique_id, a.in_order_number, a.material_base_info_id,
a.material_code, a.material_name, a.bar_code, a.quantity, a.receipt_quantity, a.shelves_quantity,
a.receipt_status, a.shelves_status, a.pack_id, a.pack_code, a.pack_name,
CASE
WHEN a.pack_detail_id IS NULL OR TRIM(a.pack_detail_id) = '' THEN NULL
ELSE CAST(a.pack_detail_id AS BIGINT)
END as pack_detail_id, a.unit_code, a.unit_name, a.material_warehouse_control_id, a.serial_number_manage, a.quality_inspection_manage,
a.quality_inspection_stage, a.quality_inspection_rule, a.quality_inspection_ratio, a.quality_inspection_term, a.quality_inspection_results, a.allow_overcharge,
a.overcharge_ratio, a.batch_number, a.material_status_code, a.material_status_name, a.distribute_rule_id, a.distribute_rule_code,
a.distribute_rule_name, a.container_id, a.container_code, a.container_type, a.container_type_name,
a.warehouse_id, a.warehouse_code, a.warehouse_name, a.storage_section_id, a.storage_code, a.storage_name, a.storage_location_id, a.storage_location_code, a.storage_location_name,
a.level, a.parent_unique_id, a.remark, a.create_time, a.create_by,a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.over_stock_id, a.over_stock_status, a.over_stock_type,
a.SPECIFICATION_MODEL, a.SKU_CODE, a.INVOICE_NO, a.LITER, a.DIMENSIONS, a.DECLARATION_UNIT, a.BATCH_REF_NO, a.SHEET_REF_NO,
a.ORIGIN_COUNTRY, a.BOX_PALLET_NO, a.CURRENCY, a.UNIT, a.DECLARED_QUANTITY, a.BOX_COUNT, a.PIECE_COUNT, a.INBOUND_QUANTITY,
a.TOTAL_NET_WEIGHT, a.TOTAL_GROSS_WEIGHT, a.TOTAL_VOLUME, a.TOTAL_AREA, a.TOTAL_PRICE,
a.PRODUCTION_DATE, a.EXPIRY_DATE, a.INVENTORY_DATE, a.EXT_ATTR_1, a.EXT_ATTR_2, a.EXT_ATTR_3, a.EXT_ATTR_4
,CASE
WHEN (a.quantity - a.receipt_quantity) &lt; 0 THEN 0
ELSE (a.quantity - a.receipt_quantity)
END AS wait_receipt_quantity,
CASE
WHEN (a.receipt_quantity - a.shelves_quantity) &lt; 0 THEN 0
ELSE (a.receipt_quantity - a.shelves_quantity)
END AS wait_shelves_quantity
</sql>
<sql id="selectMaterialDetailPo1">
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="inOrderNumber != null and inOrderNumber != '' ">
and a.in_order_number = #{inOrderNumber}
</if>
<if test="materialBaseInfoId != null ">
and a.material_base_info_id = #{materialBaseInfoId}
</if>
<if test="materialCode != null and materialCode != ''">
and a.material_code = #{materialCode}
</if>
<if test="materialName != null and materialName != ''">
and a.material_name like concat('%', #{materialName}, '%')
</if>
<if test="barCode != null and barCode != ''">
and a.bar_code = #{barCode}
</if>
<if test="quantity != null ">
and a.quantity = #{quantity}
</if>
<if test="receiptQuantity != null ">
and a.receipt_quantity = #{receiptQuantity}
</if>
<if test="shelvesQuantity != null ">
and a.shelves_quantity = #{shelvesQuantity}
</if>
<if test="packId != null ">
and a.pack_id = #{packId}
</if>
<if test="packCode != null and packCode != ''">
and a.pack_code = #{packCode}
</if>
<if test="packName != null and packName != ''">
and a.pack_name like concat('%', #{packName}, '%')
</if>
<if test="packDetailId != null">
and a.pack_detail_id = #{packDetailId}
</if>
<if test="unitCode != null and unitCode != ''">
and a.unit_code = #{unitCode}
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like concat('%', #{unitName}, '%')
</if>
<if test="materialWarehouseControlId != null ">
and a.material_warehouse_control_id = #{materialWarehouseControlId}
</if>
<if test="serialNumberManage != null ">
and a.serial_number_manage = #{serialNumberManage}
</if>
<if test="qualityInspectionManage != null ">
and a.quality_inspection_manage = #{qualityInspectionManage}
</if>
<if test="qualityInspectionStage != null ">
and a.quality_inspection_stage = #{qualityInspectionStage}
</if>
<if test="qualityInspectionRule != null ">
and a.quality_inspection_rule = #{qualityInspectionRule}
</if>
<if test="qualityInspectionTerm != null ">
and a.quality_inspection_term = #{qualityInspectionTerm}
</if>
<if test="qualityInspectionResults != null ">
and a.quality_inspection_results = #{qualityInspectionResults}
</if>
<if test="allowOvercharge != null ">
and a.allow_overcharge = #{allowOvercharge}
</if>
<if test="overchargeRatio != null ">
and a.overcharge_ratio = #{overchargeRatio}
</if>
<if test="batchNumber != null and batchNumber != ''">
and a.batch_number = #{batchNumber}
</if>
<if test="materialStatusCode != null and materialStatusCode != ''">
and a.material_status_code = #{materialStatusCode}
</if>
<if test="materialStatusName != null and materialStatusName != ''">
and a.material_status_name like concat('%', #{materialStatusName}, '%')
</if>
<if test="distributeRuleId != null ">
and a.distribute_rule_id = #{distributeRuleId}
</if>
<if test="distributeRuleCode != null and distributeRuleCode != ''">
and a.distribute_rule_code = #{distributeRuleCode}
</if>
<if test="distributeRuleName != null and distributeRuleName != ''">
and a.distribute_rule_name like concat('%', #{distributeRuleName}, '%')
</if>
<if test="containerId != null ">
and a.container_id = #{containerId}
</if>
<if test="containerCode != null and containerCode != ''">
and a.container_code = #{containerCode}
</if>
<if test="containerType != null and containerType != ''">
and a.container_type = #{containerType}
</if>
<if test="containerTypeName != null and containerTypeName != ''">
and a.container_type_name like concat('%', #{containerTypeName}, '%')
</if>
<if test="createByName != null and createByName != ''">
and a.create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and a.update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="inOrderNumberList != null and inOrderNumberList.size > 0 ">
and a.in_order_number in
<foreach collection="inOrderNumberList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
</choose>
</sql>
<sql id="joinMaterialDetailPoWhere">
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="overStockStatus != null ">
and a.over_stock_status = #{overStockStatus}
</if>
<if test="materialBaseInfoId != null ">
and a.material_base_info_id = #{materialBaseInfoId}
</if>
<if test="materialBaseInfoIdList != null and materialBaseInfoIdList != ''">
and a.material_base_info_id in
<foreach collection="materialBaseInfoIdList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
</choose>
</sql>
<sql id="joinStockInOrderPoWhere">
<if test="outOrderNumber != null and outOrderNumber != ''">
and b.out_order_number = #{outOrderNumber}
</if>
<if test="warehouseId != null and warehouseId != '' ">
and b.warehouse_id = #{warehouseId}
</if>
<if test="shipperId != null and shipperId != ''">
and b.shipper_id = #{shipperId}
</if>
<if test="shipperIdList != null and shipperIdList != ''">
and b.shipper_id in
<foreach collection="shipperIdList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="inOrderExpectStartTime != null and inOrderExpectStartTime != ''"><!-- 开始时间检索 -->
and date_format(b.expect_time,'%y%m%d') &gt;= date_format(#{inOrderExpectStartTime},'%y%m%d')
</if>
<if test="inOrderExpectEndTime != null and inOrderExpectEndTime != ''"><!-- 结束时间检索 -->
and date_format(b.expect_time,'%y%m%d') &lt;= date_format(#{inOrderExpectEndTime},'%y%m%d')
</if>
<if test="inOrderTypeCode != null and inOrderTypeCode != ''">
and b.order_type_code = #{outOrderTypeCode}
</if>
<!-- 入库状态: 1-已创建 2-已审核 3-收货中 4-上架中 5-已入库 -->
<if test="inStatus != null ">
and b.status = #{inStatus}
</if>
<choose>
<when test="delFlag != null"> and b.del_flag = #{delFlag} </when>
<otherwise> and b.del_flag = 1 </otherwise>
</choose>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.ReserveInMaterialDetailDO" resultMap="MaterialDetailResult">
select
<include refid="selectMaterialDetailPo"/>
from reserve_in_material_detail a
<where>
<include refid="selectMaterialDetailPo1"/>
</where>
</select>
<select id="queryInOrderList" parameterType="com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.QueryOrderOverStockDO" resultMap="MaterialDetailResult">
select
<include refid="selectMaterialDetailPo"/>
<include refid="com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper.joinStockInOrderPo"/>
from reserve_in_material_detail a
LEFT JOIN reserve_stock_in_order b ON a.in_order_number = b.in_order_number
<where>
<include refid="joinMaterialDetailPoWhere"/>
<include refid="joinStockInOrderPoWhere"/>
</where>
</select>
<select id="getkctzjl" resultType="com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.InventoryAdjustmentRecordPO">
select * from "NGWL_TEST_WMS".INVENTORY_ADJUSTMENT_RECORD where MATERIAL_BASE_INFO_ID = #{materialBaseInfoId} and RELATE_NO = #{orderNumber} and ADJUST_TYPE = #{adjustType}
</select>
</mapper>
@@ -0,0 +1,408 @@
<?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="com.mhd.oms.domain.reserveOutMaterialDetail.repository.mapper.ReserveOutMaterialDetailMapper">
<resultMap type="com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO" id="MaterialDetailResult">
<result property="materialDetailId" column="material_detail_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="uniqueId" column="unique_id" />
<result property="outOrderNumber" column="out_order_number" />
<result property="materialBaseInfoId" column="material_base_info_id" />
<result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" />
<result property="barCode" column="bar_code" />
<result property="weightLimit" column="weight_limit" />
<result property="volumeLimit" column="volume_limit" />
<result property="quantity" column="quantity" />
<result property="allocationQuantity" column="allocation_quantity" />
<result property="pickingQuantity" column="picking_quantity" />
<result property="checkQuantity" column="check_quantity" />
<result property="waitCheckQuantity" column="WAIT_CHECK_QUANTITY" />
<result property="packId" column="pack_id" />
<result property="packCode" column="pack_code" />
<result property="packName" column="pack_name" />
<result property="packDetailId" column="pack_detail_id" />
<result property="unitCode" column="unit_code" />
<result property="unitName" column="unit_name" />
<result property="materialWarehouseControlId" column="material_warehouse_control_id" />
<result property="serialNumberManage" column="serial_number_manage" />
<result property="materialInventoryId" column="material_inventory_id" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="storageSectionId" column="storage_section_id" />
<result property="storageCode" column="storage_code" />
<result property="storageName" column="storage_name" />
<result property="storageLocationId" column="storage_location_id" />
<result property="storageLocationCode" column="storage_location_code" />
<result property="storageLocationName" column="storage_location_name" />
<result property="level" column="level" />
<result property="parentUniqueId" column="parent_unique_id" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="delFlag" column="del_flag" />
<result property="overStockId" column="over_stock_id" />
<result property="overStockStatus" column="over_stock_status" />
<result property="overStockType" column="over_stock_type" />
<result property="commodityName" column="COMMODITY_NAME" />
<result property="commodityNo" column="COMMODITY_NO" />
<result property="materialNo" column="MATERIAL_NO" />
<result property="specificationModel" column="SPECIFICATION_MODEL" />
<result property="skucode" column="SKUCODE" />
<result property="invoiceNo" column="INVOICE_NO" />
<result property="liter" column="LITER" />
<result property="size" column="SIZE" />
<result property="declareUnit" column="DECLARE_UNIT" />
<result property="batchRefNo" column="BATCH_REF_NO" />
<result property="sheetRefNo" column="SHEET_REF_NO" />
<result property="countryOfOrigin" column="COUNTRY_OF_ORIGIN" />
<result property="boxPalletNo" column="BOX_PALLET_NO" />
<result property="currency" column="CURRENCY" />
<result property="declareQuantity" column="DECLARE_QUANTITY" />
<result property="caseCount" column="CASE_COUNT" />
<result property="pieceCount" column="PIECE_COUNT" />
<result property="outboundQuantity" column="OUTBOUND_QUANTITY" />
<result property="totalNetWeight" column="TOTAL_NET_WEIGHT" />
<result property="totalGrossWeight" column="TOTAL_GROSS_WEIGHT" />
<result property="totalVolume" column="TOTAL_VOLUME" />
<result property="totalArea" column="TOTAL_AREA" />
<result property="totalAmount" column="TOTAL_AMOUNT" />
<result property="unit" column="UNIT" />
<result property="extAttr1" column="EXT_ATTR_1" />
<result property="extAttr2" column="EXT_ATTR_2" />
<result property="productionDate" column="PRODUCTION_DATE" />
<result property="expiryDate" column="EXPIRY_DATE" />
<result property="inventoryDate" column="INVENTORY_DATE" />
<result property="extAttr3" column="EXT_ATTR_3" />
<result property="extAttr4" column="EXT_ATTR_4" />
<result property="contractFee" column="contract_fee" />
<result property="monthlyWarehouseFee" column="monthly_warehouse_fee" />
<result property="halfMonthWhFee" column="half_month_wh_fee" />
<result property="discountRate" column="discount_rate" />
<result property="singleVolume" column="single_volume" />
<result property="singleGrossWeight" column="single_gross_weight" />
<result property="lotNo" column="lot_no" />
<result property="inOrderNumber" column="in_order_number" />
<result property="stockUnit" column="stock_unit" />
<result property="stockQuantity" column="stock_quantity" />
</resultMap>
<sql id="selectMaterialDetailPo">
a.contract_fee ,
a.monthly_warehouse_fee ,
a.half_month_wh_fee ,
a.discount_rate ,
a.single_volume ,
a.single_gross_weight ,
a.lot_no ,
a.stock_quantity ,
a.stock_unit ,a.in_order_number ,
a.material_detail_id, a.organization_id, a.organization_name, a.top_organization_id, a.unique_id, a.out_order_number, a.material_base_info_id, a.line_number, a.material_code, a.material_name, a.bar_code, a.weight_limit, a.volume_limit,
a.quantity, a.already_allocation_quantity, a.allocation_quantity, a.picking_quantity, a.check_quantity, ROUND(GREATEST(0, IFNULL(a.quantity, 0) - IFNULL(a.check_quantity, 0), IFNULL(a.picking_quantity, 0) - IFNULL(a.check_quantity, 0)), 2) AS wait_check_quantity,
a.pack_id, a.pack_code, a.pack_name, a.pack_detail_id, a.unit_code, a.unit_name, a.material_warehouse_control_id, a.serial_number_manage,
a.warehouse_id, a.warehouse_code, a.warehouse_name, a.storage_section_id, a.storage_code, a.storage_name, a.storage_location_id, a.storage_location_code, a.storage_location_name, a.level, a.parent_unique_id, a.allow_modify,
a.material_inventory_id, a.batch_number, a.container_id, a.container_code, a.container_type, a.container_type_name, a.material_status_code, a.material_status_name,
a.remark, a.create_time, a.create_by,gen_picking_order,
a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.over_stock_id, a.over_stock_status, a.over_stock_type,
a.COMMODITY_NAME,
a.COMMODITY_NO,
a.MATERIAL_NO ,
a.SPECIFICATION_MODEL,
a.SKUCODE ,
a.INVOICE_NO,
a.LITER,
a.SIZE,
a.DECLARE_UNIT,
a.BATCH_REF_NO,
a.SHEET_REF_NO,
a.COUNTRY_OF_ORIGIN,
a.BOX_PALLET_NO,
a.CURRENCY,
a.DECLARE_QUANTITY,
a.CASE_COUNT,
a.PIECE_COUNT,
a.OUTBOUND_QUANTITY,
a.TOTAL_NET_WEIGHT,
a.TOTAL_GROSS_WEIGHT,
a.TOTAL_VOLUME,
a.TOTAL_AREA,
a.TOTAL_AMOUNT,
a.UNIT,
a.EXT_ATTR_1,
a.EXT_ATTR_2,
a.PRODUCTION_DATE,
a.EXPIRY_DATE,
a.INVENTORY_DATE,
a.EXT_ATTR_3,
a.EXT_ATTR_4,
a.INVENTORY_QUANTITY
</sql>
<sql id="selectMaterialDetailPo1">
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="outOrderNumber != null and outOrderNumber != '' ">
and a.out_order_number = #{outOrderNumber}
</if>
<if test="materialBaseInfoId != null ">
and a.material_base_info_id = #{materialBaseInfoId}
</if>
<if test="materialCode != null and materialCode != ''">
and a.material_code = #{materialCode}
</if>
<if test="materialName != null and materialName != ''">
and a.material_name like concat('%', #{materialName}, '%')
</if>
<if test="barCode != null and barCode != ''">
and a.bar_code = #{barCode}
</if>
<if test="quantity != null ">
and a.quantity = #{quantity}
</if>
<if test="allocationQuantity != null ">
and a.allocation_quantity = #{allocationQuantity}
</if>
<if test="pickingQuantity != null ">
and a.picking_quantity = #{pickingQuantity}
</if>
<if test="checkQuantity != null ">
and a.check_quantity = #{checkQuantity}
</if>
<if test="packId != null ">
and a.pack_id = #{packId}
</if>
<if test="packCode != null and packCode != ''">
and a.pack_code = #{packCode}
</if>
<if test="packName != null and packName != ''">
and a.pack_name like concat('%', #{packName}, '%')
</if>
<if test="packDetailId != null and packDetailId != ''">
and a.pack_detail_id = #{packDetailId}
</if>
<if test="unitCode != null and unitCode != ''">
and a.unit_code = #{unitCode}
</if>
<if test="unitName != null and unitName != ''">
and a.unit_name like concat('%', #{unitName}, '%')
</if>
<if test="materialWarehouseControlId != null ">
and a.material_warehouse_control_id = #{materialWarehouseControlId}
</if>
<if test="serialNumberManage != null ">
and a.serial_number_manage = #{serialNumberManage}
</if>
<if test="warehouseId != null ">
and a.warehouse_id = #{warehouseId}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
and a.warehouse_code = #{warehouseCode}
</if>
<if test="warehouseName != null and warehouseName != ''">
and a.warehouse_name like concat('%', #{warehouseName}, '%')
</if>
<if test="storageSectionId != null ">
and a.storage_section_id = #{storageSectionId}
</if>
<if test="storageCode != null and storageCode != ''">
and a.storage_code = #{storageCode}
</if>
<if test="storageName != null and storageName != ''">
and a.storage_name like concat('%', #{storageName}, '%')
</if>
<if test="storageLocationId != null ">
and a.storage_location_id = #{storageLocationId}
</if>
<if test="storageLocationCode != null and storageLocationCode != ''">
and a.storage_location_code = #{storageLocationCode}
</if>
<if test="storageLocationName != null and storageLocationName != ''">
and a.storage_location_name like concat('%', #{storageLocationName}, '%')
</if>
<if test="level != null ">
and a.level = #{level}
</if>
<if test="genPickingOrder != null ">
and a.gen_picking_order = #{genPickingOrder}
</if>
<if test="parentUniqueId != null ">
and a.parent_unique_id = #{parentUniqueId}
</if>
<if test="createByName != null and createByName != ''">
and a.create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and a.update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="outOrderNumberList != null and outOrderNumberList.size > 0 ">
and a.out_order_number in
<foreach collection="outOrderNumberList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
</choose>
</sql>
<sql id="joinMaterialDetailPoWhere">
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="overStockStatus != null ">
and a.over_stock_status = #{overStockStatus}
</if>
<if test="materialBaseInfoId != null ">
and a.material_base_info_id = #{materialBaseInfoId}
</if>
<if test="materialBaseInfoIdList != null and materialBaseInfoIdList != ''">
and a.material_base_info_id in
<foreach collection="materialBaseInfoIdList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
</choose>
</sql>
<sql id="joinStockOutOrderPoWhere">
<if test="outOrderNumber != null and outOrderNumber != ''">
and b.out_order_number = #{outOrderNumber}
</if>
<if test="warehouseId != null and warehouseId != '' ">
and b.warehouse_id = #{warehouseId}
</if>
<if test="shipperId != null and shipperId != ''">
and b.shipper_id = #{shipperId}
</if>
<if test="shipperIdList != null and shipperIdList != ''">
and b.shipper_id in
<foreach collection="shipperIdList" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="outOrderExpectStartTime != null and outOrderExpectStartTime != ''"><!-- 开始时间检索 -->
and date_format(b.expect_time,'%y%m%d') &gt;= date_format(#{outOrderExpectStartTime},'%y%m%d')
</if>
<if test="outOrderExpectEndTime != null and outOrderExpectEndTime != ''"><!-- 结束时间检索 -->
and date_format(b.expect_time,'%y%m%d') &lt;= date_format(#{outOrderExpectEndTime},'%y%m%d')
</if>
<if test="outOrderTypeCode != null and outOrderTypeCode != ''">
and b.order_type_code = #{outOrderTypeCode}
</if>
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 -->
<if test="outStatus != null ">
and b.status = #{outStatus}
</if>
<choose>
<when test="delFlag != null"> and b.del_flag = #{delFlag} </when>
<otherwise> and b.del_flag = 1 </otherwise>
</choose>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO" resultMap="MaterialDetailResult">
select
<include refid="selectMaterialDetailPo"/>
from reserve_out_material_detail a
<where>
<include refid="selectMaterialDetailPo1"/>
</where>
</select>
<select id="queryOutOrderList" parameterType="com.mhd.oms.domain.reserveInMaterialDetail.repository.todo.QueryOrderOverStockDO" resultMap="MaterialDetailResult">
select
<include refid="selectMaterialDetailPo"/>
<include refid="com.mhd.oms.domain.reserveStockOutOrder.repository.mapper.ReserveStockOutOrderMapper.joinStockOutOrderPo"/>
from reserve_out_material_detail a
left join reserve_stock_out_order b on a.out_order_number = b.out_order_number
<where>
<include refid="joinMaterialDetailPoWhere"/>
<include refid="joinStockOutOrderPoWhere"/>
</where>
</select>
<update id="batchAddAllocationQuantityByIds" parameterType="com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO">
UPDATE reserve_out_material_detail
<set>
allocation_quantity = CASE material_detail_id
<foreach collection="children" item="item" index="index" separator=",">
WHEN #{item.materialDetailId} THEN allocation_quantity + #{item.allocationQuantity}
</foreach>
END,
update_by = #{item.updateBy},
update_by_name = #{item.updateByName},
update_time = now()
</set>
WHERE material_detail_id IN
<foreach collection="children" item="item" index="index" open="(" separator="," close=")">
#{item.materialDetailId}
</foreach>
</update>
<update id="batchAddPickingQuantityByIds" parameterType="com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO">
UPDATE reserve_out_material_detail
<set>
picking_quantity = CASE material_detail_id
<foreach collection="children" item="item" index="index" separator=",">
WHEN #{item.materialDetailId} THEN picking_quantity + #{item.pickingQuantity}
</foreach>
END,
update_by = #{updateBy},
update_by_name = #{updateByName},
update_time = now()
</set>
WHERE material_detail_id IN
<foreach collection="children" item="item" index="index" open="(" separator="," close=")">
#{item.materialDetailId}
</foreach>
</update>
<update id="batchAddPickingQuantityByUniqueIds" parameterType="com.mhd.oms.domain.reserveOutMaterialDetail.repository.todo.ReserveOutMaterialDetailDO">
UPDATE reserve_out_material_detail
<set>
picking_quantity = CASE unique_id
<foreach collection="children" item="item" index="index" separator=",">
WHEN #{item.uniqueId} THEN picking_quantity + #{item.pickingQuantity}
</foreach>
END,
<trim prefix="picking_quantity = CASE unique_id" suffix="END,">
<foreach collection="children" item="item" index="index">
WHEN #{item.uniqueId} THEN picking_quantity + #{item.pickingQuantity}
</foreach>
</trim>
update_by = #{updateBy},
update_by_name = #{updateByName},
update_time = now()
</set>
WHERE unique_id IN
<foreach collection="children" item="item" index="index" open="(" separator="," close=")">
#{item.uniqueId}
</foreach>
</update>
</mapper>
@@ -0,0 +1,528 @@
<?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="com.mhd.oms.domain.reserveStockInOrder.repository.mapper.ReserveStockInOrderMapper">
<resultMap type="com.mhd.oms.domain.reserveStockInOrder.repository.po.ReserveStockInOrderPO" id="StockInOrderResult">
<result property="inOrderId" column="in_order_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="noticeNumber" column="notice_number" />
<result property="inOrderNumber" column="in_order_number" />
<result property="status" column="status" />
<result property="auditStatus" column="audit_status" />
<result property="auditRemark" column="audit_remark" />
<result property="auditBy" column="audit_by" />
<result property="auditByName" column="audit_by_name" />
<result property="auditTime" column="audit_time" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="shipperId" column="shipper_id" />
<result property="shipperName" column="shipper_name" />
<result property="orderTypeCode" column="order_type_code" />
<result property="orderTypeName" column="order_type_name" />
<result property="supplierId" column="supplier_id" />
<result property="supplierName" column="supplier_name" />
<result property="expectTime" column="expect_time" />
<result property="supplyChainNumber" column="supply_chain_number" />
<result property="priorityLevelCode" column="priority_level_code" />
<result property="priorityLevelName" column="priority_level_name" />
<result property="directWarehouse" column="direct_warehouse" />
<result property="annexUrl" column="annex_url" />
<result property="quantity" column="quantity" />
<result property="planInQuantity" column="plan_in_quantity" />
<result property="receiptQuantity" column="receipt_quantity" />
<result property="shelvesQuantity" column="shelves_quantity" />
<result property="cancelOrder" column="cancel_order" />
<result property="cancelRemark" column="cancel_remark" />
<result property="cancelBy" column="cancel_by" />
<result property="cancelByName" column="cancel_by_name" />
<result property="cancelTime" column="cancel_time" />
<result property="closeOrder" column="close_order" />
<result property="closeRemark" column="close_remark" />
<result property="closeBy" column="close_by" />
<result property="closeByName" column="close_by_name" />
<result property="closeTime" column="close_time" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="delFlag" column="del_flag" />
<result property="overStockId" column="over_stock_id" />
<result property="overStockStatus" column="over_stock_status" />
<result property="overStockType" column="over_stock_type" />
<result property="to" column="TO" />
<result property="contactPerson" column="CONTACT_PERSON" />
<result property="vehicleInfo" column="VEHICLE_INFO" />
<result property="consignmentNo" column="CONSIGNMENT_NO" />
<result property="tel" column="TEL" />
<result property="driverSignature" column="DRIVER_SIGNATURE" />
<result property="fax" column="FAX" />
<result property="declarationArea" column="DECLARATION_AREA" />
<result property="manufacturer" column="MANUFACTURER" />
<result property="customsBrokerInfo" column="CUSTOMS_BROKER_INFO" />
<result property="deliveryAddress" column="DELIVERY_ADDRESS" />
<result property="entryExitCustoms" column="ENTRY_EXIT_CUSTOMS" />
<result property="originDestinationCountry" column="ORIGIN_DESTINATION_COUNTRY" />
<result property="carrier" column="CARRIER" />
<result property="containerNo" column="CONTAINER_NO" />
<result property="transportMethod" column="TRANSPORT_METHOD" />
<result property="supervisionMethod" column="SUPERVISION_METHOD" />
<result property="customsInspection" column="CUSTOMS_INSPECTION" />
<result property="needCustomsDeclaration" column="NEED_CUSTOMS_DECLARATION" />
<result property="needTransport" column="NEED_TRANSPORT" />
<result property="warehouseDate" column="WAREHOUSE_DATE" />
<result property="completionTime" column="COMPLETION_TIME" />
<result property="orderDate" column="ORDER_DATE" />
<result property="issueStatus" column="issue_status" />
<result property="issueTime" column="issue_time" />
<result property="issueId" column="issue_id" />
<result property="issueName" column="issue_name" />
<result property="reservationAuditId" column="reservation_audit_id" />
<result property="reservationAuditName" column="reservation_audit_name" />
<result property="reservationAuditTime" column="reservation_audit_time" />
<result property="reservationOrderSource" column="RESERVATION_ORDER_SOURCE" />
<result property="directorId" column="DIRECTOR_ID" />
<result property="directorPhone" column="DIRECTOR_PHONE" />
<result property="directorName" column="DIRECTOR_NAME" />
<result property="storageTime" column="STORAGE_TIME" />
<result property="inQuantity" column="IN_QUANTITY" />
</resultMap>
<sql id="selectStockInOrderPo">
a.in_order_id, a.organization_id, a.organization_name, a.top_organization_id, a.notice_number, a.in_order_number, a.status,
a.audit_status, a.audit_remark, a.audit_by, a.audit_by_name, a.audit_time, a.warehouse_id, a.warehouse_code, a.warehouse_name, a.shipper_id, a.shipper_code,
a.shipper_name, a.order_type_code, a.order_type_name, a.supplier_id, a.supplier_code, a.supplier_name, a.expect_time, a.supply_chain_number,
a.priority_level_code, a.priority_level_name, a.direct_warehouse, a.annex_url, a.material_quantity, a.quantity,a.business_order_no,
-- 计划入库数量:入库明细表 in_material_detail 的 quantity 汇总
<!-- (select ifnull(sum(imd.quantity), 0)-->
<!-- from in_material_detail imd-->
<!-- where imd.in_order_number = a.in_order_number-->
<!-- and imd.del_flag = 1-->
<!-- and (imd.level is null or imd.level = 1)-->
<!-- ) as plan_in_quantity,-->
<!-- &#45;&#45; 收货数量:收货单表 stock_receipt_order 的 receipt_quantity 汇总-->
<!-- (select ifnull(sum(sro.receipt_quantity), 0)-->
<!-- from stock_receipt_order sro-->
<!-- where sro.in_order_number = a.in_order_number-->
<!-- and sro.del_flag = 1-->
<!-- ) as receipt_quantity,-->
<!-- &#45;&#45; 上架数量:上架单表 stock_shelf_order 的 shelves_quantity 汇总-->
<!-- (select ifnull(sum(sso.shelves_quantity), 0)-->
<!-- from stock_shelf_order sso-->
<!-- where sso.in_order_number = a.in_order_number-->
<!-- and sso.del_flag = 1-->
<!-- ) as shelves_quantity,-->
a.weight_limit, a.volume_limit, a.cancel_order, a.cancel_remark, a.cancel_by,
a.cancel_by_name, a.cancel_time, a.close_order, a.close_remark, a.close_by, a.close_by_name, a.close_time, a.remark, a.create_time, a.create_by,
a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, over_stock_id, over_stock_status, over_stock_type,
a."TO", a.CONTACT_PERSON, a.VEHICLE_INFO, a.CONSIGNMENT_NO, a.TEL, a.DRIVER_SIGNATURE, a.FAX, a.DECLARATION_AREA, a.MANUFACTURER,
a.CUSTOMS_BROKER_INFO, a.DELIVERY_ADDRESS, a.ENTRY_EXIT_CUSTOMS, a.ORIGIN_DESTINATION_COUNTRY, a.CARRIER, a.CONTAINER_NO,
a.TRANSPORT_METHOD, a.SUPERVISION_METHOD, a.CUSTOMS_INSPECTION, a.NEED_CUSTOMS_DECLARATION, a.NEED_TRANSPORT,
a.WAREHOUSE_DATE, a.COMPLETION_TIME, a.ORDER_DATE,a.reserve_audit_time,a.reserve_audit_name
,a.reserve_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.RESERVATION_ORDER_SOURCE,a.tms_order_number
,a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.STORAGE_TIME,a.in_quantity
</sql>
<sql id="joinStockInOrderPo">
,b.notice_number, b.warehouse_id, b.warehouse_code, b.warehouse_name, b.shipper_id, b.shipper_code, b.shipper_name,
b.order_type_code, b.order_type_name, b.supplier_id, b.supplier_code, b.supplier_name, b.expect_time, b.supply_chain_number, b.priority_level_code,
b.priority_level_name, b.direct_warehouse, b.annex_url, b.material_quantity as in_order_material_quantity, b.quantity as in_order_quantity
</sql>
<sql id="joinStockInOrderPoWhere">
<if test="noticeNumber != null and noticeNumber != ''">
and b.notice_number = #{noticeNumber}
</if>
<if test="inOrderNumber != null and inOrderNumber != ''">
and b.in_order_number like concat('%', #{inOrderNumber}, '%')
</if>
<if test="warehouseId != null ">
and b.warehouse_id = #{warehouseId}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
and b.warehouse_code = #{warehouseCode}
</if>
<if test="warehouseName != null and warehouseName != ''">
and b.warehouse_name like concat('%', #{warehouseName}, '%')
</if>
<if test="shipperId != null ">
and b.shipper_id = #{shipperId}
</if>
<if test="shipperName != null and shipperName != ''">
and b.shipper_name like concat('%', #{shipperName}, '%')
</if>
<if test="orderTypeCode != null and orderTypeCode != ''">
and b.order_type_code = #{orderTypeCode}
</if>
<if test="orderTypeName != null and orderTypeName != ''">
and b.order_type_name like concat('%', #{orderTypeName}, '%')
</if>
<if test="supplierId != null ">
and b.supplier_id = #{supplierId}
</if>
<if test="supplierName != null and supplierName != ''">
and b.supplier_name like concat('%', #{supplierName}, '%')
</if>
<if test="expectTime != null ">
and b.expect_time = #{expectTime}
</if>
<if test="supplyChainNumber != null and supplyChainNumber != ''">
and b.supply_chain_number = #{supplyChainNumber}
</if>
<if test="priorityLevelCode != null and priorityLevelCode != ''">
and b.priority_level_code = #{priorityLevelCode}
</if>
<if test="priorityLevelName != null and priorityLevelName != ''">
and b.priority_level_name like concat('%', #{priorityLevelName}, '%')
</if>
<if test="directWarehouse != null ">
and b.direct_warehouse = #{directWarehouse}
</if>
<if test="annexUrl != null and annexUrl != ''">
and b.annex_url = #{annexUrl}
</if>
<if test="quantity != null ">
and b.quantity = #{quantity}
</if>
</sql>
<sql id="selectStockInOrderPo1">
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="tmsOrderNumber != null and tmsOrderNumber != ''">
and a.tms_order_number like concat('%', #{tmsOrderNumber}, '%')
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="noticeNumber != null and noticeNumber != ''">
and a.notice_number = #{noticeNumber}
</if>
<if test="inOrderNumber != null and inOrderNumber != ''">
and a.in_order_number = #{inOrderNumber}
</if>
<if test="status != null ">
and a.status = #{status}
</if>
<if test="ltStatus != null ">
and a.status &lt; #{ltStatus}
</if>
<if test="gtStatus != null ">
and a.status &gt; #{gtStatus}
</if>
<if test="auditStatus != null ">
and a.audit_status = #{auditStatus}
</if>
<if test="ltAuditStatus != null ">
and a.audit_status &lt; #{ltAuditStatus}
</if>
<if test="gtAuditStatus != null ">
and a.audit_status &gt; #{gtAuditStatus}
</if>
<if test="auditRemark != null and auditRemark != ''">
and a.audit_remark = #{auditRemark}
</if>
<if test="auditBy != null ">
and a.audit_by = #{auditBy}
</if>
<if test="auditByName != null and auditByName != ''">
and a.audit_by_name like concat('%', #{auditByName}, '%')
</if>
<if test="auditTime != null ">
and a.audit_time = #{auditTime}
</if>
<if test="warehouseId != null ">
and a.warehouse_id = #{warehouseId}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
and a.warehouse_code = #{warehouseCode}
</if>
<if test="warehouseName != null and warehouseName != ''">
and a.warehouse_name like concat('%', #{warehouseName}, '%')
</if>
<if test="shipperId != null ">
and a.shipper_id = #{shipperId}
</if>
<if test="shipperName != null and shipperName != ''">
and a.shipper_name like concat('%', #{shipperName}, '%')
</if>
<if test="orderTypeCode != null and orderTypeCode != ''">
and a.order_type_code = #{orderTypeCode}
</if>
<if test="orderTypeName != null and orderTypeName != ''">
and a.order_type_name like concat('%', #{orderTypeName}, '%')
</if>
<if test="supplierId != null ">
and a.supplier_id = #{supplierId}
</if>
<if test="supplierName != null and supplierName != ''">
and a.supplier_name like concat('%', #{supplierName}, '%')
</if>
<if test="expectTime != null ">
and a.expect_time = #{expectTime}
</if>
<if test="supplyChainNumber != null and supplyChainNumber != ''">
and a.supply_chain_number = #{supplyChainNumber}
</if>
<if test="priorityLevelCode != null and priorityLevelCode != ''">
and a.priority_level_code = #{priorityLevelCode}
</if>
<if test="priorityLevelName != null and priorityLevelName != ''">
and a.priority_level_name like concat('%', #{priorityLevelName}, '%')
</if>
<if test="directWarehouse != null ">
and a.direct_warehouse = #{directWarehouse}
</if>
<if test="annexUrl != null and annexUrl != ''">
and a.annex_url = #{annexUrl}
</if>
<if test="quantity != null ">
and a.quantity = #{quantity}
</if>
<if test="cancelOrder != null ">
and a.cancel_order = #{cancelOrder}
</if>
<if test="cancelRemark != null and cancelRemark != ''">
and a.cancel_remark = #{cancelRemark}
</if>
<if test="cancelBy != null ">
and a.cancel_by = #{cancelBy}
</if>
<if test="cancelByName != null and cancelByName != ''">
and a.cancel_by_name like concat('%', #{cancelByName}, '%')
</if>
<if test="cancelTime != null ">
and a.cancel_time = #{cancelTime}
</if>
<if test="closeOrder != null ">
and a.close_order = #{closeOrder}
</if>
<if test="closeRemark != null and closeRemark != ''">
and a.close_remark = #{closeRemark}
</if>
<if test="closeBy != null ">
and a.close_by = #{closeBy}
</if>
<if test="closeByName != null and closeByName != ''">
and a.close_by_name like concat('%', #{closeByName}, '%')
</if>
<if test="closeTime != null ">
and a.close_time = #{closeTime}
</if>
<if test="createByName != null and createByName != ''">
and a.create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and a.update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="inOrderIds != null and inOrderIds.size > 0 ">
and a.in_order_id in
<foreach collection="inOrderIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<!-- 报关相关字段查询条件 -->
<if test="to != null and to != ''">
and a."TO" like concat('%', #{to}, '%')
</if>
<if test="contactPerson != null and contactPerson != ''">
and a.CONTACT_PERSON like concat('%', #{contactPerson}, '%')
</if>
<if test="vehicleInfo != null and vehicleInfo != ''">
and a.VEHICLE_INFO like concat('%', #{vehicleInfo}, '%')
</if>
<if test="consignmentNo != null and consignmentNo != ''">
and a.CONSIGNMENT_NO like concat('%', #{consignmentNo}, '%')
</if>
<if test="tel != null and tel != ''">
and a.TEL like concat('%', #{tel}, '%')
</if>
<if test="driverSignature != null and driverSignature != ''">
and a.DRIVER_SIGNATURE like concat('%', #{driverSignature}, '%')
</if>
<if test="fax != null and fax != ''">
and a.FAX like concat('%', #{fax}, '%')
</if>
<if test="declarationArea != null and declarationArea != ''">
and a.DECLARATION_AREA like concat('%', #{declarationArea}, '%')
</if>
<if test="manufacturer != null and manufacturer != ''">
and a.MANUFACTURER like concat('%', #{manufacturer}, '%')
</if>
<if test="customsBrokerInfo != null and customsBrokerInfo != ''">
and a.CUSTOMS_BROKER_INFO like concat('%', #{customsBrokerInfo}, '%')
</if>
<if test="deliveryAddress != null and deliveryAddress != ''">
and a.DELIVERY_ADDRESS like concat('%', #{deliveryAddress}, '%')
</if>
<if test="entryExitCustoms != null and entryExitCustoms != ''">
and a.ENTRY_EXIT_CUSTOMS like concat('%', #{entryExitCustoms}, '%')
</if>
<if test="originDestinationCountry != null and originDestinationCountry != ''">
and a.ORIGIN_DESTINATION_COUNTRY like concat('%', #{originDestinationCountry}, '%')
</if>
<if test="carrier != null and carrier != ''">
and a.CARRIER like concat('%', #{carrier}, '%')
</if>
<if test="containerNo != null and containerNo != ''">
and a.CONTAINER_NO = #{containerNo}
</if>
<if test="transportMethod != null and transportMethod != ''">
and a.TRANSPORT_METHOD = #{transportMethod}
</if>
<if test="supervisionMethod != null and supervisionMethod != ''">
and a.SUPERVISION_METHOD = #{supervisionMethod}
</if>
<if test="customsInspection != null">
and a.CUSTOMS_INSPECTION = #{customsInspection}
</if>
<if test="needCustomsDeclaration != null">
and a.NEED_CUSTOMS_DECLARATION = #{needCustomsDeclaration}
</if>
<if test="needTransport != null">
and a.NEED_TRANSPORT = #{needTransport}
</if>
<if test="warehouseDate != null">
and a.WAREHOUSE_DATE = #{warehouseDate}
</if>
<if test="completionTime != null">
and a.COMPLETION_TIME = #{completionTime}
</if>
<if test="orderDate != null">
and a.ORDER_DATE = #{orderDate}
</if>
<if test="createTimeStart != null and createTimeStart != ''">
and date_format(a.create_time,'%Y-%m-%d') &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
and date_format(a.create_time,'%Y-%m-%d') &lt;= #{createTimeEnd}
</if>
<!-- 入库明细:物料名称、物料编码(同一明细行同时满足;与计划数量汇总口径一致)。关联 material_base_info 避免明细冗余名称与主档不一致时筛不到 -->
<if test="(materialName != null and materialName != '') or (materialCode != null and materialCode != '')">
and exists (
select 1 from in_material_detail imd
left join material_base_info mb on imd.material_base_info_id = mb.material_base_info_id and mb.del_flag = 1
where imd.in_order_number = a.in_order_number
and imd.del_flag = 1
and (imd.level is null or imd.level = 1)
<if test="materialName != null and materialName != ''">
and (
imd.material_name like concat('%', #{materialName}, '%')
or mb.material_name like concat('%', #{materialName}, '%')
)
</if>
<if test="materialCode != null and materialCode != ''">
and (
imd.material_code like concat('%', #{materialCode}, '%')
or mb.material_code like concat('%', #{materialCode}, '%')
)
</if>
)
</if>
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
</choose>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.reserveStockInOrder.repository.todo.ReserveStockInOrderDO" resultMap="StockInOrderResult">
select
<include refid="selectStockInOrderPo"/>
from reserve_stock_in_order a
<where>
<include refid="selectStockInOrderPo1"/>
</where>
ORDER BY a.create_time IS NULL, a.create_time DESC
</select>
<select id="getinfo" parameterType="java.lang.Long" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where MATERIAL_BASE_INFO_ID = #{id}
</select>
<select id="getMaterialBaseInfoList" parameterType="java.lang.String" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO">
select * from "NGWL_TEST_WMS".MATERIAL_BASE_INFO where material_code = #{id}
</select>
<select id="getInfoByMaterialBaseInfoIds" parameterType="java.lang.Long" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialWarehouseControlPO">
select * from "NGWL_TEST_WMS".MATERIAL_WAREHOUSE_CONTROL where MATERIAL_BASE_INFO_ID = #{id}
</select>
<select id="getGoodsInfoByMaterialBaseInfoIds" parameterType="java.lang.Long" resultType="com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialGoodsRulePO">
select * from "NGWL_TEST_WMS".MATERIAL_GOODS_RULE where MATERIAL_BASE_INFO_ID = #{id}
</select>
<!-- 入仓通知单打印-表头查询 -->
<select id="queryNoticePrint" resultMap="StockInOrderResult">
SELECT
a.notice_number,
a.in_order_number,
a.status,
a.warehouse_name,
a.supplier_name,
a.shipper_name,
a.order_type_name,
a.expect_time,
a.material_quantity,
a.manufacturer,
a.contact_person,
a.tel,
a.vehicle_info,
a.delivery_address,
a.warehouse_date,
a.remark,
a.create_time
FROM reserve_stock_in_order a
WHERE a.del_flag = 1
AND a.in_order_id = #{inOrderId}
</select>
<!-- 入仓通知单打印-明细查询 -->
<select id="queryNoticePrintDetail" resultMap="ReserveInMaterialDetailResult">
SELECT
b.material_code,
b.material_name,
b.piece_count,
b.total_net_weight,
b.total_gross_weight,
b.unit_code,
b.pack_name,
b.batch_number,
b.storage_location_name,
b.quantity,
b.inbound_quantity
FROM reserve_in_material_detail b
WHERE b.del_flag = 1
AND b.in_order_number = #{inOrderNumber}
ORDER BY b.material_code
</select>
<!-- 明细结果映射 -->
<resultMap type="com.mhd.oms.domain.reserveInMaterialDetail.repository.po.ReserveInMaterialDetailPO" id="ReserveInMaterialDetailResult">
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="pieceCount" column="piece_count"/>
<result property="totalNetWeight" column="total_net_weight"/>
<result property="totalGrossWeight" column="total_gross_weight"/>
<result property="unitCode" column="unit_code"/>
<result property="packName" column="pack_name"/>
<result property="batchNumber" column="batch_number"/>
<result property="storageLocationName" column="storage_location_name"/>
<result property="quantity" column="quantity"/>
<result property="inboundQuantity" column="inbound_quantity"/>
</resultMap>
</mapper>
@@ -0,0 +1,407 @@
<?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="com.mhd.oms.domain.reserveStockOutOrder.repository.mapper.ReserveStockOutOrderMapper">
<resultMap type="com.mhd.oms.domain.reserveStockOutOrder.repository.po.ReserveStockOutOrderPO" id="StockOutOrderResult">
<result property="outOrderId" column="out_order_id" />
<result property="organizationId" column="organization_id" />
<result property="organizationName" column="organization_name" />
<result property="topOrganizationId" column="top_organization_id" />
<result property="noticeNumber" column="notice_number" />
<result property="outOrderNumber" column="out_order_number" />
<result property="status" column="status" />
<result property="auditStatus" column="audit_status" />
<result property="auditRemark" column="audit_remark" />
<result property="auditBy" column="audit_by" />
<result property="auditByName" column="audit_by_name" />
<result property="auditTime" column="audit_time" />
<result property="warehouseId" column="warehouse_id" />
<result property="warehouseCode" column="warehouse_code" />
<result property="warehouseName" column="warehouse_name" />
<result property="shipperId" column="shipper_id" />
<result property="shipperName" column="shipper_name" />
<result property="orderTypeCode" column="order_type_code" />
<result property="orderTypeName" column="order_type_name" />
<result property="customerId" column="customer_id" />
<result property="customerName" column="customer_name" />
<result property="expectTime" column="expect_time" />
<result property="supplyChainNumber" column="supply_chain_number" />
<result property="priorityLevelCode" column="priority_level_code" />
<result property="priorityLevelName" column="priority_level_name" />
<result property="directWarehouse" column="direct_warehouse" />
<result property="review" column="review" />
<result property="annexUrl" column="annex_url" />
<result property="quantity" column="quantity" />
<result property="cancelOrder" column="cancel_order" />
<result property="cancelRemark" column="cancel_remark" />
<result property="cancelBy" column="cancel_by" />
<result property="cancelByName" column="cancel_by_name" />
<result property="cancelTime" column="cancel_time" />
<result property="closeOrder" column="close_order" />
<result property="closeRemark" column="close_remark" />
<result property="closeBy" column="close_by" />
<result property="closeByName" column="close_by_name" />
<result property="closeTime" column="close_time" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="createBy" column="create_by" />
<result property="createByName" column="create_by_name" />
<result property="updateTime" column="update_time" />
<result property="updateBy" column="update_by" />
<result property="updateByName" column="update_by_name" />
<result property="delFlag" column="del_flag" />
<result property="overStockId" column="over_stock_id" />
<result property="overStockStatus" column="over_stock_status" />
<result property="overStockType" column="over_stock_type" />
<result property="to" column="to"/>
<result property="contactPerson" column="contact_person"/>
<result property="vehicleModelPlate" column="vehicle_model_plate"/>
<result property="entrustNo" column="entrust_no"/>
<result property="tel" column="tel"/>
<result property="driverSign" column="driver_sign"/>
<result property="fax" column="fax"/>
<result property="declareCustoms" column="declare_customs"/>
<result property="manufacturer" column="manufacturer"/>
<result property="customsDeclarerInfo" column="customs_declarer_info"/>
<result property="deliveryAddr" column="delivery_addr"/>
<result property="entryExitCustoms" column="entry_exit_customs"/>
<result property="departureArrivalCountry" column="departure_arrival_country"/>
<result property="carrier" column="carrier"/>
<result property="containerNo" column="container_no"/>
<result property="containerNoName" column="container_no_name"/>
<result property="outboundDate" column="outbound_date"/>
<result property="completeTime" column="complete_time"/>
<result property="orderDate" column="order_date"/>
<result property="transportModeCode" column="transport_mode_code"/>
<result property="transportModeName" column="transport_mode_name"/>
<result property="supervisionModeCode" column="supervision_mode_code"/>
<result property="supervisionModeName" column="supervision_mode_name"/>
<result property="customsInspectionFlag" column="customs_inspection_flag"/>
<result property="needDeclareFlag" column="need_declare_flag"/>
<result property="needTransportFlag" column="need_transport_flag"/>
<result property="pictureApp" column="picture_app"/>
<result property="issueStatus" column="issue_status" />
<result property="issueTime" column="issue_time" />
<result property="issueId" column="issue_id" />
<result property="issueName" column="issue_name" />
<result property="reservationAuditId" column="reservation_audit_id" />
<result property="reservationAuditName" column="reservation_audit_name" />
<result property="reservationAuditTime" column="reservation_audit_time" />
<result property="directorId" column="DIRECTOR_ID" />
<result property="directorPhone" column="DIRECTOR_PHONE" />
<result property="directorName" column="DIRECTOR_NAME" />
<result property="reservationOrderSource" column="RESERVATION_ORDER_SOURCE" />
<result property="outboundTime" column="OUTBOUND_TIME" />
<result property="businessOrderNo" column="BUSINESS_ORDER_NO" />
</resultMap>
<sql id="selectStockOutOrderPo">
a.out_order_id, a.organization_id, a.organization_name, a.top_organization_id, a.receipt_notice_id, a.notice_number, a.out_order_number, a.status,
a.audit_status, a.audit_remark, a.audit_by, a.audit_by_name, a.audit_time, a.warehouse_id, a.warehouse_code, a.warehouse_name, a.shipper_id, a.shipper_code,
a.shipper_name, a.order_type_code, a.order_type_name, a.customer_id, a.customer_code, a.customer_name, a.expect_time, a.supply_chain_number, a.priority_level_code,
a.priority_level_name, a.direct_warehouse, a.review, a.annex_url, a.material_quantity, a.quantity, a.weight_limit, a.volume_limit, a.check_quantity, a.cancel_order, a.cancel_remark, a.cancel_by, a.cancel_by_name,
a.cancel_time, a.close_order, a.close_remark, a.close_by, a.close_by_name, a.close_time, a.check_status,a.BUSINESS_ORDER_NO,
a.check_task_distribution, a.check_task_distribution_time, a.check_operators_by, a.check_operators_name, a.mobilize_code,
a.remark, a.create_time, a.create_by, a.create_by_name,
a.update_time, a.update_by, a.update_by_name, a.del_flag, over_stock_id, over_stock_status, over_stock_type,a."TO",
a.CONTACT_PERSON,a.VEHICLE_MODEL_PLATE,a.ENTRUST_NO,a.TEL,a.DRIVER_SIGN,a.FAX,a.DECLARE_CUSTOMS,a.MANUFACTURER,
a.CUSTOMS_DECLARER_INFO,a.DELIVERY_ADDR,a.ENTRY_EXIT_CUSTOMS,a.DEPARTURE_ARRIVAL_COUNTRY,a.CARRIER,a.CONTAINER_NO,a.CONTAINER_NO_NAME,a.OUTBOUND_DATE,
a.COMPLETE_TIME,a.ORDER_DATE,a.TRANSPORT_MODE_CODE,a.TRANSPORT_MODE_NAME,a.SUPERVISION_MODE_CODE,a.SUPERVISION_MODE_NAME,
a.CUSTOMS_INSPECTION_FLAG,a.NEED_DECLARE_FLAG,a.NEED_TRANSPORT_FLAG,a.picture_app,a.reserve_audit_time,a.reserve_audit_name
,a.reserve_audit_id,a.issue_name,a.issue_id,a.issue_time,a.issue_status,a.tms_order_number,
a.DIRECTOR_NAME ,a.DIRECTOR_PHONE,a.DIRECTOR_ID,a.RESERVATION_ORDER_SOURCE,a.OUTBOUND_TIME
</sql>
<sql id="joinStockOutOrderPo">
,b.notice_number, b.out_order_number, b.warehouse_id, b.warehouse_code, b.warehouse_name, b.shipper_id, b.shipper_code,
b.shipper_name, b.order_type_code, b.order_type_name, b.customer_id, b.customer_name, b.expect_time, b.supply_chain_number, b.priority_level_code,
b.priority_level_name, b.direct_warehouse, b.review, b.annex_url, b.quantity
</sql>
<sql id="joinStockOutOrderPoYc">
,b.notice_number, b.out_order_number, b.warehouse_id, b.warehouse_code, b.warehouse_name, b.shipper_id, b.shipper_code,
b.shipper_name, b.order_type_code, b.order_type_name, b.customer_id, b.customer_name, b.expect_time, b.supply_chain_number, b.priority_level_code,
b.priority_level_name, b.direct_warehouse, b.review, b.annex_url
</sql>
<sql id="selectStockOutOrderPo1">
<if test="outOrderId != null ">
and a.out_order_id = #{outOrderId}
</if>
<if test="organizationId != null ">
and a.organization_id = #{organizationId}
</if>
<if test="tmsOrderNumber != null and tmsOrderNumber != ''">
and a.tms_order_number like concat('%', #{tmsOrderNumber}, '%')
</if>
<if test="organizationName != null and organizationName != ''">
and a.organization_name like concat('%', #{organizationName}, '%')
</if>
<if test="topOrganizationId != null ">
and a.top_organization_id = #{topOrganizationId}
</if>
<if test="noticeNumber != null and noticeNumber != ''">
and a.notice_number = #{noticeNumber}
</if>
<if test="outOrderNumber != null and outOrderNumber != ''">
and a.out_order_number like concat('%', #{outOrderNumber}, '%')
</if>
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 -->
<if test="status != null ">
<choose>
<when test="status == -1 "> <!-- 作业中 -->
<!-- 出库状态: 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中-->
and a.status IN (3, 4, 5, 6, 7, 8)
</when>
<otherwise>
and a.status = #{status}
</otherwise>
</choose>
</if>
<!-- 出库状态: 1-已创建 2-已审核 3-部分分配 4-已分配 5-拣货中 6-波次中 7-拣货完成 8-复核中 9-已出库 10-已取消 11-已关闭 -->
<if test="gtStatus != null ">
and a.status &gt; #{gtStatus}
</if>
<if test="ltStatus != null ">
and a.status &lt; #{ltStatus}
</if>
<if test="auditStatus != null ">
and a.audit_status = #{auditStatus}
</if>
<if test="auditRemark != null and auditRemark != ''">
and a.audit_remark = #{auditRemark}
</if>
<if test="checkTaskDistribution != null ">
and a.check_task_distribution = #{checkTaskDistribution}
</if>
<if test="auditBy != null ">
and a.audit_by = #{auditBy}
</if>
<if test="auditByName != null and auditByName != ''">
and a.audit_by_name like concat('%', #{auditByName}, '%')
</if>
<if test="auditTime != null ">
and a.audit_time = #{auditTime}
</if>
<if test="warehouseId != null ">
and a.warehouse_id = #{warehouseId}
</if>
<if test="warehouseCode != null and warehouseCode != ''">
and a.warehouse_code = #{warehouseCode}
</if>
<if test="warehouseName != null and warehouseName != ''">
and a.warehouse_name like concat('%', #{warehouseName}, '%')
</if>
<if test="shipperId != null ">
and a.shipper_id = #{shipperId}
</if>
<if test="shipperName != null and shipperName != ''">
and a.shipper_name like concat('%', #{shipperName}, '%')
</if>
<if test="orderTypeCode != null and orderTypeCode != ''">
and a.order_type_code = #{orderTypeCode}
</if>
<if test="orderTypeName != null and orderTypeName != ''">
and a.order_type_name like concat('%', #{orderTypeName}, '%')
</if>
<if test="customerId != null ">
and a.customer_id = #{customerId}
</if>
<if test="customerName != null and customerName != ''">
and a.customer_name like concat('%', #{customerName}, '%')
</if>
<if test="expectTime != null ">
and a.expect_time = #{expectTime}
</if>
<if test="supplyChainNumber != null and supplyChainNumber != ''">
and a.supply_chain_number = #{supplyChainNumber}
</if>
<if test="priorityLevelCode != null and priorityLevelCode != ''">
and a.priority_level_code = #{priorityLevelCode}
</if>
<if test="priorityLevelName != null and priorityLevelName != ''">
and a.priority_level_name like concat('%', #{priorityLevelName}, '%')
</if>
<if test="directWarehouse != null ">
and a.direct_warehouse = #{directWarehouse}
</if>
<if test="review != null ">
and a.review = #{review}
</if>
<if test="annexUrl != null and annexUrl != ''">
and a.annex_url = #{annexUrl}
</if>
<if test="quantity != null ">
and a.quantity = #{quantity}
</if>
<if test="cancelOrder != null ">
and a.cancel_order = #{cancelOrder}
</if>
<if test="cancelRemark != null and cancelRemark != ''">
and a.cancel_remark = #{cancelRemark}
</if>
<if test="cancelBy != null ">
and a.cancel_by = #{cancelBy}
</if>
<if test="cancelByName != null and cancelByName != ''">
and a.cancel_by_name like concat('%', #{cancelByName}, '%')
</if>
<if test="cancelTime != null ">
and a.cancel_time = #{cancelTime}
</if>
<if test="closeOrder != null ">
and a.close_order = #{closeOrder}
</if>
<if test="closeRemark != null and closeRemark != ''">
and a.close_remark = #{closeRemark}
</if>
<if test="closeBy != null ">
and a.close_by = #{closeBy}
</if>
<if test="closeByName != null and closeByName != ''">
and a.close_by_name like concat('%', #{closeByName}, '%')
</if>
<if test="closeTime != null ">
and a.close_time = #{closeTime}
</if>
<if test="checkStatus != null ">
and a.check_status = #{checkStatus}
</if>
<if test="gtCheckStatus != null ">
and a.check_status &gt; #{gtCheckStatus}
</if>
<if test="ltCheckStatus != null ">
and a.check_status &lt; #{ltCheckStatus}
</if>
<if test="createByName != null and createByName != ''">
and a.create_by_name like concat('%', #{createByName}, '%')
</if>
<if test="updateByName != null and updateByName != ''">
and a.update_by_name like concat('%', #{updateByName}, '%')
</if>
<if test="checkOperatorsBy != null and checkOperatorsBy != ''">
and a.check_operators_by = #{checkOperatorsBy}
</if>
<if test="outOrderIds != null and outOrderIds.size > 0 ">
and a.out_order_id in
<foreach collection="outOrderIds" item="item" index="index" open="(" close=")" separator=",">
#{item}
</foreach>
</if>
<if test="createTimeStart != null and createTimeStart != ''">
and date_format(a.create_time,'%Y-%m-%d') &gt;= #{createTimeStart}
</if>
<if test="createTimeEnd != null and createTimeEnd != ''">
and date_format(a.create_time,'%Y-%m-%d') &lt;= #{createTimeEnd}
</if>
<if test="auditTimeStart != null and auditTimeStart != ''">
and date_format(a.audit_time,'%Y-%m-%d') &gt;= #{auditTimeStart}
</if>
<if test="auditTimeEnd != null and auditTimeEnd != ''">
and date_format(a.audit_time,'%Y-%m-%d') &lt;= #{auditTimeEnd}
</if>
<!-- 出库明细:物料名称、物料编码(同一明细行同时满足;与出库明细口径一致)。关联 material_base_info 避免明细冗余名称与主档不一致时筛不到 -->
<!-- <if test="(materialName != null and materialName != '') or (materialCode != null and materialCode != '')">-->
<!-- and exists (-->
<!-- select 1 from out_material_detail omd-->
<!-- left join material_base_info mb on omd.material_base_info_id = mb.material_base_info_id and mb.del_flag = 1-->
<!-- where omd.out_order_number = a.out_order_number-->
<!-- and omd.del_flag = 1-->
<!-- and (omd.level is null or omd.level = 1)-->
<!-- <if test="materialName != null and materialName != ''">-->
<!-- and (-->
<!-- omd.material_name like concat('%', #{materialName}, '%')-->
<!-- or mb.material_name like concat('%', #{materialName}, '%')-->
<!-- )-->
<!-- </if>-->
<!-- <if test="materialCode != null and materialCode != ''">-->
<!-- and (-->
<!-- omd.material_code like concat('%', #{materialCode}, '%')-->
<!-- or mb.material_code like concat('%', #{materialCode}, '%')-->
<!-- )-->
<!-- </if>-->
<!-- )-->
<!-- </if>-->
<choose>
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
<otherwise> and a.del_flag = 1 </otherwise>
</choose>
</sql>
<select id="queryList" parameterType="com.mhd.oms.domain.reserveStockOutOrder.repository.todo.ReserveStockOutOrderDO" resultMap="StockOutOrderResult">
select
<include refid="selectStockOutOrderPo"/>
from reserve_stock_out_order a
<where>
<include refid="selectStockOutOrderPo1"/>
</where>
order by a.create_time desc nulls last
</select>
<!-- 出库单提货单打印-表头查询 -->
<select id="queryOutStockNoticePrint" resultMap="StockOutOrderResult">
SELECT
a.notice_number,
a.out_order_number,
a.supply_chain_number,
a.shipper_name,
a.expect_time,
a.document_creator_name,
a.document_creator,
a.document_date,
a.warehouse_name,
a.remark
FROM reserve_stock_out_order a
WHERE a.del_flag = 1
AND a.out_order_id = #{outOrderId}
</select>
<!-- 出库单提货单打印-明细查询 -->
<select id="queryOutStockNoticePrintDetail" resultMap="OutMaterialDetailResult">
SELECT
b.batch_number,
b.material_code,
b.material_name,
b.specification_model,
b.quantity,
b.unit_name,
b.pack_name,
b.warehouse_code,
b.warehouse_id,
b.storage_location_name,
b.lot_no,
b.piece_count,
b.material_base_info_id,
b.outbound_quantity,
b.box_pallet_no
FROM reserve_out_material_detail b
WHERE b.del_flag = 1
AND b.out_order_number = (SELECT out_order_number FROM reserve_stock_out_order WHERE out_order_id = #{outOrderId} AND del_flag = 1)
ORDER BY b.material_detail_id
</select>
<!-- 明细结果映射 -->
<resultMap type="com.mhd.oms.domain.reserveOutMaterialDetail.repository.po.ReserveOutMaterialDetailPO" id="OutMaterialDetailResult">
<result property="batchNumber" column="batch_number"/>
<result property="materialCode" column="material_code"/>
<result property="materialName" column="material_name"/>
<result property="specificationModel" column="specification_model"/>
<result property="quantity" column="quantity"/>
<result property="unitName" column="unit_name"/>
<result property="packName" column="pack_name"/>
<result property="warehouseCode" column="warehouse_code"/>
<result property="warehouseId" column="warehouse_id"/>
<result property="storageLocationName" column="storage_location_name"/>
<result property="lotNo" column="lot_no"/>
<result property="pieceCount" column="piece_count"/>
<result property="materialBaseInfoId" column="material_base_info_id"/>
<result property="outboundQuantity" column="outbound_quantity"/>
<result property="boxPalletNo" column="box_pallet_no"/>
</resultMap>
</mapper>
@@ -98,12 +98,12 @@ public class ReviewOrderPO extends BaseVOEntity {
@ApiModelProperty("复核明细")
private List<ReviewMaterialDetailPO> materialDetailList;
@ApiModelProperty("货主id")
private String shipperId;
@ApiModelProperty("货主编码")
private String shipperCode;
@ApiModelProperty("货主名字")
private String shipperName;
}
// @ApiModelProperty("货主id")
// private String shipperId;
//
// @ApiModelProperty("货主编码")
// private String shipperCode;
//
// @ApiModelProperty("货主名字")
// private String shipperName;
}