Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
zhou-hongcheng
2026-03-05 17:24:11 +08:00
10 changed files with 121 additions and 13 deletions
@@ -160,6 +160,9 @@ public class ContractManage extends BaseVOEntity{
@JsonFormat(pattern = "yyyy-MM-dd")
private Date paymentDate;
@ApiModelProperty(name = "出账天数")
private Integer billDays;
@ApiModelProperty(name = "主体类型(1-货主,2-客户,3-承运商)")
private Integer principalType;
@@ -172,4 +175,4 @@ public class ContractManage extends BaseVOEntity{
@ApiModelProperty(name = "是否包含运输费用(1-包含,2-包含)")
private Integer transportationCosts;
}
}
@@ -169,6 +169,9 @@ public class ContractManagePO extends BaseVOEntity{
@JsonFormat(pattern = "d", timezone = "GMT+8")
private Date paymentDate;
@ApiModelProperty(name = "出账天数")
private Integer billDays;
@ApiModelProperty(name = "主体类型(1-货主,2-客户,3-承运商)")
private Integer principalType;
@@ -181,4 +184,4 @@ public class ContractManagePO extends BaseVOEntity{
@ApiModelProperty(name = "是否包含运输费用(1-包含,2-包含)")
private Integer transportationCosts;
}
}
@@ -199,6 +199,9 @@ public class ContractManageDO extends BaseVOEntity{
@JsonFormat(pattern = "yyyy-MM-dd")
private Date paymentDate;
@ApiModelProperty(name = "出账天数")
private Integer billDays;
@ApiModelProperty(name = "主体类型(1-货主,2-客户,3-承运商)")
private Integer principalType;
@@ -211,4 +214,4 @@ public class ContractManageDO extends BaseVOEntity{
@ApiModelProperty(name = "是否包含运输费用(1-包含,2-包含)")
private Integer transportationCosts;
}
}
@@ -190,6 +190,9 @@ public class ContractManageDTO extends BaseVOEntity{
@JsonFormat(pattern = "yyyy-MM-dd")
private Date paymentDate;
@ApiModelProperty(name = "出账天数")
private Integer billDays;
@ApiModelProperty(name = "主体类型(1-货主,2-客户,3-承运商)")
private Integer principalType;
@@ -201,4 +204,4 @@ public class ContractManageDTO extends BaseVOEntity{
@ApiModelProperty(name = "是否包含运输费用(1-包含,2-包含)")
private Integer transportationCosts;
}
}
@@ -1,7 +1,12 @@
package com.mhd.wms.application.service.materialBaseInfo;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.mhd.common.core.web.domain.AjaxResult;
import com.mhd.common.security.utils.SecurityUtils;
import com.mhd.system.api.SystemServiceFeign;
import com.mhd.system.api.domain.BatchFeignPO;
import com.mhd.system.api.model.LoginUser;
import com.mhd.wms.domain.materialBarCode.service.MaterialBarCodeDomainService;
import com.mhd.wms.domain.materialBaseInfo.repository.po.MaterialBaseInfoPO;
@@ -14,6 +19,8 @@ import com.mhd.wms.domain.materialGoodsRule.repository.mapper.MaterialGoodsRuleM
import com.mhd.wms.domain.materialGoodsRule.repository.po.MaterialGoodsRulePO;
import com.mhd.wms.domain.materialGoodsRule.repository.todo.MaterialGoodsRuleDO;
import com.mhd.wms.domain.materialGoodsRule.service.MaterialGoodsRuleDomainService;
import com.mhd.wms.domain.materialInventoryWarning.repository.facade.IMaterialInventoryWarningService;
import com.mhd.wms.domain.materialInventoryWarning.repository.po.MaterialInventoryWarningPO;
import com.mhd.wms.domain.materialInventoryWarning.service.MaterialInventoryWarningDomainService;
import com.mhd.wms.domain.materialWarehouseControl.repository.todo.MaterialWarehouseControlDO;
import com.mhd.wms.domain.materialWarehouseControl.service.MaterialWarehouseControlDomainService;
@@ -47,12 +54,18 @@ public class MaterialBaseInfoApplicationService {
private MaterialWarehouseControlDomainService materialWarehouseControlDomainService;
@Autowired
private MaterialInventoryWarningDomainService materialInventoryWarningDomainService;
@Autowired
private IMaterialInventoryWarningService materialInventoryWarningService;
@Autowired
private MaterialBarCodeDomainService materialBarCodeDomainService;
@Autowired
private MaterialGoodsRuleMapper materialGoodsRuleMapper;
@Autowired
private SystemServiceFeign systemServiceFeign;
/**
* 分页查询物料基础信息列表
*/
@@ -116,7 +129,40 @@ public class MaterialBaseInfoApplicationService {
if (materialGoodsRules != null){
MaterialGoodsRulePO materialGoodsRulePO = new MaterialGoodsRulePO();
BeanUtils.copyProperties(materialGoodsRules,materialGoodsRulePO);
// 如果批次ID不为空,查询批次信息并填充批次名称和编码
if (materialGoodsRulePO.getBatchId() != null) {
try {
AjaxResult ajaxResult = systemServiceFeign.getBatchInfoByBatchId(materialGoodsRulePO.getBatchId());
if (ajaxResult != null && "200".equals(String.valueOf(ajaxResult.get("code")))) {
BatchFeignPO batchFeignPO = JSON.parseObject(JSONObject.toJSONString(ajaxResult.get("data")), BatchFeignPO.class);
if (batchFeignPO != null) {
materialGoodsRulePO.setBatchCode(batchFeignPO.getBatchCode());
materialGoodsRulePO.setBatchName(batchFeignPO.getBatchName());
}
}
} catch (Exception e) {
log.warn("获取批次信息失败,批次ID:{},错误:{}", materialGoodsRulePO.getBatchId(), e.getMessage());
}
}
materialBaseInfoPO.setMaterialGoodsRule(materialGoodsRulePO);
// 将批次信息填充到根级别,方便前端显示
if (materialGoodsRulePO.getBatchId() != null) {
materialBaseInfoPO.setBatchId(materialGoodsRulePO.getBatchId());
materialBaseInfoPO.setBatchCode(materialGoodsRulePO.getBatchCode());
materialBaseInfoPO.setBatchName(materialGoodsRulePO.getBatchName());
}
}
// 填充库存预警信息
List<MaterialInventoryWarningPO> materialInventoryWarningList = materialInventoryWarningService.getInfoByMaterialBaseInfoIds(materialBaseInfoPO.getMaterialBaseInfoId());
materialBaseInfoPO.setMaterialInventoryWarningList(materialInventoryWarningList);
// 统计库存预警和临期预警数量
if (!CollectionUtils.isEmpty(materialInventoryWarningList)) {
materialBaseInfoPO.setInventoryWarningCount(materialInventoryWarningList.size());
// 临期预警需要根据业务逻辑计算,这里先设置为0
materialBaseInfoPO.setExpirationWarningCount(0);
} else {
materialBaseInfoPO.setInventoryWarningCount(0);
materialBaseInfoPO.setExpirationWarningCount(0);
}
// 将物料分类的List转换为逗号分隔的字符串,用于导出
if (!CollectionUtils.isEmpty(materialBaseInfoPO.getMaterialClassifyCode())) {
@@ -1002,7 +1002,15 @@ public class StockReceiptOrderApplicationService {
if (receiptMaterialDetailPO == null){
throw new ServiceException("物料明细不存在");
}
if (receiptMaterialDetailDO.getReceiptQuantity().compareTo(BigDecimal.ZERO) == 0){
List<ReceiptMaterialDetailDO> children = receiptMaterialDetailDO.getChildren();
BigDecimal childrenTotalQuantity = BigDecimal.ZERO;
if (!CollectionUtils.isEmpty(children)) {
childrenTotalQuantity = children.stream()
.map(ReceiptMaterialDetailDO::getReceiptQuantity)
.filter(Objects::nonNull)
.reduce(BigDecimal.ZERO, BigDecimal::add);
}
if (receiptMaterialDetailDO.getReceiptQuantity().compareTo(BigDecimal.ZERO) == 0 && childrenTotalQuantity.compareTo(BigDecimal.ZERO) == 0){
//未进行收货直接跳过
continue;
}
@@ -223,4 +223,24 @@ public class MaterialBaseInfoPO extends BaseVOEntity {
@ApiModelProperty("规格型号")
private String specificationModel;
@ApiModelProperty("批次ID")
@Excel(name = "批次ID")
private Long batchId;
@ApiModelProperty("批次编码")
@Excel(name = "批次编码")
private String batchCode;
@ApiModelProperty("批次名称")
@Excel(name = "批次名称")
private String batchName;
@ApiModelProperty("库存预警数量")
@Excel(name = "库存预警数量")
private Integer inventoryWarningCount;
@ApiModelProperty("临期预警数量")
@Excel(name = "临期预警数量")
private Integer expirationWarningCount;
}
@@ -214,4 +214,7 @@ public class MaterialBaseInfoDO extends BaseVOEntity {
@ApiModelProperty("规格型号")
private String specificationModel;
@ApiModelProperty("批次ID")
private Long batchId;
}
@@ -217,4 +217,7 @@ public class MaterialBaseInfoDTO extends BaseVOEntity {
@ApiModelProperty("规格型号")
private String specificationModel;
@ApiModelProperty("批次ID")
private Long batchId;
}
@@ -113,11 +113,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="barCode != null and barCode != ''">
and bar_code like concat('%',#{barCode},'%')
</if>
<if test="materialClassifyCode != null and materialClassifyCode != ''">
and material_classify_code = #{materialClassifyCode}
<if test="materialClassifyCode != null and materialClassifyCode.size() > 0">
<foreach collection="materialClassifyCode" item="code" open="and (" separator="or" close=")">
FIND_IN_SET(#{code}, material_classify_code) > 0
</foreach>
</if>
<if test="materialClassifyName != null and materialClassifyName != ''">
and material_classify_name like concat('%', #{materialClassifyName}, '%')
<if test="materialClassifyName != null and materialClassifyName.size() > 0">
<foreach collection="materialClassifyName" item="name" open="and (" separator="or" close=")">
material_classify_name like concat('%', #{name}, '%')
</foreach>
</if>
<if test="materialType != null and materialType != ''">
and material_type = #{materialType}
@@ -186,6 +190,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
or
instr(bar_code, #{compoundOrQuery}) > 0
)
</if>
<if test="batchId != null">
and exists (
select 1 from material_goods_rule mgr
where mgr.material_base_info_id = material_base_info.material_base_info_id
and mgr.batch_id = #{batchId}
and mgr.del_flag = 1
)
</if>
<!-- 传 1:只查公共 , 2:只查自己的 ,3:公共的和自己的 -->
<choose>
@@ -223,11 +235,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="barCode != null and barCode != ''">
and b.bar_code = #{barCode}
</if>
<if test="materialClassifyCode != null and materialClassifyCode != ''">
and b.material_classify_code = #{materialClassifyCode}
<if test="materialClassifyCode != null and materialClassifyCode.size() > 0">
<foreach collection="materialClassifyCode" item="code" open="and (" separator="or" close=")">
FIND_IN_SET(#{code}, b.material_classify_code) > 0
</foreach>
</if>
<if test="materialClassifyName != null and materialClassifyName != ''">
and b.material_classify_name like concat('%', #{materialClassifyName}, '%')
<if test="materialClassifyName != null and materialClassifyName.size() > 0">
<foreach collection="materialClassifyName" item="name" open="and (" separator="or" close=")">
b.material_classify_name like concat('%', #{name}, '%')
</foreach>
</if>
<if test="materialType != null and materialType != ''">
and b.material_type = #{materialType}