Merge remote-tracking branch 'origin/dev_WMS20260401' into dev_WMS20260401
This commit is contained in:
@@ -2,10 +2,7 @@ package com.mhd.system.api;
|
||||
|
||||
import com.mhd.common.core.constant.ServiceNameConstants;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.system.api.domain.InMaterialDetail;
|
||||
import com.mhd.system.api.domain.OutMaterialDetail;
|
||||
import com.mhd.system.api.domain.StockInOrder;
|
||||
import com.mhd.system.api.domain.StockOutOrder;
|
||||
import com.mhd.system.api.domain.*;
|
||||
import com.mhd.system.api.factory.RemoteBmsFeignFallbackFactory;
|
||||
import com.mhd.system.api.feign.FeignAutoConfiguration;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
@@ -33,4 +30,8 @@ public interface OmsServiceFeign {
|
||||
@ApiOperation("wms推送入库单明细")
|
||||
@PostMapping(value = "/reservationStockOutOrderApi/pushOutOrderDetail")
|
||||
public AjaxResult pushOutOrderDetail(@RequestBody OutMaterialDetail outMaterialDetail);
|
||||
|
||||
@ApiOperation("编辑物料库存")
|
||||
@PostMapping("/materialInventoryApi/omsEdit")
|
||||
public AjaxResult omsEdit(@RequestBody MaterialInventoryOmsParamDO materialInventoryOmsParamDO);
|
||||
}
|
||||
+79
@@ -0,0 +1,79 @@
|
||||
package com.mhd.system.api.domain;
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 物料库存对象 material_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MaterialInventoryOmsParamDO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//库存id
|
||||
private Long materialInventoryId;
|
||||
//物料基础信息id
|
||||
private Long materialBaseInfoId;
|
||||
//物料明细ID
|
||||
private Long materialDetailId;
|
||||
//仓库信息参数
|
||||
private Long organizationId;
|
||||
private String organizationName;
|
||||
private Long topOrganizationId;
|
||||
//仓库ID
|
||||
private Long warehouseId;
|
||||
//仓库编码
|
||||
private String warehouseCode;
|
||||
//仓库名称
|
||||
private String warehouseName;
|
||||
//存储区ID
|
||||
private Long storageSectionId;
|
||||
//存储区编码
|
||||
private String storageCode;
|
||||
//存储区名称
|
||||
private String storageName;
|
||||
//存储位置ID
|
||||
private Long storageLocationId;
|
||||
//存储位置编码
|
||||
private String storageLocationCode;
|
||||
//存储位置名称
|
||||
private String storageLocationName;
|
||||
//调整数量
|
||||
private BigDecimal quantity;
|
||||
//净重
|
||||
private BigDecimal netWeight;
|
||||
//毛重
|
||||
private BigDecimal grossWeight;
|
||||
//体积
|
||||
private BigDecimal volume;
|
||||
//面积
|
||||
private BigDecimal area;
|
||||
//类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结)
|
||||
private String type;
|
||||
|
||||
private String barCode;
|
||||
|
||||
private String inOrderNumber;
|
||||
|
||||
private String lotNumber;
|
||||
|
||||
private String batchNumber;
|
||||
|
||||
private String isNew;
|
||||
|
||||
/** 业务关联单号(出库单号、交接单对应单号等),用于库存调整记录 relate_no;可与入库单号区分 */
|
||||
private String relateNo;
|
||||
|
||||
private String kctzType;
|
||||
|
||||
private LoginUser loginUser;
|
||||
|
||||
}
|
||||
@@ -203,7 +203,7 @@ public class UserPo {
|
||||
private Integer esignEnterpriseStatus;
|
||||
|
||||
@ApiModelProperty(name = "部门ID")
|
||||
private Integer departmentId;
|
||||
private String departmentId;
|
||||
|
||||
@ApiModelProperty(name = "钉钉user_id")
|
||||
private String dingUserId;
|
||||
|
||||
+1
@@ -73,6 +73,7 @@ public class ScheduledTaskServiceImpl extends ServiceImpl<ScheduledTaskMapper, S
|
||||
} else if ("散租".equals(leaseType)) {
|
||||
ScatteredRentalSynchronization(busId);
|
||||
}
|
||||
log.info("结束执行出账业务");
|
||||
} catch (Exception e) {
|
||||
log.error("出账业务异常", e);
|
||||
}
|
||||
|
||||
+15
-9
@@ -64,13 +64,18 @@ public class BillingScheduler {
|
||||
}
|
||||
|
||||
private void executeTask(ScheduledTask task) {
|
||||
String status = "";
|
||||
String status = "SUCCESS";
|
||||
try {
|
||||
// 执行具体的出账逻辑
|
||||
scheduledTaskService.executeBilling(task.getBusId());
|
||||
|
||||
ScheduledTaskLog log = new ScheduledTaskLog();
|
||||
log.setTaskId(task.getId());
|
||||
log.setBusId(task.getBusId());
|
||||
log.setTaskStatus(status);
|
||||
log.setExecuteTime(new Date());
|
||||
scheduledTaskLogMapper.insert(log);
|
||||
//scheduledTaskMapper.updateStatus(task.getId(), "SUCCESS");
|
||||
status = "SUCCESS";
|
||||
//status = "SUCCESS";
|
||||
} catch (Exception e) {
|
||||
// 重试机制
|
||||
scheduledTaskMapper.incrementRetryCount(task.getId());
|
||||
@@ -78,14 +83,15 @@ public class BillingScheduler {
|
||||
//scheduledTaskMapper.updateStatus(task.getId(), "PENDING");
|
||||
} else {
|
||||
status = "FAILED";
|
||||
ScheduledTaskLog log = new ScheduledTaskLog();
|
||||
log.setTaskId(task.getId());
|
||||
log.setBusId(task.getBusId());
|
||||
log.setTaskStatus(status);
|
||||
log.setExecuteTime(new Date());
|
||||
scheduledTaskLogMapper.insert(log);
|
||||
//scheduledTaskMapper.updateStatus(task.getId(), "FAILED");
|
||||
}
|
||||
}
|
||||
ScheduledTaskLog log = new ScheduledTaskLog();
|
||||
log.setTaskId(task.getId());
|
||||
log.setBusId(task.getBusId());
|
||||
log.setTaskStatus(status);
|
||||
log.setExecuteTime(new Date());
|
||||
scheduledTaskLogMapper.insert(log);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -14,20 +14,20 @@ spring:
|
||||
nacos:
|
||||
discovery:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
server-addr: 10.33.0.129:6010
|
||||
# server-addr: 10.33.0.129:6010
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
# server-addr: 10.102.192.5:6848
|
||||
# username: nacos
|
||||
# password: manhuoda@2023
|
||||
server-addr: 10.102.192.5:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
# server-addr: 10.102.192.105:6848
|
||||
config:
|
||||
# server-addr: 127.0.0.1:8848
|
||||
server-addr: 10.33.0.129:6010
|
||||
# server-addr: 10.33.0.129:6010
|
||||
# 线上测试环境配置 容器名+端口号
|
||||
# server-addr: 10.102.192.5:6848
|
||||
# username: nacos
|
||||
# password: manhuoda@2023
|
||||
server-addr: 10.102.192.5:6848
|
||||
username: nacos
|
||||
password: manhuoda@2023
|
||||
#线上正式环境
|
||||
# server-addr: 10.102.192.105:6848
|
||||
group: DEFAULT_GROUP # 默认分组就是DEFAULT_GROUP,如果使用默认分组可以不配置
|
||||
|
||||
+2
-2
@@ -145,7 +145,7 @@ public class UserEntity extends BaseVOEntity {
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty(name = "部门ID")
|
||||
private Integer departmentId;
|
||||
private String departmentId;
|
||||
|
||||
@ApiModelProperty
|
||||
private Boolean hasDefaultAddress;
|
||||
@@ -192,4 +192,4 @@ public class UserEntity extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty("税号")
|
||||
private String taxNumber;
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -21,7 +21,7 @@ public class UserFactory {
|
||||
public UserEntity getUserEntity(UserDO userDO) {
|
||||
UserEntity userEntity = new UserEntity();
|
||||
BeanUtils.copyProperties(userDO,userEntity, IgnoreNullUtil.getNullPropertyNames(userDO));
|
||||
userEntity.setDepartmentId(ObjectUtil.isNotEmpty(userDO.getDepartmentId())?Integer.valueOf(userDO.getDepartmentId()):null);
|
||||
userEntity.setDepartmentId(ObjectUtil.isNotEmpty(userDO.getDepartmentId())?userDO.getDepartmentId():null);
|
||||
return userEntity;
|
||||
}
|
||||
public CheckDO getCheckDo(UserDO userDO) {
|
||||
@@ -30,4 +30,4 @@ public class UserFactory {
|
||||
return checkDO;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -173,6 +173,7 @@
|
||||
WHERE a.del_flag = 1
|
||||
AND (b.del_flag = 1 OR b.del_flag IS NULL)
|
||||
AND a.business_type IN (1,3)
|
||||
AND a.role_code != 'customer'
|
||||
</sql>
|
||||
|
||||
<select id="selectList" parameterType="com.mhd.user.domain.userAggregate.repository.todo.UserShipperDO"
|
||||
|
||||
+1
@@ -953,6 +953,7 @@ public class BusinessDocumentApplicationService {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean wholeRentSynchronization(BusinessDocumentDO businessDocumentDO) {
|
||||
log.info("定时任务进入BMS业务单据保存--开始");
|
||||
log.error("定时任务进入BMS业务单据保存--开始");
|
||||
//根据结算主题id查询 结算对象编码
|
||||
Long settlementEntityId = businessDocumentDO.getSettlementEntityId();
|
||||
List<SettlementCustomers> settlementCustomersList = settlementCustomersService.list(new LambdaQueryWrapper<SettlementCustomers>()
|
||||
|
||||
+2
-2
@@ -86,8 +86,8 @@ public class BusinessDocumentOrderApplicationService {
|
||||
return businessDocumentOrderDomainService.execute(ids);
|
||||
}
|
||||
|
||||
public boolean executeAndIssue(List<Long> ids) {
|
||||
return businessDocumentOrderDomainService.executeAndIssue(ids);
|
||||
public boolean executeAndIssue(List<Long> ids,Long organizationId) {
|
||||
return businessDocumentOrderDomainService.executeAndIssue(ids,organizationId);
|
||||
}
|
||||
|
||||
public boolean cancelExecute(List<Long> ids) throws Exception{
|
||||
|
||||
+2
-2
@@ -60,8 +60,8 @@ public class ExecuteOrderApplicationService {
|
||||
return executeOrderDomainService.delete(ids);
|
||||
}
|
||||
|
||||
public boolean issueDocuments(List<Long> ids) {
|
||||
return executeOrderDomainService.issueDocuments(ids);
|
||||
public boolean issueDocuments(List<Long> ids,Long organizationId) {
|
||||
return executeOrderDomainService.issueDocuments(ids,organizationId);
|
||||
}
|
||||
|
||||
public boolean cancelIssueDocuments(List<Long> ids) {
|
||||
|
||||
+1
-1
@@ -37,7 +37,7 @@ public interface IBusinessDocumentOrderService extends IService<BusinessDocument
|
||||
|
||||
public Boolean execute(List<Long> ids);
|
||||
|
||||
public Boolean executeAndIssue(List<Long> ids);
|
||||
public Boolean executeAndIssue(List<Long> ids,Long organizationId);
|
||||
|
||||
public Boolean cancelExecute(List<Long> ids) throws Exception;
|
||||
|
||||
|
||||
+5
-1
@@ -228,7 +228,7 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean executeAndIssue(List<Long> ids) {
|
||||
public Boolean executeAndIssue(List<Long> ids,Long organizationId) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();//获取登录人
|
||||
try {
|
||||
for (Long id:ids){
|
||||
@@ -358,6 +358,10 @@ public class BusinessDocumentOrderImpl extends ServiceImpl<BusinessDocumentOrder
|
||||
tmsOrderAddDTO.setPayerType(0);
|
||||
tmsOrderAddDTO.setExecuteOrderNumber(executeOrder.getGoodsNumber());
|
||||
tmsOrderAddDTO.setOrderSource("0");
|
||||
tmsOrderAddDTO.setOrganizationId(organizationId);
|
||||
String orgName = executeOrderMapper.getOrgNameByOrgId(organizationId);
|
||||
|
||||
tmsOrderAddDTO.setOrganizationName(orgName);
|
||||
|
||||
AjaxResult ajaxResult=wlhyServiceFeign.add(tmsOrderAddDTO);
|
||||
if(ajaxResult.get("code").toString().equals("200")){
|
||||
|
||||
+2
-2
@@ -733,8 +733,8 @@ public class BusinessDocumentOrderDomainService {
|
||||
return businessDocumentOrderService.execute(ids);
|
||||
}
|
||||
|
||||
public Boolean executeAndIssue(List<Long> ids) {
|
||||
return businessDocumentOrderService.executeAndIssue(ids);
|
||||
public Boolean executeAndIssue(List<Long> ids,Long organizationId) {
|
||||
return businessDocumentOrderService.executeAndIssue(ids,organizationId);
|
||||
}
|
||||
|
||||
public Boolean cancelExecute(List<Long> ids) throws Exception {
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ public interface IExecuteOrderService extends IService<ExecuteOrder>
|
||||
*/
|
||||
public Boolean delete(Long[] ids);
|
||||
|
||||
public Boolean issueDocuments(List<Long> ids);
|
||||
public Boolean issueDocuments(List<Long> ids,Long organizationId);
|
||||
|
||||
public Boolean cancelIssueDocuments(List<Long> ids);
|
||||
|
||||
|
||||
+1
@@ -19,4 +19,5 @@ public interface ExecuteOrderMapper extends BaseMapper<ExecuteOrder>
|
||||
*/
|
||||
public List<ExecuteOrderPO> queryList(ExecuteOrderDO executeOrderDO);
|
||||
|
||||
String getOrgNameByOrgId(@Param("organizationId") Long organizationId);
|
||||
}
|
||||
|
||||
+5
-2
@@ -117,7 +117,7 @@ public class ExecuteOrderImpl extends ServiceImpl<ExecuteOrderMapper, ExecuteOrd
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean issueDocuments(List<Long> ids) {
|
||||
public Boolean issueDocuments(List<Long> ids,Long organizationId) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();//获取登录人
|
||||
for (Long id:ids){
|
||||
ExecuteOrder executeOrder=executeOrderMapper.selectById(id);
|
||||
@@ -203,7 +203,10 @@ public class ExecuteOrderImpl extends ServiceImpl<ExecuteOrderMapper, ExecuteOrd
|
||||
tmsOrderAddDTO.setPayerType(0);
|
||||
tmsOrderAddDTO.setExecuteOrderNumber(executeOrder.getGoodsNumber());
|
||||
tmsOrderAddDTO.setOrderSource("0");
|
||||
// tmsOrderAddDTO.setOrganizationId(organizationId);
|
||||
tmsOrderAddDTO.setOrganizationId(organizationId);
|
||||
String orgName = executeOrderMapper.getOrgNameByOrgId(organizationId);
|
||||
|
||||
tmsOrderAddDTO.setOrganizationName(orgName);
|
||||
|
||||
AjaxResult ajaxResult=wlhyServiceFeign.add(tmsOrderAddDTO);
|
||||
if(ajaxResult.get("code").toString().equals("200")){
|
||||
|
||||
+2
-2
@@ -57,8 +57,8 @@ public class ExecuteOrderDomainService {
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
public Boolean issueDocuments(List<Long> ids) {
|
||||
return executeOrderService.issueDocuments(ids);
|
||||
public Boolean issueDocuments(List<Long> ids,Long organizationId) {
|
||||
return executeOrderService.issueDocuments(ids,organizationId);
|
||||
}
|
||||
|
||||
public Boolean cancelIssueDocuments(List<Long> ids) {
|
||||
|
||||
+1
@@ -428,4 +428,5 @@ public class ReservationInMaterialDetailDO extends ReservationStockInOrderBaseDO
|
||||
@ApiModelProperty("调整后面积")
|
||||
@Excel(name = "调整后面积")
|
||||
private BigDecimal adjustedArea;
|
||||
|
||||
}
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* 库存调整记录对象 inventory_adjustment_record
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ReservationInventoryAdjustmentRecord extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("库存调整记录id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long inventoryAdjustmentId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("物料库存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("货主id")
|
||||
@Excel(name = "货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@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 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("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
|
||||
@Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
|
||||
private Long adjustType;
|
||||
|
||||
@ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存")
|
||||
@Excel(name = "调整方向:0:无状态 1:增库存 2:减库存")
|
||||
private Long adjustDirection;
|
||||
|
||||
@ApiModelProperty("调整前状态编码")
|
||||
@Excel(name = "调整前状态编码")
|
||||
private String adjustBeforeStatusCode;
|
||||
|
||||
@ApiModelProperty("调整前状态名称")
|
||||
@Excel(name = "调整前状态名称")
|
||||
private String adjustBeforeStatusName;
|
||||
|
||||
@ApiModelProperty("调整后状态编码")
|
||||
@Excel(name = "调整后状态编码")
|
||||
private String adjustAfterStatusCode;
|
||||
|
||||
@ApiModelProperty("调整后状态名称")
|
||||
@Excel(name = "调整后状态名称")
|
||||
private String adjustAfterStatusName;
|
||||
|
||||
@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("调整动作")
|
||||
@Excel(name = "调整动作")
|
||||
private String adjustAction;
|
||||
|
||||
@ApiModelProperty("关联单号")
|
||||
@Excel(name = "关联单号")
|
||||
private String relateNo;
|
||||
|
||||
@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;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
@Excel(name = "LOT编号")
|
||||
private String lotNumber;
|
||||
@ApiModelProperty("批次号")
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
}
|
||||
+43
@@ -0,0 +1,43 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存调整记录Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
public interface IReservationInventoryAdjustmentRecordService extends IService<ReservationInventoryAdjustmentRecord>
|
||||
{
|
||||
/**
|
||||
* 分页查询库存调整记录列表
|
||||
*/
|
||||
public List<ReservationInventoryAdjustmentRecordPO> queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO);
|
||||
|
||||
/**
|
||||
* 新增库存调整记录
|
||||
*/
|
||||
public Boolean insert(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO);
|
||||
|
||||
/**
|
||||
* 修改库存调整记录
|
||||
*/
|
||||
public Boolean update(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO);
|
||||
|
||||
/**
|
||||
* 批量删除库存调整记录
|
||||
*/
|
||||
public Boolean delete(Long[] inventoryAdjustmentIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询库存调整记录
|
||||
*/
|
||||
public ReservationInventoryAdjustmentRecordPO getInfo(Long inventoryAdjustmentId);
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存调整记录Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
public interface ReservationInventoryAdjustmentRecordMapper extends BaseMapper<ReservationInventoryAdjustmentRecord>
|
||||
{
|
||||
/**
|
||||
* 查询库存调整记录列表
|
||||
*/
|
||||
public List<ReservationInventoryAdjustmentRecordPO> queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO);
|
||||
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.persistence;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.facade.IReservationInventoryAdjustmentRecordService;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper.ReservationInventoryAdjustmentRecordMapper;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO;
|
||||
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-07-17
|
||||
*/
|
||||
@Service
|
||||
public class ReservationInventoryAdjustmentRecordImpl extends ServiceImpl<ReservationInventoryAdjustmentRecordMapper, ReservationInventoryAdjustmentRecord> implements IReservationInventoryAdjustmentRecordService {
|
||||
@Autowired
|
||||
private ReservationInventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询库存调整记录列表
|
||||
*/
|
||||
@Override
|
||||
public List<ReservationInventoryAdjustmentRecordPO> queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO)
|
||||
{
|
||||
return inventoryAdjustmentRecordMapper.queryList(inventoryAdjustmentRecordDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增库存调整记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecord();
|
||||
BeanUtils.copyProperties(inventoryAdjustmentRecordDO,inventoryAdjustmentRecord);
|
||||
return this.save(inventoryAdjustmentRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存调整记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecord();
|
||||
BeanUtils.copyProperties(inventoryAdjustmentRecordDO,inventoryAdjustmentRecord);
|
||||
return this.updateById(inventoryAdjustmentRecord);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存调整记录
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] inventoryAdjustmentIds ) {
|
||||
List<ReservationInventoryAdjustmentRecord> list = new ArrayList<>();
|
||||
for (Long id : inventoryAdjustmentIds) {
|
||||
ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecord();
|
||||
inventoryAdjustmentRecord.setInventoryAdjustmentId(id);
|
||||
inventoryAdjustmentRecord.setDelFlag(2);
|
||||
list.add(inventoryAdjustmentRecord);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存调整记录
|
||||
*/
|
||||
@Override
|
||||
public ReservationInventoryAdjustmentRecordPO getInfo(Long inventoryAdjustmentId) {
|
||||
ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = this.getById(inventoryAdjustmentId);
|
||||
ReservationInventoryAdjustmentRecordPO inventoryAdjustmentRecordPO = new ReservationInventoryAdjustmentRecordPO();
|
||||
BeanUtils.copyProperties(inventoryAdjustmentRecord,inventoryAdjustmentRecordPO);
|
||||
return inventoryAdjustmentRecordPO;
|
||||
}
|
||||
}
|
||||
+258
@@ -0,0 +1,258 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.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.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;
|
||||
|
||||
|
||||
/**
|
||||
* 库存调整记录对象 inventory_adjustment_record
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "库存调整记录对象", description = "库存调整记录响应对象")
|
||||
public class ReservationInventoryAdjustmentRecordPO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("库存调整记录id")
|
||||
private Long inventoryAdjustmentId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("物料库存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("货主id")
|
||||
@Excel(name = "货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@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 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("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
|
||||
@Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
|
||||
private Long adjustType;
|
||||
|
||||
@ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存")
|
||||
@Excel(name = "调整方向:0:无状态 1:增库存 2:减库存")
|
||||
private Long adjustDirection;
|
||||
|
||||
@ApiModelProperty("调整前状态编码")
|
||||
@Excel(name = "调整前状态编码")
|
||||
private String adjustBeforeStatusCode;
|
||||
|
||||
@ApiModelProperty("调整前状态名称")
|
||||
@Excel(name = "调整前状态名称")
|
||||
private String adjustBeforeStatusName;
|
||||
|
||||
@ApiModelProperty("调整后状态编码")
|
||||
@Excel(name = "调整后状态编码")
|
||||
private String adjustAfterStatusCode;
|
||||
|
||||
@ApiModelProperty("调整后状态名称")
|
||||
@Excel(name = "调整后状态名称")
|
||||
private String adjustAfterStatusName;
|
||||
|
||||
@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("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 boxPalletNo;
|
||||
|
||||
@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("物料更多属性列表(批次属性)")
|
||||
private List<MaterialMoreDetailPO> materialMoreDetailList;
|
||||
|
||||
@ApiModelProperty("调整动作")
|
||||
@Excel(name = "调整动作")
|
||||
private String adjustAction;
|
||||
|
||||
@ApiModelProperty("关联单号")
|
||||
@Excel(name = "关联单号")
|
||||
private String relateNo;
|
||||
|
||||
@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;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
@Excel(name = "LOT编号")
|
||||
private String LotNumber;
|
||||
@ApiModelProperty("批次号")
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
}
|
||||
+214
@@ -0,0 +1,214 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo;
|
||||
|
||||
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;
|
||||
|
||||
|
||||
/**
|
||||
* 库存调整记录对象 inventory_adjustment_record
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ReservationInventoryAdjustmentRecordDO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("库存调整记录id")
|
||||
private Long inventoryAdjustmentId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("物料库存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("货主id")
|
||||
@Excel(name = "货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@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 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("批次号")
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty("容器id")
|
||||
@Excel(name = "容器id")
|
||||
private Long containerId;
|
||||
|
||||
@ApiModelProperty("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
|
||||
@Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
|
||||
private Long adjustType;
|
||||
|
||||
@ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存")
|
||||
@Excel(name = "调整方向:0:无状态 1:增库存 2:减库存")
|
||||
private Long adjustDirection;
|
||||
|
||||
@ApiModelProperty("调整前状态编码")
|
||||
@Excel(name = "调整前状态编码")
|
||||
private String adjustBeforeStatusCode;
|
||||
|
||||
@ApiModelProperty("调整前状态名称")
|
||||
@Excel(name = "调整前状态名称")
|
||||
private String adjustBeforeStatusName;
|
||||
|
||||
@ApiModelProperty("调整后状态编码")
|
||||
@Excel(name = "调整后状态编码")
|
||||
private String adjustAfterStatusCode;
|
||||
|
||||
@ApiModelProperty("调整后状态名称")
|
||||
@Excel(name = "调整后状态名称")
|
||||
private String adjustAfterStatusName;
|
||||
|
||||
@ApiModelProperty("调整数量")
|
||||
@Excel(name = "调整数量")
|
||||
private BigDecimal adjustQuantity;
|
||||
|
||||
@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(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("调整动作")
|
||||
@Excel(name = "调整动作")
|
||||
private String adjustAction;
|
||||
|
||||
@ApiModelProperty("关联单号")
|
||||
@Excel(name = "关联单号")
|
||||
private String relateNo;
|
||||
|
||||
@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;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
@Excel(name = "LOT编号")
|
||||
private String lotNumber;
|
||||
}
|
||||
+171
@@ -0,0 +1,171 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* 库存调整记录对象 inventory_adjustment_record
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ReservationInventoryAdjustmentRecordDTO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("库存调整记录id")
|
||||
private Long inventoryAdjustmentId;
|
||||
|
||||
@ApiModelProperty("组织表ID")
|
||||
@Excel(name = "组织表ID")
|
||||
private Long organizationId;
|
||||
|
||||
@ApiModelProperty("组织名称")
|
||||
@Excel(name = "组织名称")
|
||||
private String organizationName;
|
||||
|
||||
@ApiModelProperty("一级组织表ID")
|
||||
@Excel(name = "一级组织表ID")
|
||||
private Long topOrganizationId;
|
||||
|
||||
@ApiModelProperty("物料库存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("货主id")
|
||||
@Excel(name = "货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@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 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("批次号")
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty("容器id")
|
||||
@Excel(name = "容器id")
|
||||
private Long containerId;
|
||||
|
||||
@ApiModelProperty("调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
|
||||
@Excel(name = "调整类型:0:无状态 1:数量调整 :2:状态调整 3:库存冻结")
|
||||
private Long adjustType;
|
||||
|
||||
@ApiModelProperty("调整方向:0:无状态 1:增库存 2:减库存")
|
||||
@Excel(name = "调整方向:0:无状态 1:增库存 2:减库存")
|
||||
private Long adjustDirection;
|
||||
|
||||
@ApiModelProperty("调整前状态编码")
|
||||
@Excel(name = "调整前状态编码")
|
||||
private String adjustBeforeStatusCode;
|
||||
|
||||
@ApiModelProperty("调整前状态名称")
|
||||
@Excel(name = "调整前状态名称")
|
||||
private String adjustBeforeStatusName;
|
||||
|
||||
@ApiModelProperty("调整后状态编码")
|
||||
@Excel(name = "调整后状态编码")
|
||||
private String adjustAfterStatusCode;
|
||||
|
||||
@ApiModelProperty("调整后状态名称")
|
||||
@Excel(name = "调整后状态名称")
|
||||
private String adjustAfterStatusName;
|
||||
|
||||
@ApiModelProperty("调整数量")
|
||||
@Excel(name = "调整数量")
|
||||
private BigDecimal adjustQuantity;
|
||||
|
||||
@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("调整动作")
|
||||
private String adjustAction;
|
||||
|
||||
@ApiModelProperty("关联单号")
|
||||
private String relateNo;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
}
|
||||
+169
@@ -0,0 +1,169 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service.ReservationInventoryAdjustmentRecordDomainService;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.domain.BatchDetailFeignPO;
|
||||
import com.mhd.system.api.domain.MaterialMoreDetailPO;
|
||||
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
|
||||
import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
|
||||
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.util.CollectionUtils;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 库存调整记录ApplicationService
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ReservationInventoryAdjustmentRecordApplicationService {
|
||||
@Autowired
|
||||
private ReservationInventoryAdjustmentRecordDomainService inventoryAdjustmentRecordDomainService;
|
||||
@Autowired
|
||||
private ReservationMaterialInventoryMapper materialInventoryMapper;
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询库存调整记录列表
|
||||
*/
|
||||
|
||||
public List<ReservationInventoryAdjustmentRecordPO> queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserPo() != null){
|
||||
Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
|
||||
Long frontendOrganizationId = inventoryAdjustmentRecordDO.getOrganizationId(); // 前端传递的 organizationId
|
||||
|
||||
// 数据权限:根据 organizationId 来设置查询权限
|
||||
// 当前登录用户的 organizationId 为 2827 时,可查全部组织数据;其他组织只能查自己
|
||||
if (userOrganizationId != null && userOrganizationId == 2827L) {
|
||||
// 南光组织(organizationId=2827):可以查询所有组织的数据
|
||||
// 如果前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤
|
||||
// 如果前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据
|
||||
if (frontendOrganizationId != null) {
|
||||
// 前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤
|
||||
inventoryAdjustmentRecordDO.setOrganizationId(frontendOrganizationId);
|
||||
inventoryAdjustmentRecordDO.setTopOrganizationId(null); // 明确设置为 null,避免使用 topOrganizationId 条件
|
||||
} else {
|
||||
// 前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据
|
||||
inventoryAdjustmentRecordDO.setOrganizationId(null);
|
||||
inventoryAdjustmentRecordDO.setTopOrganizationId(null);
|
||||
}
|
||||
} else {
|
||||
// 其他组织:设置organizationId,只查询当前组织的数据
|
||||
// 如果前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (frontendOrganizationId != null && userOrganizationId != null) {
|
||||
// 前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (!frontendOrganizationId.equals(userOrganizationId)) {
|
||||
// 前端传递了其他组织的 organizationId,强制使用当前登录用户的组织ID,防止越权查询
|
||||
inventoryAdjustmentRecordDO.setOrganizationId(userOrganizationId);
|
||||
}
|
||||
// 如果前端传递的 organizationId 与当前登录用户的组织ID一致,使用前端传递的值
|
||||
} else {
|
||||
// 前端没有传递 organizationId,使用当前登录用户的组织ID
|
||||
if (userOrganizationId != null) {
|
||||
inventoryAdjustmentRecordDO.setOrganizationId(userOrganizationId);
|
||||
}
|
||||
}
|
||||
// 只有当 organizationId 为 null 时,才使用 topOrganizationId 作为查询条件
|
||||
// 如果 organizationId 不为 null,则优先使用 organizationId,不使用 topOrganizationId
|
||||
if (inventoryAdjustmentRecordDO.getOrganizationId() == null) {
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1) {
|
||||
inventoryAdjustmentRecordDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
} else {
|
||||
// 对于非2827组织,必须设置 topOrganizationId=2827
|
||||
inventoryAdjustmentRecordDO.setTopOrganizationId(2827L);
|
||||
}
|
||||
}
|
||||
AssociationWarehouseCacheDO associationWarehouseCacheDO = SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
if (associationWarehouseCacheDO != null) {
|
||||
inventoryAdjustmentRecordDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
}
|
||||
}
|
||||
List<ReservationInventoryAdjustmentRecordPO> inventoryAdjustmentRecordPOS = inventoryAdjustmentRecordDomainService.queryList(inventoryAdjustmentRecordDO);
|
||||
|
||||
// 性能优化:批量获取批次属性,避免N+1查询问题
|
||||
// 1. 收集所有唯一的materialBaseInfoId
|
||||
Set<Long> materialBaseInfoIdSet = inventoryAdjustmentRecordPOS.stream()
|
||||
.map(ReservationInventoryAdjustmentRecordPO::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(inventoryAdjustmentRecordPOS, batchDetailMap);
|
||||
inventoryAdjustmentRecordPOS.sort(Comparator.comparing(ReservationInventoryAdjustmentRecordPO::getCreateTime).reversed());
|
||||
return inventoryAdjustmentRecordPOS;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增库存调整记录
|
||||
*/
|
||||
public Boolean insert(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
|
||||
return inventoryAdjustmentRecordDomainService.insert(inventoryAdjustmentRecordDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存调整记录
|
||||
*/
|
||||
public Boolean update(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
return inventoryAdjustmentRecordDomainService.update(inventoryAdjustmentRecordDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存调整记录
|
||||
*/
|
||||
public boolean delete(Long[] inventoryAdjustmentIds) {
|
||||
return inventoryAdjustmentRecordDomainService.delete(inventoryAdjustmentIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库存调整记录详细信息
|
||||
*/
|
||||
public ReservationInventoryAdjustmentRecordPO getInfo(Long inventoryAdjustmentId)
|
||||
{
|
||||
return inventoryAdjustmentRecordDomainService.getInfo(inventoryAdjustmentId);
|
||||
}
|
||||
}
|
||||
+28
@@ -0,0 +1,28 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service;
|
||||
|
||||
import com.mhd.common.core.utils.IgnoreNullUtil;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDTO;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* 库存调整记录Assembler
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
@Component
|
||||
public class ReservationInventoryAdjustmentRecordAssembler {
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
public ReservationInventoryAdjustmentRecordDO toDO(ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO) {
|
||||
ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = new ReservationInventoryAdjustmentRecordDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(inventoryAdjustmentRecordDTO, inventoryAdjustmentRecordDO, IgnoreNullUtil.getNullPropertyNames(inventoryAdjustmentRecordDTO));
|
||||
return inventoryAdjustmentRecordDO;
|
||||
}
|
||||
|
||||
}
|
||||
+305
@@ -0,0 +1,305 @@
|
||||
package com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.aliyun.oss.ServiceException;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mhd.common.core.constant.SnowFlakeConstants;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
import com.mhd.common.core.utils.uuid.IdGenerator;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.facade.IReservationInventoryAdjustmentRecordService;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReservationMaterialInventoryService;
|
||||
import com.mhd.system.api.OmsServiceFeign;
|
||||
import com.mhd.system.api.domain.InMaterialDetail;
|
||||
import com.mhd.system.api.domain.OutMaterialDetail;
|
||||
import com.mhd.system.api.domain.StockOutOrder;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
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.math.BigDecimal;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 库存调整记录
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ReservationInventoryAdjustmentRecordDomainService {
|
||||
|
||||
@Autowired
|
||||
private IReservationInventoryAdjustmentRecordService inventoryAdjustmentRecordService;
|
||||
@Autowired
|
||||
private IReservationMaterialInventoryService materialInventoryService;
|
||||
// @Autowired
|
||||
// private IMaterialBaseInfoService materialBaseInfoService;
|
||||
// @Autowired
|
||||
// private IInventoryStandingDetailService inventoryStandingDetailService;
|
||||
@Autowired
|
||||
private IdGenerator idGenerator;
|
||||
@Autowired
|
||||
private OmsServiceFeign omsServiceFeign;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询库存调整记录列表
|
||||
*/
|
||||
public List<ReservationInventoryAdjustmentRecordPO> queryList(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
return inventoryAdjustmentRecordService.queryList(inventoryAdjustmentRecordDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增库存调整记录
|
||||
*/
|
||||
public Boolean insert(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
|
||||
return inventoryAdjustmentRecordService.insert(inventoryAdjustmentRecordDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改库存调整记录
|
||||
*/
|
||||
public Boolean update(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
return inventoryAdjustmentRecordService.update(inventoryAdjustmentRecordDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存调整记录
|
||||
*/
|
||||
public Boolean delete(Long[] inventoryAdjustmentIds) {
|
||||
return inventoryAdjustmentRecordService.delete(inventoryAdjustmentIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库存调整记录详细信息
|
||||
*/
|
||||
public ReservationInventoryAdjustmentRecordPO getInfo(Long inventoryAdjustmentId)
|
||||
{
|
||||
return inventoryAdjustmentRecordService.getInfo(inventoryAdjustmentId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:库存调整
|
||||
* @param inventoryAdjustmentRecordDO
|
||||
* @return: java.lang.Boolean
|
||||
* @author: lianzj
|
||||
* @time: 2024-07-18 9:30:30
|
||||
*/
|
||||
// @Transactional
|
||||
// public Boolean inventoryAdjust(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
// ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecordDO();
|
||||
// inventoryAdjustmentRecord.setAdjustAction("库存调整");
|
||||
// LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// inventoryAdjustmentRecord.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
// inventoryAdjustmentRecord.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
// inventoryAdjustmentRecord.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
// inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
|
||||
// inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername());
|
||||
// inventoryAdjustmentRecord.setCreateTime(new Date());
|
||||
// ReservationMaterialInventory materialInventory = null;
|
||||
// //根据调整类型判断,数量调整只调整当前库存记录数量,状态调整减少当前原物料状态库存数量和可用数量,增加到现状态库存数量和可用数量
|
||||
// if (inventoryAdjustmentRecordDO.getAdjustType() != null && inventoryAdjustmentRecordDO.getAdjustType() == 1) {
|
||||
// inventoryAdjustmentRecord.setAdjustType(1L);
|
||||
// if (inventoryAdjustmentRecordDO.getReservationMaterialInventoryId() != null) {
|
||||
// materialInventory = materialInventoryService.getById(inventoryAdjustmentRecordDO.getReservationMaterialInventoryId());
|
||||
// if (ObjectUtil.isNotNull(materialInventory)) {
|
||||
// BeanUtils.copyProperties(materialInventory, inventoryAdjustmentRecord);
|
||||
// inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity());
|
||||
// inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity());
|
||||
// inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity());
|
||||
// MaterialBaseInfo materialBaseInfo = materialBaseInfoService.getOne(new QueryWrapper<MaterialBaseInfo>().lambda()
|
||||
// .eq(MaterialBaseInfo::getMaterialBaseInfoId,materialInventory.getMaterialBaseInfoId()).eq(BaseVOEntity::getDelFlag,1));
|
||||
// if (ObjectUtil.isNotNull(materialBaseInfo)) {
|
||||
// inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode());
|
||||
// inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName());
|
||||
// inventoryAdjustmentRecord.setBarCode(materialBaseInfo.getBarCode());
|
||||
// inventoryAdjustmentRecord.setShipperId(materialBaseInfo.getShipperId());
|
||||
// inventoryAdjustmentRecord.setShipperName(materialBaseInfo.getShipperName());
|
||||
// }
|
||||
// //根据调整方向判断
|
||||
// if (inventoryAdjustmentRecordDO.getAdjustDirection() != null && inventoryAdjustmentRecordDO.getAdjustDirection() == 1) {
|
||||
// materialInventory.setInventoryQuantity(materialInventory.getInventoryQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
//
|
||||
// } else if (inventoryAdjustmentRecordDO.getAdjustDirection() != null && inventoryAdjustmentRecordDO.getAdjustDirection() == 2) {
|
||||
// materialInventory.setInventoryQuantity(materialInventory.getInventoryQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// if (materialInventory.getInventoryQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
// throw new ServiceException("库存数量调整之后不能小于0");
|
||||
// }
|
||||
// materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
// throw new ServiceException("可用数量调整之后不能小于0");
|
||||
// }
|
||||
// }
|
||||
// inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
// inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity());
|
||||
// inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());
|
||||
// // 调整前:库存数量(净重、毛重、体积、面积)
|
||||
// inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight());
|
||||
// inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight());
|
||||
// inventoryAdjustmentRecord.setVolume(materialInventory.getVolume());
|
||||
// inventoryAdjustmentRecord.setArea(materialInventory.getArea());
|
||||
// // 调整后:库存数量 - 复核时填写的数量
|
||||
// inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight());
|
||||
// inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight());
|
||||
// inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume());
|
||||
// inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea());
|
||||
//
|
||||
// } else {
|
||||
// throw new ServiceException("根据物料库存id查询不到物料库存信息!");
|
||||
// }
|
||||
// }
|
||||
// } else if (inventoryAdjustmentRecordDO.getAdjustType() != null && inventoryAdjustmentRecordDO.getAdjustType() == 2) {
|
||||
// inventoryAdjustmentRecord.setAdjustType(2L);
|
||||
// inventoryAdjustmentRecord.setAdjustBeforeStatusCode(inventoryAdjustmentRecordDO.getAdjustBeforeStatusCode());
|
||||
// inventoryAdjustmentRecord.setAdjustBeforeStatusName(inventoryAdjustmentRecordDO.getAdjustBeforeStatusName());
|
||||
// //根据物料基本信息id,仓库id,库区id,库位id,原物料状态查询
|
||||
// materialInventory = materialInventoryService.getOne(new QueryWrapper<ReservationMaterialInventory>().lambda()
|
||||
// .eq(ReservationMaterialInventory::getReservationMaterialInventoryId,inventoryAdjustmentRecordDO.getReservationMaterialInventoryId())
|
||||
// .eq(ReservationMaterialInventory::getMaterialBaseInfoId,inventoryAdjustmentRecordDO.getMaterialBaseInfoId())
|
||||
// .eq(ReservationMaterialInventory::getWarehouseId,inventoryAdjustmentRecordDO.getWarehouseId())
|
||||
// .eq(ReservationMaterialInventory::getStorageSectionId,inventoryAdjustmentRecordDO.getStorageSectionId())
|
||||
// .eq(ReservationMaterialInventory::getStorageLocationId,inventoryAdjustmentRecordDO.getStorageLocationId())
|
||||
// .eq(ReservationMaterialInventory::getMaterialStatusCode,inventoryAdjustmentRecordDO.getAdjustBeforeStatusCode())
|
||||
// .eq(ReservationMaterialInventory::getBatchNumber,inventoryAdjustmentRecordDO.getBatchNumber())
|
||||
// .eq(ReservationMaterialInventory::getContainerId,inventoryAdjustmentRecordDO.getContainerId())
|
||||
// .eq(BaseVOEntity::getDelFlag, 1));
|
||||
// if (ObjectUtil.isNotNull(materialInventory)) {
|
||||
// BeanUtils.copyProperties(materialInventory, inventoryAdjustmentRecord);
|
||||
// inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity());
|
||||
// inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity());
|
||||
// inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity());
|
||||
// MaterialBaseInfo materialBaseInfo = materialBaseInfoService.getOne(new QueryWrapper<MaterialBaseInfo>().lambda()
|
||||
// .eq(MaterialBaseInfo::getMaterialBaseInfoId,materialInventory.getMaterialBaseInfoId()).eq(BaseVOEntity::getDelFlag,1));
|
||||
// if (ObjectUtil.isNotNull(materialBaseInfo)) {
|
||||
// inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode());
|
||||
// inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName());
|
||||
// inventoryAdjustmentRecord.setBarCode(materialBaseInfo.getBarCode());
|
||||
// inventoryAdjustmentRecord.setShipperId(materialBaseInfo.getShipperId());
|
||||
// inventoryAdjustmentRecord.setShipperName(materialBaseInfo.getShipperName());
|
||||
// }
|
||||
// materialInventory.setInventoryQuantity(materialInventory.getInventoryQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// if (materialInventory.getInventoryQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
// throw new ServiceException("库存数量调整之后不能小于0");
|
||||
// }
|
||||
// materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
// throw new ServiceException("可用数量调整之后不能小于0");
|
||||
// }
|
||||
// inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
// inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity());
|
||||
// inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());
|
||||
// // 调整前:库存数量(净重、毛重、体积、面积)
|
||||
// inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight());
|
||||
// inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight());
|
||||
// inventoryAdjustmentRecord.setVolume(materialInventory.getVolume());
|
||||
// inventoryAdjustmentRecord.setArea(materialInventory.getArea());
|
||||
// // 调整后:库存数量 - 复核时填写的数量
|
||||
// inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight());
|
||||
// inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight());
|
||||
// inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume());
|
||||
// inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea());
|
||||
// } else {
|
||||
// throw new ServiceException("根据原物料状态查询不到物料库存信息!");
|
||||
// }
|
||||
// //根据物料基本信息id,仓库id,库区id,库位id,现物料状态查询
|
||||
// ReservationMaterialInventory materialInventory1 = materialInventoryService.getOne(new QueryWrapper<ReservationMaterialInventory>().lambda()
|
||||
// .eq(ReservationMaterialInventory::getMaterialBaseInfoId,inventoryAdjustmentRecordDO.getMaterialBaseInfoId())
|
||||
// .eq(ReservationMaterialInventory::getWarehouseId,inventoryAdjustmentRecordDO.getWarehouseId())
|
||||
// .eq(ReservationMaterialInventory::getStorageSectionId,inventoryAdjustmentRecordDO.getStorageSectionId())
|
||||
// .eq(ReservationMaterialInventory::getStorageLocationId,inventoryAdjustmentRecordDO.getStorageLocationId())
|
||||
// .eq(ReservationMaterialInventory::getMaterialStatusCode,inventoryAdjustmentRecordDO.getAdjustAfterStatusCode())
|
||||
// .eq(ReservationMaterialInventory::getBatchNumber,inventoryAdjustmentRecordDO.getBatchNumber())
|
||||
// .eq(ReservationMaterialInventory::getContainerId,inventoryAdjustmentRecordDO.getContainerId())
|
||||
// .eq(BaseVOEntity::getDelFlag, 1));
|
||||
// if (ObjectUtil.isNotNull(materialInventory1)) {
|
||||
// materialInventory1.setInventoryQuantity(materialInventory1.getInventoryQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// materialInventory1.setAllocationQuantity(materialInventory1.getAllocationQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// materialInventoryService.updateById(materialInventory1);
|
||||
//
|
||||
// inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory1.getInventoryQuantity());
|
||||
// inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory1.getAllocationQuantity());
|
||||
// inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory1.getFreezeQuantity());
|
||||
// } else {
|
||||
// throw new ServiceException("根据现物料状态查询不到调整库存库存信息!");
|
||||
// }
|
||||
// inventoryAdjustmentRecord.setAdjustAfterStatusCode(inventoryAdjustmentRecordDO.getAdjustAfterStatusCode());
|
||||
// inventoryAdjustmentRecord.setAdjustAfterStatusName(inventoryAdjustmentRecordDO.getAdjustAfterStatusName());
|
||||
// }
|
||||
// //生成库存调整追溯记录
|
||||
// if (ObjectUtil.isNotNull(materialInventory)){
|
||||
// genInventoryStandingDetail(materialInventory, inventoryAdjustmentRecordDO.getAdjustQuantity());
|
||||
// }
|
||||
//
|
||||
//
|
||||
// materialInventoryService.updateById(materialInventory);
|
||||
// Boolean insert = inventoryAdjustmentRecordService.insert(inventoryAdjustmentRecord);
|
||||
// //推送oms库存调整记录
|
||||
// pushOms(materialInventory, inventoryAdjustmentRecordDO);
|
||||
// return insert;
|
||||
// }
|
||||
|
||||
/**
|
||||
* @description:库存冻结
|
||||
* @param inventoryAdjustmentRecordDO
|
||||
* @return: java.lang.Boolean
|
||||
* @author: lianzj
|
||||
* @time: 2024-07-18 14:58:50
|
||||
*/
|
||||
// @Transactional
|
||||
// public Boolean inventoryFrozen(ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO) {
|
||||
// ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecordDO();
|
||||
// LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// inventoryAdjustmentRecord.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
// inventoryAdjustmentRecord.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
// inventoryAdjustmentRecord.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
// inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
|
||||
// inventoryAdjustmentRecord.setCreateByName(loginUser.getUsername());
|
||||
// inventoryAdjustmentRecord.setCreateTime(new Date());
|
||||
// ReservationMaterialInventory materialInventory = materialInventoryService.getById(inventoryAdjustmentRecordDO.getReservationMaterialInventoryId());
|
||||
// inventoryAdjustmentRecord.setAdjustType(3L);
|
||||
// if (ObjectUtil.isNotNull(materialInventory)) {
|
||||
// BeanUtils.copyProperties(materialInventory, inventoryAdjustmentRecord);
|
||||
// inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity());
|
||||
// inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity());
|
||||
// inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity());
|
||||
// MaterialBaseInfo materialBaseInfo = materialBaseInfoService.getOne(new QueryWrapper<MaterialBaseInfo>().lambda()
|
||||
// .eq(MaterialBaseInfo::getMaterialBaseInfoId,materialInventory.getMaterialBaseInfoId()).eq(BaseVOEntity::getDelFlag,1));
|
||||
// if (ObjectUtil.isNotNull(materialBaseInfo)) {
|
||||
// inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode());
|
||||
// inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName());
|
||||
// inventoryAdjustmentRecord.setBarCode(materialBaseInfo.getBarCode());
|
||||
// inventoryAdjustmentRecord.setShipperId(materialBaseInfo.getShipperId());
|
||||
// inventoryAdjustmentRecord.setShipperName(materialBaseInfo.getShipperName());
|
||||
// }
|
||||
// //可用数量减,冻结数量加
|
||||
// materialInventory.setAllocationQuantity(materialInventory.getAllocationQuantity().subtract(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// materialInventory.setFreezeQuantity(materialInventory.getFreezeQuantity().add(inventoryAdjustmentRecordDO.getAdjustQuantity()));
|
||||
// if (materialInventory.getAllocationQuantity().compareTo(BigDecimal.ZERO) < 0) {
|
||||
// throw new ServiceException("冻结可用数量不能小于0");
|
||||
// }
|
||||
// inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
// inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity());
|
||||
// inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());
|
||||
// } else {
|
||||
// throw new ServiceException("根据物料库存id查询不到物料库存信息!");
|
||||
// }
|
||||
// materialInventoryService.updateById(materialInventory);
|
||||
// return inventoryAdjustmentRecordService.insert(inventoryAdjustmentRecord);
|
||||
// }
|
||||
}
|
||||
+239
@@ -0,0 +1,239 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.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;
|
||||
|
||||
|
||||
/**
|
||||
* 物料库存对象 material_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ReservationMaterialInventory extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料库存id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long materialInventoryId;
|
||||
|
||||
@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 materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("货主ID")
|
||||
@Excel(name = "货主ID")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
@Excel(name = "货主编码")
|
||||
private String shipperCode;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("上架单物料明细id")
|
||||
@Excel(name = "上架单物料明细id")
|
||||
private Long materialDetailId;
|
||||
|
||||
@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 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("批次号")
|
||||
@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("库存数量")
|
||||
@Excel(name = "库存数量")
|
||||
private BigDecimal inventoryQuantity;
|
||||
|
||||
@ApiModelProperty("可用数量")
|
||||
@Excel(name = "可用数量")
|
||||
private BigDecimal allocationQuantity;
|
||||
|
||||
@ApiModelProperty("冻结数量")
|
||||
@Excel(name = "冻结数量")
|
||||
private BigDecimal freezeQuantity;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
|
||||
@Excel(name = "盘点是否可用:0-禁用 1-可用")
|
||||
private Integer isAble;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
@Excel(name = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
@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("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 boxPalletNo;
|
||||
|
||||
@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("生产日期")
|
||||
@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")
|
||||
@TableField("ext_attr_3")
|
||||
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")
|
||||
@TableField("ext_attr_4")
|
||||
private Date extAttr4;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
@Excel(name = "条码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
@Excel(name = "LOT编号")
|
||||
private String lotNumber;
|
||||
|
||||
}
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.facade;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryParamDO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryQueryListDO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryPO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料库存Service接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
public interface IReservationMaterialInventoryService extends IService<ReservationMaterialInventory>
|
||||
{
|
||||
/**
|
||||
* 分页查询物料库存列表
|
||||
*/
|
||||
public List<ReservationMaterialInventoryPO> queryList(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
|
||||
/**
|
||||
* 新增物料库存
|
||||
*/
|
||||
public Boolean insert(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*/
|
||||
public Boolean update(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
|
||||
/**
|
||||
* 批量删除物料库存
|
||||
*/
|
||||
public Boolean delete(Long[] materialInventoryIds);
|
||||
|
||||
|
||||
/**
|
||||
* 查询物料库存
|
||||
*/
|
||||
public ReservationMaterialInventoryPO getInfo(Long materialInventoryId);
|
||||
|
||||
public Boolean omsEdit(MaterialInventoryOmsParamDO materialInventoryOmsParamDO);
|
||||
|
||||
/**
|
||||
* @description 修改物料库存信息
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/29 16:31
|
||||
* @param materialInventoryDOList
|
||||
*/
|
||||
//public void updateReservationMaterialInventoryInfo(List<ReservationMaterialInventoryDO> materialInventoryDOList, Integer type);
|
||||
|
||||
/**
|
||||
* @description:库存查询列表
|
||||
* @param materialInventoryQueryListDO
|
||||
* @return: java.util.List<com.mhd.wms.domain.materialInventory.repository.po.ReservationMaterialInventoryQueryListPO>
|
||||
* @author: lianzj
|
||||
* @time: 2024-07-16 14:46:10
|
||||
*/
|
||||
//List<ReservationMaterialInventoryQueryListPO> materialQueryList(MaterialInventoryQueryListDO materialInventoryQueryListDO);
|
||||
|
||||
/**
|
||||
* 分页查询物料库存列表
|
||||
*/
|
||||
//public List<ImmediateInventoryPO> queryImmediateInventoryList(ImmediateInventoryDO immediateInventoryDO);
|
||||
|
||||
/**
|
||||
* @description 增加指定库存
|
||||
* @author ZhouGY
|
||||
* @date 2024/7/21 0:27
|
||||
* @param materialInventoryParentDO
|
||||
* @return Boolean
|
||||
*/
|
||||
//public Boolean batchAddInventoryQuantity(ReservationMaterialInventoryParentDO materialInventoryParentDO);
|
||||
|
||||
/**
|
||||
* @description 减少指定库存
|
||||
* @author ZhouGY
|
||||
* @date 2024/7/21 0:29
|
||||
* @param materialInventoryParentDO
|
||||
* @return Boolean
|
||||
*/
|
||||
//public Boolean batchSubtractInventoryQuantity(ReservationMaterialInventoryParentDO materialInventoryParentDO);
|
||||
|
||||
/**
|
||||
* @description 货主编码和物料编码统计库存数量
|
||||
* @author ZhouGY
|
||||
* @date 2024/7/25 13:44
|
||||
* @return BigDecimal
|
||||
*/
|
||||
//public BigDecimal sumInventoryQuantityByShipperAndMaterialCode(Long shipperCode, Long materialBaseInfoId);
|
||||
|
||||
//ReservationMaterialInventoryPO selectOneByWhere(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
|
||||
/*
|
||||
* 库存调整方法
|
||||
* netWeight 总净重
|
||||
* grossWeight 总毛重
|
||||
* volume 体积
|
||||
* area 面积
|
||||
* quantity 数量
|
||||
* type 类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结)
|
||||
* materialInventoryId 物料库存ID
|
||||
* */
|
||||
public void xgkc(MaterialInventoryOmsParamDO materialInventoryParamDO);
|
||||
|
||||
public void kctzjl(MaterialInventoryOmsParamDO materialInventoryParamDO,String adjustAction,LoginUser loginUser);
|
||||
}
|
||||
+37
@@ -0,0 +1,37 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.mapper;
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBarCodePO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBaseInfo;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料库存Mapper接口
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
public interface ReservationMaterialInventoryMapper extends BaseMapper<ReservationMaterialInventory>
|
||||
{
|
||||
//查全部
|
||||
public List<ReservationMaterialInventoryPO> queryList(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-物料/库位
|
||||
public List<ReservationMaterialInventoryPO> queryListByWlKw(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-库位
|
||||
public List<ReservationMaterialInventoryPO> queryListByKw(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-物料
|
||||
public List<ReservationMaterialInventoryPO> queryListByWl(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-货主
|
||||
public List<ReservationMaterialInventoryPO> queryListByHz(ReservationMaterialInventoryDO materialInventoryDO);
|
||||
|
||||
|
||||
public MaterialBaseInfo getByInfoId(@Param("id") Long id);
|
||||
|
||||
public List<MaterialBarCodePO> getInfoByMaterialBaseInfoIds(@Param("id") Long id);
|
||||
}
|
||||
+832
@@ -0,0 +1,832 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.persistence;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.entity.ReservationInventoryAdjustmentRecord;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.mapper.ReservationInventoryAdjustmentRecordMapper;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReservationMaterialInventoryService;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBarCodePO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBaseInfo;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryParamDO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO;
|
||||
import com.mhd.oms.domain.reservationStockInOrder.repository.po.MaterialBaseInfoPO;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryPO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.util.StringUtils;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 物料库存Service业务层处理
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
@Service
|
||||
public class ReservationMaterialInventoryImpl extends ServiceImpl<ReservationMaterialInventoryMapper, ReservationMaterialInventory> implements IReservationMaterialInventoryService {
|
||||
@Autowired
|
||||
private ReservationMaterialInventoryMapper materialInventoryMapper;
|
||||
@Autowired
|
||||
private ReservationInventoryAdjustmentRecordMapper inventoryAdjustmentRecordMapper;
|
||||
|
||||
/**
|
||||
* 查询物料库存列表
|
||||
*/
|
||||
@Override
|
||||
public List<ReservationMaterialInventoryPO> queryList(ReservationMaterialInventoryDO materialInventoryDO)
|
||||
{
|
||||
String queryRule = materialInventoryDO.getQueryRule();
|
||||
if ("hz".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByHz(materialInventoryDO);
|
||||
} else if ("wl".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByWl(materialInventoryDO);
|
||||
} else if ("kw".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByKw(materialInventoryDO);
|
||||
} else if ("wlkw".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByWlKw(materialInventoryDO);
|
||||
} else if ("all".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryList(materialInventoryDO);
|
||||
} else {
|
||||
//不传返回全部
|
||||
return materialInventoryMapper.queryList(materialInventoryDO);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料库存
|
||||
*/
|
||||
@Override
|
||||
public Boolean insert(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
BeanUtils.copyProperties(materialInventoryDO,materialInventory);
|
||||
return this.save(materialInventory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*/
|
||||
@Override
|
||||
public Boolean update(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
BeanUtils.copyProperties(materialInventoryDO,materialInventory);
|
||||
return this.updateById(materialInventory);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料库存
|
||||
*/
|
||||
@Override
|
||||
public Boolean delete(Long[] materialInventoryIds ) {
|
||||
List<ReservationMaterialInventory> list = new ArrayList<>();
|
||||
for (Long id : materialInventoryIds) {
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
materialInventory.setMaterialInventoryId(id);
|
||||
materialInventory.setDelFlag(2);
|
||||
list.add(materialInventory);
|
||||
}
|
||||
return this.updateBatchById(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*/
|
||||
@Override
|
||||
public ReservationMaterialInventoryPO getInfo(Long materialInventoryId) {
|
||||
ReservationMaterialInventory materialInventory = this.getById(materialInventoryId);
|
||||
ReservationMaterialInventoryPO materialInventoryPO = new ReservationMaterialInventoryPO();
|
||||
BeanUtils.copyProperties(materialInventory,materialInventoryPO);
|
||||
return materialInventoryPO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Boolean omsEdit(MaterialInventoryOmsParamDO materialInventoryOmsParamDO) {
|
||||
String inOrderNumber = materialInventoryOmsParamDO.getInOrderNumber();
|
||||
String lotNumber = materialInventoryOmsParamDO.getLotNumber();
|
||||
String batchNumber = materialInventoryOmsParamDO.getBatchNumber();
|
||||
Long materialBaseInfoId = materialInventoryOmsParamDO.getMaterialBaseInfoId();
|
||||
Long warehouseId = materialInventoryOmsParamDO.getWarehouseId();
|
||||
List<ReservationMaterialInventory> reservationMaterialInventories = materialInventoryMapper.selectList(new LambdaQueryWrapper<ReservationMaterialInventory>()
|
||||
.eq(ReservationMaterialInventory::getInOrderNumber, inOrderNumber)
|
||||
.eq(ReservationMaterialInventory::getLotNumber, lotNumber)
|
||||
.eq(ReservationMaterialInventory::getBatchNumber, batchNumber)
|
||||
.eq(ReservationMaterialInventory::getMaterialBaseInfoId, materialBaseInfoId)
|
||||
.eq(ReservationMaterialInventory::getWarehouseId, warehouseId));
|
||||
if (reservationMaterialInventories != null && reservationMaterialInventories.size() > 0) {
|
||||
ReservationMaterialInventory reservationMaterialInventory = reservationMaterialInventories.get(0);
|
||||
Long materialInventoryId = reservationMaterialInventory.getMaterialInventoryId();
|
||||
materialInventoryOmsParamDO.setMaterialInventoryId(materialInventoryId);
|
||||
}
|
||||
kctzjl(materialInventoryOmsParamDO, materialInventoryOmsParamDO.getKctzType(), materialInventoryOmsParamDO.getLoginUser());
|
||||
xgkc(materialInventoryOmsParamDO);
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 修改物料库存信息
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/23 14:03
|
||||
*/
|
||||
// @Override
|
||||
// @Transactional(rollbackFor = Exception.class)
|
||||
// public void updateReservationMaterialInventoryInfo(List<ReservationMaterialInventoryDO> materialInventoryDOList, Integer type){
|
||||
// if (type == 1){
|
||||
// //增加
|
||||
// addReservationMaterialInventory(materialInventoryDOList);
|
||||
// }else if (type == 2) {
|
||||
// //减少
|
||||
// subtractReservationMaterialInventory(materialInventoryDOList);
|
||||
// }else {
|
||||
// throw new ServiceException("修改库存指定方式不存在");
|
||||
// }
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void xgkc(MaterialInventoryOmsParamDO materialInventoryParamDO) {
|
||||
BigDecimal netWeight = materialInventoryParamDO.getNetWeight() != null ? materialInventoryParamDO.getNetWeight() : BigDecimal.ZERO;
|
||||
BigDecimal grossWeight = materialInventoryParamDO.getGrossWeight() != null ? materialInventoryParamDO.getGrossWeight() : BigDecimal.ZERO;
|
||||
BigDecimal volume = materialInventoryParamDO.getVolume() != null ? materialInventoryParamDO.getVolume() : BigDecimal.ZERO;
|
||||
BigDecimal area = materialInventoryParamDO.getArea() != null ? materialInventoryParamDO.getArea() : BigDecimal.ZERO;
|
||||
BigDecimal quantity = materialInventoryParamDO.getQuantity() != null ? materialInventoryParamDO.getQuantity() : BigDecimal.ZERO;
|
||||
String type = materialInventoryParamDO.getType();
|
||||
Long materialInventoryId = materialInventoryParamDO.getMaterialInventoryId();
|
||||
|
||||
//类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结)
|
||||
switch (type) {
|
||||
case "1":
|
||||
// 上架
|
||||
sj(netWeight, grossWeight, volume, area, quantity, materialInventoryId, materialInventoryParamDO);
|
||||
break;
|
||||
case "2":
|
||||
// 分配
|
||||
ff(netWeight, grossWeight, volume, area, quantity, materialInventoryId);
|
||||
break;
|
||||
case "3":
|
||||
// 取消分配
|
||||
qxff(netWeight, grossWeight, volume, area, quantity, materialInventoryId);
|
||||
break;
|
||||
case "4":
|
||||
// 出库交接
|
||||
ckjj(netWeight, grossWeight, volume, area, quantity, materialInventoryId);
|
||||
break;
|
||||
case "5":
|
||||
// 移位
|
||||
yw(netWeight, grossWeight, volume, area, quantity, materialInventoryId);
|
||||
break;
|
||||
case "6":
|
||||
// 库存调整
|
||||
kctz(netWeight, grossWeight, volume, area, quantity, materialInventoryId);
|
||||
break;
|
||||
case "7":
|
||||
// 库存冻结
|
||||
kcdj(netWeight, grossWeight, volume, area, quantity, materialInventoryId);
|
||||
break;
|
||||
default:
|
||||
throw new ServiceException("错误的类型");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public synchronized void kctzjl(MaterialInventoryOmsParamDO materialInventoryParamDO,
|
||||
String adjustAction,LoginUser loginUser) {
|
||||
//库存调整记录(在 xgkc 更新库存前调用,materialInventory 为调整前快照)
|
||||
Long materialInventoryId = materialInventoryParamDO.getMaterialInventoryId();
|
||||
ReservationMaterialInventory materialInventory = materialInventoryMapper.selectOne(new QueryWrapper<ReservationMaterialInventory>().lambda()
|
||||
.eq(ReservationMaterialInventory::getMaterialInventoryId, materialInventoryId));
|
||||
if (materialInventory == null) {
|
||||
throw new ServiceException("物料库存不存在,无法生成库存调整记录");
|
||||
}
|
||||
Long materialBaseInfoId = materialInventory.getMaterialBaseInfoId();
|
||||
MaterialBaseInfo materialBaseInfo = materialInventoryMapper.getByInfoId(materialBaseInfoId);
|
||||
ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord = new ReservationInventoryAdjustmentRecord();
|
||||
inventoryAdjustmentRecord.setAdjustAction(adjustAction);
|
||||
String relateNo = StringUtils.hasText(materialInventoryParamDO.getRelateNo())
|
||||
? materialInventoryParamDO.getRelateNo()
|
||||
: materialInventoryParamDO.getInOrderNumber();
|
||||
inventoryAdjustmentRecord.setRelateNo(relateNo);
|
||||
inventoryAdjustmentRecord.setAdjustAfterStatusCode(materialInventory.getMaterialStatusCode() == null ? "" : materialInventory.getMaterialStatusCode());
|
||||
inventoryAdjustmentRecord.setAdjustBeforeStatusCode(materialInventory.getMaterialStatusCode() == null ? "" : materialInventory.getMaterialStatusCode());
|
||||
inventoryAdjustmentRecord.setAdjustAfterStatusName(materialInventory.getMaterialStatusName() == null ? "" : materialInventory.getMaterialStatusName());
|
||||
inventoryAdjustmentRecord.setAdjustBeforeStatusName(materialInventory.getMaterialStatusName() == null ? "" : materialInventory.getMaterialStatusName());
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||
|
||||
inventoryAdjustmentRecord.setLotNumber(materialInventoryParamDO.getLotNumber());
|
||||
inventoryAdjustmentRecord.setInOrderNumber(materialInventoryParamDO.getInOrderNumber());
|
||||
inventoryAdjustmentRecord.setBatchNumber(materialInventoryParamDO.getBatchNumber());
|
||||
if (ObjectUtil.isNotNull(materialBaseInfo)) {
|
||||
inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode());
|
||||
inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName());
|
||||
inventoryAdjustmentRecord.setBarCode(materialBaseInfo.getBarCode());
|
||||
inventoryAdjustmentRecord.setShipperId(materialBaseInfo.getShipperId());
|
||||
inventoryAdjustmentRecord.setShipperName(materialBaseInfo.getShipperName());
|
||||
}
|
||||
if (inventoryAdjustmentRecord.getBarCode() == null || inventoryAdjustmentRecord.getBarCode().isEmpty()){
|
||||
getBarCode(materialInventory, inventoryAdjustmentRecord);
|
||||
}
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||
inventoryAdjustmentRecord.setAdjustType(1L);
|
||||
if ("库存冻结".equals(adjustAction)) {
|
||||
inventoryAdjustmentRecord.setAdjustType(3L);
|
||||
}
|
||||
inventoryAdjustmentRecord.setOrganizationId(materialInventory.getOrganizationId());
|
||||
inventoryAdjustmentRecord.setOrganizationName(materialInventory.getOrganizationName());
|
||||
inventoryAdjustmentRecord.setTopOrganizationId(materialInventory.getTopOrganizationId());
|
||||
inventoryAdjustmentRecord.setWarehouseCode(materialInventory.getWarehouseCode());
|
||||
inventoryAdjustmentRecord.setWarehouseName(materialInventory.getWarehouseName());
|
||||
inventoryAdjustmentRecord.setWarehouseId(materialInventory.getWarehouseId());
|
||||
inventoryAdjustmentRecord.setStorageCode(materialInventory.getStorageCode());
|
||||
inventoryAdjustmentRecord.setStorageName(materialInventory.getStorageName());
|
||||
inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId());
|
||||
inventoryAdjustmentRecord.setStorageLocationCode(materialInventory.getStorageLocationCode());
|
||||
inventoryAdjustmentRecord.setStorageLocationName(materialInventory.getStorageLocationName());
|
||||
inventoryAdjustmentRecord.setMaterialInventoryId(materialInventory.getMaterialInventoryId());
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||
inventoryAdjustmentRecord.setStorageSectionId(materialInventory.getStorageSectionId());
|
||||
inventoryAdjustmentRecord.setStorageLocationId(materialInventory.getStorageLocationId());
|
||||
inventoryAdjustmentRecord.setCreateBy(loginUser.getUserid());
|
||||
UserPo userPo = loginUser.getUserPo();
|
||||
if (userPo != null) inventoryAdjustmentRecord.setCreateByName(userPo.getUserName());
|
||||
inventoryAdjustmentRecord.setCreateTime(new Date());
|
||||
|
||||
BigDecimal qty = nz(materialInventoryParamDO.getQuantity());
|
||||
if ("分配库存".equals(adjustAction)) {
|
||||
// 总库存不变;可用减少、冻结增加(数量从可用转至冻结)
|
||||
BigDecimal invBefore = nz(materialInventory.getInventoryQuantity());
|
||||
BigDecimal allocBefore = nz(materialInventory.getAllocationQuantity());
|
||||
BigDecimal freezeBefore = nz(materialInventory.getFreezeQuantity());
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(invBefore); //调整前库存数量
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(invBefore); //调整后库存数量
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(allocBefore); //调整前可用数量
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(allocBefore.subtract(qty));//调整后可用数量
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(freezeBefore);//调整前冻结数量
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(freezeBefore.add(qty));//调整后冻结数量
|
||||
inventoryAdjustmentRecord.setNetWeight(nz(materialInventory.getNetWeight()));//净重
|
||||
inventoryAdjustmentRecord.setGrossWeight(nz(materialInventory.getGrossWeight()));//毛重
|
||||
inventoryAdjustmentRecord.setVolume(nz(materialInventory.getVolume()));//体积
|
||||
inventoryAdjustmentRecord.setArea(nz(materialInventory.getArea()));//积
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(nz(materialInventory.getNetWeight()));//净重
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(nz(materialInventory.getGrossWeight()));//毛重
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(nz(materialInventory.getVolume()));//体积
|
||||
inventoryAdjustmentRecord.setAdjustedArea(nz(materialInventory.getArea()));//积
|
||||
} else if ("取消分配".equals(adjustAction)) {
|
||||
// 与分配相反:可用增加、冻结减少,总库存不变
|
||||
BigDecimal invBefore = nz(materialInventory.getInventoryQuantity());
|
||||
BigDecimal allocBefore = nz(materialInventory.getAllocationQuantity());
|
||||
BigDecimal freezeBefore = nz(materialInventory.getFreezeQuantity());
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(invBefore);
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(invBefore);
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(allocBefore);
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(allocBefore.add(qty));
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(freezeBefore);
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(freezeBefore.subtract(qty));
|
||||
inventoryAdjustmentRecord.setNetWeight(nz(materialInventory.getNetWeight()));
|
||||
inventoryAdjustmentRecord.setGrossWeight(nz(materialInventory.getGrossWeight()));
|
||||
inventoryAdjustmentRecord.setVolume(nz(materialInventory.getVolume()));
|
||||
inventoryAdjustmentRecord.setArea(nz(materialInventory.getArea()));
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(nz(materialInventory.getNetWeight()));
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(nz(materialInventory.getGrossWeight()));
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(nz(materialInventory.getVolume()));
|
||||
inventoryAdjustmentRecord.setAdjustedArea(nz(materialInventory.getArea()));
|
||||
} else if ("入库".equals(adjustAction)){
|
||||
if ("1".equals(materialInventoryParamDO.getIsNew())) {
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventoryParamDO.getQuantity());
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(BigDecimal.ZERO);//调整后 冻结-出库
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventoryParamDO.getQuantity());
|
||||
// 调整前:库存数量(净重、毛重、体积、面积)
|
||||
inventoryAdjustmentRecord.setNetWeight(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setGrossWeight(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setVolume(BigDecimal.ZERO);
|
||||
inventoryAdjustmentRecord.setArea(BigDecimal.ZERO);
|
||||
// 调整后:库存数量 - 复核时填写的数量
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventoryParamDO.getNetWeight());
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventoryParamDO.getGrossWeight());
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(materialInventoryParamDO.getVolume());
|
||||
inventoryAdjustmentRecord.setAdjustedArea(materialInventoryParamDO.getArea());
|
||||
} else {
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity());
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventory.getAllocationQuantity().add(materialInventoryParamDO.getQuantity()));
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(materialInventory.getFreezeQuantity());
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());//调整后 冻结-出库
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity());
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity().add(materialInventoryParamDO.getQuantity()));
|
||||
// 调整前:库存数量(净重、毛重、体积、面积)
|
||||
inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight());
|
||||
inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight());
|
||||
inventoryAdjustmentRecord.setVolume(materialInventory.getVolume());
|
||||
inventoryAdjustmentRecord.setArea(materialInventory.getArea());
|
||||
// 调整后:库存数量 - 复核时填写的数量
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight().add(inventoryAdjustmentRecord.getNetWeight()));
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight().add(inventoryAdjustmentRecord.getGrossWeight()));
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume().add(inventoryAdjustmentRecord.getVolume()));
|
||||
inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea().add(inventoryAdjustmentRecord.getArea()));
|
||||
}
|
||||
} else if ("出库".equals(adjustAction)){
|
||||
// 出库交接:总库存与冻结同减 checkQuantity;可用数量不变(与 ckjj 中不修改 allocation_quantity 一致)
|
||||
BigDecimal invBefore = nz(materialInventory.getInventoryQuantity());
|
||||
BigDecimal allocBefore = nz(materialInventory.getAllocationQuantity());
|
||||
BigDecimal freezeBefore = nz(materialInventory.getFreezeQuantity());
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(invBefore);// 调整前:库存数量
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(invBefore.subtract(qty));// 调整后:库存数量
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(allocBefore);// 调整前:可用数量
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(allocBefore);// 调整后:可用数量
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(freezeBefore);// 调整前:冻结数量
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(freezeBefore.subtract(qty));// 调整后:冻结数量
|
||||
BigDecimal nw = nz(materialInventory.getNetWeight());
|
||||
BigDecimal gw = nz(materialInventory.getGrossWeight());
|
||||
BigDecimal vol = nz(materialInventory.getVolume());
|
||||
BigDecimal ar = nz(materialInventory.getArea());
|
||||
inventoryAdjustmentRecord.setNetWeight(nw);
|
||||
inventoryAdjustmentRecord.setGrossWeight(gw);
|
||||
inventoryAdjustmentRecord.setVolume(vol);
|
||||
inventoryAdjustmentRecord.setArea(ar);
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(nw.subtract(nz(materialInventoryParamDO.getNetWeight())));
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(gw.subtract(nz(materialInventoryParamDO.getGrossWeight())));
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(vol.subtract(nz(materialInventoryParamDO.getVolume())));
|
||||
inventoryAdjustmentRecord.setAdjustedArea(ar.subtract(nz(materialInventoryParamDO.getArea())));
|
||||
} else if ("移位".equals(adjustAction)){
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(materialInventory.getAllocationQuantity());
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(materialInventoryParamDO.getQuantity());
|
||||
//inventoryAdjustmentRecord.setFreezeBeforeQuantity(oldFreezeQuantity);
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(materialInventory.getFreezeQuantity());//调整后 冻结-出库
|
||||
//inventoryAdjustmentRecord.setInventoryBeforeQuantity(oldInventoryQuantity);
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
// 调整前:库存数量(净重、毛重、体积、面积)
|
||||
inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight());
|
||||
inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight());
|
||||
inventoryAdjustmentRecord.setVolume(materialInventory.getVolume());
|
||||
inventoryAdjustmentRecord.setArea(materialInventory.getArea());
|
||||
// 调整后:库存数量 - 复核时填写的数量
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight());
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight());
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume());
|
||||
inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea());
|
||||
} else if ("库存冻结".equals(adjustAction)) {
|
||||
inventoryAdjustmentRecord.setAllocationBeforeQuantity(nz(materialInventory.getAllocationQuantity()));
|
||||
inventoryAdjustmentRecord.setAllocationAfterQuantity(nz(materialInventory.getAllocationQuantity()).subtract(qty));
|
||||
inventoryAdjustmentRecord.setFreezeBeforeQuantity(nz(materialInventory.getFreezeQuantity()));
|
||||
inventoryAdjustmentRecord.setFreezeAfterQuantity(nz(materialInventory.getFreezeQuantity()).add(qty));//调整后 冻结-出库
|
||||
inventoryAdjustmentRecord.setInventoryBeforeQuantity(materialInventory.getInventoryQuantity());
|
||||
inventoryAdjustmentRecord.setInventoryAfterQuantity(materialInventory.getInventoryQuantity());
|
||||
|
||||
// 调整前:库存数量(净重、毛重、体积、面积)
|
||||
inventoryAdjustmentRecord.setNetWeight(materialInventory.getNetWeight());
|
||||
inventoryAdjustmentRecord.setGrossWeight(materialInventory.getGrossWeight());
|
||||
inventoryAdjustmentRecord.setVolume(materialInventory.getVolume());
|
||||
inventoryAdjustmentRecord.setArea(materialInventory.getArea());
|
||||
// 调整后:库存数量 - 复核时填写的数量
|
||||
inventoryAdjustmentRecord.setAdjustedNetWeight(materialInventory.getNetWeight());
|
||||
inventoryAdjustmentRecord.setAdjustedGrossWeight(materialInventory.getGrossWeight());
|
||||
inventoryAdjustmentRecord.setAdjustedVolume(materialInventory.getVolume());
|
||||
inventoryAdjustmentRecord.setAdjustedArea(materialInventory.getArea());
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
inventoryAdjustmentRecordMapper.insert(inventoryAdjustmentRecord);
|
||||
}
|
||||
|
||||
private static BigDecimal nz(BigDecimal v) {
|
||||
return v == null ? BigDecimal.ZERO : v;
|
||||
}
|
||||
|
||||
private void getBarCode(ReservationMaterialInventory materialInventoryPO, ReservationInventoryAdjustmentRecord inventoryAdjustmentRecord) {
|
||||
List<MaterialBarCodePO> materialBarCodePOList = materialInventoryMapper.getInfoByMaterialBaseInfoIds(materialInventoryPO.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(materialInventoryPO.getMaterialBaseInfoId());
|
||||
if (materialBarCodePO != null && materialBarCodePO.getBarCode() != null) {
|
||||
inventoryAdjustmentRecord.setBarCode(materialBarCodePO.getBarCode());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void sj(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId,MaterialInventoryOmsParamDO materialInventoryParamDO) {
|
||||
if (materialInventoryId == null) {
|
||||
Long materialBaseInfoId = materialInventoryParamDO.getMaterialBaseInfoId();
|
||||
MaterialBaseInfo materialBaseInfo = materialInventoryMapper.getByInfoId(materialBaseInfoId);
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
materialInventory.setInventoryQuantity(quantity);
|
||||
materialInventory.setAllocationQuantity(quantity);
|
||||
materialInventory.setFreezeQuantity(BigDecimal.ZERO);
|
||||
materialInventory.setArea(area);
|
||||
materialInventory.setVolume(volume);
|
||||
materialInventory.setGrossWeight(grossWeight);
|
||||
materialInventory.setNetWeight(netWeight);
|
||||
materialInventory.setMaterialBaseInfoId(materialInventoryParamDO.getMaterialBaseInfoId());
|
||||
materialInventory.setInOrderNumber(materialInventoryParamDO.getInOrderNumber());
|
||||
if (materialBaseInfo != null) {
|
||||
materialInventory.setShipperId(materialBaseInfo.getShipperId());
|
||||
materialInventory.setShipperName(materialBaseInfo.getShipperName());
|
||||
materialInventory.setShipperCode(materialBaseInfo.getShipperCode());
|
||||
}
|
||||
//仓库信息
|
||||
materialInventory.setOrganizationId(materialInventoryParamDO.getOrganizationId());
|
||||
materialInventory.setOrganizationName(materialInventoryParamDO.getOrganizationName());
|
||||
materialInventory.setTopOrganizationId(materialInventoryParamDO.getTopOrganizationId());
|
||||
materialInventory.setWarehouseCode(materialInventoryParamDO.getWarehouseCode());
|
||||
materialInventory.setWarehouseName(materialInventoryParamDO.getWarehouseName());
|
||||
materialInventory.setWarehouseId(materialInventoryParamDO.getWarehouseId());
|
||||
// materialInventory.setStorageCode(materialInventoryParamDO.getStorageCode());
|
||||
// materialInventory.setStorageName(materialInventoryParamDO.getStorageName());
|
||||
// materialInventory.setStorageLocationId(materialInventoryParamDO.getStorageLocationId());
|
||||
// materialInventory.setStorageLocationCode(materialInventoryParamDO.getStorageLocationCode());
|
||||
// materialInventory.setStorageLocationName(materialInventoryParamDO.getStorageLocationName());
|
||||
// materialInventory.setStorageSectionId(materialInventoryParamDO.getStorageSectionId());
|
||||
//更多属性
|
||||
// materialInventory.setBatchRefNo(materialInventoryParamDO.getBatchRefNo());
|
||||
// materialInventory.setSheetRefNo(materialInventoryParamDO.getSheetRefNo());
|
||||
// materialInventory.setBoxPalletNo(materialInventoryParamDO.getBoxPalletNo());
|
||||
// materialInventory.setProductionDate(materialInventoryParamDO.getProductionDate());
|
||||
// materialInventory.setExtAttr1(materialInventoryParamDO.getExtAttr1());
|
||||
// materialInventory.setExtAttr2(materialInventoryParamDO.getExtAttr2());
|
||||
// materialInventory.setExtAttr3(materialInventoryParamDO.getExtAttr3());
|
||||
// materialInventory.setExtAttr4(materialInventoryParamDO.getExtAttr4());
|
||||
// materialInventory.setExpiryDate(materialInventoryParamDO.getExpiryDate());
|
||||
// materialInventory.setInventoryDate(materialInventoryParamDO.getInventoryDate());
|
||||
materialInventory.setBatchNumber(materialInventoryParamDO.getBatchNumber());
|
||||
materialInventory.setUnit(materialBaseInfo.getUnitCode());
|
||||
materialInventory.setUnitName(materialBaseInfo.getUnitName());
|
||||
//创建人信息
|
||||
materialInventory.setCreateBy(materialInventoryParamDO.getCreateBy());
|
||||
materialInventory.setCreateByName(materialInventoryParamDO.getCreateByName());
|
||||
materialInventory.setCreateTime(new Date());
|
||||
materialInventory.setUpdateTime(new Date());
|
||||
materialInventory.setBarCode(materialInventoryParamDO.getBarCode());
|
||||
materialInventory.setLotNumber(materialInventoryParamDO.getLotNumber());
|
||||
materialInventory.setBatchNumber((materialInventoryParamDO.getBatchNumber()));
|
||||
materialInventory.setInOrderNumber((materialInventoryParamDO.getInOrderNumber()));
|
||||
materialInventoryMapper.insert(materialInventory);
|
||||
materialInventoryParamDO.setMaterialInventoryId(materialInventory.getMaterialInventoryId());
|
||||
} else {
|
||||
ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO;
|
||||
//可用数量
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO;
|
||||
//冻结数量(出库交接不变动冻结数量)
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO;
|
||||
//扣减后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity);
|
||||
//扣减后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity);
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity);
|
||||
|
||||
|
||||
|
||||
BigDecimal oldArea = materialInventoryPO.getArea();
|
||||
BigDecimal oldVolume = materialInventoryPO.getVolume();
|
||||
BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight();
|
||||
BigDecimal oldNetWeight = materialInventoryPO.getNetWeight();
|
||||
|
||||
// 初始化旧数据,避免空指针
|
||||
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
||||
oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO;
|
||||
oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO;
|
||||
oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO;
|
||||
|
||||
BigDecimal newArea = oldArea.add(area);
|
||||
BigDecimal newVolume = oldVolume.add(volume);
|
||||
BigDecimal newGrossWeight = oldGrossWeight.add(grossWeight);
|
||||
BigDecimal newNetWeight = oldNetWeight.add(netWeight);
|
||||
|
||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
//materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity());
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
materialInventoryPO.setArea(newArea);
|
||||
materialInventoryPO.setVolume(newVolume);
|
||||
materialInventoryPO.setGrossWeight(newGrossWeight);
|
||||
materialInventoryPO.setNetWeight(newNetWeight);
|
||||
materialInventoryPO.setUpdateTime(new Date());
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
}
|
||||
private void ff(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO;
|
||||
//可用数量
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO;
|
||||
//冻结数量(出库交接不变动冻结数量)
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO;
|
||||
//扣减后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity);
|
||||
//扣减后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity);
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.add(quantity);
|
||||
|
||||
|
||||
|
||||
BigDecimal oldArea = materialInventoryPO.getArea();
|
||||
BigDecimal oldVolume = materialInventoryPO.getVolume();
|
||||
BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight();
|
||||
BigDecimal oldNetWeight = materialInventoryPO.getNetWeight();
|
||||
|
||||
// 初始化旧数据,避免空指针
|
||||
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
||||
oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO;
|
||||
oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO;
|
||||
oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO;
|
||||
|
||||
BigDecimal newArea = oldArea.subtract(area);
|
||||
BigDecimal newVolume = oldVolume.subtract(volume);
|
||||
BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight);
|
||||
BigDecimal newNetWeight = oldNetWeight.subtract(netWeight);
|
||||
|
||||
//materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
materialInventoryPO.setAllocationQuantity(newAllocationQuantity);
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
materialInventoryPO.setArea(newArea);
|
||||
materialInventoryPO.setVolume(newVolume);
|
||||
materialInventoryPO.setGrossWeight(newGrossWeight);
|
||||
materialInventoryPO.setNetWeight(newNetWeight);
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
materialInventoryPO.setUpdateTime(new Date());
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
private void qxff(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO;
|
||||
//可用数量
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO;
|
||||
//冻结数量(出库交接不变动冻结数量)
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO;
|
||||
//扣减后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity);
|
||||
//扣减后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.add(quantity);
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity);
|
||||
|
||||
|
||||
|
||||
BigDecimal oldArea = materialInventoryPO.getArea();
|
||||
BigDecimal oldVolume = materialInventoryPO.getVolume();
|
||||
BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight();
|
||||
BigDecimal oldNetWeight = materialInventoryPO.getNetWeight();
|
||||
|
||||
// 初始化旧数据,避免空指针
|
||||
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
||||
oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO;
|
||||
oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO;
|
||||
oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO;
|
||||
|
||||
BigDecimal newArea = oldArea.subtract(area);
|
||||
BigDecimal newVolume = oldVolume.subtract(volume);
|
||||
BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight);
|
||||
BigDecimal newNetWeight = oldNetWeight.subtract(netWeight);
|
||||
|
||||
//materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
materialInventoryPO.setAllocationQuantity(newAllocationQuantity);
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
materialInventoryPO.setArea(newArea);
|
||||
materialInventoryPO.setVolume(newVolume);
|
||||
materialInventoryPO.setGrossWeight(newGrossWeight);
|
||||
materialInventoryPO.setNetWeight(newNetWeight);
|
||||
materialInventoryPO.setUpdateTime(new Date());
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
private void ckjj(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO;
|
||||
//可用数量
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO;
|
||||
//冻结数量(出库交接不变动冻结数量)
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO;
|
||||
//扣减后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity);
|
||||
//扣减后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity);
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity);
|
||||
|
||||
|
||||
|
||||
BigDecimal oldArea = materialInventoryPO.getArea();
|
||||
BigDecimal oldVolume = materialInventoryPO.getVolume();
|
||||
BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight();
|
||||
BigDecimal oldNetWeight = materialInventoryPO.getNetWeight();
|
||||
|
||||
// 初始化旧数据,避免空指针
|
||||
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
||||
oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO;
|
||||
oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO;
|
||||
oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO;
|
||||
|
||||
BigDecimal newArea = oldArea.subtract(area);
|
||||
BigDecimal newVolume = oldVolume.subtract(volume);
|
||||
BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight);
|
||||
BigDecimal newNetWeight = oldNetWeight.subtract(netWeight);
|
||||
|
||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
//materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity());
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
materialInventoryPO.setArea(newArea);
|
||||
materialInventoryPO.setVolume(newVolume);
|
||||
materialInventoryPO.setGrossWeight(newGrossWeight);
|
||||
materialInventoryPO.setNetWeight(newNetWeight);
|
||||
materialInventoryPO.setUpdateTime(new Date());
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
private void yw(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO;
|
||||
//可用数量
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO;
|
||||
//冻结数量(出库交接不变动冻结数量)
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO;
|
||||
//扣减后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity);
|
||||
//扣减后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity);
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity);
|
||||
|
||||
|
||||
|
||||
BigDecimal oldArea = materialInventoryPO.getArea();
|
||||
BigDecimal oldVolume = materialInventoryPO.getVolume();
|
||||
BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight();
|
||||
BigDecimal oldNetWeight = materialInventoryPO.getNetWeight();
|
||||
|
||||
// 初始化旧数据,避免空指针
|
||||
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
||||
oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO;
|
||||
oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO;
|
||||
oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO;
|
||||
|
||||
BigDecimal newArea = oldArea.subtract(area);
|
||||
BigDecimal newVolume = oldVolume.subtract(volume);
|
||||
BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight);
|
||||
BigDecimal newNetWeight = oldNetWeight.subtract(netWeight);
|
||||
|
||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
//materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity());
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
materialInventoryPO.setArea(newArea);
|
||||
materialInventoryPO.setVolume(newVolume);
|
||||
materialInventoryPO.setGrossWeight(newGrossWeight);
|
||||
materialInventoryPO.setNetWeight(newNetWeight);
|
||||
materialInventoryPO.setUpdateTime(new Date());
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
private void kctz(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO;
|
||||
//可用数量
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO;
|
||||
//冻结数量(出库交接不变动冻结数量)
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO;
|
||||
//扣减后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity);
|
||||
//扣减后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity);
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.subtract(quantity);
|
||||
|
||||
|
||||
|
||||
BigDecimal oldArea = materialInventoryPO.getArea();
|
||||
BigDecimal oldVolume = materialInventoryPO.getVolume();
|
||||
BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight();
|
||||
BigDecimal oldNetWeight = materialInventoryPO.getNetWeight();
|
||||
|
||||
// 初始化旧数据,避免空指针
|
||||
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
||||
oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO;
|
||||
oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO;
|
||||
oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO;
|
||||
|
||||
BigDecimal newArea = oldArea.subtract(area);
|
||||
BigDecimal newVolume = oldVolume.subtract(volume);
|
||||
BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight);
|
||||
BigDecimal newNetWeight = oldNetWeight.subtract(netWeight);
|
||||
|
||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
//materialInventoryPO.setAllocationQuantity(materialInventoryPO.getAllocationQuantity());
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
materialInventoryPO.setArea(newArea);
|
||||
materialInventoryPO.setVolume(newVolume);
|
||||
materialInventoryPO.setGrossWeight(newGrossWeight);
|
||||
materialInventoryPO.setNetWeight(newNetWeight);
|
||||
materialInventoryPO.setUpdateTime(new Date());
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
private void kcdj(BigDecimal netWeight, BigDecimal grossWeight, BigDecimal volume, BigDecimal area, BigDecimal quantity, Long materialInventoryId) {
|
||||
ReservationMaterialInventory materialInventoryPO = materialInventoryMapper.selectById(materialInventoryId);
|
||||
if (materialInventoryPO != null) {
|
||||
//库存数量
|
||||
BigDecimal oldInventoryQuantity = materialInventoryPO.getInventoryQuantity();
|
||||
oldInventoryQuantity = oldInventoryQuantity != null ? oldInventoryQuantity : BigDecimal.ZERO;
|
||||
//可用数量
|
||||
BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
oldAllocationQuantity = oldAllocationQuantity != null ? oldAllocationQuantity : BigDecimal.ZERO;
|
||||
//冻结数量(出库交接不变动冻结数量)
|
||||
BigDecimal oldFreezeQuantity = materialInventoryPO.getFreezeQuantity();
|
||||
oldFreezeQuantity = oldFreezeQuantity != null ? oldFreezeQuantity : BigDecimal.ZERO;
|
||||
//扣减后库存数量
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.subtract(quantity);
|
||||
//扣减后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.subtract(quantity);
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.add(quantity);
|
||||
|
||||
|
||||
|
||||
BigDecimal oldArea = materialInventoryPO.getArea();
|
||||
BigDecimal oldVolume = materialInventoryPO.getVolume();
|
||||
BigDecimal oldGrossWeight = materialInventoryPO.getGrossWeight();
|
||||
BigDecimal oldNetWeight = materialInventoryPO.getNetWeight();
|
||||
|
||||
// 初始化旧数据,避免空指针
|
||||
oldArea = oldArea != null ? oldArea : BigDecimal.ZERO;
|
||||
oldVolume = oldVolume != null ? oldVolume : BigDecimal.ZERO;
|
||||
oldGrossWeight = oldGrossWeight != null ? oldGrossWeight : BigDecimal.ZERO;
|
||||
oldNetWeight = oldNetWeight != null ? oldNetWeight : BigDecimal.ZERO;
|
||||
|
||||
BigDecimal newArea = oldArea.subtract(area);
|
||||
BigDecimal newVolume = oldVolume.subtract(volume);
|
||||
BigDecimal newGrossWeight = oldGrossWeight.subtract(grossWeight);
|
||||
BigDecimal newNetWeight = oldNetWeight.subtract(netWeight);
|
||||
|
||||
//materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
materialInventoryPO.setAllocationQuantity(newAllocationQuantity);
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
materialInventoryPO.setArea(newArea);
|
||||
materialInventoryPO.setVolume(newVolume);
|
||||
materialInventoryPO.setGrossWeight(newGrossWeight);
|
||||
materialInventoryPO.setNetWeight(newNetWeight);
|
||||
materialInventoryPO.setUpdateTime(new Date());
|
||||
ReservationMaterialInventory materialInventory = new ReservationMaterialInventory();
|
||||
com.mhd.common.core.utils.bean.BeanUtils.copyProperties(materialInventoryPO, materialInventory);
|
||||
materialInventoryMapper.updateById(materialInventory);
|
||||
}
|
||||
}
|
||||
}
|
||||
+228
@@ -0,0 +1,228 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBasePO;
|
||||
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_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "物料库存对象", description = "物料库存响应对象")
|
||||
public class ReservationMaterialInventoryPO extends MaterialBasePO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料库存id")
|
||||
private Long materialInventoryId;
|
||||
|
||||
@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 materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("上架单物料明细id")
|
||||
@Excel(name = "上架单物料明细id")
|
||||
private Long materialDetailId;
|
||||
|
||||
@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 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("批次号")
|
||||
@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("库存数量")
|
||||
@Excel(name = "库存数量")
|
||||
private BigDecimal inventoryQuantity;
|
||||
|
||||
@ApiModelProperty("可用数量")
|
||||
@Excel(name = "可用数量")
|
||||
private BigDecimal allocationQuantity;
|
||||
|
||||
@ApiModelProperty("冻结数量")
|
||||
@Excel(name = "冻结数量")
|
||||
private BigDecimal freezeQuantity;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
|
||||
@Excel(name = "盘点是否可用:0-禁用 1-可用")
|
||||
private Integer isAble;
|
||||
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@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("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 boxPalletNo;
|
||||
|
||||
@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("包装名")
|
||||
@Excel(name = "包装名")
|
||||
private String packName;
|
||||
|
||||
|
||||
@ApiModelProperty("单位名")
|
||||
@Excel(name = "单位名")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
@Excel(name = "条码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
@Excel(name = "LOT编号")
|
||||
private String lotNumber;
|
||||
}
|
||||
+289
@@ -0,0 +1,289 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.po;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBasePO;
|
||||
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_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "库存查询对象", description = "库存查询响应对象")
|
||||
public class ReservationMaterialInventoryQueryListPO extends MaterialBasePO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料库存id")
|
||||
private Long materialInventoryId;
|
||||
|
||||
@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 materialBaseInfoId;
|
||||
|
||||
@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 materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@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 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("移入库位id,供 PDA 底部表单区填写")
|
||||
private Long newStorageLocationId;
|
||||
|
||||
@ApiModelProperty("移入库位编码,供 PDA 底部表单区填写")
|
||||
private String newStorageLocationCode;
|
||||
|
||||
@ApiModelProperty("移入库位名称,供 PDA 底部表单区显示")
|
||||
private String newStorageLocationName;
|
||||
|
||||
@ApiModelProperty("批次号")
|
||||
@Excel(name = "批次号")
|
||||
private String batchNumber;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("批号/LOT")
|
||||
@Excel(name = "批号")
|
||||
private String lotNumber;
|
||||
|
||||
@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("库存数量")
|
||||
@Excel(name = "库存数量")
|
||||
private BigDecimal inventoryQuantity;
|
||||
|
||||
@ApiModelProperty("可用数量")
|
||||
@Excel(name = "可用数量")
|
||||
private BigDecimal allocationQuantity;
|
||||
|
||||
@ApiModelProperty("移位数量,供 PDA 底部表单区显示,库存查询时等于可用数量")
|
||||
@Excel(name = "移位数量")
|
||||
private BigDecimal shiftQuantity;
|
||||
|
||||
@ApiModelProperty("冻结数量")
|
||||
@Excel(name = "冻结数量")
|
||||
private BigDecimal freezeQuantity;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
|
||||
@Excel(name = "盘点是否可用:0-禁用 1-可用")
|
||||
private Integer isAble;
|
||||
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
@Excel(name = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
@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("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 boxPalletNo;
|
||||
|
||||
@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("层级深度,与移位详情一致:1-主项 2-子项")
|
||||
private Integer level;
|
||||
|
||||
@ApiModelProperty("业务唯一id,与移位详情一致")
|
||||
private Long uniqueId;
|
||||
|
||||
@ApiModelProperty("父级唯一Id,子项时使用")
|
||||
private Long parentUniqueId;
|
||||
|
||||
@ApiModelProperty("子项列表,与移位详情一致,主项下含一条 parent_copy 子项")
|
||||
private List<ReservationMaterialInventoryQueryListPO> children;
|
||||
|
||||
@ApiModelProperty("总净重(KG),PDA 表单区显示")
|
||||
private BigDecimal totalNetWeight;
|
||||
|
||||
@ApiModelProperty("总毛重(KG),PDA 表单区显示")
|
||||
private BigDecimal totalGrossWeight;
|
||||
|
||||
@ApiModelProperty("总体积(CBM),PDA 表单区显示")
|
||||
private BigDecimal totalVolume;
|
||||
|
||||
@ApiModelProperty("总面积(SQM),PDA 表单区显示")
|
||||
private BigDecimal totalArea;
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
|
||||
/**
|
||||
* 物料条码信息对象 material_bar_code
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ApiModel(value = "物料条码信息对象", description = "物料条码信息响应对象")
|
||||
public class MaterialBarCodePO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("商品规则id")
|
||||
private Long materialBarCodeId;
|
||||
|
||||
@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 materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("条码")
|
||||
@Excel(name = "条码")
|
||||
private String barCode;
|
||||
|
||||
@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 name;
|
||||
|
||||
@ApiModelProperty("数量")
|
||||
@Excel(name = "数量")
|
||||
private BigDecimal number;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.handler.ListTypeHandler;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ZhouGY
|
||||
* @title MaterialBaseDO
|
||||
* @description: TODO
|
||||
* @date 2024/7/5 10:59
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MaterialBaseDO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@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 materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("物料分类编码")
|
||||
@Excel(name = "物料分类编码")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyCode;
|
||||
|
||||
@ApiModelProperty("物料分类名称")
|
||||
@Excel(name = "物料分类名称")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyName;
|
||||
|
||||
@ApiModelProperty("物料种类编码 数据字典")
|
||||
@Excel(name = "物料种类编码 数据字典")
|
||||
private String materialType;
|
||||
|
||||
@ApiModelProperty("物料种类名称 数据字典")
|
||||
@Excel(name = "物料种类名称 数据字典")
|
||||
private String materialTypeName;
|
||||
|
||||
@ApiModelProperty("货主信息")
|
||||
@Excel(name = "货主信息")
|
||||
private String shipperInfo;
|
||||
|
||||
@ApiModelProperty("物料信息")
|
||||
@Excel(name = "物料信息")
|
||||
private String materialInfo;
|
||||
}
|
||||
+61
@@ -0,0 +1,61 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.handler.ListTypeHandler;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ZhouGY
|
||||
* @title MaterialBaseDO
|
||||
* @description: TODO
|
||||
* @date 2024/7/5 10:59
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MaterialBaseDTO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
@Excel(name = "货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
@Excel(name = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("物料分类编码")
|
||||
@Excel(name = "物料分类编码")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyCode;
|
||||
|
||||
@ApiModelProperty("物料分类名称")
|
||||
@Excel(name = "物料分类名称")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyName;
|
||||
|
||||
@ApiModelProperty("物料种类编码 数据字典")
|
||||
@Excel(name = "物料种类编码 数据字典")
|
||||
private String materialType;
|
||||
|
||||
@ApiModelProperty("物料种类名称 数据字典")
|
||||
@Excel(name = "物料种类名称 数据字典")
|
||||
private String materialTypeName;
|
||||
}
|
||||
+207
@@ -0,0 +1,207 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.handler.ListTypeHandler;
|
||||
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_base_info
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
|
||||
//@TableName(value = "material_base_info", autoResultMap = true)
|
||||
@Data
|
||||
public class MaterialBaseInfo extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料基础信息id")
|
||||
@TableId(type = IdType.AUTO)
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@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 shipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
@Excel(name = "货主编码")
|
||||
private String shipperCode;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
@Excel(name = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("物料分类id")
|
||||
@Excel(name = "物料分类id")
|
||||
private String materialClassifyId;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("物料分类编码")
|
||||
@Excel(name = "物料分类编码")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyCode;
|
||||
|
||||
@ApiModelProperty("物料分类名称")
|
||||
@Excel(name = "物料分类名称")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyName;
|
||||
|
||||
@ApiModelProperty("物料种类编码 数据字典")
|
||||
@Excel(name = "物料种类编码 数据字典")
|
||||
private String materialType;
|
||||
|
||||
@ApiModelProperty("物料种类名称 数据字典")
|
||||
@Excel(name = "物料种类名称 数据字典")
|
||||
private String materialTypeName;
|
||||
|
||||
@ApiModelProperty("包装规格id")
|
||||
@Excel(name = "包装规格id")
|
||||
private Long packId;
|
||||
|
||||
@ApiModelProperty("包装规格编码")
|
||||
@Excel(name = "包装规格编码")
|
||||
private String packCode;
|
||||
|
||||
@ApiModelProperty("包装规格名称")
|
||||
@Excel(name = "包装规格名称")
|
||||
private String packName;
|
||||
|
||||
@ApiModelProperty("包装单位编码")
|
||||
@Excel(name = "包装单位编码")
|
||||
private String unitCode;
|
||||
|
||||
@ApiModelProperty("包装单位名称")
|
||||
@Excel(name = "包装单位名称")
|
||||
private String unitName;
|
||||
|
||||
@ApiModelProperty("品牌id")
|
||||
@Excel(name = "品牌id")
|
||||
private Long brandId;
|
||||
|
||||
@ApiModelProperty("品牌编码")
|
||||
@Excel(name = "品牌编码")
|
||||
private String brandCode;
|
||||
|
||||
@ApiModelProperty("品牌名称")
|
||||
@Excel(name = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@ApiModelProperty("保质期 单位:天")
|
||||
@Excel(name = "保质期 单位:天")
|
||||
private Long shelfLife;
|
||||
|
||||
@ApiModelProperty("净重 单位:千克")
|
||||
@Excel(name = "净重 单位:千克")
|
||||
private BigDecimal weightLimit;
|
||||
|
||||
@ApiModelProperty("体积 单位:立方米")
|
||||
@Excel(name = "体积 单位:立方米")
|
||||
private BigDecimal volumeLimit;
|
||||
|
||||
@ApiModelProperty("商品形态编码 数据字典")
|
||||
@Excel(name = "商品形态编码 数据字典")
|
||||
private String materialShape;
|
||||
|
||||
@ApiModelProperty("商品形态名称 数据字典")
|
||||
@Excel(name = "商品形态名称 数据字典")
|
||||
private String materialShapeName;
|
||||
|
||||
@ApiModelProperty("物料大小 长*宽*高 单位:米")
|
||||
@Excel(name = "物料大小 长*宽*高 单位:米")
|
||||
private String materialSize;
|
||||
|
||||
@ApiModelProperty("物料大小-长 单位:米")
|
||||
@Excel(name = "物料大小-长 单位:米")
|
||||
private BigDecimal materialLength;
|
||||
|
||||
@ApiModelProperty("物料大小-宽 单位:米")
|
||||
@Excel(name = "物料大小-宽 单位:米")
|
||||
private BigDecimal materialWidth;
|
||||
|
||||
@ApiModelProperty("物料大小-高 单位:米")
|
||||
@Excel(name = "物料大小-高 单位:米")
|
||||
private BigDecimal materialHeight;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("是否作废: 1-是 2-否")
|
||||
@Excel(name = "是否作废: 1-是 2-否")
|
||||
private Integer nullify;
|
||||
|
||||
@ApiModelProperty("单位数量")
|
||||
@Excel(name = "单位数量")
|
||||
private BigDecimal unitNumber;
|
||||
|
||||
@ApiModelProperty("是否公用: 1-是 2-否")
|
||||
@Excel(name = "是否公用: 1-是 2-否")
|
||||
private Integer common;
|
||||
|
||||
@ApiModelProperty("SKU码")
|
||||
private String skuCode;
|
||||
|
||||
@ApiModelProperty("单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("币制")
|
||||
private String currency;
|
||||
|
||||
@ApiModelProperty("原产国")
|
||||
private String originCountry;
|
||||
|
||||
@ApiModelProperty("HS码")
|
||||
private String hsCode;
|
||||
|
||||
@ApiModelProperty("申报单位")
|
||||
private String declarationUnit;
|
||||
|
||||
@ApiModelProperty("法定单位")
|
||||
private String statutoryUnit;
|
||||
|
||||
@ApiModelProperty("法定第二单位")
|
||||
private String statutorySecondUnit;
|
||||
|
||||
@ApiModelProperty("规格型号")
|
||||
private String specificationModel;
|
||||
|
||||
@ApiModelProperty("是否抄码: 1-是 2-否")
|
||||
@Excel(name = "是否抄码: 1-是 2-否")
|
||||
@TableField("copy_code")
|
||||
private Integer copyCode;
|
||||
|
||||
}
|
||||
+261
@@ -0,0 +1,261 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.handler.ListTypeHandler;
|
||||
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_base_info
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-07
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MaterialBaseInfoDTO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料基础信息id")
|
||||
private Long materialBaseInfoId;
|
||||
|
||||
@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 shipperId;
|
||||
|
||||
@ApiModelProperty("货主编码")
|
||||
@Excel(name = "货主编码")
|
||||
private String shipperCode;
|
||||
|
||||
@ApiModelProperty("货主名称")
|
||||
@Excel(name = "货主名称")
|
||||
private String shipperName;
|
||||
|
||||
@ApiModelProperty("物料编码")
|
||||
@Excel(name = "物料编码")
|
||||
private String materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("物料分类编码")
|
||||
@Excel(name = "物料分类编码")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyCode;
|
||||
|
||||
@ApiModelProperty("物料分类名称")
|
||||
@Excel(name = "物料分类名称")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyName;
|
||||
@ApiModelProperty("物料分类(导入)")
|
||||
@Excel(name = "物料分类")
|
||||
private String materialClassifyImport;
|
||||
|
||||
@ApiModelProperty("物料种类编码 数据字典")
|
||||
@Excel(name = "物料种类编码 数据字典")
|
||||
private String materialType;
|
||||
|
||||
@ApiModelProperty("物料种类名称 数据字典")
|
||||
@Excel(name = "物料种类名称 数据字典")
|
||||
private String materialTypeName;
|
||||
@ApiModelProperty("物料种类(导入)")
|
||||
@Excel(name = "物料种类")
|
||||
private String materialTypeImport;
|
||||
|
||||
@ApiModelProperty("包装规格id")
|
||||
@Excel(name = "包装规格id")
|
||||
private Long packId;
|
||||
|
||||
@ApiModelProperty("包装规格编码")
|
||||
@Excel(name = "包装规格编码")
|
||||
private String packCode;
|
||||
|
||||
@ApiModelProperty("包装规格名称")
|
||||
@Excel(name = "包装规格名称")
|
||||
private String packName;
|
||||
@ApiModelProperty("包装规格(导入)")
|
||||
@Excel(name = "包装规格")
|
||||
private String packImport;
|
||||
|
||||
@ApiModelProperty("包装单位编码")
|
||||
@Excel(name = "包装单位编码")
|
||||
private String unitCode;
|
||||
|
||||
@ApiModelProperty("包装单位名称")
|
||||
@Excel(name = "包装单位名称")
|
||||
private String unitName;
|
||||
@ApiModelProperty("物料单位(导入)")
|
||||
@Excel(name = "物料单位")
|
||||
private String unitImport;
|
||||
@ApiModelProperty("单位(导入)")
|
||||
@Excel(name = "单位")
|
||||
private String unitImport2;
|
||||
|
||||
@ApiModelProperty("品牌id")
|
||||
@Excel(name = "品牌id")
|
||||
private Long brandId;
|
||||
|
||||
@ApiModelProperty("品牌编码")
|
||||
@Excel(name = "品牌编码")
|
||||
private String brandCode;
|
||||
|
||||
@ApiModelProperty("品牌名称")
|
||||
@Excel(name = "品牌名称")
|
||||
private String brandName;
|
||||
|
||||
@ApiModelProperty("保质期 单位:天")
|
||||
@Excel(name = "保质期 单位:天")
|
||||
private Long shelfLife;
|
||||
|
||||
@ApiModelProperty("净重 单位:千克")
|
||||
@Excel(name = "净重 单位:千克")
|
||||
private BigDecimal weightLimit;
|
||||
|
||||
@ApiModelProperty("体积 单位:立方米")
|
||||
@Excel(name = "体积 单位:立方米")
|
||||
private BigDecimal volumeLimit;
|
||||
|
||||
@ApiModelProperty("商品形态编码 数据字典")
|
||||
@Excel(name = "商品形态编码 数据字典")
|
||||
private String materialShape;
|
||||
|
||||
@ApiModelProperty("商品形态名称 数据字典")
|
||||
@Excel(name = "商品形态名称 数据字典")
|
||||
private String materialShapeName;
|
||||
|
||||
@ApiModelProperty("物料大小 长*宽*高 单位:米")
|
||||
@Excel(name = "物料大小 长*宽*高 单位:米")
|
||||
private String materialSize;
|
||||
|
||||
@ApiModelProperty("物料大小-长 单位:米")
|
||||
@Excel(name = "物料大小-长 单位:米")
|
||||
private BigDecimal materialLength;
|
||||
|
||||
@ApiModelProperty("物料大小-宽 单位:米")
|
||||
@Excel(name = "物料大小-宽 单位:米")
|
||||
private BigDecimal materialWidth;
|
||||
|
||||
@ApiModelProperty("物料大小-高 单位:米")
|
||||
@Excel(name = "物料大小-高 单位:米")
|
||||
private BigDecimal materialHeight;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty("是否作废: 1-是 2-否")
|
||||
@Excel(name = "是否作废: 1-是 2-否")
|
||||
private Integer nullify;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
//
|
||||
// @ApiModelProperty("商品规则")
|
||||
// private MaterialGoodsRuleDO materialGoodsRule;
|
||||
//
|
||||
// @ApiModelProperty("公共信息")
|
||||
// private MaterialCommonDTO materialCommon;
|
||||
//
|
||||
// @ApiModelProperty("仓库控制信息")
|
||||
// private MaterialWarehouseControlDTO materialWarehouseControl;
|
||||
//
|
||||
// @ApiModelProperty("库存预警信息")
|
||||
// private List<MaterialInventoryWarningDTO> materialInventoryWarningList;
|
||||
//
|
||||
// @ApiModelProperty("条码信息")
|
||||
// private List<MaterialBarCodeDTO> materialBarCodeList;
|
||||
|
||||
@ApiModelProperty("复合条件查询 物料名称 物料编码 物料条码")
|
||||
private String compoundOrQuery;
|
||||
|
||||
@ApiModelProperty("feign 是否是修改: 1-是 2-否")
|
||||
private Integer updateFeign;
|
||||
|
||||
@ApiModelProperty("是否公用: 1-是 2-否")
|
||||
@Excel(name = "是否公用: 1-是 2-否")
|
||||
private Integer common;
|
||||
|
||||
@ApiModelProperty("SKU码")
|
||||
@Excel(name = "SKU码")
|
||||
private String skuCode;
|
||||
|
||||
@ApiModelProperty("单价")
|
||||
@Excel(name = "单价")
|
||||
private BigDecimal unitPrice;
|
||||
|
||||
@ApiModelProperty("币制")
|
||||
@Excel(name = "币制")
|
||||
private String currency;
|
||||
|
||||
@ApiModelProperty("原产国")
|
||||
@Excel(name = "原产国")
|
||||
private String originCountry;
|
||||
|
||||
@ApiModelProperty("HS码")
|
||||
@Excel(name = "HS码")
|
||||
private String hsCode;
|
||||
@ApiModelProperty("HS编码(导入)")
|
||||
@Excel(name = "HS编码")
|
||||
private String hsCodeImport;
|
||||
|
||||
@ApiModelProperty("申报单位")
|
||||
@Excel(name = "申报单位")
|
||||
private String declarationUnit;
|
||||
|
||||
@ApiModelProperty("法定单位")
|
||||
@Excel(name = "法定单位")
|
||||
private String statutoryUnit;
|
||||
|
||||
@ApiModelProperty("法定第二单位")
|
||||
@Excel(name = "法定第二单位")
|
||||
private String statutorySecondUnit;
|
||||
|
||||
@ApiModelProperty("规格型号")
|
||||
@Excel(name = "规格型号")
|
||||
private String specificationModel;
|
||||
|
||||
@ApiModelProperty("批次ID")
|
||||
private Long batchId;
|
||||
|
||||
@ApiModelProperty("批次规则(导入:批次名称)")
|
||||
@Excel(name = "批次规则")
|
||||
private String batchRuleNameImport;
|
||||
|
||||
@ApiModelProperty("批次名称(导入)")
|
||||
@Excel(name = "批次名称")
|
||||
private String batchName;
|
||||
|
||||
@ApiModelProperty("批次(导入)")
|
||||
@Excel(name = "批次")
|
||||
private String batchImport;
|
||||
|
||||
@ApiModelProperty("是否抄码: 1-是 2-否")
|
||||
@Excel(name = "是否抄码: 1-是 2-否")
|
||||
private Integer copyCode;
|
||||
}
|
||||
+65
@@ -0,0 +1,65 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.handler.ListTypeHandler;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author ZhouGY
|
||||
* @title MaterialBaseDO
|
||||
* @description: TODO
|
||||
* @date 2024/7/5 10:59
|
||||
**/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Data
|
||||
public class MaterialBasePO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@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 materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("物料分类编码")
|
||||
@Excel(name = "物料分类编码")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyCode;
|
||||
|
||||
@ApiModelProperty("物料分类名称")
|
||||
@Excel(name = "物料分类名称")
|
||||
@TableField(typeHandler = ListTypeHandler.class)
|
||||
private List<String> materialClassifyName;
|
||||
|
||||
@ApiModelProperty("物料种类编码 数据字典")
|
||||
@Excel(name = "物料种类编码 数据字典")
|
||||
private String materialType;
|
||||
|
||||
@ApiModelProperty("物料种类名称 数据字典")
|
||||
@Excel(name = "物料种类名称 数据字典")
|
||||
private String materialTypeName;
|
||||
}
|
||||
+102
@@ -0,0 +1,102 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
|
||||
|
||||
/**
|
||||
* 物料库存对象 material_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MaterialInventoryParamDO extends MaterialBaseDO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
//库存id
|
||||
private Long materialInventoryId;
|
||||
//物料基础信息id
|
||||
private Long materialBaseInfoId;
|
||||
//物料明细ID
|
||||
private Long materialDetailId;
|
||||
|
||||
//仓库信息参数
|
||||
private Long organizationId;
|
||||
private String organizationName;
|
||||
private Long topOrganizationId;
|
||||
//仓库ID
|
||||
private Long warehouseId;
|
||||
//仓库编码
|
||||
private String warehouseCode;
|
||||
//仓库名称
|
||||
private String warehouseName;
|
||||
//存储区ID
|
||||
private Long storageSectionId;
|
||||
//存储区编码
|
||||
private String storageCode;
|
||||
//存储区名称
|
||||
private String storageName;
|
||||
//存储位置ID
|
||||
private Long storageLocationId;
|
||||
//存储位置编码
|
||||
private String storageLocationCode;
|
||||
//存储位置名称
|
||||
private String storageLocationName;
|
||||
|
||||
|
||||
//调整参数
|
||||
|
||||
//调整数量
|
||||
private BigDecimal quantity;
|
||||
//净重
|
||||
private BigDecimal netWeight;
|
||||
//毛重
|
||||
private BigDecimal grossWeight;
|
||||
//体积
|
||||
private BigDecimal volume;
|
||||
//面积
|
||||
private BigDecimal area;
|
||||
//类型(1:上架2:分配3:取消分配4:出库交接5:移位6:库存调整7:库存冻结)
|
||||
private String type;
|
||||
|
||||
private String barCode;
|
||||
|
||||
|
||||
|
||||
|
||||
//更多属性
|
||||
private String batchRefNo;
|
||||
private String sheetRefNo;
|
||||
//箱码
|
||||
private String boxPalletNo;
|
||||
//扩展字段2
|
||||
private String extAttr1;
|
||||
//扩展字段1
|
||||
private String extAttr2;
|
||||
//生产日期
|
||||
private Date productionDate;
|
||||
//过期日期
|
||||
private Date expiryDate;
|
||||
//库存日期
|
||||
private Date inventoryDate;
|
||||
//扩展字段3
|
||||
private Date extAttr3;
|
||||
//扩展字段4
|
||||
private Date extAttr4;
|
||||
|
||||
|
||||
private String inOrderNumber;
|
||||
|
||||
private String lotNumber;
|
||||
|
||||
private String batchNumber;
|
||||
|
||||
private String isNew;
|
||||
|
||||
/** 业务关联单号(出库单号、交接单对应单号等),用于库存调整记录 relate_no;可与入库单号区分 */
|
||||
private String relateNo;
|
||||
|
||||
}
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
/**
|
||||
* 物料库存对象 material_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MaterialInventoryParentDO extends BaseVOEntity {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料库存对象")
|
||||
private List<ReservationMaterialInventoryDO> materialInventoryDOList;
|
||||
}
|
||||
+255
@@ -0,0 +1,255 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
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_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MaterialInventoryQueryListDO extends MaterialBaseDO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料库存id")
|
||||
private Long materialInventoryId;
|
||||
|
||||
@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 materialBaseInfoId;
|
||||
|
||||
@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 materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@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 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("批次号")
|
||||
@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("库存数量")
|
||||
@Excel(name = "库存数量")
|
||||
private BigDecimal inventoryQuantity;
|
||||
|
||||
@ApiModelProperty("可用数量")
|
||||
@Excel(name = "可用数量")
|
||||
private BigDecimal allocationQuantity;
|
||||
|
||||
@ApiModelProperty("冻结数量")
|
||||
@Excel(name = "冻结数量")
|
||||
private BigDecimal freezeQuantity;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
|
||||
@Excel(name = "盘点是否可用:0-禁用 1-可用")
|
||||
private Integer isAble;
|
||||
|
||||
@ApiModelProperty("查询类型 0-全部查询 1-按货主查询 2-按物料查询 3-按批次查询 4-按库位查询 5-按物料/库位查询 6-按容器查询")
|
||||
@Excel(name = "查询类型 0-全部查询 1-按货主查询 2-按物料查询 3-按批次查询 4-按库位查询 5-按物料/库位查询 6-按容器查询")
|
||||
private Integer queryType;
|
||||
|
||||
@ApiModelProperty("货主信息")
|
||||
@Excel(name = "货主信息")
|
||||
private String shipperInfo;
|
||||
|
||||
@ApiModelProperty("物料信息")
|
||||
@Excel(name = "物料信息")
|
||||
private String materialInfo;
|
||||
|
||||
@ApiModelProperty("物料/库位信息")
|
||||
@Excel(name = "物料/库位信息")
|
||||
private String storageInfo;
|
||||
|
||||
@ApiModelProperty("容器号或批次号,输入后同时按容器号、批次号模糊匹配")
|
||||
@Excel(name = "容器号或批次号")
|
||||
private String containerOrBatch;
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
@Excel(name = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
@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("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 boxPalletNo;
|
||||
|
||||
@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("订单物料明细id")
|
||||
private Long materialDetailId;
|
||||
|
||||
}
|
||||
+186
@@ -0,0 +1,186 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料库存对象 material_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class MaterialInventoryQueryListDTO extends MaterialBaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料库存id")
|
||||
private Long materialInventoryId;
|
||||
|
||||
@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 materialBaseInfoId;
|
||||
|
||||
@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 materialCode;
|
||||
|
||||
@ApiModelProperty("物料名称")
|
||||
@Excel(name = "物料名称")
|
||||
private String materialName;
|
||||
|
||||
@ApiModelProperty("物料条形码")
|
||||
@Excel(name = "物料条形码")
|
||||
private String barCode;
|
||||
|
||||
@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 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("批次号")
|
||||
@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("库存数量")
|
||||
@Excel(name = "库存数量")
|
||||
private BigDecimal inventoryQuantity;
|
||||
|
||||
@ApiModelProperty("可用数量")
|
||||
@Excel(name = "可用数量")
|
||||
private BigDecimal allocationQuantity;
|
||||
|
||||
@ApiModelProperty("冻结数量")
|
||||
@Excel(name = "冻结数量")
|
||||
private BigDecimal freezeQuantity;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
|
||||
@Excel(name = "盘点是否可用:0-禁用 1-可用")
|
||||
private Integer isAble;
|
||||
|
||||
@ApiModelProperty("查询类型 0-全部查询 1-按货主查询 2-按物料查询 3-按批次查询 4-按库位查询 5-按物料/库位查询 6-按容器查询")
|
||||
@Excel(name = "查询类型 0-全部查询 1-按货主查询 2-按物料查询 3-按批次查询 4-按库位查询 5-按物料/库位查询 6-按容器查询")
|
||||
private Integer queryType;
|
||||
|
||||
@ApiModelProperty("货主信息")
|
||||
@Excel(name = "货主信息")
|
||||
private String shipperInfo;
|
||||
|
||||
@ApiModelProperty("物料信息")
|
||||
@Excel(name = "物料信息")
|
||||
private String materialInfo;
|
||||
|
||||
@ApiModelProperty("物料/库位信息")
|
||||
@Excel(name = "物料/库位信息")
|
||||
private String storageInfo;
|
||||
|
||||
@ApiModelProperty("容器号或批次号,输入后同时按容器号、批次号模糊匹配")
|
||||
@Excel(name = "容器号或批次号")
|
||||
private String containerOrBatch;
|
||||
|
||||
@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 boxPalletNo;
|
||||
}
|
||||
+246
@@ -0,0 +1,246 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
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_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ReservationMaterialInventoryDO extends MaterialBaseDO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料库存id")
|
||||
private Long materialInventoryId;
|
||||
|
||||
@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 materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("上架单物料明细id")
|
||||
@Excel(name = "上架单物料明细id")
|
||||
private Long materialDetailId;
|
||||
|
||||
@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 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("批次号")
|
||||
@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("容器号或批次号(PDA单输入框模糊查询,优先于 batchNumber/containerCode 单独传参)")
|
||||
private String containerOrBatch;
|
||||
|
||||
@ApiModelProperty("容器类型 数据字典")
|
||||
@Excel(name = "容器类型 数据字典")
|
||||
private String containerType;
|
||||
|
||||
@ApiModelProperty("容器类型名称 数据字典")
|
||||
@Excel(name = "容器类型名称 数据字典")
|
||||
private String containerTypeName;
|
||||
|
||||
@ApiModelProperty("库存数量")
|
||||
@Excel(name = "库存数量")
|
||||
private BigDecimal inventoryQuantity;
|
||||
|
||||
@ApiModelProperty("可用数量")
|
||||
@Excel(name = "可用数量")
|
||||
private BigDecimal allocationQuantity;
|
||||
|
||||
@ApiModelProperty("冻结数量")
|
||||
@Excel(name = "冻结数量")
|
||||
private BigDecimal freezeQuantity;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
|
||||
@Excel(name = "盘点是否可用:0-禁用 1-可用")
|
||||
private Integer isAble;
|
||||
|
||||
@ApiModelProperty("货主信息")
|
||||
@Excel(name = "货主信息")
|
||||
private String shipperInfo;
|
||||
|
||||
@ApiModelProperty("物料信息")
|
||||
@Excel(name = "物料信息")
|
||||
private String materialInfo;
|
||||
|
||||
@ApiModelProperty("物料/库位信息")
|
||||
@Excel(name = "物料/库位信息")
|
||||
private String storageInfo;
|
||||
|
||||
|
||||
@ApiModelProperty("单位")
|
||||
@Excel(name = "单位")
|
||||
private String unit;
|
||||
|
||||
@ApiModelProperty("单位名称")
|
||||
@Excel(name = "单位名称")
|
||||
private String unitName;
|
||||
|
||||
@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("货主id")
|
||||
private Long shipperId;
|
||||
|
||||
|
||||
@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 boxPalletNo;
|
||||
|
||||
@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;
|
||||
|
||||
//查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部
|
||||
private String queryRule;
|
||||
|
||||
@ApiModelProperty("冻结数量大于0条件")
|
||||
@Excel(name = "冻结数量大于0条件")
|
||||
private String greaterThanFreezeQuantity;
|
||||
|
||||
@ApiModelProperty("入库单号")
|
||||
@Excel(name = "入库单号")
|
||||
private String inOrderNumber;
|
||||
|
||||
@ApiModelProperty("LOT编号")
|
||||
@Excel(name = "LOT编号")
|
||||
private String lotNumber;
|
||||
}
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.repository.todo;
|
||||
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料库存对象 material_inventory
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
|
||||
@Data
|
||||
public class ReservationMaterialInventoryDTO extends MaterialBaseDTO {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
@ApiModelProperty("物料库存id")
|
||||
private Long materialInventoryId;
|
||||
|
||||
@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 materialBaseInfoId;
|
||||
|
||||
@ApiModelProperty("上架单物料明细id")
|
||||
@Excel(name = "上架单物料明细id")
|
||||
private Long materialDetailId;
|
||||
|
||||
@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 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("批次号")
|
||||
@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("容器号或批次号(PDA单输入框模糊查询,优先于 batchNumber/containerCode 单独传参)")
|
||||
private String containerOrBatch;
|
||||
|
||||
@ApiModelProperty("容器类型 数据字典")
|
||||
@Excel(name = "容器类型 数据字典")
|
||||
private String containerType;
|
||||
|
||||
@ApiModelProperty("容器类型名称 数据字典")
|
||||
@Excel(name = "容器类型名称 数据字典")
|
||||
private String containerTypeName;
|
||||
|
||||
@ApiModelProperty("库存数量")
|
||||
@Excel(name = "库存数量")
|
||||
private BigDecimal inventoryQuantity;
|
||||
|
||||
@ApiModelProperty("可用数量")
|
||||
@Excel(name = "可用数量")
|
||||
private BigDecimal allocationQuantity;
|
||||
|
||||
@ApiModelProperty("冻结数量")
|
||||
@Excel(name = "冻结数量")
|
||||
private BigDecimal freezeQuantity;
|
||||
|
||||
@ApiModelProperty("备注")
|
||||
@Excel(name = "备注")
|
||||
private String remark;
|
||||
|
||||
|
||||
@ApiModelProperty(name = "组织ID集合")
|
||||
private List<Long> organizationIdList;
|
||||
|
||||
@ApiModelProperty(name = "权限菜单ID")
|
||||
private Long permissionMenuId;
|
||||
|
||||
@ApiModelProperty("盘点是否可用:0-禁用 1-可用")
|
||||
@Excel(name = "盘点是否可用:0-禁用 1-可用")
|
||||
private Integer isAble;
|
||||
|
||||
@ApiModelProperty("货主信息")
|
||||
@Excel(name = "货主信息")
|
||||
private String shipperInfo;
|
||||
|
||||
@ApiModelProperty("物料信息")
|
||||
@Excel(name = "物料信息")
|
||||
private String materialInfo;
|
||||
|
||||
@ApiModelProperty("物料/库位信息")
|
||||
@Excel(name = "物料/库位信息")
|
||||
private String storageInfo;
|
||||
|
||||
@ApiModelProperty("货主id")
|
||||
private Long shipperId;
|
||||
|
||||
@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 boxPalletNo;
|
||||
//查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部
|
||||
private String queryRule;
|
||||
|
||||
@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("冻结数量大于0条件")
|
||||
@Excel(name = "冻结数量大于0条件")
|
||||
private String greaterThanFreezeQuantity;
|
||||
|
||||
}
|
||||
+567
@@ -0,0 +1,567 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.service;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.alibaba.nacos.common.utils.CollectionUtils;
|
||||
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.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBarCodePO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.service.ReservationMaterialInventoryDomainService;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.domain.BatchDetailFeignPO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryPO;
|
||||
import com.mhd.system.api.domain.MaterialMoreDetailPO;
|
||||
import com.mhd.system.api.domain.cache.AssociationWarehouseCacheDO;
|
||||
import com.mhd.system.api.domain.cache.SystemServiceCacheUtil;
|
||||
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.lang.reflect.Field;
|
||||
import java.math.BigDecimal;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 物料库存ApplicationService
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ReservationMaterialInventoryApplicationService {
|
||||
@Autowired
|
||||
private ReservationMaterialInventoryDomainService materialInventoryDomainService;
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private ReservationMaterialInventoryMapper materialInventoryMapper;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询物料库存列表
|
||||
*/
|
||||
|
||||
public List<ReservationMaterialInventoryPO> queryList(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null && loginUser.getUserPo() != null){
|
||||
Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
|
||||
Long frontendOrganizationId = materialInventoryDO.getOrganizationId(); // 前端传递的 organizationId
|
||||
|
||||
// 数据权限:根据 organizationId 来设置查询权限
|
||||
// 当前登录用户的 organizationId 为 2827 时,可查全部组织数据;其他组织只能查自己
|
||||
if (userOrganizationId != null && userOrganizationId == 2827L) {
|
||||
// 南光组织(organizationId=2827):可以查询所有组织的数据
|
||||
// 如果前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤
|
||||
// 如果前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据
|
||||
if (frontendOrganizationId != null) {
|
||||
// 前端传递了 organizationId(包括2827或其他组织),使用前端传递的值进行过滤
|
||||
materialInventoryDO.setOrganizationId(frontendOrganizationId);
|
||||
materialInventoryDO.setTopOrganizationId(null); // 明确设置为 null,避免使用 topOrganizationId 条件
|
||||
} else {
|
||||
// 前端没有传递 organizationId,清空组织过滤条件,查询所有组织的数据
|
||||
materialInventoryDO.setOrganizationId(null);
|
||||
materialInventoryDO.setTopOrganizationId(null);
|
||||
}
|
||||
} else {
|
||||
// 其他组织:设置organizationId,只查询当前组织的数据
|
||||
// 如果前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (frontendOrganizationId != null && userOrganizationId != null) {
|
||||
// 前端传递了 organizationId,验证是否与当前登录用户的组织ID一致
|
||||
if (!frontendOrganizationId.equals(userOrganizationId)) {
|
||||
// 前端传递了其他组织的 organizationId,强制使用当前登录用户的组织ID,防止越权查询
|
||||
materialInventoryDO.setOrganizationId(userOrganizationId);
|
||||
}
|
||||
// 如果前端传递的 organizationId 与当前登录用户的组织ID一致,使用前端传递的值
|
||||
} else {
|
||||
// 前端没有传递 organizationId,使用当前登录用户的组织ID
|
||||
if (userOrganizationId != null) {
|
||||
materialInventoryDO.setOrganizationId(userOrganizationId);
|
||||
}
|
||||
}
|
||||
// 只有当 organizationId 为 null 时,才使用 topOrganizationId 作为查询条件
|
||||
// 如果 organizationId 不为 null,则优先使用 organizationId,不使用 topOrganizationId
|
||||
if (materialInventoryDO.getOrganizationId() == null) {
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1) {
|
||||
materialInventoryDO.setTopOrganizationId(topOrganizationId);
|
||||
}
|
||||
} else {
|
||||
// 对于非2827组织,必须设置 topOrganizationId=2827
|
||||
materialInventoryDO.setTopOrganizationId(2827L);
|
||||
}
|
||||
}
|
||||
// 前端有传warehouseId则优先使用传参;未传时才使用"用户关联仓库"作为默认值
|
||||
// if (materialInventoryDO.getWarehouseId() == null) {
|
||||
// AssociationWarehouseCacheDO associationWarehouseCacheDO =
|
||||
// SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
// if (associationWarehouseCacheDO != null) {
|
||||
// materialInventoryDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
// }
|
||||
// }
|
||||
}
|
||||
return materialInventoryDomainService.queryList(materialInventoryDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料库存列表(带批次属性)
|
||||
* 批次属性值从库存表中获取
|
||||
*/
|
||||
public List<ReservationMaterialInventoryPO> queryListWithBatchAttributes(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
List<ReservationMaterialInventoryPO> list = queryList(materialInventoryDO);
|
||||
|
||||
if (CollectionUtils.isEmpty(list)) {
|
||||
return list;
|
||||
}
|
||||
|
||||
// 性能优化:批量获取批次属性,避免N+1查询问题
|
||||
// 1. 收集所有唯一的materialBaseInfoId
|
||||
Set<Long> materialBaseInfoIdSet = list.stream()
|
||||
.map(ReservationMaterialInventoryPO::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(list, batchDetailMap);
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public BigDecimal sumInventoryQuantity(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null){
|
||||
Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
if (topOrganizationId != null && topOrganizationId != 1){
|
||||
materialInventoryDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
}
|
||||
// 前端有传warehouseId则优先使用传参;未传时才使用“用户关联仓库”作为默认值
|
||||
if (materialInventoryDO.getWarehouseId() == null) {
|
||||
AssociationWarehouseCacheDO associationWarehouseCacheDO =
|
||||
SystemServiceCacheUtil.getAssociationWarehouseCache(loginUser.getUserid());
|
||||
if (associationWarehouseCacheDO != null) {
|
||||
materialInventoryDO.setWarehouseId(associationWarehouseCacheDO.getWarehouseId());
|
||||
}
|
||||
}
|
||||
}
|
||||
List<ReservationMaterialInventoryPO> materialInventoryPOS = materialInventoryDomainService.queryList(materialInventoryDO);
|
||||
if (CollectionUtils.isNotEmpty(materialInventoryPOS)){
|
||||
return materialInventoryPOS.stream().map(ReservationMaterialInventoryPO::getAllocationQuantity).reduce(BigDecimal.ZERO, BigDecimal::add);
|
||||
}
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料库存
|
||||
*/
|
||||
public Boolean insert(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
|
||||
return materialInventoryDomainService.insert(materialInventoryDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*/
|
||||
public Boolean update(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
return materialInventoryDomainService.update(materialInventoryDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料库存
|
||||
*/
|
||||
public boolean delete(Long[] materialInventoryIds) {
|
||||
return materialInventoryDomainService.delete(materialInventoryIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料库存详细信息
|
||||
*/
|
||||
public ReservationMaterialInventoryPO getInfo(Long materialInventoryId)
|
||||
{
|
||||
return materialInventoryDomainService.getInfo(materialInventoryId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description 根据库位Id和物料基础信息Id 获取物料库存详细信息
|
||||
* @author ZhouGY
|
||||
* @date 2024/5/29 17:15
|
||||
* @param storageLocationId
|
||||
* @param materialBaseInfoId
|
||||
* @return BigDecimal
|
||||
*/
|
||||
public BigDecimal getInventoryByStorageLocationIdAndMaterialBaseInfoId(Long storageLocationId, Long materialBaseInfoId) {
|
||||
return materialInventoryDomainService.getInventoryByStorageLocationIdAndMaterialBaseInfoId(storageLocationId, materialBaseInfoId);
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:库存查询列表
|
||||
* @param materialInventoryQueryListDO
|
||||
* @return: java.util.List<com.mhd.wms.domain.materialInventory.repository.po.ReservationMaterialInventoryQueryListPO>
|
||||
* @author: lianzj
|
||||
* @time: 2024-07-16 14:43:38
|
||||
*/
|
||||
// public List<ReservationMaterialInventoryQueryListPO> materialQueryList(ReservationMaterialInventoryQueryListDO materialInventoryQueryListDO) {
|
||||
// LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
// //topOrganizationId 会查到一级组织下全部子组织
|
||||
// if (loginUser != null && loginUser.getUserPo() != null) {
|
||||
// Long userOrganizationId = loginUser.getUserPo().getOrganizationId();
|
||||
// Long frontendOrganizationId = materialInventoryQueryListDO.getOrganizationId();
|
||||
// if (userOrganizationId != null && userOrganizationId == 2827L) {
|
||||
// if (frontendOrganizationId != null) {
|
||||
// materialInventoryQueryListDO.setOrganizationId(frontendOrganizationId);
|
||||
// materialInventoryQueryListDO.setTopOrganizationId(null);
|
||||
// } else {
|
||||
// materialInventoryQueryListDO.setOrganizationId(null);
|
||||
// materialInventoryQueryListDO.setTopOrganizationId(null);
|
||||
// }
|
||||
// } else {
|
||||
// if (frontendOrganizationId != null && userOrganizationId != null) {
|
||||
// if (!frontendOrganizationId.equals(userOrganizationId)) {
|
||||
// materialInventoryQueryListDO.setOrganizationId(userOrganizationId);
|
||||
// }
|
||||
// } else {
|
||||
// if (userOrganizationId != null) {
|
||||
// materialInventoryQueryListDO.setOrganizationId(userOrganizationId);
|
||||
// }
|
||||
// }
|
||||
// if (materialInventoryQueryListDO.getOrganizationId() == null) {
|
||||
// Long topOrganizationId = loginUser.getUserPo().getTopOrganizationId();
|
||||
// if (topOrganizationId != null && topOrganizationId != 1) {
|
||||
// materialInventoryQueryListDO.setTopOrganizationId(topOrganizationId);
|
||||
// }
|
||||
// } else {
|
||||
// materialInventoryQueryListDO.setTopOrganizationId(2827L);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// List<ReservationMaterialInventoryQueryListPO> list = materialInventoryDomainService.materialQueryList(materialInventoryQueryListDO);
|
||||
// // 批次属性填充,与按单移位一致
|
||||
// fillMaterialMoreDetailForInventoryQueryList(list);
|
||||
// // 主项子项结构仅用于 0-全部、6-按容器,供移位表单复用;1-5 按货主/物料/批次/库位/物料库位 为合并汇总展示,不转主项子项
|
||||
// Integer queryType = materialInventoryQueryListDO.getQueryType();
|
||||
// if (queryType == null || queryType == 0 || queryType == 6) {
|
||||
// buildParentChildForInventoryQueryList(list);
|
||||
// }
|
||||
// return list;
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 将库存查询列表转为主项子项结构,与移位详情一致,供 PDA 表单复用
|
||||
// */
|
||||
// private void buildParentChildForInventoryQueryList(List<ReservationMaterialInventoryQueryListPO> list) {
|
||||
// if (CollectionUtils.isEmpty(list)) return;
|
||||
// for (ReservationMaterialInventoryQueryListPO parent : list) {
|
||||
// Long uid = parent.getReservationMaterialInventoryId();
|
||||
// parent.setLevel(1);
|
||||
// parent.setUniqueId(uid);
|
||||
// parent.setParentUniqueId(null);
|
||||
// ReservationMaterialInventoryQueryListPO child = new ReservationMaterialInventoryQueryListPO();
|
||||
// BeanUtils.copyProperties(parent, child, "children");
|
||||
// child.setLevel(2);
|
||||
// child.setUniqueId(uid);
|
||||
// child.setParentUniqueId(uid);
|
||||
// child.setChildren(null);
|
||||
// BigDecimal qty = parent.getShiftQuantity() != null ? parent.getShiftQuantity() : parent.getAllocationQuantity();
|
||||
// if (qty == null) qty = BigDecimal.ONE;
|
||||
// if (parent.getNetWeight() != null) child.setTotalNetWeight(parent.getNetWeight().multiply(qty));
|
||||
// if (parent.getGrossWeight() != null) child.setTotalGrossWeight(parent.getGrossWeight().multiply(qty));
|
||||
// if (parent.getVolume() != null) child.setTotalVolume(parent.getVolume().multiply(qty));
|
||||
// if (parent.getArea() != null) child.setTotalArea(parent.getArea().multiply(qty));
|
||||
// parent.setTotalNetWeight(child.getTotalNetWeight());
|
||||
// parent.setTotalGrossWeight(child.getTotalGrossWeight());
|
||||
// parent.setTotalVolume(child.getTotalVolume());
|
||||
// parent.setTotalArea(child.getTotalArea());
|
||||
// List<ReservationMaterialInventoryQueryListPO> children = new ArrayList<>();
|
||||
// children.add(child);
|
||||
// parent.setChildren(children);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// /**
|
||||
// * 根据 materialInventoryId 获取单条库存(含批次属性、shiftQuantity),供移位表单预填,内部使用
|
||||
// */
|
||||
// public ReservationMaterialInventoryQueryListPO getInventoryForShiftForm(Long materialInventoryId) {
|
||||
// if (materialInventoryId == null) return null;
|
||||
// ReservationMaterialInventoryQueryListDO do_ = new ReservationMaterialInventoryQueryListDO();
|
||||
// do_.setReservationMaterialInventoryId(materialInventoryId);
|
||||
// do_.setQueryType(0);
|
||||
// List<ReservationMaterialInventoryQueryListPO> list = materialQueryList(do_);
|
||||
// return CollectionUtils.isEmpty(list) ? null : list.get(0);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 库存查询列表批次属性填充,与按单移位 fillMaterialMoreDetailForShiftDetail 一致
|
||||
* 物料条码、包装规格:优先用 material_base_info,为空时从 material_bar_code 取条码(参考收货单实现)
|
||||
*/
|
||||
// private void fillMaterialMoreDetailForInventoryQueryList(List<ReservationMaterialInventoryQueryListPO> list) {
|
||||
// if (CollectionUtils.isEmpty(list)) {
|
||||
// return;
|
||||
// }
|
||||
// Set<Long> materialBaseInfoIdSet = list.stream()
|
||||
// .map(ReservationMaterialInventoryQueryListPO::getMaterialBaseInfoId)
|
||||
// .filter(Objects::nonNull)
|
||||
// .collect(Collectors.toSet());
|
||||
// // 物料条码:material_base_info.bar_code 为空时,从 material_bar_code 取第一条(参考 StockReceiptOrderApplicationService)
|
||||
// Map<Long, String> materialBarCodeMap = buildMaterialBarCodeMap(materialBaseInfoIdSet);
|
||||
// list.forEach(po -> {
|
||||
// if (StringUtils.isBlank(po.getBarCode()) && po.getMaterialBaseInfoId() != null) {
|
||||
// String barCode = materialBarCodeMap.get(po.getMaterialBaseInfoId());
|
||||
// if (StringUtils.isNotBlank(barCode)) {
|
||||
// po.setBarCode(barCode);
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// 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> batchList = JSON.parseArray(
|
||||
// JSONObject.toJSONString(ajaxResult.get("data")), BatchDetailFeignPO.class);
|
||||
// if (!CollectionUtils.isEmpty(batchList)) {
|
||||
// batchDetailMap.put(materialBaseInfoId, batchList);
|
||||
// }
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.warn("获取物料批次属性失败,materialBaseInfoId={}, error={}", materialBaseInfoId, e.getMessage());
|
||||
// }
|
||||
// }
|
||||
// list.forEach(po -> {
|
||||
// fillMaterialMoreDetailForInventoryQueryPO(po, batchDetailMap);
|
||||
// // 移位数量供 PDA 底部表单区显示,库存查询时等于可用数量
|
||||
// po.setShiftQuantity(po.getAllocationQuantity());
|
||||
// });
|
||||
// }
|
||||
//
|
||||
// private void fillMaterialMoreDetailForInventoryQueryPO(ReservationMaterialInventoryQueryListPO po,
|
||||
// Map<Long, List<BatchDetailFeignPO>> batchDetailMap) {
|
||||
// if (po == null || po.getMaterialBaseInfoId() == null) {
|
||||
// po.setMaterialMoreDetailList(new ArrayList<>());
|
||||
// return;
|
||||
// }
|
||||
// List<MaterialMoreDetailPO> materialMoreDetailList = new ArrayList<>();
|
||||
// List<BatchDetailFeignPO> batchList = batchDetailMap.get(po.getMaterialBaseInfoId());
|
||||
// if (!CollectionUtils.isEmpty(batchList)) {
|
||||
// materialMoreDetailList = filterAndConvertToMaterialMoreDetail(batchList);
|
||||
// }
|
||||
// // 与按单移位一致:净重、毛重、体积、面积、移位数量不放在上面 materialMoreDetailList,由 PO 顶层字段在底部表单区(移入数量、移入库位、容器旁)显示
|
||||
// materialMoreDetailList = excludeWeightVolumeAreaShiftFromList(materialMoreDetailList);
|
||||
// fillAttributeValueFromInventoryQueryPO(po, materialMoreDetailList);
|
||||
// List<MaterialMoreDetailPO> filtered = materialMoreDetailList.stream()
|
||||
// .filter(m -> m.getAttributeValue() != null && !m.getAttributeValue().trim().isEmpty())
|
||||
// .collect(Collectors.toList());
|
||||
// po.setMaterialMoreDetailList(filtered);
|
||||
// }
|
||||
|
||||
/**
|
||||
* 批量查询物料条码,取 material_bar_code 表第一条 barCode(参考 StockReceiptOrderApplicationService)
|
||||
*/
|
||||
// private Map<Long, String> buildMaterialBarCodeMap(Set<Long> materialBaseInfoIdSet) {
|
||||
// Map<Long, String> map = new HashMap<>();
|
||||
// if (materialBaseInfoIdSet == null || materialBaseInfoIdSet.isEmpty()) return map;
|
||||
// for (Long materialBaseInfoId : materialBaseInfoIdSet) {
|
||||
// try {
|
||||
// List<MaterialBarCodePO> list = materialBarCodeService.getInfoByMaterialBaseInfoIds(materialBaseInfoId);
|
||||
// if (!CollectionUtils.isEmpty(list) && StringUtils.isNotBlank(list.get(0).getBarCode())) {
|
||||
// map.put(materialBaseInfoId, list.get(0).getBarCode());
|
||||
// }
|
||||
// } catch (Exception e) {
|
||||
// log.warn("获取物料条码失败,materialBaseInfoId={}, error={}", materialBaseInfoId, e.getMessage());
|
||||
// }
|
||||
// }
|
||||
// return map;
|
||||
// }
|
||||
//
|
||||
// /** 净重、毛重、体积、面积、移位数量在底部表单区显示,从上面 materialMoreDetailList 中排除,与按单移位一致 */
|
||||
// private static final String[] WEIGHT_VOLUME_AREA_SHIFT_LABELS = {
|
||||
// "净重(KG)", "净重", "总净重",
|
||||
// "毛重(KG)", "毛重", "总毛重",
|
||||
// "体积(CBM)", "体积", "总体积",
|
||||
// "面积(SQM)", "面积", "总面积",
|
||||
// "移位数量", "可移位数量"
|
||||
// };
|
||||
//
|
||||
// private List<MaterialMoreDetailPO> excludeWeightVolumeAreaShiftFromList(List<MaterialMoreDetailPO> list) {
|
||||
// if (CollectionUtils.isEmpty(list)) {
|
||||
// return list;
|
||||
// }
|
||||
// return list.stream()
|
||||
// .filter(m -> {
|
||||
// String label = m.getBatchLabels();
|
||||
// if (label == null) return true;
|
||||
// for (String exclude : WEIGHT_VOLUME_AREA_SHIFT_LABELS) {
|
||||
// if (exclude.equals(label.trim())) return false;
|
||||
// }
|
||||
// return true;
|
||||
// })
|
||||
// .collect(Collectors.toList());
|
||||
// }
|
||||
//
|
||||
// private List<MaterialMoreDetailPO> filterAndConvertToMaterialMoreDetail(List<BatchDetailFeignPO> batchList) {
|
||||
// List<MaterialMoreDetailPO> result = new ArrayList<>();
|
||||
// if (CollectionUtils.isEmpty(batchList)) {
|
||||
// return result;
|
||||
// }
|
||||
// for (BatchDetailFeignPO po : batchList) {
|
||||
// if (po.getIsDisplay() == null || po.getIsDisplay() != 1) {
|
||||
// continue;
|
||||
// }
|
||||
// MaterialMoreDetailPO mpo = new MaterialMoreDetailPO();
|
||||
// mpo.setBatchId(po.getBatchId());
|
||||
// mpo.setBatchDetailId(po.getBatchDetailId());
|
||||
// mpo.setBatchLabels(po.getBatchLabels());
|
||||
// mpo.setInputControl(po.getInputControl());
|
||||
// mpo.setAttributeFormat(po.getAttributeFormat());
|
||||
// mpo.setAttributeOption(po.getAttributeOption());
|
||||
// result.add(mpo);
|
||||
// }
|
||||
// return result;
|
||||
// }
|
||||
//
|
||||
// private void fillAttributeValueFromInventoryQueryPO(ReservationMaterialInventoryQueryListPO po,
|
||||
// List<MaterialMoreDetailPO> materialMoreDetailList) {
|
||||
// if (CollectionUtils.isEmpty(materialMoreDetailList)) {
|
||||
// return;
|
||||
// }
|
||||
// for (MaterialMoreDetailPO materialMoreDetail : materialMoreDetailList) {
|
||||
// if (materialMoreDetail.getAttributeValue() != null && !materialMoreDetail.getAttributeValue().trim().isEmpty()) {
|
||||
// continue;
|
||||
// }
|
||||
// String batchLabels = materialMoreDetail.getBatchLabels();
|
||||
// String attributeOption = materialMoreDetail.getAttributeOption();
|
||||
// String refVal = null;
|
||||
// if (StringUtils.isNotBlank(batchLabels)) {
|
||||
// switch (batchLabels.trim()) {
|
||||
// case "Invoice No.":
|
||||
// case "Invoice No":
|
||||
// case "发票号":
|
||||
// refVal = po.getExtAttr1();
|
||||
// break;
|
||||
// case "Batch Ref NO's":
|
||||
// case "Batch Ref NO":
|
||||
// case "批次参考号":
|
||||
// refVal = po.getBatchRefNo();
|
||||
// break;
|
||||
// case "Sheet Ref NO's":
|
||||
// case "Sheet Ref NO":
|
||||
// case "单据参考号":
|
||||
// refVal = po.getSheetRefNo();
|
||||
// break;
|
||||
// case "箱号/卡板号":
|
||||
// case "箱号":
|
||||
// case "卡板号":
|
||||
// refVal = po.getBoxPalletNo();
|
||||
// break;
|
||||
// case "扩展字段1":
|
||||
// case "扩展属性1":
|
||||
// refVal = po.getExtAttr1();
|
||||
// break;
|
||||
// case "扩展字段2":
|
||||
// case "扩展属性2":
|
||||
// refVal = po.getExtAttr2();
|
||||
// break;
|
||||
// case "扩展字段3":
|
||||
// case "扩展属性3":
|
||||
// refVal = po.getExtAttr3() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getExtAttr3()) : null;
|
||||
// break;
|
||||
// case "扩展字段4":
|
||||
// case "扩展属性4":
|
||||
// refVal = po.getExtAttr4() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getExtAttr4()) : null;
|
||||
// break;
|
||||
// case "生产日期":
|
||||
// refVal = po.getProductionDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getProductionDate()) : null;
|
||||
// break;
|
||||
// case "过期日期":
|
||||
// refVal = po.getExpiryDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getExpiryDate()) : null;
|
||||
// break;
|
||||
// case "存货日期":
|
||||
// refVal = po.getInventoryDate() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getInventoryDate()) : null;
|
||||
// break;
|
||||
// case "批次号":
|
||||
// refVal = po.getBatchNumber();
|
||||
// break;
|
||||
// case "总净重":
|
||||
// case "净重(KG)":
|
||||
// case "净重":
|
||||
// refVal = po.getNetWeight() != null ? po.getNetWeight().toString() : null;
|
||||
// break;
|
||||
// case "总毛重":
|
||||
// case "毛重(KG)":
|
||||
// case "毛重":
|
||||
// refVal = po.getGrossWeight() != null ? po.getGrossWeight().toString() : null;
|
||||
// break;
|
||||
// case "总体积":
|
||||
// case "体积(CBM)":
|
||||
// case "体积":
|
||||
// refVal = po.getVolume() != null ? po.getVolume().toString() : null;
|
||||
// break;
|
||||
// case "总面积":
|
||||
// case "面积(SQM)":
|
||||
// case "面积":
|
||||
// refVal = po.getArea() != null ? po.getArea().toString() : null;
|
||||
// break;
|
||||
// default:
|
||||
// if ("InvoiceNo".equalsIgnoreCase(attributeOption)) refVal = po.getExtAttr1();
|
||||
// else if ("BatchRefNo".equalsIgnoreCase(attributeOption)) refVal = po.getBatchRefNo();
|
||||
// else if ("SheetRefNo".equalsIgnoreCase(attributeOption)) refVal = po.getSheetRefNo();
|
||||
// else if ("BoxPalletNo".equalsIgnoreCase(attributeOption)) refVal = po.getBoxPalletNo();
|
||||
// else if ("ProductionDate".equalsIgnoreCase(attributeOption) && po.getProductionDate() != null)
|
||||
// refVal = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getProductionDate());
|
||||
// else if ("ExpiryDate".equalsIgnoreCase(attributeOption) && po.getExpiryDate() != null)
|
||||
// refVal = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getExpiryDate());
|
||||
// else if ("InventoryDate".equalsIgnoreCase(attributeOption) && po.getInventoryDate() != null)
|
||||
// refVal = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(po.getInventoryDate());
|
||||
// else if ("NetWeight".equalsIgnoreCase(attributeOption) && po.getNetWeight() != null) refVal = po.getNetWeight().toString();
|
||||
// else if ("GrossWeight".equalsIgnoreCase(attributeOption) && po.getGrossWeight() != null) refVal = po.getGrossWeight().toString();
|
||||
// else if ("Volume".equalsIgnoreCase(attributeOption) && po.getVolume() != null) refVal = po.getVolume().toString();
|
||||
// else if ("Area".equalsIgnoreCase(attributeOption) && po.getArea() != null) refVal = po.getArea().toString();
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
// if (refVal != null) {
|
||||
// materialMoreDetail.setAttributeValue(refVal);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
/**
|
||||
* 获取物料库存详细信息
|
||||
*/
|
||||
public Boolean omsEdit(MaterialInventoryOmsParamDO materialInventoryOmsParamDO)
|
||||
{
|
||||
return materialInventoryDomainService.omsEdit(materialInventoryOmsParamDO);
|
||||
}
|
||||
}
|
||||
+73
@@ -0,0 +1,73 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.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.reservationMaterialInventory.repository.todo.MaterialInventoryQueryListDO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialInventoryQueryListDTO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDTO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 物料库存Assembler
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
@Component
|
||||
public class ReservationMaterialInventoryAssembler {
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
public ReservationMaterialInventoryDO toDO(ReservationMaterialInventoryDTO materialInventoryDTO) {
|
||||
ReservationMaterialInventoryDO materialInventoryDO = new ReservationMaterialInventoryDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(materialInventoryDTO, materialInventoryDO, IgnoreNullUtil.getNullPropertyNames(materialInventoryDTO));
|
||||
return materialInventoryDO;
|
||||
}
|
||||
|
||||
/**
|
||||
* 转换实体
|
||||
*/
|
||||
public ReservationMaterialInventoryDO toDOByEdit(ReservationMaterialInventoryDTO materialInventoryDTO) {
|
||||
ReservationMaterialInventoryDO materialInventoryDO = new ReservationMaterialInventoryDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(materialInventoryDTO, materialInventoryDO, IgnoreNullUtil.getNullPropertyNames(materialInventoryDTO));
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (ObjectUtil.isNull(loginUser)) {
|
||||
throw new DigitalLogisticsException(UserError.TIMEOUT);
|
||||
}
|
||||
String userName = loginUser.getUsername();
|
||||
// 获取登录人id
|
||||
Long userId = loginUser.getUserid();
|
||||
if(materialInventoryDTO.getMaterialInventoryId() != null){
|
||||
materialInventoryDO.setUpdateBy(userId);
|
||||
materialInventoryDO.setUpdateByName(userName);
|
||||
materialInventoryDO.setUpdateTime(new Date());
|
||||
}else {
|
||||
materialInventoryDO.setOrganizationId(loginUser.getUserPo().getOrganizationId());
|
||||
materialInventoryDO.setOrganizationName(loginUser.getUserPo().getOrganizationName());
|
||||
materialInventoryDO.setTopOrganizationId(loginUser.getUserPo().getTopOrganizationId());
|
||||
materialInventoryDO.setCreateBy(userId);
|
||||
materialInventoryDO.setCreateByName(userName);
|
||||
materialInventoryDO.setCreateTime(new Date());
|
||||
materialInventoryDO.setDelFlag(1);
|
||||
}
|
||||
return materialInventoryDO;
|
||||
}
|
||||
|
||||
public MaterialInventoryQueryListDO toDOByQueryList(MaterialInventoryQueryListDTO materialInventoryQueryListDTO) {
|
||||
MaterialInventoryQueryListDO materialInventoryQueryListDO = new MaterialInventoryQueryListDO();
|
||||
// 拷贝
|
||||
BeanUtils.copyProperties(materialInventoryQueryListDTO, materialInventoryQueryListDO, IgnoreNullUtil.getNullPropertyNames(materialInventoryQueryListDTO));
|
||||
return materialInventoryQueryListDO;
|
||||
}
|
||||
}
|
||||
+113
@@ -0,0 +1,113 @@
|
||||
package com.mhd.oms.domain.reservationMaterialInventory.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.entity.ReservationMaterialInventory;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.facade.IReservationMaterialInventoryService;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryPO;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料库存
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
@Service
|
||||
@Slf4j
|
||||
public class ReservationMaterialInventoryDomainService {
|
||||
|
||||
@Autowired
|
||||
private IReservationMaterialInventoryService materialInventoryService;
|
||||
|
||||
|
||||
/**
|
||||
* 分页查询物料库存列表
|
||||
*/
|
||||
public List<ReservationMaterialInventoryPO> queryList(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
return materialInventoryService.queryList(materialInventoryDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 新增物料库存
|
||||
*/
|
||||
public Boolean insert(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
|
||||
return materialInventoryService.insert(materialInventoryDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料库存
|
||||
*/
|
||||
public Boolean update(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
return materialInventoryService.update(materialInventoryDO);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料库存
|
||||
*/
|
||||
public Boolean delete(Long[] materialInventoryIds) {
|
||||
return materialInventoryService.delete(materialInventoryIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料库存详细信息
|
||||
*/
|
||||
public ReservationMaterialInventoryPO getInfo(Long materialInventoryId)
|
||||
{
|
||||
return materialInventoryService.getInfo(materialInventoryId);
|
||||
}
|
||||
|
||||
public Boolean omsEdit(MaterialInventoryOmsParamDO materialInventoryOmsParamDO)
|
||||
{
|
||||
return materialInventoryService.omsEdit(materialInventoryOmsParamDO);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据库位Id和物料基础信息Id 获取物料库存详细信息
|
||||
*/
|
||||
public BigDecimal getInventoryByStorageLocationIdAndMaterialBaseInfoId(Long storageLocationId, Long materialBaseInfoId) {
|
||||
ReservationMaterialInventory materialInventory = materialInventoryService.getOne(new QueryWrapper<ReservationMaterialInventory>().lambda()
|
||||
.select(ReservationMaterialInventory::getAllocationQuantity)
|
||||
.eq(ReservationMaterialInventory::getStorageLocationId, storageLocationId)
|
||||
.eq(ReservationMaterialInventory::getMaterialBaseInfoId, materialBaseInfoId)
|
||||
.eq(ReservationMaterialInventory::getDelFlag, 1));
|
||||
if (materialInventory == null){
|
||||
return BigDecimal.ZERO;
|
||||
}
|
||||
return materialInventory.getInventoryQuantity();
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:库存查询列表
|
||||
* @param materialInventoryQueryListDO
|
||||
* @return: java.util.List<com.mhd.wms.domain.materialInventory.repository.po.ReservationMaterialInventoryQueryListPO>
|
||||
* @author: lianzj
|
||||
* @time: 2024-07-16 14:45:23
|
||||
*/
|
||||
// public List<ReservationMaterialInventoryQueryListPO> materialQueryList(ReservationMaterialInventoryQueryListDO materialInventoryQueryListDO) {
|
||||
// return materialInventoryService.materialQueryList(materialInventoryQueryListDO);
|
||||
// }
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 分页查询即时库存列表
|
||||
// */
|
||||
// public List<ImmediateInventoryPO> queryImmediateInventoryList(ImmediateInventoryDO immediateInventoryDO) {
|
||||
// return materialInventoryService.queryImmediateInventoryList(immediateInventoryDO);
|
||||
// }
|
||||
//
|
||||
// public ReservationMaterialInventoryPO selectOneByWhere(ReservationMaterialInventoryDO materialInventoryDO) {
|
||||
// return materialInventoryService.selectOneByWhere(materialInventoryDO);
|
||||
// }
|
||||
}
|
||||
+3
@@ -1,5 +1,6 @@
|
||||
package com.mhd.oms.interfaces.dto.businessDocumentAddressMulti;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
@@ -18,4 +19,6 @@ public class BusinessAuditDTO {
|
||||
private Long reviewStatus;
|
||||
private String salesManagerName;
|
||||
private String reviewOpinionName;
|
||||
@ApiModelProperty("组织id")
|
||||
private Long organizationId;
|
||||
}
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ public class BusinessDocumentOrderApi extends BaseController{
|
||||
@PostMapping("/executeAndIssue")
|
||||
public AjaxResult executeAndIssue(@RequestBody BusinessAuditDTO businessAuditDTO)
|
||||
{
|
||||
return toAjax(businessDocumentOrderApplicationService.executeAndIssue(businessAuditDTO.getIds()));
|
||||
return toAjax(businessDocumentOrderApplicationService.executeAndIssue(businessAuditDTO.getIds(),businessAuditDTO.getOrganizationId()));
|
||||
}
|
||||
|
||||
@ApiOperation("获取业务单的货物内容")
|
||||
|
||||
+1
-1
@@ -96,7 +96,7 @@ public class ExecuteOrderApi extends BaseController{
|
||||
@PostMapping("/issueDocuments")
|
||||
public AjaxResult issueDocuments(@RequestBody BusinessAuditDTO businessAuditDTO)
|
||||
{
|
||||
return toAjax(executeOrderApplicationService.issueDocuments(businessAuditDTO.getIds()));
|
||||
return toAjax(executeOrderApplicationService.issueDocuments(businessAuditDTO.getIds(),businessAuditDTO.getOrganizationId()));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+120
@@ -0,0 +1,120 @@
|
||||
package com.mhd.oms.interfaces.facade.inventoryAdjustmentRecord;
|
||||
|
||||
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.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDTO;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service.ReservationInventoryAdjustmentRecordApplicationService;
|
||||
import com.mhd.oms.domain.reservationInventoryAdjustmentRecord.service.ReservationInventoryAdjustmentRecordAssembler;
|
||||
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;
|
||||
|
||||
/**
|
||||
* 库存调整记录
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-07-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/reservationInventoryAdjustmentRecordApi")
|
||||
public class ReservationInventoryAdjustmentRecordApi extends BaseController {
|
||||
@Autowired
|
||||
private ReservationInventoryAdjustmentRecordApplicationService inventoryAdjustmentRecordApplicationService;
|
||||
|
||||
@Resource
|
||||
private ReservationInventoryAdjustmentRecordAssembler inventoryAdjustmentRecordAssembler;
|
||||
|
||||
/**
|
||||
* 分页查询库存调整记录列表
|
||||
*/
|
||||
@ApiOperation("查询库存调整记录列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO)
|
||||
{
|
||||
//转换实体
|
||||
ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = inventoryAdjustmentRecordAssembler.toDO(inventoryAdjustmentRecordDTO);
|
||||
startPage();
|
||||
List<ReservationInventoryAdjustmentRecordPO> list = inventoryAdjustmentRecordApplicationService.queryList(inventoryAdjustmentRecordDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑库存调整记录
|
||||
*/
|
||||
@ApiOperation("编辑库存调整记录")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO)
|
||||
{
|
||||
//转换实体
|
||||
ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = inventoryAdjustmentRecordAssembler.toDO(inventoryAdjustmentRecordDTO);
|
||||
if(inventoryAdjustmentRecordDTO.getInventoryAdjustmentId() != null){
|
||||
return toAjax(inventoryAdjustmentRecordApplicationService.update(inventoryAdjustmentRecordDO));
|
||||
} else {
|
||||
return toAjax(inventoryAdjustmentRecordApplicationService.insert(inventoryAdjustmentRecordDO));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除库存调整记录
|
||||
*/
|
||||
@ApiOperation("批量删除库存调整记录")
|
||||
@DeleteMapping("/deleteByIds/{inventoryAdjustmentIds}")
|
||||
public AjaxResult delete(@PathVariable Long[] inventoryAdjustmentIds)
|
||||
{
|
||||
return toAjax(inventoryAdjustmentRecordApplicationService.delete(inventoryAdjustmentIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取库存调整记录详细信息
|
||||
*/
|
||||
@ApiOperation("获取库存调整记录")
|
||||
@GetMapping(value = "/getInfo/{inventoryAdjustmentId}")
|
||||
public AjaxResult getInfo(@PathVariable("inventoryAdjustmentId") Long inventoryAdjustmentId)
|
||||
{
|
||||
return AjaxResult.success(inventoryAdjustmentRecordApplicationService.getInfo(inventoryAdjustmentId));
|
||||
}
|
||||
|
||||
/**
|
||||
* @description:库存调整
|
||||
* @param inventoryAdjustmentRecordDTO
|
||||
* @return: com.mhd.common.core.web.domain.AjaxResult
|
||||
* @author: lianzj
|
||||
* @time: 2024-07-18 9:28:47
|
||||
*/
|
||||
// @ApiOperation("库存调整")
|
||||
// @PostMapping("/inventoryAdjust")
|
||||
// public AjaxResult inventoryAdjust(@RequestBody ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO)
|
||||
// {
|
||||
// //转换实体
|
||||
// ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = inventoryAdjustmentRecordAssembler.toDO(inventoryAdjustmentRecordDTO);
|
||||
// return AjaxResult.success(inventoryAdjustmentRecordApplicationService.inventoryAdjust(inventoryAdjustmentRecordDO));
|
||||
// }
|
||||
|
||||
|
||||
/**
|
||||
* @description:库存冻结
|
||||
* @param inventoryAdjustmentRecordDTO
|
||||
* @return: com.mhd.common.core.web.domain.AjaxResult
|
||||
* @author: lianzj
|
||||
* @time: 2024-07-18 14:57:51
|
||||
*/
|
||||
// @ApiOperation("库存冻结")
|
||||
// @PostMapping("/inventoryFrozen")
|
||||
// public AjaxResult inventoryFrozen(@RequestBody ReservationInventoryAdjustmentRecordDTO inventoryAdjustmentRecordDTO)
|
||||
// {
|
||||
// //转换实体
|
||||
// ReservationInventoryAdjustmentRecordDO inventoryAdjustmentRecordDO = inventoryAdjustmentRecordAssembler.toDO(inventoryAdjustmentRecordDTO);
|
||||
// return AjaxResult.success(inventoryAdjustmentRecordApplicationService.inventoryFrozenForAll(inventoryAdjustmentRecordDO));
|
||||
// }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
+194
@@ -0,0 +1,194 @@
|
||||
package com.mhd.oms.interfaces.facade.reservationMaterialInventory;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.mhd.common.core.domain.po.UserPo;
|
||||
import com.mhd.common.core.utils.StringUtils;
|
||||
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.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDTO;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.service.ReservationMaterialInventoryApplicationService;
|
||||
import com.mhd.oms.domain.reservationMaterialInventory.service.ReservationMaterialInventoryAssembler;
|
||||
import com.mhd.system.api.UserServiceFeign;
|
||||
import com.mhd.system.api.domain.MaterialInventoryDTO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryPO;
|
||||
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.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 物料库存Api
|
||||
*
|
||||
* @author gen
|
||||
* @date 2024-05-29
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/materialInventoryApi")
|
||||
@Slf4j
|
||||
public class ReservationMaterialInventoryApi extends BaseController {
|
||||
@Autowired
|
||||
private ReservationMaterialInventoryApplicationService materialInventoryApplicationService;
|
||||
|
||||
@Resource
|
||||
private ReservationMaterialInventoryAssembler materialInventoryAssembler;
|
||||
|
||||
@Autowired
|
||||
private UserServiceFeign userServiceFeign;
|
||||
|
||||
/**
|
||||
* 分页查询物料库存列表
|
||||
*/
|
||||
@ApiOperation("查询物料库存列表")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ReservationMaterialInventoryDTO materialInventoryDTO,
|
||||
@RequestParam(value = "customerName", required = false) String customerName)
|
||||
{
|
||||
// 出库分配前端传的是客户名称 customerName,这里通过名称查询货主ID,使用精确匹配(不模糊匹配)
|
||||
String shipperName = null; // 保存查询到的货主名称
|
||||
if (StringUtils.isNotBlank(customerName) && materialInventoryDTO.getShipperId() == null) {
|
||||
try {
|
||||
AjaxResult ajaxResult = userServiceFeign.getInfoByName(customerName);
|
||||
if ("200".equals(String.valueOf(ajaxResult.get("code"))) && ajaxResult.get("data") != null) {
|
||||
UserPo userPo = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), UserPo.class);
|
||||
if (userPo != null && userPo.getUserId() != null) {
|
||||
materialInventoryDTO.setShipperId(userPo.getUserId());
|
||||
// 获取货主名称:优先使用企业名称,如果没有则使用用户名称
|
||||
shipperName = StringUtils.isNotBlank(userPo.getShipperEnterpriseName())
|
||||
? userPo.getShipperEnterpriseName()
|
||||
: userPo.getUserName();
|
||||
log.info("根据客户名称查询到货主信息,客户名称:{},货主ID:{},货主名称:{}",
|
||||
customerName, userPo.getUserId(), shipperName);
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.warn("根据客户名称查询货主ID失败,客户名称:{},错误:{}", customerName, e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//转换实体
|
||||
ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
|
||||
startPage();
|
||||
// 使用带批次属性的查询方法,批次属性值从库存表中获取
|
||||
List<ReservationMaterialInventoryPO> list = materialInventoryApplicationService.queryListWithBatchAttributes(materialInventoryDO);
|
||||
// 按更新时间倒序排序;update_time 为空的数据放最后
|
||||
list.sort((o1, o2) -> {
|
||||
Date t1 = o1.getUpdateTime();
|
||||
Date t2 = o2.getUpdateTime();
|
||||
if (t1 == null && t2 == null) return 0;
|
||||
if (t1 == null) return 1;
|
||||
if (t2 == null) return -1;
|
||||
return t2.compareTo(t1); // desc
|
||||
});
|
||||
TableDataInfo tableDataInfo = getDataTable(list);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
@ApiOperation("查询物料库存列表不分页")
|
||||
@GetMapping("/listAll")
|
||||
public TableDataInfo listAll(ReservationMaterialInventoryDTO materialInventoryDTO)
|
||||
{
|
||||
//转换实体
|
||||
ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
|
||||
List<ReservationMaterialInventoryPO> list = materialInventoryApplicationService.queryList(materialInventoryDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑物料库存
|
||||
*/
|
||||
@ApiOperation("编辑物料库存")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody ReservationMaterialInventoryDTO materialInventoryDTO)
|
||||
{
|
||||
//转换实体
|
||||
ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDOByEdit(materialInventoryDTO);
|
||||
if(materialInventoryDTO.getMaterialInventoryId() != null){
|
||||
return toAjax(materialInventoryApplicationService.update(materialInventoryDO));
|
||||
}else {
|
||||
// 新增时补齐更新时间(update_time),避免新增数据 update_time 为空
|
||||
materialInventoryDO.setUpdateTime(new Date());
|
||||
// update_by/update_by_name 与 create_by/create_by_name 保持一致
|
||||
materialInventoryDO.setUpdateBy(materialInventoryDO.getCreateBy());
|
||||
materialInventoryDO.setUpdateByName(materialInventoryDO.getCreateByName());
|
||||
return toAjax(materialInventoryApplicationService.insert(materialInventoryDO));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料库存
|
||||
*/
|
||||
@ApiOperation("批量删除物料库存")
|
||||
@DeleteMapping("/deleteByIds/{materialInventoryIds}")
|
||||
public AjaxResult delete(@PathVariable Long[] materialInventoryIds)
|
||||
{
|
||||
return toAjax(materialInventoryApplicationService.delete(materialInventoryIds));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料库存详细信息
|
||||
*/
|
||||
@ApiOperation("获取物料库存")
|
||||
@GetMapping(value = "/getInfo/{materialInventoryId}")
|
||||
public AjaxResult getInfo(@PathVariable("materialInventoryId") Long materialInventoryId)
|
||||
{
|
||||
return AjaxResult.success(materialInventoryApplicationService.getInfo(materialInventoryId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据库位Id和物料基础信息Id 获取物料库存详细信息
|
||||
*/
|
||||
@ApiOperation("根据库位Id和物料基础信息Id 获取物料库存详细信息")
|
||||
@GetMapping(value = "/getInventory/{storageLocationId}/{materialBaseInfoId}")
|
||||
public AjaxResult getInventoryByStorageLocationIdAndMaterialBaseInfoId(@PathVariable("storageLocationId") Long storageLocationId, @PathVariable("materialBaseInfoId") Long materialBaseInfoId)
|
||||
{
|
||||
return AjaxResult.success(materialInventoryApplicationService.getInventoryByStorageLocationIdAndMaterialBaseInfoId(storageLocationId, materialBaseInfoId));
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 分页库存列表
|
||||
*/
|
||||
// @ApiOperation("查询库存列表")
|
||||
// @GetMapping("/queryList")
|
||||
// public TableDataInfo queryList(MaterialInventoryQueryListDTO materialInventoryQueryListDTO)
|
||||
// {
|
||||
// //转换实体
|
||||
// MaterialInventoryQueryListDO materialInventoryQueryListDO = materialInventoryAssembler.toDOByQueryList(materialInventoryQueryListDTO);
|
||||
// startPage();
|
||||
// List<ReservationMaterialInventoryQueryListPO> list = materialInventoryApplicationService.materialQueryList(materialInventoryQueryListDO);
|
||||
// return getDataTable(list);
|
||||
// }
|
||||
|
||||
@ApiOperation("查询物料库存数量")
|
||||
@GetMapping("/sumInventoryQuantity")
|
||||
public AjaxResult sumInventoryQuantity(ReservationMaterialInventoryDTO materialInventoryDTO)
|
||||
{
|
||||
//转换实体
|
||||
ReservationMaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
|
||||
return AjaxResult.success(materialInventoryApplicationService.sumInventoryQuantity(materialInventoryDO));
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑物料库存
|
||||
*/
|
||||
@ApiOperation("编辑物料库存")
|
||||
@PostMapping("/omsEdit")
|
||||
public AjaxResult omsEdit(@RequestBody MaterialInventoryOmsParamDO materialInventoryOmsParamDO)
|
||||
{
|
||||
materialInventoryApplicationService.omsEdit(materialInventoryOmsParamDO);
|
||||
return AjaxResult.success();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -104,4 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<include refid="selectExecuteOrderPo1"/>
|
||||
order by CREATE_TIME desc
|
||||
</select>
|
||||
<select id="getOrgNameByOrgId" resultType="java.lang.String">
|
||||
select ORGANIZATION_NAME from NGWL_TEST_PRODUCT.SYS_ORGANIZATION where ORGANIZATION_ID=#{organizationId}
|
||||
</select>
|
||||
</mapper>
|
||||
+202
@@ -0,0 +1,202 @@
|
||||
<?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.reservationInventoryAdjustmentRecord.repository.mapper.ReservationInventoryAdjustmentRecordMapper">
|
||||
|
||||
<resultMap type="com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.po.ReservationInventoryAdjustmentRecordPO" id="InventoryAdjustmentRecordResult">
|
||||
<result property="inventoryAdjustmentId" column="inventory_adjustment_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="materialInventoryId" column="material_inventory_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="shipperId" column="shipper_id" />
|
||||
<result property="shipperName" column="shipper_name" />
|
||||
<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="adjustType" column="adjust_type" />
|
||||
<result property="adjustDirection" column="adjust_direction" />
|
||||
<result property="adjustBeforeStatusCode" column="adjust_before_status_code" />
|
||||
<result property="adjustBeforeStatusName" column="adjust_before_status_name" />
|
||||
<result property="adjustAfterStatusCode" column="adjust_after_status_code" />
|
||||
<result property="adjustAfterStatusName" column="adjust_after_status_name" />
|
||||
<result property="inventoryBeforeQuantity" column="inventory_before_quantity" />
|
||||
<result property="allocationBeforeQuantity" column="allocation_before_quantity" />
|
||||
<result property="freezeBeforeQuantity" column="freeze_before_quantity" />
|
||||
<result property="inventoryAfterQuantity" column="inventory_after_quantity" />
|
||||
<result property="allocationAfterQuantity" column="allocation_after_quantity" />
|
||||
<result property="freezeAfterQuantity" column="freeze_after_quantity" />
|
||||
<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="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="productionDate" column="production_date" />
|
||||
<result property="expiryDate" column="expiry_date" />
|
||||
<result property="inventoryDate" column="inventory_date" />
|
||||
<result property="batchRefNo" column="batch_ref_no" />
|
||||
<result property="sheetRefNo" column="sheet_ref_no" />
|
||||
<result property="boxPalletNo" column="box_pallet_no" />
|
||||
<result property="adjustAction" column="adjust_action" />
|
||||
<result property="relateNo" column="relate_no" />
|
||||
<result property="inOrderNumber" column="in_order_number" />
|
||||
<result property="lotNumber" column="lot_number" />
|
||||
<result property="batchNumber" column="batch_number" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectInventoryAdjustmentRecordPo">
|
||||
select a.inventory_adjustment_id, a.organization_id, a.organization_name, a.top_organization_id, a.material_inventory_id,
|
||||
a.material_base_info_id, a.material_code, a.material_name, a.bar_code, a.shipper_id, a.shipper_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.adjust_type, a.adjust_direction, a.adjust_before_status_code,
|
||||
a.adjust_before_status_name, a.adjust_after_status_code, a.adjust_after_status_name, a.inventory_before_quantity,
|
||||
a.allocation_before_quantity, a.freeze_before_quantity, a.inventory_after_quantity, a.allocation_after_quantity,
|
||||
a.freeze_after_quantity, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name,
|
||||
a.del_flag,a.net_weight,
|
||||
a.gross_weight,
|
||||
a.volume,
|
||||
a.area,
|
||||
a.adjusted_net_weight,
|
||||
a.adjusted_gross_weight,
|
||||
a.adjusted_volume,
|
||||
a.adjusted_area,
|
||||
b.ext_attr_1, b.ext_attr_2, b.ext_attr_3, b.ext_attr_4,
|
||||
b.production_date, b.expiry_date, b.inventory_date,
|
||||
b.batch_ref_no, b.sheet_ref_no, b.box_pallet_no,a.ADJUST_ACTION,a.RELATE_NO,
|
||||
a.in_order_number,a.lot_number,b.batch_number
|
||||
from inventory_adjustment_record a left join material_inventory b on a.material_inventory_id = b.material_inventory_id
|
||||
where a.del_flag = 1
|
||||
</sql>
|
||||
|
||||
<sql id="selectInventoryAdjustmentRecordPo1">
|
||||
<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="materialBaseInfoId != null ">
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialInventoryId != null ">
|
||||
and a.material_inventory_id = #{materialInventoryId}
|
||||
</if>
|
||||
<if test="materialCode != null and materialCode != ''">
|
||||
and a.material_code = #{materialCode}
|
||||
</if>
|
||||
<if test="adjustAction != null and adjustAction != ''">
|
||||
and a.adjust_action = #{adjustAction}
|
||||
</if>
|
||||
<if test="relateNo != null and relateNo != ''">
|
||||
and a.relate_no = #{relateNo}
|
||||
</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="shipperId != null ">
|
||||
and a.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="shipperName != null and shipperName != ''">
|
||||
and a.shipper_name like concat('%', #{shipperName}, '%')
|
||||
</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="adjustType != null ">
|
||||
and a.adjust_type = #{adjustType}
|
||||
</if>
|
||||
<if test="adjustDirection != null ">
|
||||
and a.adjust_direction = #{adjustDirection}
|
||||
</if>
|
||||
<if test="adjustBeforeStatusCode != null ">
|
||||
and a.adjust_before_status_code = #{adjustBeforeStatusCode}
|
||||
</if>
|
||||
<if test="adjustBeforeStatusName != null ">
|
||||
and a.adjust_before_status_name = #{adjustBeforeStatusName}
|
||||
</if>
|
||||
<if test="adjustAfterStatusCode != null ">
|
||||
and a.adjust_after_status_code = #{adjustAfterStatusCode}
|
||||
</if>
|
||||
<if test="adjustAfterStatusName != null ">
|
||||
and a.adjust_after_status_name = #{adjustAfterStatusName}
|
||||
</if>
|
||||
<if test="inventoryBeforeQuantity != null ">
|
||||
and a.inventory_before_quantity = #{inventoryBeforeQuantity}
|
||||
</if>
|
||||
<if test="allocationBeforeQuantity != null ">
|
||||
and a.allocation_before_quantity = #{allocationBeforeQuantity}
|
||||
</if>
|
||||
<if test="freezeBeforeQuantity != null ">
|
||||
and a.freeze_before_quantity = #{freezeBeforeQuantity}
|
||||
</if>
|
||||
<if test="inventoryAfterQuantity != null ">
|
||||
and a.inventory_after_quantity = #{inventoryAfterQuantity}
|
||||
</if>
|
||||
<if test="allocationAfterQuantity != null ">
|
||||
and a.allocation_after_quantity = #{allocationAfterQuantity}
|
||||
</if>
|
||||
<if test="freezeAfterQuantity != null ">
|
||||
and a.freeze_after_quantity = #{freezeAfterQuantity}
|
||||
</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>
|
||||
order by a.create_time desc
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.oms.domain.reservationInventoryAdjustmentRecord.repository.todo.ReservationInventoryAdjustmentRecordDO" resultMap="InventoryAdjustmentRecordResult">
|
||||
<include refid="selectInventoryAdjustmentRecordPo"/>
|
||||
<include refid="selectInventoryAdjustmentRecordPo1"/>
|
||||
</select>
|
||||
</mapper>
|
||||
+404
@@ -0,0 +1,404 @@
|
||||
<?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.reservationMaterialInventory.repository.mapper.ReservationMaterialInventoryMapper">
|
||||
|
||||
<resultMap type="com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryPO" id="MaterialInventoryResult">
|
||||
<result property="materialInventoryId" column="material_inventory_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="shipperId" column="shipper_id" />
|
||||
<result property="shipperCode" column="shipper_code" />
|
||||
<result property="shipperName" column="shipper_name" />
|
||||
<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="materialBaseInfoId" column="material_base_info_id" />
|
||||
<result property="materialDetailId" column="material_detail_id" />
|
||||
|
||||
<result property="batchNumber" column="batch_number" />
|
||||
<result property="materialStatusCode" column="material_status_code" />
|
||||
<result property="materialStatusName" column="material_status_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="freezeQuantity" column="freeze_quantity" />
|
||||
|
||||
<result property="inventoryQuantity" column="inventory_quantity" />
|
||||
<result property="allocationQuantity" column="allocation_quantity" />
|
||||
<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="isAble" column="is_able" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="netWeight" column="net_weight" />
|
||||
<result property="grossWeight" column="gross_weight" />
|
||||
<result property="volume" column="volume" />
|
||||
<result property="area" column="area" />
|
||||
<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="productionDate" column="production_date" />
|
||||
<result property="expiryDate" column="expiry_date" />
|
||||
<result property="inventoryDate" column="inventory_date" />
|
||||
<result property="batchRefNo" column="batch_ref_no" />
|
||||
<result property="sheetRefNo" column="sheet_ref_no" />
|
||||
<result property="boxPalletNo" column="box_pallet_no" />
|
||||
<result property="packName" column="pack_name" />
|
||||
<result property="unitName" column="unit_name" />
|
||||
<result property="barCode" column="inv_bar_code" />
|
||||
<result property="inOrderNumber" column="in_order_number" />
|
||||
<result property="lotNumber" column="lot_number" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
<sql id="selectMaterialInventoryPo">
|
||||
a.material_inventory_id, a.organization_id, a.organization_name, a.top_organization_id,
|
||||
a.shipper_id, a.shipper_code, a.shipper_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.material_base_info_id,a.material_detail_id,
|
||||
a.batch_number,a.material_status_code,a.material_status_name,a.container_id,a.container_code,a.container_type,a.container_type_name
|
||||
,IFNULL (sum(a.freeze_quantity), 0) freeze_quantity,a.is_able,
|
||||
IFNULL (sum(a.inventory_quantity), 0) inventory_quantity,
|
||||
IFNULL (sum(a.allocation_quantity), 0) allocation_quantity,
|
||||
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.unit,
|
||||
IFNULL (sum(a.area), 0) area,
|
||||
IFNULL (sum(a.NET_WEIGHT), 0) NET_WEIGHT,
|
||||
IFNULL (sum(a.GROSS_WEIGHT), 0) GROSS_WEIGHT,
|
||||
IFNULL (sum(a.VOLUME), 0) VOLUME,
|
||||
a.ext_attr_1, a.ext_attr_2, a.ext_attr_3, a.ext_attr_4,
|
||||
a.production_date, a.expiry_date, a.inventory_date,
|
||||
a.BATCH_REF_NO, a.SHEET_REF_NO, a.BOX_PALLET_NO,nvl(a.unit_name,b.unit_name) as unit_name,
|
||||
a.bar_code as inv_bar_code,
|
||||
a.in_order_number,a.lot_number
|
||||
</sql>
|
||||
|
||||
<sql id="selectMaterialInventoryPo1">
|
||||
<if test="materialInventoryId != null ">
|
||||
and a.material_inventory_id = #{materialInventoryId}
|
||||
</if>
|
||||
<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="warehouseId != null ">
|
||||
and a.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and a.shipper_id = #{shipperId}
|
||||
</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="materialBaseInfoId != null ">
|
||||
and a.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialDetailId != null ">
|
||||
and a.material_detail_id, = #{materialDetailId}
|
||||
</if>
|
||||
<!-- 容器号或批次号:containerOrBatch 优先;若 batchNumber 与 containerCode 相同则按 OR 查(PDA 单输入框传两个相同值) -->
|
||||
<choose>
|
||||
<when test="containerOrBatch != null and containerOrBatch != ''">
|
||||
and (a.container_code like concat('%', #{containerOrBatch}, '%') or a.batch_number like concat('%', #{containerOrBatch}, '%'))
|
||||
</when>
|
||||
<when test="batchNumber != null and batchNumber != '' and containerCode != null and containerCode != '' and batchNumber == containerCode">
|
||||
and (a.batch_number like concat('%', #{batchNumber}, '%') or a.container_code like concat('%', #{containerCode}, '%'))
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="batchNumber != null and batchNumber != ''">
|
||||
and a.batch_number like concat('%', #{batchNumber}, '%')
|
||||
</if>
|
||||
<if test="containerCode != null and containerCode != ''">
|
||||
and a.container_code like concat('%', #{containerCode}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="materialStatusCode != null and materialStatusCode != ''">
|
||||
and a.material_status_code like concat('%', #{materialStatusCode}, '%')
|
||||
</if>
|
||||
<if test="materialStatusName != null and materialStatusName != ''">
|
||||
and a.material_status_name like concat('%', #{materialStatusName}, '%')
|
||||
</if>
|
||||
<if test="containerId != null ">
|
||||
and a.container_id = #{containerId}
|
||||
</if>
|
||||
<if test="containerType != null and containerType != ''">
|
||||
and a.container_type like concat('%', #{containerType}, '%')
|
||||
</if>
|
||||
<if test="containerTypeName != null and containerTypeName != ''">
|
||||
and a.container_type_name like concat('%', #{containerTypeName}, '%')
|
||||
</if>
|
||||
<choose>
|
||||
<when test="inventoryQuantity != null"> and a.inventory_quantity = #{inventoryQuantity} </when>
|
||||
<otherwise> and a.inventory_quantity != 0 </otherwise>
|
||||
</choose>
|
||||
<if test="allocationQuantity != null ">
|
||||
and a.allocation_quantity = #{allocationQuantity}
|
||||
</if>
|
||||
<if test="freezeQuantity != null ">
|
||||
and a.freeze_quantity = #{freezeQuantity}
|
||||
</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>
|
||||
<choose>
|
||||
<when test="delFlag != null"> and a.del_flag = #{delFlag} </when>
|
||||
<otherwise> and a.del_flag = 1 </otherwise>
|
||||
</choose>
|
||||
<if test="storageInfo != null and storageInfo != ''">
|
||||
and (a.storage_location_code = #{storageInfo} or material_code = #{storageInfo} or material_name like concat('%', #{storageInfo}, '%') or bar_code = #{storageInfo})
|
||||
</if>
|
||||
<if test="batchRefNo != null and batchRefNo != ''">
|
||||
and a.BATCH_REF_NO like concat('%', #{batchRefNo}, '%')
|
||||
</if>
|
||||
<if test="sheetRefNo != null and sheetRefNo != ''">
|
||||
and a.SHEET_REF_NO like concat('%', #{sheetRefNo}, '%')
|
||||
</if>
|
||||
<if test="boxPalletNo != null and boxPalletNo != ''">
|
||||
and a.BOX_PALLET_NO like concat('%', #{boxPalletNo}, '%')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from reservation_material_inventory a
|
||||
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
group by a.MATERIAL_INVENTORY_ID order by a.update_time desc
|
||||
</select>
|
||||
|
||||
<select id="queryListByWlKw" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from reservation_material_inventory a
|
||||
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
GROUP BY a.MATERIAL_BASE_INFO_ID,a.WAREHOUSE_ID,a.STORAGE_SECTION_ID,a.STORAGE_LOCATION_ID
|
||||
</select>
|
||||
|
||||
<select id="queryListByKw" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from reservation_material_inventory a
|
||||
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
GROUP BY a.WAREHOUSE_ID,a.STORAGE_SECTION_ID,a.STORAGE_LOCATION_ID
|
||||
</select>
|
||||
|
||||
<select id="queryListByWl" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from reservation_material_inventory a
|
||||
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
GROUP BY a.MATERIAL_BASE_INFO_ID
|
||||
</select>
|
||||
|
||||
<select id="queryListByHz" parameterType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.ReservationMaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from reservation_material_inventory a
|
||||
left join NGWL_TEST_WMS.material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
GROUP BY a.SHIPPER_ID
|
||||
</select>
|
||||
|
||||
<resultMap type="com.mhd.oms.domain.reservationMaterialInventory.repository.po.ReservationMaterialInventoryQueryListPO" id="MaterialQueryListResult">
|
||||
<result property="materialInventoryId" column="material_inventory_id" />
|
||||
<result property="organizationId" column="organization_id" />
|
||||
<result property="organizationName" column="organization_name" />
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="shipperId" column="shipper_id" />
|
||||
<result property="shipperCode" column="shipper_code" />
|
||||
<result property="shipperName" column="shipper_name" />
|
||||
<result property="materialCode" column="material_code" />
|
||||
<result property="materialName" column="material_name" />
|
||||
<result property="barCode" column="inv_bar_code" />
|
||||
<result property="packId" column="pack_id" />
|
||||
<result property="packCode" column="pack_code" />
|
||||
<result property="packName" column="pack_name" />
|
||||
<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="materialBaseInfoId" column="material_base_info_id" />
|
||||
<result property="batchNumber" column="batch_number" />
|
||||
<result property="inOrderNumber" column="in_order_number" />
|
||||
<result property="lotNumber" column="lot_number" />
|
||||
<result property="materialStatusCode" column="material_status_code" />
|
||||
<result property="materialStatusName" column="material_status_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="inventoryQuantity" column="inventory_quantity" />
|
||||
<result property="allocationQuantity" column="allocation_quantity" />
|
||||
<result property="freezeQuantity" column="freeze_quantity" />
|
||||
<result property="isAble" column="is_able" />
|
||||
<result property="unit" column="unit" />
|
||||
<result property="unitName" column="unit_name" />
|
||||
<result property="netWeight" column="NET_WEIGHT" />
|
||||
<result property="grossWeight" column="GROSS_WEIGHT" />
|
||||
<result property="volume" column="VOLUME" />
|
||||
<result property="area" column="area" />
|
||||
<result property="batchRefNo" column="BATCH_REF_NO" />
|
||||
<result property="sheetRefNo" column="SHEET_REF_NO" />
|
||||
<result property="boxPalletNo" column="BOX_PALLET_NO" />
|
||||
<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="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" />
|
||||
</resultMap>
|
||||
|
||||
<!-- 1-按货主 2-按物料 3-按批次 4-按库位 5-按物料/库位 6-按容器 0-全部 -->
|
||||
<sql id="materialQueryListByGroup">
|
||||
<choose>
|
||||
<when test="queryType != null and queryType == 1">
|
||||
group by a.shipper_id
|
||||
order by max(a.shipper_name)
|
||||
</when>
|
||||
<when test="queryType != null and queryType == 2">
|
||||
group by b.material_base_info_id, a.shipper_id
|
||||
order by max(b.material_name), max(a.shipper_name)
|
||||
</when>
|
||||
<when test="queryType != null and queryType == 3">
|
||||
group by b.material_base_info_id, a.shipper_id, a.batch_number
|
||||
order by max(b.material_name), max(a.shipper_name), a.batch_number
|
||||
</when>
|
||||
<when test="queryType != null and queryType == 4">
|
||||
group by a.storage_location_id
|
||||
order by max(a.storage_location_code)
|
||||
</when>
|
||||
<when test="queryType != null and queryType == 5">
|
||||
group by b.material_base_info_id, a.storage_location_id, a.shipper_id
|
||||
order by max(b.material_name), max(a.storage_location_code), max(a.shipper_name)
|
||||
</when>
|
||||
<when test="queryType != null and queryType == 6">
|
||||
group by a.container_id, a.container_code, a.container_type, a.container_type_name
|
||||
order by a.container_type_name, b.material_name, a.storage_location_name
|
||||
</when>
|
||||
<otherwise>
|
||||
group by a.material_inventory_id
|
||||
order by a.shipper_name, b.material_name, a.storage_location_name, a.batch_number
|
||||
</otherwise>
|
||||
</choose>
|
||||
</sql>
|
||||
|
||||
|
||||
<!-- 根据库存ID查询库存信息(包含批次属性字段) -->
|
||||
<select id="selectByIdWithBatchAttributes" parameterType="java.lang.Long" resultMap="MaterialInventoryResult">
|
||||
SELECT
|
||||
material_inventory_id, organization_id, organization_name, top_organization_id,
|
||||
material_base_info_id, shipper_id, shipper_code, shipper_name, material_detail_id,
|
||||
warehouse_id, warehouse_code, warehouse_name,
|
||||
storage_section_id, storage_code, storage_name, storage_location_id, storage_location_code, storage_location_name,
|
||||
batch_number, material_status_code, material_status_name,
|
||||
container_id, container_code, container_type, container_type_name,
|
||||
inventory_quantity, allocation_quantity, freeze_quantity, remark, is_able, unit,
|
||||
net_weight, gross_weight, volume, area,
|
||||
ext_attr_1, ext_attr_2, ext_attr_3, ext_attr_4,
|
||||
production_date, expiry_date, inventory_date,
|
||||
batch_ref_no, sheet_ref_no, box_pallet_no,
|
||||
create_time, create_by, create_by_name, update_time, update_by, update_by_name, del_flag
|
||||
FROM reservation_material_inventory
|
||||
WHERE material_inventory_id = #{materialInventoryId} AND del_flag = 1
|
||||
</select>
|
||||
|
||||
<!-- 根据库存ID查询库存信息(包含批次属性字段) -->
|
||||
<select id="getByInfoId" parameterType="java.lang.Long" resultType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBaseInfo">
|
||||
SELECT
|
||||
*
|
||||
FROM NGWL_TEST_WMS.material_base_info
|
||||
WHERE material_base_info_id = #{id} AND del_flag = 1
|
||||
</select>
|
||||
|
||||
<select id="getInfoByMaterialBaseInfoIds" parameterType="java.lang.Long" resultType="com.mhd.oms.domain.reservationMaterialInventory.repository.todo.MaterialBarCodePO">
|
||||
SELECT
|
||||
*
|
||||
FROM NGWL_TEST_WMS.material_bar_code
|
||||
WHERE material_base_info_id = #{id} AND del_flag = 1
|
||||
</select>
|
||||
</mapper>
|
||||
+10
@@ -8,6 +8,8 @@ import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.utils.OrderSequence;
|
||||
import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.OmsServiceFeign;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.copyCodeReference.entity.CopyCodeReference;
|
||||
import com.mhd.wms.domain.copyCodeReference.repository.facade.ICopyCodeReferenceService;
|
||||
@@ -81,6 +83,8 @@ public class HandoverTaskOrderDomainService {
|
||||
private IStockOutOrderService stockOutOrderService;
|
||||
@Autowired
|
||||
private CopyCodeReferenceDomainService copyCodeReferenceDomainService;
|
||||
@Autowired
|
||||
private OmsServiceFeign omsServiceFeign;
|
||||
|
||||
|
||||
/**
|
||||
@@ -427,6 +431,12 @@ public class HandoverTaskOrderDomainService {
|
||||
materialInventoryParamDO.setType("4");
|
||||
materialInventoryService.kctzjl(materialInventoryParamDO,"出库",loginUser);
|
||||
materialInventoryService.xgkc(materialInventoryParamDO);
|
||||
MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO();
|
||||
BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO);
|
||||
materialInventoryOmsParamDO.setKctzType("出库");
|
||||
materialInventoryOmsParamDO.setLoginUser(loginUser);
|
||||
//库存推送oms
|
||||
omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
|
||||
//库存调整记录
|
||||
// InventoryAdjustmentRecord inventoryAdjustmentRecord = new InventoryAdjustmentRecord();
|
||||
// inventoryAdjustmentRecord.setAdjustAction("出库");
|
||||
|
||||
+6
@@ -11,6 +11,7 @@ import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.OmsServiceFeign;
|
||||
import com.mhd.system.api.domain.InMaterialDetail;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.domain.OutMaterialDetail;
|
||||
import com.mhd.system.api.domain.StockOutOrder;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
@@ -466,6 +467,11 @@ public class InventoryAdjustmentRecordDomainService {
|
||||
materialInventoryParamDO.setType("7");
|
||||
materialInventoryService.kctzjl(materialInventoryParamDO,"库存冻结",loginUser);
|
||||
materialInventoryService.xgkc(materialInventoryParamDO);
|
||||
MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO();
|
||||
BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO);
|
||||
materialInventoryOmsParamDO.setKctzType("库存冻结");
|
||||
materialInventoryOmsParamDO.setLoginUser(loginUser);
|
||||
omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
|
||||
+17
-3
@@ -584,9 +584,23 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
inventoryAdjustmentRecord.setAdjustBeforeStatusName(materialInventory.getMaterialStatusName() == null ? "" : materialInventory.getMaterialStatusName());
|
||||
inventoryAdjustmentRecord.setMaterialBaseInfoId(materialInventory.getMaterialBaseInfoId());
|
||||
|
||||
inventoryAdjustmentRecord.setLotNumber(materialInventoryParamDO.getLotNumber());
|
||||
inventoryAdjustmentRecord.setInOrderNumber(materialInventoryParamDO.getInOrderNumber());
|
||||
inventoryAdjustmentRecord.setBatchNumber(materialInventoryParamDO.getBatchNumber());
|
||||
// 分配/取消分配/完成交接(出库):调整记录 LOT 以库存行 material_inventory.lot_number 为准;仅库存为空时再用入参兜底
|
||||
// 其它业务(入上架、移库等):入参优先,入参无则取库存
|
||||
String lotForRecord;
|
||||
if ("分配库存".equals(adjustAction) || "取消分配".equals(adjustAction) || "出库".equals(adjustAction)) {
|
||||
lotForRecord = StringUtils.hasText(materialInventory.getLotNumber())
|
||||
? materialInventory.getLotNumber() : materialInventoryParamDO.getLotNumber();
|
||||
} else {
|
||||
lotForRecord = StringUtils.hasText(materialInventoryParamDO.getLotNumber())
|
||||
? materialInventoryParamDO.getLotNumber() : materialInventory.getLotNumber();
|
||||
}
|
||||
inventoryAdjustmentRecord.setLotNumber(lotForRecord);
|
||||
String inOrderForRecord = StringUtils.hasText(materialInventoryParamDO.getInOrderNumber())
|
||||
? materialInventoryParamDO.getInOrderNumber() : materialInventory.getInOrderNumber();
|
||||
inventoryAdjustmentRecord.setInOrderNumber(inOrderForRecord);
|
||||
String batchForRecord = StringUtils.hasText(materialInventoryParamDO.getBatchNumber())
|
||||
? materialInventoryParamDO.getBatchNumber() : materialInventory.getBatchNumber();
|
||||
inventoryAdjustmentRecord.setBatchNumber(batchForRecord);
|
||||
if (ObjectUtil.isNotNull(materialBaseInfo)) {
|
||||
inventoryAdjustmentRecord.setMaterialCode(materialBaseInfo.getMaterialCode());
|
||||
inventoryAdjustmentRecord.setMaterialName(materialBaseInfo.getMaterialName());
|
||||
|
||||
+20
@@ -13,6 +13,8 @@ import com.mhd.common.core.utils.StringUtils;
|
||||
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.system.api.OmsServiceFeign;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.copyCodeReference.entity.CopyCodeReference;
|
||||
import com.mhd.wms.domain.copyCodeReference.repository.facade.ICopyCodeReferenceService;
|
||||
@@ -84,6 +86,8 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
private IMaterialBarCodeService materialBarCodeService;
|
||||
@Autowired
|
||||
private IMaterialInventoryService materialInventoryService;
|
||||
@Autowired
|
||||
private OmsServiceFeign omsServiceFeign;
|
||||
|
||||
|
||||
/**
|
||||
@@ -570,6 +574,12 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
materialInventoryParamDO.setInOrderNumber(outMaterialDetail.getInOrderNumber());
|
||||
materialInventoryService.kctzjl(materialInventoryParamDO,"分配库存",loginUser);
|
||||
materialInventoryService.xgkc(materialInventoryParamDO);
|
||||
MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO();
|
||||
BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO);
|
||||
materialInventoryOmsParamDO.setKctzType("分配库存");
|
||||
materialInventoryOmsParamDO.setLoginUser(loginUser);
|
||||
omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
|
||||
|
||||
//materialInventoryMapper.updateById(materialInventory);
|
||||
|
||||
//库存调整记录
|
||||
@@ -955,6 +965,11 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
materialInventoryParamDO.setRelateNo(cancelRelateNo);
|
||||
materialInventoryService.kctzjl(materialInventoryParamDO,"取消分配",loginUser);
|
||||
materialInventoryService.xgkc(materialInventoryParamDO);
|
||||
MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO();
|
||||
BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO);
|
||||
materialInventoryOmsParamDO.setKctzType("取消分配");
|
||||
materialInventoryOmsParamDO.setLoginUser(loginUser);
|
||||
omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
|
||||
// //更新库存数量
|
||||
// //可用数量
|
||||
// BigDecimal oldAllocationQuantity = materialInventoryPO.getAllocationQuantity();
|
||||
@@ -1050,6 +1065,11 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
materialInventoryParamDO.setRelateNo(cancelRelateNoCh);
|
||||
materialInventoryService.kctzjl(materialInventoryParamDO,"取消分配",loginUser);
|
||||
materialInventoryService.xgkc(materialInventoryParamDO);
|
||||
MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO();
|
||||
BeanUtils.copyProperties(materialInventoryParamDO, materialInventoryOmsParamDO);
|
||||
materialInventoryOmsParamDO.setKctzType("取消分配");
|
||||
materialInventoryOmsParamDO.setLoginUser(loginUser);
|
||||
omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
|
||||
|
||||
// //更新库存数量
|
||||
// //可用数量
|
||||
|
||||
+3
-3
@@ -24,9 +24,9 @@ public interface StockShelfOrderMapper extends BaseMapper<StockShelfOrder>
|
||||
|
||||
public void updateOmsOrder(@Param("orderNumber") String orderNumber, @Param("status") Integer status, @Param("shelvesQuantity") Integer shelvesQuantity);
|
||||
|
||||
void updateOmsDocument(BigDecimal shelvesQuantity, BigDecimal totalNetWeight, String omsInMaterialDetail);
|
||||
void updateOmsDocument(@Param("shelvesQuantity") BigDecimal shelvesQuantity, @Param("totalNetWeight") BigDecimal totalNetWeight, @Param("omsInMaterialDetail") String omsInMaterialDetail);
|
||||
|
||||
void updateOmsHandover(BigDecimal checkQuantity, BigDecimal totalNetWeight, String outOrderNumber, Long uniqueId);
|
||||
void updateOmsHandover(@Param("checkQuantity") BigDecimal checkQuantity, @Param("totalNetWeight") BigDecimal totalNetWeight, @Param("outOrderNumber") String outOrderNumber, @Param("uniqueId") Long uniqueId);
|
||||
|
||||
void updateOmsDocumentLot(BigDecimal shelvesQuantity, BigDecimal totalNetWeight, String lotNumber);
|
||||
void updateOmsDocumentLot(@Param("shelvesQuantity") BigDecimal shelvesQuantity, @Param("totalNetWeight") BigDecimal totalNetWeight, @Param("lotNumber") String lotNumber);
|
||||
}
|
||||
+14
@@ -19,8 +19,10 @@ import com.mhd.common.core.utils.bean.BeanUtils;
|
||||
import com.mhd.common.core.utils.uuid.IdGenerator;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.OmsServiceFeign;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.domain.ContainerFeignPO;
|
||||
import com.mhd.system.api.domain.MaterialInventoryOmsParamDO;
|
||||
import com.mhd.system.api.model.LoginUser;
|
||||
import com.mhd.wms.domain.containerUsageRecord.repository.facade.IContainerUsageRecordService;
|
||||
import com.mhd.wms.domain.containerUsageRecord.repository.todo.ContainerUsageRecordDO;
|
||||
@@ -135,6 +137,8 @@ public class StockShelfOrderDomainService {
|
||||
private MaterialBaseInfoMapper materialBaseInfoMapper;
|
||||
@Autowired
|
||||
private ICopyCodeReferenceService copyCodeReferenceService;
|
||||
@Autowired
|
||||
private OmsServiceFeign omsServiceFeign;
|
||||
|
||||
/**
|
||||
* 分页查询上架单列表
|
||||
@@ -1068,6 +1072,11 @@ public class StockShelfOrderDomainService {
|
||||
//库存调整记录
|
||||
materialInventoryService.xgkc(inventoryParamDO);
|
||||
materialInventoryService.kctzjl(inventoryParamDO,"入库", loginUser);
|
||||
MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO();
|
||||
BeanUtils.copyProperties(inventoryParamDO, materialInventoryOmsParamDO);
|
||||
materialInventoryOmsParamDO.setKctzType("入库");
|
||||
materialInventoryOmsParamDO.setLoginUser(loginUser);
|
||||
omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
|
||||
//抄码商品对照数据插入
|
||||
copyCodeProductComparison(materialBaseInfo,shelfMaterialDetail,inventoryParamDO);
|
||||
} else if (materialInventoryPOS.size() == 1) {
|
||||
@@ -1125,6 +1134,11 @@ public class StockShelfOrderDomainService {
|
||||
//库存调整记录
|
||||
materialInventoryService.kctzjl(inventoryParamDO, "入库", loginUser);
|
||||
materialInventoryService.xgkc(inventoryParamDO);
|
||||
MaterialInventoryOmsParamDO materialInventoryOmsParamDO = new MaterialInventoryOmsParamDO();
|
||||
BeanUtils.copyProperties(inventoryParamDO, materialInventoryOmsParamDO);
|
||||
materialInventoryOmsParamDO.setKctzType("入库");
|
||||
materialInventoryOmsParamDO.setLoginUser(loginUser);
|
||||
omsServiceFeign.omsEdit(materialInventoryOmsParamDO);
|
||||
//抄码商品对照数据插入
|
||||
copyCodeProductComparison(materialBaseInfo,shelfMaterialDetail,inventoryParamDO);
|
||||
}
|
||||
|
||||
@@ -93,6 +93,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="salesmanId" column="SALESMAN_ID" />
|
||||
<result property="salesmanName" column="SALESMAN_NAME" />
|
||||
<result property="settlementCurrency" column="SETTLEMENT_CURRENCY" />
|
||||
<result property="businessOrderNo" column="business_order_no" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -110,7 +111,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
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.billing_json,a.SETTLEMENT_CURRENCY,
|
||||
a.SALESMAN_ID,a.SALESMAN_NAME
|
||||
a.SALESMAN_ID,a.SALESMAN_NAME,a.business_order_no
|
||||
</sql>
|
||||
|
||||
|
||||
|
||||
+282
-1
@@ -176,4 +176,285 @@ COMMENT ON COLUMN "NGWL_TEST_WMS"."OUT_MATERIAL_DETAIL"."CONTRACT_FEE" IS '合
|
||||
|
||||
COMMENT ON COLUMN "NGWL_TEST_WMS"."OUT_MATERIAL_DETAIL"."STOCK_UNIT" IS '库存单位';
|
||||
|
||||
COMMENT ON COLUMN "NGWL_TEST_WMS"."OUT_MATERIAL_DETAIL"."STOCK_QUANTITY" IS '库存件数'
|
||||
COMMENT ON COLUMN "NGWL_TEST_WMS"."OUT_MATERIAL_DETAIL"."STOCK_QUANTITY" IS '库存件数'
|
||||
|
||||
----------------------------------已发布生产----------------------------------------
|
||||
|
||||
/*
|
||||
Navicat Premium Dump SQL
|
||||
|
||||
Source Server : 113.44.106.61
|
||||
Source Server Type : Dameng
|
||||
Source Server Version : 8014116 (08.01.4116)
|
||||
Source Host : 113.44.106.61:5236
|
||||
Source Schema : NGWL_TEST_OMS
|
||||
|
||||
Target Server Type : Dameng
|
||||
Target Server Version : 8014116 (08.01.4116)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 22/04/2026 08:57:55
|
||||
*/
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for RESERVATION_MATERIAL_INVENTORY
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY";
|
||||
CREATE TABLE "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY" (
|
||||
"RESERVATION_MATERIAL_INVENTORY_ID" BIGINT IDENTITY(1,1) NOT NULL,
|
||||
"ORGANIZATION_ID" BIGINT DEFAULT 0,
|
||||
"ORGANIZATION_NAME" VARCHAR(100 CHAR) DEFAULT '',
|
||||
"TOP_ORGANIZATION_ID" BIGINT DEFAULT 0,
|
||||
"MATERIAL_BASE_INFO_ID" BIGINT DEFAULT 0,
|
||||
"MATERIAL_DETAIL_ID" BIGINT,
|
||||
"WAREHOUSE_ID" BIGINT DEFAULT 0,
|
||||
"WAREHOUSE_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"WAREHOUSE_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"STORAGE_SECTION_ID" BIGINT DEFAULT 0,
|
||||
"STORAGE_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"STORAGE_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"STORAGE_LOCATION_ID" BIGINT DEFAULT 0,
|
||||
"STORAGE_LOCATION_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"STORAGE_LOCATION_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"BATCH_NUMBER" VARCHAR(50 CHAR) DEFAULT '',
|
||||
"MATERIAL_STATUS_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"MATERIAL_STATUS_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"CONTAINER_ID" BIGINT DEFAULT 0 NOT NULL,
|
||||
"CONTAINER_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"CONTAINER_TYPE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"CONTAINER_TYPE_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"INVENTORY_QUANTITY" DECIMAL(20,2) DEFAULT 0.,
|
||||
"ALLOCATION_QUANTITY" DECIMAL(20,2) DEFAULT 0.,
|
||||
"FREEZE_QUANTITY" DECIMAL(20,2) DEFAULT 0.,
|
||||
"REMARK" VARCHAR(255 CHAR) DEFAULT '',
|
||||
"CREATE_TIME" TIMESTAMP,
|
||||
"CREATE_BY" BIGINT DEFAULT 0,
|
||||
"CREATE_BY_NAME" VARCHAR(20 CHAR) DEFAULT '',
|
||||
"UPDATE_TIME" TIMESTAMP,
|
||||
"UPDATE_BY" BIGINT DEFAULT 0,
|
||||
"UPDATE_BY_NAME" VARCHAR(20 CHAR) DEFAULT '',
|
||||
"DEL_FLAG" TINYINT DEFAULT 1,
|
||||
"IS_ABLE" TINYINT DEFAULT 1,
|
||||
"UNIT" VARCHAR2(128),
|
||||
"NET_WEIGHT" DECIMAL(10,2),
|
||||
"GROSS_WEIGHT" DECIMAL(10,2),
|
||||
"VOLUME" DECIMAL(10,2),
|
||||
"AREA" DECIMAL(10,2),
|
||||
"SHIPPER_ID" BIGINT,
|
||||
"SHIPPER_CODE" VARCHAR(50),
|
||||
"SHIPPER_NAME" VARCHAR(100),
|
||||
"PRODUCTION_DATE" DATE,
|
||||
"EXPIRY_DATE" DATE,
|
||||
"INVENTORY_DATE" DATE,
|
||||
"BATCH_REF_NO" VARCHAR(100),
|
||||
"SHEET_REF_NO" VARCHAR(100),
|
||||
"BOX_PALLET_NO" VARCHAR(200),
|
||||
"EXT_ATTR_1" VARCHAR2(255),
|
||||
"EXT_ATTR_2" VARCHAR2(255),
|
||||
"EXT_ATTR_3" DATE DEFAULT '',
|
||||
"EXT_ATTR_4" DATE,
|
||||
"UNIT_NAME" VARCHAR2(255),
|
||||
"BAR_CODE" VARCHAR(255),
|
||||
"IN_ORDER_NUMBER" VARCHAR(100),
|
||||
"LOT_NUMBER" VARCHAR(100)
|
||||
)
|
||||
;
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."RESERVATION_MATERIAL_INVENTORY_ID" IS '物料库存id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."ORGANIZATION_ID" IS '组织表ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."ORGANIZATION_NAME" IS '组织名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."TOP_ORGANIZATION_ID" IS '一级组织表ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."MATERIAL_BASE_INFO_ID" IS '物料基础信息id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."MATERIAL_DETAIL_ID" IS '上架单物料明细id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."WAREHOUSE_ID" IS '仓库id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."WAREHOUSE_CODE" IS '仓库编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."WAREHOUSE_NAME" IS '仓库名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."STORAGE_SECTION_ID" IS '库区id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."STORAGE_CODE" IS '库区编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."STORAGE_NAME" IS '库区名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."STORAGE_LOCATION_ID" IS '库位id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."STORAGE_LOCATION_CODE" IS '库位编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."STORAGE_LOCATION_NAME" IS '库位名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."BATCH_NUMBER" IS '批次号';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."MATERIAL_STATUS_CODE" IS '物料状态编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."MATERIAL_STATUS_NAME" IS '物料状态名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."CONTAINER_ID" IS '容器id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."CONTAINER_CODE" IS '容器编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."CONTAINER_TYPE" IS '容器类型 数据字典';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."CONTAINER_TYPE_NAME" IS '容器类型名称 数据字典';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."INVENTORY_QUANTITY" IS '库存数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."ALLOCATION_QUANTITY" IS '可用数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."FREEZE_QUANTITY" IS '冻结数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."REMARK" IS '备注';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."CREATE_TIME" IS '创建时间';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."CREATE_BY" IS '创建人用户ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."CREATE_BY_NAME" IS '创建人姓名';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."UPDATE_TIME" IS '最后修改时间';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."UPDATE_BY" IS '最后修改人用户ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."UPDATE_BY_NAME" IS '修改人姓名';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."DEL_FLAG" IS '删除标记:0-无状态,1-正常,2-已删除';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."IS_ABLE" IS '盘点是否可用:0-禁用 1-可用';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."UNIT" IS '单位';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."NET_WEIGHT" IS '净重(KG)';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."GROSS_WEIGHT" IS '毛重(KG)';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."VOLUME" IS '体积(CBM)';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."AREA" IS '面积(SQM)';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."SHIPPER_ID" IS '货主ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."SHIPPER_CODE" IS '货主编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."SHIPPER_NAME" IS '货主名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."PRODUCTION_DATE" IS '生产日期';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."EXPIRY_DATE" IS '过期日期';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."INVENTORY_DATE" IS '存货日期';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."BATCH_REF_NO" IS 'Batch Ref NO''s';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."SHEET_REF_NO" IS 'Sheet Ref NO''s';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."BOX_PALLET_NO" IS '箱号/卡板号';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."EXT_ATTR_1" IS '扩展字段1';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."EXT_ATTR_2" IS '扩展字段2';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."EXT_ATTR_3" IS '扩展字段3';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."EXT_ATTR_4" IS '扩展字段4';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."UNIT_NAME" IS '单位名';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."IN_ORDER_NUMBER" IS '入库单号';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY"."LOT_NUMBER" IS 'LOT编号';
|
||||
COMMENT ON TABLE "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY" IS '物料库存表';
|
||||
|
||||
-- ----------------------------
|
||||
-- Primary Key structure for table RESERVATION_MATERIAL_INVENTORY
|
||||
-- ----------------------------
|
||||
ALTER TABLE "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY" ADD PRIMARY KEY ("RESERVATION_MATERIAL_INVENTORY_ID");
|
||||
|
||||
-- ----------------------------
|
||||
-- Indexes structure for table RESERVATION_MATERIAL_INVENTORY
|
||||
-- ----------------------------
|
||||
CREATE INDEX "NGWL_TEST_OMS"."IDX_MAT_INV_BASE_ID"
|
||||
ON "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY" ("MATERIAL_BASE_INFO_ID" ASC)
|
||||
UNUSABLE;
|
||||
CREATE INDEX "NGWL_TEST_OMS"."IDX_MAT_INV_LOC_MAT_SHIPPER_ID"
|
||||
ON "NGWL_TEST_OMS"."RESERVATION_MATERIAL_INVENTORY" ("MATERIAL_BASE_INFO_ID" ASC, "SHIPPER_ID" ASC)
|
||||
UNUSABLE;
|
||||
|
||||
|
||||
|
||||
/*
|
||||
Navicat Premium Dump SQL
|
||||
|
||||
Source Server : 113.44.106.61
|
||||
Source Server Type : Dameng
|
||||
Source Server Version : 8014116 (08.01.4116)
|
||||
Source Host : 113.44.106.61:5236
|
||||
Source Schema : NGWL_TEST_OMS
|
||||
|
||||
Target Server Type : Dameng
|
||||
Target Server Version : 8014116 (08.01.4116)
|
||||
File Encoding : 65001
|
||||
|
||||
Date: 22/04/2026 09:00:34
|
||||
*/
|
||||
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for RESERVATION_INVENTORY_ADJUSTMENT_RECORD
|
||||
-- ----------------------------
|
||||
DROP TABLE IF EXISTS "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD";
|
||||
CREATE TABLE "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD" (
|
||||
"INVENTORY_ADJUSTMENT_ID" BIGINT IDENTITY(1,1) NOT NULL,
|
||||
"ORGANIZATION_ID" BIGINT DEFAULT 0,
|
||||
"ORGANIZATION_NAME" VARCHAR(100 CHAR) DEFAULT '',
|
||||
"TOP_ORGANIZATION_ID" BIGINT DEFAULT 0,
|
||||
"MATERIAL_INVENTORY_ID" BIGINT,
|
||||
"MATERIAL_BASE_INFO_ID" BIGINT DEFAULT 0,
|
||||
"MATERIAL_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"MATERIAL_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"BAR_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"SHIPPER_ID" BIGINT DEFAULT 0,
|
||||
"SHIPPER_NAME" VARCHAR(50 CHAR) DEFAULT '',
|
||||
"WAREHOUSE_ID" BIGINT DEFAULT 0,
|
||||
"WAREHOUSE_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"WAREHOUSE_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"STORAGE_SECTION_ID" BIGINT DEFAULT 0,
|
||||
"STORAGE_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"STORAGE_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"STORAGE_LOCATION_ID" BIGINT DEFAULT 0,
|
||||
"STORAGE_LOCATION_CODE" VARCHAR(32 CHAR) DEFAULT '',
|
||||
"STORAGE_LOCATION_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"ADJUST_TYPE" TINYINT DEFAULT 0,
|
||||
"ADJUST_DIRECTION" TINYINT DEFAULT 0,
|
||||
"ADJUST_BEFORE_STATUS_CODE" VARCHAR(32 CHAR) DEFAULT '0',
|
||||
"ADJUST_BEFORE_STATUS_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"ADJUST_AFTER_STATUS_CODE" VARCHAR(32 CHAR) DEFAULT '0',
|
||||
"ADJUST_AFTER_STATUS_NAME" VARCHAR(64 CHAR) DEFAULT '',
|
||||
"INVENTORY_BEFORE_QUANTITY" DECIMAL(20,2) DEFAULT 0.,
|
||||
"ALLOCATION_BEFORE_QUANTITY" DECIMAL(20,2),
|
||||
"FREEZE_BEFORE_QUANTITY" DECIMAL(20,2),
|
||||
"INVENTORY_AFTER_QUANTITY" DECIMAL(20,2) DEFAULT 0.,
|
||||
"ALLOCATION_AFTER_QUANTITY" DECIMAL(20,2),
|
||||
"FREEZE_AFTER_QUANTITY" DECIMAL(20,2),
|
||||
"CREATE_TIME" TIMESTAMP,
|
||||
"CREATE_BY" BIGINT DEFAULT 0,
|
||||
"CREATE_BY_NAME" VARCHAR(20 CHAR) DEFAULT '',
|
||||
"UPDATE_TIME" TIMESTAMP,
|
||||
"UPDATE_BY" BIGINT DEFAULT 0,
|
||||
"UPDATE_BY_NAME" VARCHAR(20 CHAR) DEFAULT '',
|
||||
"DEL_FLAG" TINYINT DEFAULT 1,
|
||||
"ADJUST_ACTION" VARCHAR2(100),
|
||||
"RELATE_NO" VARCHAR2(128),
|
||||
"NET_WEIGHT" DECIMAL(18,3) DEFAULT NULL,
|
||||
"GROSS_WEIGHT" DECIMAL(18,3) DEFAULT NULL,
|
||||
"VOLUME" DECIMAL(18,3) DEFAULT NULL,
|
||||
"AREA" DECIMAL(18,3) DEFAULT NULL,
|
||||
"ADJUSTED_NET_WEIGHT" DECIMAL(18,3) DEFAULT NULL,
|
||||
"ADJUSTED_GROSS_WEIGHT" DECIMAL(18,3) DEFAULT NULL,
|
||||
"ADJUSTED_VOLUME" DECIMAL(18,3) DEFAULT NULL,
|
||||
"ADJUSTED_AREA" DECIMAL(18,3) DEFAULT NULL,
|
||||
"IN_ORDER_NUMBER" VARCHAR(100),
|
||||
"LOT_NUMBER" VARCHAR(100),
|
||||
"BATCH_NUMBER" VARCHAR(50 CHAR) DEFAULT ''
|
||||
)
|
||||
;
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."INVENTORY_ADJUSTMENT_ID" IS '库存调整记录id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ORGANIZATION_ID" IS '组织表ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ORGANIZATION_NAME" IS '组织名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."TOP_ORGANIZATION_ID" IS '一级组织表ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."MATERIAL_INVENTORY_ID" IS '物料库存id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."MATERIAL_BASE_INFO_ID" IS '物料基础信息id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."MATERIAL_CODE" IS '物料编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."MATERIAL_NAME" IS '物料名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."BAR_CODE" IS '物料条形码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."SHIPPER_ID" IS '货主id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."SHIPPER_NAME" IS '货主名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."WAREHOUSE_ID" IS '仓库id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."WAREHOUSE_CODE" IS '仓库编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."WAREHOUSE_NAME" IS '仓库名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."STORAGE_SECTION_ID" IS '库区id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."STORAGE_CODE" IS '库区编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."STORAGE_NAME" IS '库区名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."STORAGE_LOCATION_ID" IS '库位id';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."STORAGE_LOCATION_CODE" IS '库位编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."STORAGE_LOCATION_NAME" IS '库位名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ADJUST_TYPE" IS '调整类型:0:无状态 1:数量调整 2:状态调整 3:库存冻结';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ADJUST_DIRECTION" IS '调整方向:0:无状态 1:增库存 2:减库存';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ADJUST_BEFORE_STATUS_CODE" IS '调整前状态编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ADJUST_BEFORE_STATUS_NAME" IS '调整前状态名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ADJUST_AFTER_STATUS_CODE" IS '调整后状态编码';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ADJUST_AFTER_STATUS_NAME" IS '调整后状态名称';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."INVENTORY_BEFORE_QUANTITY" IS '调整前库存数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ALLOCATION_BEFORE_QUANTITY" IS '调整前可用数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."FREEZE_BEFORE_QUANTITY" IS '调整前冻结数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."INVENTORY_AFTER_QUANTITY" IS '调整后库存数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ALLOCATION_AFTER_QUANTITY" IS '调整后可用数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."FREEZE_AFTER_QUANTITY" IS '调整后冻结数量';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."CREATE_TIME" IS '创建时间';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."CREATE_BY" IS '创建人用户ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."CREATE_BY_NAME" IS '创建人姓名';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."UPDATE_TIME" IS '最后修改时间';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."UPDATE_BY" IS '最后修改人用户ID';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."UPDATE_BY_NAME" IS '修改人姓名';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."DEL_FLAG" IS '删除标记:0-无状态,1-正常,2-已删除';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."ADJUST_ACTION" IS '调整动作';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."RELATE_NO" IS '关联单号';
|
||||
COMMENT ON COLUMN "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD"."BATCH_NUMBER" IS '批次号';
|
||||
COMMENT ON TABLE "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD" IS '库存调整记录';
|
||||
|
||||
-- ----------------------------
|
||||
-- Primary Key structure for table RESERVATION_INVENTORY_ADJUSTMENT_RECORD
|
||||
-- ----------------------------
|
||||
ALTER TABLE "NGWL_TEST_OMS"."RESERVATION_INVENTORY_ADJUSTMENT_RECORD" ADD PRIMARY KEY ("INVENTORY_ADJUSTMENT_ID");
|
||||
+1
-1
@@ -137,4 +137,4 @@ ALTER TABLE "NGWL_TEST_WMS"."RECEIPT_ORDER_ACCOUNT" ADD PRIMARY KEY ("ID");
|
||||
|
||||
ALTER TABLE "NGWL_TEST_SYSTEM"."WAREHOUSE" ADD COLUMN "IS_ENABLE" TINYINT;
|
||||
|
||||
COMMENT ON COLUMN "NGWL_TEST_SYSTEM"."WAREHOUSE"."IS_ENABLE" IS '是否启用'
|
||||
COMMENT ON COLUMN "NGWL_TEST_SYSTEM"."WAREHOUSE"."IS_ENABLE" IS '是否启用';
|
||||
Reference in New Issue
Block a user