Merge branch 'dev_20260429' into dev_WMS20260401
# Conflicts: # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/OmsServiceFeign.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/UserServiceFeign.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteOmsFeignFallbackFactory.java # mhd-api/mhd-api-system/src/main/java/com/mhd/system/api/factory/RemoteUserFeignFallbackFactory.java # mhd-modules/mhd-system/src/main/java/com/mhd/basic/application/service/batchDetail/BatchDetailApplicationService.java # mhd-modules/mhd-system/src/main/java/com/mhd/basic/domain/batchDetail/service/BatchDetailDomainService.java # mhd_oms/src/main/java/com/mhd/oms/interfaces/facade/sysTableConfig/SysTableConfigApi.java
This commit is contained in:
+82
-10
@@ -9,6 +9,7 @@ import com.mhd.common.core.exception.ServiceException;
|
||||
import com.mhd.common.core.enums.DictCode;
|
||||
import com.mhd.common.core.utils.poi.ExcelUtil;
|
||||
import com.mhd.common.core.web.domain.AjaxResult;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.common.security.utils.SecurityUtils;
|
||||
import com.mhd.system.api.SystemServiceFeign;
|
||||
import com.mhd.system.api.UserServiceFeign;
|
||||
@@ -20,6 +21,7 @@ import com.mhd.wms.domain.materialBarCode.service.MaterialBarCodeDomainService;
|
||||
import com.mhd.wms.domain.materialBarCode.repository.todo.MaterialBarCodeDO;
|
||||
import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.facade.IMaterialBaseInfoService;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO;
|
||||
import com.mhd.wms.domain.materialBaseInfo.service.MaterialBaseInfoDomainService;
|
||||
@@ -49,6 +51,7 @@ import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.InputStream;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Date;
|
||||
@@ -97,6 +100,8 @@ public class MaterialBaseInfoApplicationService {
|
||||
@Autowired
|
||||
private IMaterialWarehouseControlService materialWarehouseControlService;
|
||||
|
||||
@Resource
|
||||
private MaterialBaseInfoMapper materialBaseInfoMapper;
|
||||
/**
|
||||
* 分页查询物料基础信息列表
|
||||
*/
|
||||
@@ -444,6 +449,8 @@ public class MaterialBaseInfoApplicationService {
|
||||
if (StringUtils.isBlank(row.getHsCode()) && StringUtils.isNotBlank(row.getHsCodeImport())) {
|
||||
row.setHsCode(row.getHsCodeImport().trim());
|
||||
}
|
||||
// Excel 表头错位或重复时,HS 可能被读入「物料条形码」列;与 HS 完全相同时视为误填,保留 hsCode、清空条码
|
||||
normalizeImportBarCodeWhenDuplicateOfHs(row);
|
||||
fillOrganizationName(row, loginUser);
|
||||
|
||||
String shipperCode = StringUtils.defaultString(row.getShipperCode(), "");
|
||||
@@ -471,18 +478,36 @@ public class MaterialBaseInfoApplicationService {
|
||||
fillClassifyTypeAndUnit(row);
|
||||
|
||||
Object result = systemServiceFeign.getPackList(null, row.getPackName(), row.getOrganizationId());
|
||||
if (result == null) {
|
||||
errors.append("第").append(rowNum).append("行:包装规格查询无返回,请稍后重试或检查系统服务;");
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> resultMap = JSON.parseObject(JSONObject.toJSONString(result), new TypeReference<Map<String, Object>>() {});
|
||||
List<Map<String, Object>> rowsPack = extractTableDataRows(resultMap);
|
||||
Map<String, Object> stringObjectMap = rowsPack.get(0);
|
||||
if (stringObjectMap != null){
|
||||
String packCode = stringObjectMap.get("packCode") == null ? "" : String.valueOf(stringObjectMap.get("packCode"));
|
||||
row.setPackCode(packCode);
|
||||
String packId = stringObjectMap.get("packId") == null ? "" : String.valueOf(stringObjectMap.get("packId"));
|
||||
row.setPackId(Long.valueOf(packId));
|
||||
String unitName = stringObjectMap.get("unitName") == null ? "" : String.valueOf(stringObjectMap.get("unitName"));
|
||||
row.setUnitCode("EA");
|
||||
row.setUnitName(unitName);
|
||||
if (CollectionUtils.isEmpty(rowsPack)) {
|
||||
if (StringUtils.isNotBlank(row.getPackName())) {
|
||||
errors.append("第").append(rowNum).append("行:包装规格「").append(row.getPackName()).append("」不存在或未在系统中维护,请先在主数据维护该包装;");
|
||||
} else {
|
||||
errors.append("第").append(rowNum).append("行:包装规格未填写,或系统中无匹配的包装数据,请填写正确的包装规格名称;");
|
||||
}
|
||||
continue;
|
||||
}
|
||||
Map<String, Object> stringObjectMap = rowsPack.get(0);
|
||||
if (stringObjectMap == null) {
|
||||
errors.append("第").append(rowNum).append("行:包装规格查询结果为空,请检查包装主数据;");
|
||||
continue;
|
||||
}
|
||||
String packCode = stringObjectMap.get("packCode") == null ? "" : String.valueOf(stringObjectMap.get("packCode"));
|
||||
row.setPackCode(packCode);
|
||||
String packId = stringObjectMap.get("packId") == null ? "" : String.valueOf(stringObjectMap.get("packId"));
|
||||
if (StringUtils.isBlank(packId) || !StringUtils.isNumeric(packId)) {
|
||||
errors.append("第").append(rowNum).append("行:包装规格数据异常(缺少包装ID),请检查系统包装主数据;");
|
||||
continue;
|
||||
}
|
||||
row.setPackId(Long.valueOf(packId));
|
||||
String unitName = stringObjectMap.get("unitName") == null ? "" : String.valueOf(stringObjectMap.get("unitName"));
|
||||
row.setUnitCode("EA");
|
||||
row.setUnitName(unitName);
|
||||
|
||||
MaterialBaseInfoDO materialBaseInfoDO = new MaterialBaseInfoDO();
|
||||
BeanUtils.copyProperties(row, materialBaseInfoDO);
|
||||
@@ -494,7 +519,7 @@ public class MaterialBaseInfoApplicationService {
|
||||
Long materialBaseInfoId = materialBaseInfoDO.getMaterialBaseInfoId();
|
||||
|
||||
//商品规则批次
|
||||
if (StringUtils.isNotBlank(row.getBatchRuleNameImport())){
|
||||
if (StringUtils.isNotBlank(row.getBatchRuleNameImport())) {
|
||||
MaterialGoodsRuleDO materialGoodsRuleDO = new MaterialGoodsRuleDO();
|
||||
Object batchListByName = systemServiceFeign.getBatchListByName(row.getBatchRuleNameImport(), row.getOrganizationId());
|
||||
Map<String, Object> batchListByNameMap = JSON.parseObject(JSONObject.toJSONString(batchListByName), new TypeReference<Map<String, Object>>() {});
|
||||
@@ -964,6 +989,25 @@ public class MaterialBaseInfoApplicationService {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入约定:「HS码/HS编码」与「物料条形码」为不同列。模板表头错位或两列误填相同 HS 时,
|
||||
* barCode 会与 hsCode 相同;此时保留 hsCode,清空主表/子表条码,避免 HS 写入 bar_code。
|
||||
*/
|
||||
private void normalizeImportBarCodeWhenDuplicateOfHs(MaterialBaseInfoDTO row) {
|
||||
if (row == null) {
|
||||
return;
|
||||
}
|
||||
if (StringUtils.isBlank(row.getBarCode())) {
|
||||
row.setBarCode(null);
|
||||
return;
|
||||
}
|
||||
row.setBarCode(row.getBarCode().trim());
|
||||
String hs = StringUtils.isNotBlank(row.getHsCode()) ? row.getHsCode().trim() : "";
|
||||
if (StringUtils.isNotBlank(hs) && row.getBarCode().equals(hs)) {
|
||||
row.setBarCode(null);
|
||||
}
|
||||
}
|
||||
|
||||
private List<MaterialBarCodeDO> buildImportBarCodeList(MaterialBaseInfoDTO row) {
|
||||
if (StringUtils.isBlank(row.getBarCode())) {
|
||||
return null;
|
||||
@@ -1109,4 +1153,32 @@ public class MaterialBaseInfoApplicationService {
|
||||
return orgCandidates;
|
||||
}
|
||||
|
||||
public int updatePushStatus(Long materialBaseInfoId, Integer pushStatus, Date pushTimeDate, Long pushBy, String pushByName) {
|
||||
MaterialBaseInfo materialBaseInfo = new MaterialBaseInfo();
|
||||
materialBaseInfo.setMaterialBaseInfoId(materialBaseInfoId);
|
||||
materialBaseInfo.setPushStatus(pushStatus);
|
||||
materialBaseInfo.setPushTime(pushTimeDate);
|
||||
materialBaseInfo.setPushBy(pushBy);
|
||||
materialBaseInfo.setPushByName(pushByName);
|
||||
return materialBaseInfoMapper.updateById(materialBaseInfo);
|
||||
}
|
||||
|
||||
public TableDataInfo getBatchByIds(List<Long> materialBaseInfoIds) {
|
||||
if (materialBaseInfoIds == null || materialBaseInfoIds.isEmpty()) {
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(new ArrayList<>());
|
||||
tableDataInfo.setTotal(0);
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
List<MaterialBaseInfoPO> list = materialBaseInfoMapper.selectBatchByIds(materialBaseInfoIds);
|
||||
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setData(list);
|
||||
tableDataInfo.setTotal(list.size());
|
||||
tableDataInfo.setCode(200);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+17
-5
@@ -24,9 +24,11 @@ import com.mhd.wms.domain.pickingMaterialDetail.service.PickingMaterialDetailDom
|
||||
import com.mhd.wms.domain.pickingOrder.repository.po.PickingOrderPO;
|
||||
import com.mhd.wms.domain.pickingOrder.repository.todo.PickingOrderDO;
|
||||
import com.mhd.wms.domain.pickingOrder.service.PickingOrderDomainService;
|
||||
import com.mhd.wms.domain.materialGoodsRule.repository.facade.IMaterialGoodsRuleService;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.facade.IOutMaterialDetailService;
|
||||
import com.mhd.wms.domain.outMaterialDetail.entity.OutMaterialDetail;
|
||||
import com.mhd.wms.domain.outMaterialDetail.repository.po.OutMaterialDetailPO;
|
||||
import com.mhd.wms.util.ReceiptBatchDetailFilter;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
@@ -58,6 +60,8 @@ public class PickingOrderApplicationService {
|
||||
@Autowired
|
||||
private SystemServiceFeign systemServiceFeign;
|
||||
@Autowired
|
||||
private IMaterialGoodsRuleService materialGoodsRuleService;
|
||||
@Autowired
|
||||
private IOutMaterialDetailService outMaterialDetailService;
|
||||
|
||||
|
||||
@@ -212,11 +216,19 @@ public class PickingOrderApplicationService {
|
||||
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());
|
||||
if (CollectionUtils.isEmpty(batchDetailFeignPOList)) {
|
||||
continue;
|
||||
}
|
||||
// 物料未在商品规则中绑定批次模板时不返回批次属性(与收货单组装逻辑一致)
|
||||
List<BatchDetailFeignPO> alignedToRule = ReceiptBatchDetailFilter.filterByMaterialGoodsRule(
|
||||
materialBaseInfoId, batchDetailFeignPOList, materialGoodsRuleService);
|
||||
if (CollectionUtils.isEmpty(alignedToRule)) {
|
||||
continue;
|
||||
}
|
||||
List<BatchDetailFeignPO> filteredList = alignedToRule.stream()
|
||||
.filter(batchDetail -> batchDetail.getIsDisplay() != null && batchDetail.getIsDisplay() == 1)
|
||||
.collect(Collectors.toList());
|
||||
if (!CollectionUtils.isEmpty(filteredList)) {
|
||||
batchDetailMap.put(materialBaseInfoId, filteredList);
|
||||
}
|
||||
}
|
||||
|
||||
+12
-10
@@ -192,7 +192,7 @@ public class StockInOrderApplicationService {
|
||||
List<StockInOrderPO> stockInOrderPOS = stockInOrderDomainService.queryList(stockInOrderDO);
|
||||
for (StockInOrderPO stockInOrderPO : stockInOrderPOS) {
|
||||
Long inOrderId = stockInOrderPO.getInOrderId();
|
||||
List<ReceiptOrderAccount> list = receiptOrderAccountService.list(new LambdaQueryWrapper<ReceiptOrderAccount>().eq(ReceiptOrderAccount::getOrderId, inOrderId));
|
||||
List<ReceiptOrderAccount> list = receiptOrderAccountService.list(new LambdaQueryWrapper<ReceiptOrderAccount>().eq(ReceiptOrderAccount::getOrderId, inOrderId).eq(ReceiptOrderAccount::getInOrOut, "in"));
|
||||
stockInOrderPO.setReceiptOrderAccountList(list);
|
||||
}
|
||||
return stockInOrderPOS;
|
||||
@@ -255,9 +255,10 @@ public class StockInOrderApplicationService {
|
||||
if (receiptOrderAccountList != null && !receiptOrderAccountList.isEmpty()) {
|
||||
for (ReceiptOrderAccount receiptOrderAccount : receiptOrderAccountList) {
|
||||
receiptOrderAccount.setOrderId(inOrderId);
|
||||
receiptOrderAccount.setInOrOut("in");
|
||||
}
|
||||
r = receiptOrderAccountService.saveBatch(receiptOrderAccountList);
|
||||
wholeRentSynchronizationZXF(inOrderId);
|
||||
wholeRentSynchronizationZXF(inOrderId,"in");
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@@ -276,9 +277,10 @@ public class StockInOrderApplicationService {
|
||||
if (receiptOrderAccountList != null && !receiptOrderAccountList.isEmpty()) {
|
||||
for (ReceiptOrderAccount receiptOrderAccount : receiptOrderAccountList) {
|
||||
receiptOrderAccount.setOrderId(outOrderId);
|
||||
receiptOrderAccount.setInOrOut("out");
|
||||
}
|
||||
r = receiptOrderAccountService.saveBatch(receiptOrderAccountList);
|
||||
wholeRentSynchronizationZXF(outOrderId);
|
||||
wholeRentSynchronizationZXF(outOrderId,"out");
|
||||
}
|
||||
return r;
|
||||
}
|
||||
@@ -286,10 +288,10 @@ public class StockInOrderApplicationService {
|
||||
/**
|
||||
* 定时任务整租推送到bms装卸费
|
||||
*/
|
||||
public void wholeRentSynchronizationZXF(Long busId) {
|
||||
StockInOrder stockInOrder = stockInOrderService.getOne(new QueryWrapper<StockInOrder>().lambda().eq(StockInOrder::getInOrderId, busId),false);
|
||||
StockOutOrder stockOutOrder = stockOutOrderService.getOne(new QueryWrapper<StockOutOrder>().lambda().eq(StockOutOrder::getOutOrderId, busId),false);
|
||||
if (stockInOrder != null) {
|
||||
public void wholeRentSynchronizationZXF(Long busId,String inOrOut) {
|
||||
StockInOrder stockInOrder = stockInOrderService.getOne(new QueryWrapper<StockInOrder>().lambda().eq(StockInOrder::getInOrderId, busId).eq(StockInOrder::getDelFlag, 1),false);
|
||||
StockOutOrder stockOutOrder = stockOutOrderService.getOne(new QueryWrapper<StockOutOrder>().lambda().eq(StockOutOrder::getOutOrderId, busId).eq(StockOutOrder::getDelFlag, 1),false);
|
||||
if ("in".equals(inOrOut)) {
|
||||
Long shipperId = stockInOrder.getShipperId();
|
||||
Long organizationId = stockInOrder.getOrganizationId();
|
||||
String organizationName = stockInOrder.getOrganizationName();
|
||||
@@ -297,7 +299,7 @@ public class StockInOrderApplicationService {
|
||||
String inOrderNumber = stockInOrder.getInOrderNumber();
|
||||
String settlementCurrency = stockInOrder.getSettlementCurrency();
|
||||
String salesmanId = stockInOrder.getSalesmanId();
|
||||
List<ReceiptOrderAccount> accounts = receiptOrderAccountService.list(new QueryWrapper<ReceiptOrderAccount>().lambda().eq(ReceiptOrderAccount::getOrderId, busId));
|
||||
List<ReceiptOrderAccount> accounts = receiptOrderAccountService.list(new QueryWrapper<ReceiptOrderAccount>().lambda().eq(ReceiptOrderAccount::getOrderId, busId).eq(ReceiptOrderAccount::getInOrOut, "in"));
|
||||
for (ReceiptOrderAccount account : accounts) {
|
||||
BigDecimal amount = account.getAmount();
|
||||
String subjectCode = account.getSubjectCode();
|
||||
@@ -355,7 +357,7 @@ public class StockInOrderApplicationService {
|
||||
bmsServiceFeign.wholeRentSynchronizationZXF(businessDataPushDTO);
|
||||
}
|
||||
}
|
||||
} else if (stockOutOrder != null) {
|
||||
} else if ("out".equals(inOrOut)) {
|
||||
Long shipperId = stockOutOrder.getShipperId();
|
||||
Long organizationId = stockOutOrder.getOrganizationId();
|
||||
String organizationName = stockOutOrder.getOrganizationName();
|
||||
@@ -363,7 +365,7 @@ public class StockInOrderApplicationService {
|
||||
String inOrderNumber = stockOutOrder.getOutOrderNumber();
|
||||
String settlementCurrency = stockOutOrder.getSettlementCurrency();
|
||||
String salesmanId = stockOutOrder.getSalesmanId();
|
||||
List<ReceiptOrderAccount> accounts = receiptOrderAccountService.list(new QueryWrapper<ReceiptOrderAccount>().lambda().eq(ReceiptOrderAccount::getOrderId, busId));
|
||||
List<ReceiptOrderAccount> accounts = receiptOrderAccountService.list(new QueryWrapper<ReceiptOrderAccount>().lambda().eq(ReceiptOrderAccount::getOrderId, busId).eq(ReceiptOrderAccount::getInOrOut, "out"));
|
||||
for (ReceiptOrderAccount account : accounts) {
|
||||
String subjectCode = account.getSubjectCode();
|
||||
String subjectName = account.getSubjectName();
|
||||
|
||||
+1
-1
@@ -212,7 +212,7 @@ public class StockOutOrderApplicationService {
|
||||
Map<Long, List<ReceiptOrderAccount>> accountByOrderId = Collections.emptyMap();
|
||||
if (!CollectionUtils.isEmpty(orderIds)) {
|
||||
List<ReceiptOrderAccount> accounts = receiptOrderAccountService.list(
|
||||
new LambdaQueryWrapper<ReceiptOrderAccount>().in(ReceiptOrderAccount::getOrderId, orderIds));
|
||||
new LambdaQueryWrapper<ReceiptOrderAccount>().in(ReceiptOrderAccount::getOrderId, orderIds).eq(ReceiptOrderAccount::getInOrOut, "out"));
|
||||
accountByOrderId = accounts.stream().collect(Collectors.groupingBy(ReceiptOrderAccount::getOrderId));
|
||||
}
|
||||
|
||||
|
||||
+23
@@ -4,13 +4,16 @@ 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.fasterxml.jackson.annotation.JsonFormat;
|
||||
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 org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -204,4 +207,24 @@ public class MaterialBaseInfo extends BaseVOEntity {
|
||||
@TableField("copy_code")
|
||||
private Integer copyCode;
|
||||
|
||||
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
||||
@Excel(name = "货物类型:0-物料 1-半成品 2-成品")
|
||||
private Integer goodsType;
|
||||
|
||||
@ApiModelProperty(name = "推送状态 1-未推送 2-推送中 3-推送成功 4-推送失败")
|
||||
private Integer pushStatus;
|
||||
@ApiModelProperty(name = "推送时间")
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTime;
|
||||
@ApiModelProperty(name = "推送人")
|
||||
private Long pushBy;
|
||||
|
||||
@ApiModelProperty(name = "推送人名称")
|
||||
private String pushByName;
|
||||
|
||||
@ApiModelProperty("毛重(kg)")
|
||||
@Excel(name = "毛重(kg)")
|
||||
private BigDecimal grossWeight;
|
||||
|
||||
}
|
||||
|
||||
+4
@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.mhd.wms.domain.materialBaseInfo.entity.MaterialBaseInfo;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO;
|
||||
import com.mhd.wms.domain.materialBaseInfo.repository.todo.MaterialBaseInfoDO;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -21,4 +22,7 @@ public interface MaterialBaseInfoMapper extends BaseMapper<MaterialBaseInfo>
|
||||
public List<MaterialBaseInfoPO> queryList(MaterialBaseInfoDO materialBaseInfoDO);
|
||||
|
||||
MaterialBaseInfoPO selectOneByID(Long materialBaseInfoId);
|
||||
|
||||
List<MaterialBaseInfoPO> selectBatchByIds(@Param("materialBaseInfoIds") List<Long> materialBaseInfoIds);
|
||||
|
||||
}
|
||||
|
||||
+26
@@ -1,6 +1,8 @@
|
||||
package com.mhd.wms.domain.materialBaseInfo.repository.po;
|
||||
|
||||
import com.alibaba.nacos.shaded.io.grpc.Internal;
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.mhd.common.core.annotation.Excel;
|
||||
import com.mhd.common.core.handler.ListTypeHandler;
|
||||
import com.mhd.common.core.web.domain.BaseVOEntity;
|
||||
@@ -13,8 +15,10 @@ import com.mhd.wms.domain.materialWarehouseControl.repository.po.MaterialWarehou
|
||||
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;
|
||||
|
||||
|
||||
@@ -249,4 +253,26 @@ public class MaterialBaseInfoPO extends BaseVOEntity {
|
||||
@Excel(name = "是否抄码: 1-是 2-否")
|
||||
private Integer copyCode;
|
||||
|
||||
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
||||
@Excel(name = "货物类型:0-物料 1-半成品 2-成品")
|
||||
private Integer goodsType;
|
||||
|
||||
@ApiModelProperty("毛重(kg)")
|
||||
@Excel(name = "毛重(kg)")
|
||||
private BigDecimal grossWeight;
|
||||
|
||||
@ApiModelProperty("推送状态 1-未推送 2推送中 3-推送成功 4-推送失败")
|
||||
private Integer pushStatus;
|
||||
|
||||
@ApiModelProperty("推送时间")
|
||||
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pushTime;
|
||||
|
||||
@ApiModelProperty("推送人")
|
||||
private Long pushBy;
|
||||
|
||||
@ApiModelProperty(name = "推送人名称")
|
||||
private String pushByName;
|
||||
|
||||
}
|
||||
+29
@@ -221,4 +221,33 @@ public class MaterialBaseInfoDO extends BaseVOEntity {
|
||||
@ApiModelProperty("是否抄码: 1-是 2-否")
|
||||
@Excel(name = "是否抄码: 1-是 2-否")
|
||||
private Integer copyCode;
|
||||
|
||||
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
||||
@Excel(name = "货物类型:0-物料 1-半成品 2-成品")
|
||||
private Integer goodsType;
|
||||
|
||||
@ApiModelProperty("毛重(kg)")
|
||||
@Excel(name = "毛重(kg)")
|
||||
private BigDecimal grossWeight;
|
||||
|
||||
@ApiModelProperty("推送状态")
|
||||
private Integer pushStatus;
|
||||
|
||||
@ApiModelProperty("推送时间起")
|
||||
private String pushTimeStart;
|
||||
|
||||
@ApiModelProperty("推送时间止")
|
||||
private String pushTimeEnd;
|
||||
|
||||
@ApiModelProperty("创建时间起")
|
||||
private String createTimeStart;
|
||||
|
||||
@ApiModelProperty("创建时间止")
|
||||
private String createTimeEnd;
|
||||
|
||||
@ApiModelProperty("更新时间起")
|
||||
private String updateTimeStart;
|
||||
|
||||
@ApiModelProperty("更新时间止")
|
||||
private String updateTimeEnd;
|
||||
}
|
||||
|
||||
+2
@@ -33,6 +33,8 @@ public interface MaterialInventoryMapper extends BaseMapper<MaterialInventory>
|
||||
public List<MaterialInventoryPO> queryListByWl(MaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-货主
|
||||
public List<MaterialInventoryPO> queryListByHz(MaterialInventoryDO materialInventoryDO);
|
||||
//查物料库存列表-货主+物料(同一物料在不同货主下各一行)
|
||||
public List<MaterialInventoryPO> queryListByHzWl(MaterialInventoryDO materialInventoryDO);
|
||||
|
||||
/**
|
||||
* @description 批量增加库存
|
||||
|
||||
+4
-2
@@ -77,6 +77,8 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
String queryRule = materialInventoryDO.getQueryRule();
|
||||
if ("hz".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByHz(materialInventoryDO);
|
||||
} else if ("hzwl".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByHzWl(materialInventoryDO);
|
||||
} else if ("wl".equals(queryRule)) {
|
||||
return materialInventoryMapper.queryListByWl(materialInventoryDO);
|
||||
} else if ("kw".equals(queryRule)) {
|
||||
@@ -874,7 +876,7 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
BigDecimal newInventoryQuantity = oldInventoryQuantity.add(quantity);
|
||||
//扣减后可用数量
|
||||
BigDecimal newAllocationQuantity = oldAllocationQuantity.add(quantity);
|
||||
BigDecimal newFreezeQuantity = oldFreezeQuantity.add(quantity);
|
||||
//BigDecimal newFreezeQuantity = oldFreezeQuantity.add(quantity);
|
||||
|
||||
|
||||
|
||||
@@ -896,7 +898,7 @@ public class MaterialInventoryImpl extends ServiceImpl<MaterialInventoryMapper,
|
||||
|
||||
materialInventoryPO.setInventoryQuantity(newInventoryQuantity);
|
||||
materialInventoryPO.setAllocationQuantity(newAllocationQuantity);
|
||||
materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
//materialInventoryPO.setFreezeQuantity(newFreezeQuantity);
|
||||
materialInventoryPO.setArea(newArea);
|
||||
materialInventoryPO.setVolume(newVolume);
|
||||
materialInventoryPO.setGrossWeight(newGrossWeight);
|
||||
|
||||
+4
-1
@@ -230,7 +230,7 @@ public class MaterialInventoryDO extends MaterialBaseDO {
|
||||
@Excel(name = "ExtAttr4", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date extAttr4;
|
||||
|
||||
//查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部
|
||||
//查询规则 hz:货主,hzwl:货主+物料,wl:物料,kw:库位,wlkw:物料库位,all:全部(listAll 传入 hz 时会改为 hzwl)
|
||||
private String queryRule;
|
||||
|
||||
@ApiModelProperty("冻结数量大于0条件")
|
||||
@@ -244,4 +244,7 @@ public class MaterialInventoryDO extends MaterialBaseDO {
|
||||
@ApiModelProperty("LOT编号")
|
||||
@Excel(name = "LOT编号")
|
||||
private String lotNumber;
|
||||
|
||||
/** 为 true 时 SQL 排除库存数量为 0(含 null 视为 0) */
|
||||
private Boolean excludeZeroInventoryQuantity;
|
||||
}
|
||||
+12
-6
@@ -201,12 +201,18 @@ public class OutMaterialDetailImpl extends ServiceImpl<OutMaterialDetailMapper,
|
||||
String materialNo = outMaterialDetail.getMaterialNo();
|
||||
List<MaterialBaseInfo> materialBaseInfos = materialBaseInfoMapper.selectList(new QueryWrapper<MaterialBaseInfo>().lambda().eq(MaterialBaseInfo::getMaterialCode, materialNo));
|
||||
if (!CollectionUtils.isEmpty(materialBaseInfos) && materialBaseInfos.size() > 0) {
|
||||
outMaterialDetail.setCommodityName(materialBaseInfos.get(0).getMaterialName());
|
||||
outMaterialDetail.setBarCode(materialBaseInfos.get(0).getBarCode());
|
||||
outMaterialDetail.setPackName(materialBaseInfos.get(0).getPackName());
|
||||
outMaterialDetail.setPackCode(materialBaseInfos.get(0).getPackCode());
|
||||
outMaterialDetail.setUnitCode(materialBaseInfos.get(0).getUnitCode());
|
||||
outMaterialDetail.setUnitName(materialBaseInfos.get(0).getUnitName());
|
||||
MaterialBaseInfo mbi = materialBaseInfos.get(0);
|
||||
outMaterialDetail.setCommodityName(mbi.getMaterialName());
|
||||
// 主数据未维护条码时不写入明细,避免误带主表 bar_code(如历史脏数据);有维护再回填
|
||||
if (StringUtils.isNotBlank(mbi.getBarCode())) {
|
||||
outMaterialDetail.setBarCode(mbi.getBarCode().trim());
|
||||
} else {
|
||||
outMaterialDetail.setBarCode(null);
|
||||
}
|
||||
outMaterialDetail.setPackName(mbi.getPackName());
|
||||
outMaterialDetail.setPackCode(mbi.getPackCode());
|
||||
outMaterialDetail.setUnitCode(mbi.getUnitCode());
|
||||
outMaterialDetail.setUnitName(mbi.getUnitName());
|
||||
}
|
||||
outMaterialDetailList.add(outMaterialDetail);
|
||||
}
|
||||
|
||||
+4
@@ -210,6 +210,7 @@ public class ReviewOrderDomainService {
|
||||
d.setMaterialCode(line.getMaterialCode());
|
||||
d.setMaterialName(line.getMaterialName());
|
||||
d.setBarCode(line.getBarCode());
|
||||
d.setSize(line.getSize());
|
||||
d.setUnitCode(line.getUnitCode());
|
||||
d.setUnitName(line.getUnitName());
|
||||
d.setLotNo(line.getLotNo());
|
||||
@@ -272,6 +273,9 @@ public class ReviewOrderDomainService {
|
||||
if (!StringUtils.hasText(d.getBarCode())) {
|
||||
d.setBarCode(outMd.getBarCode());
|
||||
}
|
||||
if (!StringUtils.hasText(d.getSize()) && StringUtils.hasText(outMd.getSize())) {
|
||||
d.setSize(outMd.getSize());
|
||||
}
|
||||
if (d.getMaterialBaseInfoId() == null) {
|
||||
d.setMaterialBaseInfoId(outMd.getMaterialBaseInfoId());
|
||||
}
|
||||
|
||||
+2
@@ -115,4 +115,6 @@ public class ReceiptOrderAccount extends BaseVOEntity {
|
||||
|
||||
@ApiModelProperty(value = "计算价格json")
|
||||
private String amountJson;
|
||||
@ApiModelProperty(value = "出入库区别标识")
|
||||
private String inOrOut;
|
||||
}
|
||||
@@ -42,6 +42,10 @@ public class ReviewMaterialDetail extends BaseVOEntity {
|
||||
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("尺寸")
|
||||
@TableField("SIZE")
|
||||
private String size;
|
||||
|
||||
private String unitCode;
|
||||
|
||||
private String unitName;
|
||||
|
||||
+3
@@ -49,6 +49,9 @@ public class ReviewMaterialDetailPO extends BaseVOEntity {
|
||||
@ApiModelProperty("物料条码")
|
||||
private String barCode;
|
||||
|
||||
@ApiModelProperty("尺寸")
|
||||
private String size;
|
||||
|
||||
@ApiModelProperty("单位代码")
|
||||
private String unitCode;
|
||||
|
||||
|
||||
+20
@@ -134,4 +134,24 @@ public class ImmediateInventoryPO {
|
||||
@ApiModelProperty("LOT编号")
|
||||
@Excel(name = "LOT编号")
|
||||
private String lotNumber;
|
||||
|
||||
@ApiModelProperty("库存更新时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date inventoryUpdateTime;
|
||||
|
||||
@ApiModelProperty("拣货明细最近更新时间(本库存相关已拣货明细)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date pickLastUpdateTime;
|
||||
|
||||
@ApiModelProperty("复核明细最近更新时间(本库存相关复核条件内明细)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date checkLastUpdateTime;
|
||||
|
||||
@ApiModelProperty("列表排序用时间(库存/拣货/复核三者最晚)")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date latestChangeTime;
|
||||
}
|
||||
+5
@@ -1651,6 +1651,11 @@ public class StockOutOrderDomainService {
|
||||
outMaterialDetailDO.setPackCode(materialBaseInfoPO.getPackCode());
|
||||
outMaterialDetailDO.setPackName(materialBaseInfoPO.getPackName());
|
||||
|
||||
// 将出库数量赋值给计划数量
|
||||
if (outMaterialDetailDO.getOutboundQuantity() != null) {
|
||||
outMaterialDetailDO.setQuantity(outMaterialDetailDO.getOutboundQuantity());
|
||||
}
|
||||
|
||||
//获取包装详情
|
||||
/*AjaxResult packDetailResult = systemServiceFeign.getInfoByPackIdAndUnitCode(materialBaseInfoPO.getPackId(), "EA");
|
||||
if(!"200".equals(String.valueOf(packDetailResult.get("code")))){
|
||||
|
||||
+4
@@ -1477,6 +1477,10 @@ public class StockShelfOrderDomainService {
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
param.setBoxPalletNo(shelfMaterialDetail.getBoxPalletNo());
|
||||
param.setSheetRefNo(shelfMaterialDetail.getSheetRefNo());
|
||||
param.setBatchRefNo(shelfMaterialDetail.getBatchRefNo());
|
||||
}
|
||||
return param;
|
||||
}
|
||||
|
||||
+32
@@ -264,4 +264,36 @@ public class MaterialBaseInfoDTO extends BaseVOEntity {
|
||||
@ApiModelProperty("是否抄码: 1-是 2-否")
|
||||
@Excel(name = "是否抄码: 1-是 2-否")
|
||||
private Integer copyCode;
|
||||
|
||||
@ApiModelProperty("货物类型:0-物料 1-半成品 2-成品")
|
||||
@Excel(name = "货物类型:0-物料 1-半成品 2-成品")
|
||||
private Integer goodsType;
|
||||
|
||||
@ApiModelProperty("毛重(kg)")
|
||||
@Excel(name = "毛重(kg)")
|
||||
private BigDecimal grossWeight;
|
||||
|
||||
@ApiModelProperty("推送状态")
|
||||
private Integer pushStatus;
|
||||
|
||||
@ApiModelProperty("推送时间起")
|
||||
private String pushTimeStart;
|
||||
|
||||
@ApiModelProperty("推送时间止")
|
||||
private String pushTimeEnd;
|
||||
|
||||
@ApiModelProperty("创建时间起")
|
||||
private String createTimeStart;
|
||||
|
||||
@ApiModelProperty("创建时间止")
|
||||
private String createTimeEnd;
|
||||
|
||||
@ApiModelProperty("更新时间起")
|
||||
private String updateTimeStart;
|
||||
|
||||
@ApiModelProperty("更新时间止")
|
||||
private String updateTimeEnd;
|
||||
|
||||
@ApiModelProperty(name = "推送人名称")
|
||||
private String pushByName;
|
||||
}
|
||||
|
||||
+5
-1
@@ -162,7 +162,7 @@ public class MaterialInventoryDTO extends MaterialBaseDTO {
|
||||
@ApiModelProperty("箱号/卡板号")
|
||||
@Excel(name = "箱号/卡板号")
|
||||
private String boxPalletNo;
|
||||
//查询规则 hz:货主,wl:物料,kw:库位,wlkw:物料库位,all:全部
|
||||
//查询规则 hz:货主,hzwl:货主+物料,wl:物料,kw:库位,wlkw:物料库位,all:全部(materialInventoryApi/listAll 传 hz 时后端按货主+物料分组)
|
||||
private String queryRule;
|
||||
|
||||
@ApiModelProperty("净重(KG)")
|
||||
@@ -185,4 +185,8 @@ public class MaterialInventoryDTO extends MaterialBaseDTO {
|
||||
@Excel(name = "冻结数量大于0条件")
|
||||
private String greaterThanFreezeQuantity;
|
||||
|
||||
/** 为 true 时排除库存数量为 0 的行(出库分配选库存用);库存查询页不传或 false */
|
||||
@ApiModelProperty(value = "是否排除库存数量为0", example = "false")
|
||||
private Boolean excludeZeroInventoryQuantity;
|
||||
|
||||
}
|
||||
+38
-1
@@ -1,7 +1,10 @@
|
||||
package com.mhd.wms.interfaces.facadeApi.materialBaseInfo;
|
||||
|
||||
import cn.hutool.core.date.DateUtil;
|
||||
import com.github.pagehelper.Page;
|
||||
import com.mhd.common.core.domain.entity.R;
|
||||
import com.mhd.common.core.exception.ServiceException;
|
||||
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;
|
||||
@@ -17,6 +20,7 @@ import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
@@ -109,10 +113,43 @@ public class MaterialBaseInfoApi extends BaseController {
|
||||
return materialBaseInfoApplicationService.importData(file);
|
||||
}
|
||||
|
||||
@ApiOperation("物料管理更新推送信息")
|
||||
@PostMapping("/updatePushStatus")
|
||||
public AjaxResult<?> updateMaterialPushStatus(@RequestParam("materialBaseInfoId") Long materialBaseInfoId,
|
||||
@RequestParam("pushStatus") Integer pushStatus,
|
||||
@RequestParam(value = "pushTime",required = false) String pushTime,
|
||||
@RequestParam(value = "pushBy",required = false) Long pushBy,
|
||||
@RequestParam(value = "pushByName",required = false) String pushByName){
|
||||
Date pushTimeDate = null;
|
||||
if (StringUtils.isNotBlank(pushTime)) {
|
||||
pushTimeDate = DateUtil.parse(pushTime);
|
||||
}
|
||||
return toAjax(materialBaseInfoApplicationService.updatePushStatus(materialBaseInfoId, pushStatus, pushTimeDate, pushBy, pushByName));
|
||||
}
|
||||
|
||||
@ApiOperation("查询物料基础信息列表")
|
||||
@GetMapping("/queryList")
|
||||
public TableDataInfo queryList(MaterialBaseInfoDTO materialBaseInfoDTO)
|
||||
{
|
||||
//转换实体
|
||||
MaterialBaseInfoDO materialBaseInfoDO = materialBaseInfoAssembler.toDO(materialBaseInfoDTO);
|
||||
startPage();
|
||||
List<MaterialBaseInfoPO> list = materialBaseInfoApplicationService.queryList(materialBaseInfoDO);
|
||||
Page<MaterialBaseInfoPO> page = (Page<MaterialBaseInfoPO>) list;
|
||||
TableDataInfo tableDataInfo = new TableDataInfo();
|
||||
tableDataInfo.setTotal(page.getTotal());
|
||||
tableDataInfo.setCode(200);
|
||||
tableDataInfo.setData(list);
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@ApiOperation("根据物料ID列表批量查询物料")
|
||||
@GetMapping("/getBatchByIds")
|
||||
public TableDataInfo getBatchByIds(@RequestParam("materialBaseInfoIds") List<Long> materialBaseInfoIds) {
|
||||
return materialBaseInfoApplicationService.getBatchByIds(materialBaseInfoIds);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
+11
-3
@@ -48,11 +48,15 @@ public class MaterialInventoryApi extends BaseController {
|
||||
/**
|
||||
* 分页查询物料库存列表
|
||||
*/
|
||||
@ApiOperation("查询物料库存列表")
|
||||
@ApiOperation(value = "查询物料库存列表", notes = "库存查询页不传 excludeZeroInventoryQuantity 可查出数量为0;出库分配页传 excludeZeroInventoryQuantity=true 排除库存数量为0")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MaterialInventoryDTO materialInventoryDTO,
|
||||
@RequestParam(value = "customerName", required = false) String customerName)
|
||||
@RequestParam(value = "customerName", required = false) String customerName,
|
||||
@RequestParam(value = "excludeZeroInventoryQuantity", required = false) Boolean excludeZeroInventoryQuantity)
|
||||
{
|
||||
if (Boolean.TRUE.equals(excludeZeroInventoryQuantity)) {
|
||||
materialInventoryDTO.setExcludeZeroInventoryQuantity(true);
|
||||
}
|
||||
// 出库分配前端传的是客户名称 customerName,这里通过名称查询货主ID,使用精确匹配(不模糊匹配)
|
||||
String shipperName = null; // 保存查询到的货主名称
|
||||
if (StringUtils.isNotBlank(customerName) && materialInventoryDTO.getShipperId() == null) {
|
||||
@@ -124,12 +128,16 @@ public class MaterialInventoryApi extends BaseController {
|
||||
return tableDataInfo;
|
||||
}
|
||||
|
||||
@ApiOperation("查询物料库存列表不分页")
|
||||
@ApiOperation("查询物料库存列表不分页;queryRule=hz 时按货主+物料分组(同一物料在不同货主各占一行)")
|
||||
@GetMapping("/listAll")
|
||||
public TableDataInfo listAll(MaterialInventoryDTO materialInventoryDTO)
|
||||
{
|
||||
//转换实体
|
||||
MaterialInventoryDO materialInventoryDO = materialInventoryAssembler.toDO(materialInventoryDTO);
|
||||
// 不分页列表按货主查询:需按「货主+物料」汇总;分页 /list 仍用 hz 表示仅按货主一行
|
||||
if ("hz".equals(materialInventoryDO.getQueryRule())) {
|
||||
materialInventoryDO.setQueryRule("hzwl");
|
||||
}
|
||||
List<MaterialInventoryPO> list = materialInventoryApplicationService.queryList(materialInventoryDO);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
+15
@@ -1,8 +1,11 @@
|
||||
package com.mhd.wms.interfaces.facadeApi.statementStatistics;
|
||||
|
||||
import com.github.pagehelper.PageHelper;
|
||||
import com.github.pagehelper.PageInfo;
|
||||
import com.mhd.common.core.constant.HttpStatus;
|
||||
import com.mhd.common.core.utils.PageUtils;
|
||||
import com.mhd.common.core.web.page.PageDomain;
|
||||
import com.mhd.common.core.web.page.TableSupport;
|
||||
import com.mhd.common.core.web.page.TableDataInfo;
|
||||
import com.mhd.wms.application.service.statementStatistics.StatementStatisticsService;
|
||||
import com.mhd.wms.domain.statementStatistics.po.ImmediateInventoryPO;
|
||||
@@ -100,6 +103,18 @@ public class StatementStatisticsApi {
|
||||
PageUtils.startPage();
|
||||
}
|
||||
|
||||
/**
|
||||
* 即时库存分页:不注入 PageHelper 的 orderBy,保证仅使用 SQL 中的倒序(时间由晚到早)。
|
||||
*/
|
||||
private void startPageImmediateInventory()
|
||||
{
|
||||
PageDomain pageDomain = TableSupport.buildPageRequest();
|
||||
Integer pageNum = pageDomain.getPageNum();
|
||||
Integer pageSize = pageDomain.getPageSize();
|
||||
Boolean reasonable = pageDomain.getReasonable();
|
||||
PageHelper.startPage(pageNum, pageSize, "").setReasonable(reasonable);
|
||||
}
|
||||
|
||||
/**
|
||||
* 响应请求分页数据
|
||||
*/
|
||||
|
||||
@@ -58,6 +58,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="specificationModel" column="SPECIFICATION_MODEL" />
|
||||
<result property="stockQuantity" column="stock_quantity" />
|
||||
<result property="copyCode" column="copy_code" />
|
||||
<result property="goodsType" column="goods_type" />
|
||||
<result property="pushStatus" column="push_status" />
|
||||
<result property="pushTime" column="push_time" />
|
||||
<result property="pushBy" column="push_by" />
|
||||
<result property="grossWeight" column="gross_weight" />
|
||||
</resultMap>
|
||||
|
||||
|
||||
@@ -66,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
material_classify_name, a.material_type, a.material_type_name, a.pack_id, a.pack_code, a.pack_name, a.unit_code, a.unit_name, a.brand_id, a.brand_code, a.brand_name, a.shelf_life, a.weight_limit, a.volume_limit, a.material_shape,
|
||||
material_shape_name, a.material_size, a.material_length, a.material_width, a.material_height, a.remark, a.nullify, a.create_time, a.create_by, a.create_by_name, a.update_time, a.update_by, a.update_by_name, a.del_flag, a.common,
|
||||
sku_code, a.unit_price, a.currency, a.origin_country, a.hs_code, a.declaration_unit, a.statutory_unit, a.statutory_second_unit, a.copy_code,
|
||||
a.push_status,a.push_time,a.push_by,a.goods_type,a.gross_weight,
|
||||
specification_model as specification_model,nvl(b.stock_qty,0) as stock_quantity from material_base_info a left join (
|
||||
select material_base_info_id, sum(INVENTORY_QUANTITY) as stock_qty from MATERIAL_INVENTORY group by material_base_info_id
|
||||
) b on a.material_base_info_id = b.material_base_info_id
|
||||
@@ -209,6 +215,27 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
and mgr.batch_id = #{batchId}
|
||||
and mgr.del_flag = 1
|
||||
)
|
||||
</if>
|
||||
<if test="pushStatus != null">
|
||||
and a.push_status = #{pushStatus}
|
||||
</if>
|
||||
<if test="pushTimeStart != null and pushTimeStart != ''">
|
||||
and date_format(a.push_time,'%Y-%m-%d') >= #{pushTimeStart}
|
||||
</if>
|
||||
<if test="pushTimeEnd != null and pushTimeEnd != ''">
|
||||
and date_format(a.push_time,'%Y-%m-%d') <= #{pushTimeEnd}
|
||||
</if>
|
||||
<if test="createTimeStart != null and createTimeStart != ''">
|
||||
and date_format(a.create_time,'%Y-%m-%d') >= #{createTimeStart}
|
||||
</if>
|
||||
<if test="createTimeEnd != null and createTimeEnd != ''">
|
||||
and date_format(a.create_time,'%Y-%m-%d') <= #{createTimeEnd}
|
||||
</if>
|
||||
<if test="updateTimeStart != null and updateTimeStart != ''">
|
||||
and date_format(a.update_time,'%Y-%m-%d') >= #{updateTimeStart}
|
||||
</if>
|
||||
<if test="updateTimeEnd != null and updateTimeEnd != ''">
|
||||
and date_format(a.update_time,'%Y-%m-%d') <= #{updateTimeEnd}
|
||||
</if>
|
||||
<!-- 传 1:只查公共 , 2:只查自己的 ,3:公共的和自己的 -->
|
||||
<choose>
|
||||
@@ -281,4 +308,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
where material_base_info_id = #{materialBaseInfoId}
|
||||
|
||||
</select>
|
||||
|
||||
|
||||
<select id="selectBatchByIds" resultType="com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO">
|
||||
select * from material_base_info
|
||||
where material_base_info_id in
|
||||
<foreach collection="materialBaseInfoIds" item="id" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
|
||||
</mapper>
|
||||
@@ -89,6 +89,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.in_order_number,a.lot_number
|
||||
</sql>
|
||||
|
||||
<!-- 按物料(wl)汇总:仓库/库区/库位取创建时间最新的一条明细(与 queryListByWl 中 loc 子查询一致;并列时取 material_inventory_id 更大) -->
|
||||
<sql id="selectMaterialInventoryPoWl">
|
||||
a.material_inventory_id, a.organization_id, a.organization_name, a.top_organization_id,
|
||||
a.shipper_id, a.shipper_code, a.shipper_name,
|
||||
loc.warehouse_id, loc.warehouse_code, loc.warehouse_name,
|
||||
loc.storage_section_id, loc.storage_code, loc.storage_name, loc.storage_location_id, loc.storage_location_code, loc.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}
|
||||
@@ -183,6 +206,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="freezeQuantity != null ">
|
||||
and a.freeze_quantity = #{freezeQuantity}
|
||||
</if>
|
||||
<if test="excludeZeroInventoryQuantity != null and excludeZeroInventoryQuantity == true">
|
||||
and COALESCE(a.inventory_quantity, 0) > 0
|
||||
</if>
|
||||
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and a.create_by_name like concat('%', #{createByName}, '%')
|
||||
@@ -208,6 +234,124 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<!-- 与 selectMaterialInventoryPo1 相同条件,表别名为 mi(用于 queryListByWl 最新明细子查询) -->
|
||||
<sql id="selectMaterialInventoryPo1Mi">
|
||||
<if test="materialInventoryId != null ">
|
||||
and mi.material_inventory_id = #{materialInventoryId}
|
||||
</if>
|
||||
<if test="organizationId != null ">
|
||||
and mi.organization_id = #{organizationId}
|
||||
</if>
|
||||
<if test="organizationName != null and organizationName != ''">
|
||||
and mi.organization_name like concat('%', #{organizationName}, '%')
|
||||
</if>
|
||||
<if test="topOrganizationId != null ">
|
||||
and mi.top_organization_id = #{topOrganizationId}
|
||||
</if>
|
||||
<if test="warehouseId != null ">
|
||||
and mi.warehouse_id = #{warehouseId}
|
||||
</if>
|
||||
<if test="shipperId != null ">
|
||||
and mi.shipper_id = #{shipperId}
|
||||
</if>
|
||||
<if test="warehouseCode != null and warehouseCode != ''">
|
||||
and mi.warehouse_code = #{warehouseCode}
|
||||
</if>
|
||||
<if test="warehouseName != null and warehouseName != ''">
|
||||
and mi.warehouse_name like concat('%', #{warehouseName}, '%')
|
||||
</if>
|
||||
<if test="storageSectionId != null ">
|
||||
and mi.storage_section_id = #{storageSectionId}
|
||||
</if>
|
||||
<if test="storageCode != null and storageCode != ''">
|
||||
and mi.storage_code = #{storageCode}
|
||||
</if>
|
||||
<if test="storageName != null and storageName != ''">
|
||||
and mi.storage_name like concat('%', #{storageName}, '%')
|
||||
</if>
|
||||
<if test="storageLocationId != null ">
|
||||
and mi.storage_location_id = #{storageLocationId}
|
||||
</if>
|
||||
<if test="storageLocationCode != null and storageLocationCode != ''">
|
||||
and mi.storage_location_code = #{storageLocationCode}
|
||||
</if>
|
||||
<if test="storageLocationName != null and storageLocationName != ''">
|
||||
and mi.storage_location_name like concat('%', #{storageLocationName}, '%')
|
||||
</if>
|
||||
<if test="materialBaseInfoId != null ">
|
||||
and mi.material_base_info_id = #{materialBaseInfoId}
|
||||
</if>
|
||||
<if test="materialDetailId != null ">
|
||||
and mi.material_detail_id, = #{materialDetailId}
|
||||
</if>
|
||||
<choose>
|
||||
<when test="containerOrBatch != null and containerOrBatch != ''">
|
||||
and (mi.container_code like concat('%', #{containerOrBatch}, '%') or mi.batch_number like concat('%', #{containerOrBatch}, '%'))
|
||||
</when>
|
||||
<when test="batchNumber != null and batchNumber != '' and containerCode != null and containerCode != '' and batchNumber == containerCode">
|
||||
and (mi.batch_number like concat('%', #{batchNumber}, '%') or mi.container_code like concat('%', #{containerCode}, '%'))
|
||||
</when>
|
||||
<otherwise>
|
||||
<if test="batchNumber != null and batchNumber != ''">
|
||||
and mi.batch_number like concat('%', #{batchNumber}, '%')
|
||||
</if>
|
||||
<if test="containerCode != null and containerCode != ''">
|
||||
and mi.container_code like concat('%', #{containerCode}, '%')
|
||||
</if>
|
||||
</otherwise>
|
||||
</choose>
|
||||
<if test="materialStatusCode != null and materialStatusCode != ''">
|
||||
and mi.material_status_code like concat('%', #{materialStatusCode}, '%')
|
||||
</if>
|
||||
<if test="materialStatusName != null and materialStatusName != ''">
|
||||
and mi.material_status_name like concat('%', #{materialStatusName}, '%')
|
||||
</if>
|
||||
<if test="containerId != null ">
|
||||
and mi.container_id = #{containerId}
|
||||
</if>
|
||||
<if test="containerType != null and containerType != ''">
|
||||
and mi.container_type like concat('%', #{containerType}, '%')
|
||||
</if>
|
||||
<if test="containerTypeName != null and containerTypeName != ''">
|
||||
and mi.container_type_name like concat('%', #{containerTypeName}, '%')
|
||||
</if>
|
||||
<if test="inventoryQuantity != null ">
|
||||
and mi.inventory_quantity = #{inventoryQuantity}
|
||||
</if>
|
||||
<if test="allocationQuantity != null ">
|
||||
and mi.allocation_quantity = #{allocationQuantity}
|
||||
</if>
|
||||
<if test="freezeQuantity != null ">
|
||||
and mi.freeze_quantity = #{freezeQuantity}
|
||||
</if>
|
||||
<if test="excludeZeroInventoryQuantity != null and excludeZeroInventoryQuantity == true">
|
||||
and COALESCE(mi.inventory_quantity, 0) > 0
|
||||
</if>
|
||||
|
||||
<if test="createByName != null and createByName != ''">
|
||||
and mi.create_by_name like concat('%', #{createByName}, '%')
|
||||
</if>
|
||||
<if test="updateByName != null and updateByName != ''">
|
||||
and mi.update_by_name like concat('%', #{updateByName}, '%')
|
||||
</if>
|
||||
<choose>
|
||||
<when test="delFlag != null"> and mi.del_flag = #{delFlag} </when>
|
||||
<otherwise> and mi.del_flag = 1 </otherwise>
|
||||
</choose>
|
||||
<if test="storageInfo != null and storageInfo != ''">
|
||||
and (mi.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 mi.BATCH_REF_NO like concat('%', #{batchRefNo}, '%')
|
||||
</if>
|
||||
<if test="sheetRefNo != null and sheetRefNo != ''">
|
||||
and mi.SHEET_REF_NO like concat('%', #{sheetRefNo}, '%')
|
||||
</if>
|
||||
<if test="boxPalletNo != null and boxPalletNo != ''">
|
||||
and mi.BOX_PALLET_NO like concat('%', #{boxPalletNo}, '%')
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="queryList" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
@@ -249,15 +393,69 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
|
||||
<select id="queryListByWl" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPo"/>
|
||||
<include refid="selectMaterialInventoryPoWl"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from material_inventory a
|
||||
left join material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
inner join (
|
||||
select material_base_info_id, warehouse_id, warehouse_code, warehouse_name,
|
||||
storage_section_id, storage_code, storage_name,
|
||||
storage_location_id, storage_location_code, storage_location_name
|
||||
from (
|
||||
select mi.material_base_info_id, mi.warehouse_id, mi.warehouse_code, mi.warehouse_name,
|
||||
mi.storage_section_id, mi.storage_code, mi.storage_name,
|
||||
mi.storage_location_id, mi.storage_location_code, mi.storage_location_name,
|
||||
row_number() over (partition by mi.material_base_info_id order by mi.create_time desc, mi.material_inventory_id desc) as wl_rn
|
||||
from material_inventory mi
|
||||
left join material_base_info b on mi.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1Mi"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
) wl_ranked where wl_ranked.wl_rn = 1
|
||||
) loc on loc.material_base_info_id = a.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
|
||||
GROUP BY a.MATERIAL_BASE_INFO_ID,
|
||||
loc.warehouse_id, loc.warehouse_code, loc.warehouse_name,
|
||||
loc.storage_section_id, loc.storage_code, loc.storage_name,
|
||||
loc.storage_location_id, loc.storage_location_code, loc.storage_location_name
|
||||
</select>
|
||||
|
||||
<!-- 按货主+物料汇总:A货主物料1、A货主物料2、B货主物料1、B货主物料2 为 4 行;库位取该货主+该物料下创建时间最新的一条明细 -->
|
||||
<select id="queryListByHzWl" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
select
|
||||
<include refid="selectMaterialInventoryPoWl"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPo"/>
|
||||
from material_inventory a
|
||||
left join material_base_info b on a.material_base_info_id = b.material_base_info_id
|
||||
inner join (
|
||||
select shipper_id, material_base_info_id, warehouse_id, warehouse_code, warehouse_name,
|
||||
storage_section_id, storage_code, storage_name,
|
||||
storage_location_id, storage_location_code, storage_location_name
|
||||
from (
|
||||
select mi.shipper_id, mi.material_base_info_id, mi.warehouse_id, mi.warehouse_code, mi.warehouse_name,
|
||||
mi.storage_section_id, mi.storage_code, mi.storage_name,
|
||||
mi.storage_location_id, mi.storage_location_code, mi.storage_location_name,
|
||||
row_number() over (partition by mi.shipper_id, mi.material_base_info_id order by mi.create_time desc, mi.material_inventory_id desc) as hzwl_rn
|
||||
from material_inventory mi
|
||||
left join material_base_info b on mi.material_base_info_id = b.material_base_info_id
|
||||
<where>
|
||||
<include refid="selectMaterialInventoryPo1Mi"/>
|
||||
<include refid="com.mhd.wms.domain.materialBaseInfo.repository.mapper.MaterialBaseInfoMapper.JoinMaterialBaseInfoPoWhere"/>
|
||||
</where>
|
||||
) hzwl_ranked where hzwl_ranked.hzwl_rn = 1
|
||||
) loc on loc.shipper_id = a.shipper_id and loc.material_base_info_id = a.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, a.MATERIAL_BASE_INFO_ID,
|
||||
loc.warehouse_id, loc.warehouse_code, loc.warehouse_name,
|
||||
loc.storage_section_id, loc.storage_code, loc.storage_name,
|
||||
loc.storage_location_id, loc.storage_location_code, loc.storage_location_name
|
||||
</select>
|
||||
|
||||
<select id="queryListByHz" parameterType="com.mhd.wms.domain.materialInventory.repository.todo.MaterialInventoryDO" resultMap="MaterialInventoryResult">
|
||||
@@ -540,6 +738,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<result property="topOrganizationId" column="top_organization_id" />
|
||||
<result property="inOrderNumber" column="in_order_number" />
|
||||
<result property="lotNumber" column="lot_number" />
|
||||
<result property="inventoryUpdateTime" column="inventory_update_time" />
|
||||
<result property="pickLastUpdateTime" column="pick_last_update_time" />
|
||||
<result property="checkLastUpdateTime" column="check_last_update_time" />
|
||||
<result property="latestChangeTime" column="latest_change_time" />
|
||||
</resultMap>
|
||||
<select id="queryImmediateInventoryList" parameterType="com.mhd.wms.domain.statementStatistics.todo.ImmediateInventoryDO"
|
||||
resultMap="queryImmediateInventoryListResult">
|
||||
@@ -653,7 +855,66 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
a.organization_name,
|
||||
a.top_organization_id,
|
||||
a.batch_number,
|
||||
a.in_order_number,a.lot_number
|
||||
a.in_order_number,
|
||||
a.lot_number,
|
||||
a.update_time inventory_update_time,
|
||||
(
|
||||
SELECT MAX(c.update_time)
|
||||
FROM picking_material_detail c
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
|
||||
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
|
||||
WHERE
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
) pick_last_update_time,
|
||||
(
|
||||
SELECT MAX(c.update_time)
|
||||
FROM OUT_MATERIAL_DETAIL c
|
||||
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
|
||||
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
|
||||
WHERE
|
||||
d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12)
|
||||
AND d.DEL_FLAG = 1
|
||||
AND c.DEL_FLAG = 1
|
||||
and e.del_flag = 1
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
) check_last_update_time,
|
||||
GREATEST(
|
||||
IFNULL(a.update_time, '1970-01-01 00:00:00'),
|
||||
IFNULL((
|
||||
SELECT MAX(c.update_time)
|
||||
FROM picking_material_detail c
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
|
||||
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
|
||||
WHERE
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
), '1970-01-01 00:00:00'),
|
||||
IFNULL((
|
||||
SELECT MAX(c.update_time)
|
||||
FROM OUT_MATERIAL_DETAIL c
|
||||
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
|
||||
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
|
||||
WHERE
|
||||
d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12)
|
||||
AND d.DEL_FLAG = 1
|
||||
AND c.DEL_FLAG = 1
|
||||
and e.del_flag = 1
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
), '1970-01-01 00:00:00')
|
||||
) latest_change_time
|
||||
FROM
|
||||
material_inventory a
|
||||
left join material_base_info b on a.material_base_info_id=b.material_base_info_id
|
||||
@@ -925,6 +1186,36 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="freezeQuantityEnd != null ">
|
||||
and a.freeze_quantity < #{freezeQuantityEnd}
|
||||
</if>
|
||||
ORDER BY GREATEST(
|
||||
IFNULL(a.update_time, '1970-01-01 00:00:00'),
|
||||
IFNULL((
|
||||
SELECT MAX(c.update_time)
|
||||
FROM picking_material_detail c
|
||||
LEFT JOIN picking_order d ON c.picking_order_number = d.PICKING_ORDER_NUMBER
|
||||
left join STOCK_OUT_ORDER e ON d.ORDER_NUMBER = e.OUT_ORDER_NUMBER
|
||||
WHERE
|
||||
c.del_flag = 1 and d.STATUS = 3 and e.STATUS = 7
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
), '1970-01-01 00:00:00'),
|
||||
IFNULL((
|
||||
SELECT MAX(c.update_time)
|
||||
FROM OUT_MATERIAL_DETAIL c
|
||||
LEFT JOIN STOCK_OUT_ORDER d ON c.OUT_ORDER_NUMBER = d.OUT_ORDER_NUMBER
|
||||
LEFT JOIN HANDOVER_TASK_ORDER e ON d.OUT_ORDER_NUMBER = e.ORDER_NUMBER
|
||||
WHERE
|
||||
d.CHECK_STATUS in (2,3) and e.STATUS = 1 and d.STATUS in (8,12)
|
||||
AND d.DEL_FLAG = 1
|
||||
AND c.DEL_FLAG = 1
|
||||
and e.del_flag = 1
|
||||
AND d.warehouse_id = a.warehouse_id
|
||||
AND (a.shipper_id IS NULL OR d.shipper_id = a.shipper_id)
|
||||
AND c.material_base_info_id = a.material_base_info_id
|
||||
AND c.MATERIAL_INVENTORY_ID = a.MATERIAL_INVENTORY_ID
|
||||
), '1970-01-01 00:00:00')
|
||||
) DESC, a.material_inventory_id DESC
|
||||
</select>
|
||||
|
||||
<select id="selectOneByWhere" parameterType="com.mhd.wms.domain.statementStatistics.todo.ImmediateInventoryDO"
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<result property="materialCode" column="material_code"/>
|
||||
<result property="materialName" column="material_name"/>
|
||||
<result property="barCode" column="bar_code"/>
|
||||
<result property="size" column="SIZE"/>
|
||||
<result property="unitCode" column="unit_code"/>
|
||||
<result property="unitName" column="unit_name"/>
|
||||
<result property="pendingReviewQty" column="pending_review_qty"/>
|
||||
@@ -232,6 +233,7 @@
|
||||
d.material_code,
|
||||
d.material_name,
|
||||
d.bar_code,
|
||||
d.SIZE,
|
||||
d.unit_code,
|
||||
d.unit_name,
|
||||
d.pending_review_qty,
|
||||
|
||||
Reference in New Issue
Block a user