修改
This commit is contained in:
1 parent
8f809fdea7
commit
21af312edd
3 files changed
+14
-3
No files matched your search
+3
@@ -172,4 +172,7 @@ public class SmErpInventoryRecordsEntity extends Model<SmErpInventoryRecordsEnti
|
||||
@Schema(description="经办人名称")
|
||||
@TableField(exist = false)
|
||||
private String handlerUserName;
|
||||
|
||||
@Schema(description="收货数量")
|
||||
private Integer receiveAmount;
|
||||
}
|
||||
+10
-3
@@ -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();
|
||||
}
|
||||
|
||||
+1
@@ -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">
|
||||
|
||||
Reference in new issue
Block a user