This commit is contained in:
zjf committed 2025-03-07 15:10:53 +08:00
1 parent 8f809fdea7
commit 21af312edd
3 files changed
+14 -3

No files matched your search

@@ -172,4 +172,7 @@ public class SmErpInventoryRecordsEntity extends Model<SmErpInventoryRecordsEnti
@Schema(description="经办人名称")
@TableField(exist = false)
private String handlerUserName;
@Schema(description="收货数量")
private Integer receiveAmount;
}
@@ -243,8 +243,7 @@ public class SmErpSpuServiceImpl extends ServiceImpl<SmErpSpuMapper, SmErpSpuEnt
smErpInventoryRecordsEntity.setInventoryType(InventoryTypeEnum.LSCK.getType());
smErpInventoryRecordsEntity.setOrderType(OrderTypeEnum.CK.getType());
smErpInventoryRecordsEntity.setDeviceType(updateStockReqDTO.getDeviceType());
//生成出入库记录
smErpInventoryRecordsMapper.insert(smErpInventoryRecordsEntity);
List<SmErpInventoryRecordsItemEntity> smErpInventoryRecordsItemEntityList = new ArrayList<>();
for (SupermarketSpuUpdateStockReqDTO.Item v : updateStockReqDTO.getItems()) {
@@ -281,12 +280,20 @@ public class SmErpSpuServiceImpl extends ServiceImpl<SmErpSpuMapper, SmErpSpuEnt
smErpInventoryRecordsItemEntity.setQuantity(incrCount);
smErpInventoryRecordsItemEntity.setUnitId(v.getId());
smErpInventoryRecordsItemEntity.setOrderType(OrderTypeEnum.CK.getType());
//todo 添加收款金额字段和会员卡号,用于记录零售业务
// 添加收款金额字段和会员卡号,用于记录零售业务,后续扩展使用
smErpInventoryRecordsItemEntity.setUnitPrice
(smErpUnitEntity.getPromotionPrice()==null || smErpUnitEntity.getPromotionPrice()==0
?smErpUnitEntity.getRetailPrice():smErpUnitEntity.getPromotionPrice());
smErpInventoryRecordsItemEntityList.add(smErpInventoryRecordsItemEntity);
}
int sum = smErpInventoryRecordsItemEntityList.stream().map(smErpInventoryRecordsItemEntity -> smErpInventoryRecordsItemEntity.getUnitPrice()).mapToInt(Integer::intValue).sum();
smErpInventoryRecordsEntity.setTotalAmount(sum);
smErpInventoryRecordsEntity.setReceiveAmount(sum);
//生成出入库记录
smErpInventoryRecordsMapper.insert(smErpInventoryRecordsEntity);
smErpInventoryRecordsItemEntityList.forEach(smErpInventoryRecordsItemEntity -> {
smErpInventoryRecordsItemEntity.setInventoryId(smErpInventoryRecordsEntity.getId());
});
smErpInventoryRecordsItemMapper.insert(smErpInventoryRecordsItemEntityList);
return R.ok();
}
@@ -27,6 +27,7 @@
<result property="delFlag" column="del_flag"/>
<result property="tenantId" column="tenant_id"/>
<result property="deviceType" column="device_type"/>
<result property="receiveAmount" column="receive_amount"/>
</resultMap>
<select id="getInventoryDetailPageByScope"
resultType="com.bsd.pjcloud.supermarket.vo.inventoryrecord.InventoryRecordPageVo" parameterType="com.bsd.pjcloud.supermarket.dto.inventoryrecords.InventoryDetailQueryDTO">