Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
J
jyzb_platformV2
概览
Overview
Details
Activity
Cycle Analytics
版本库
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
问题
0
Issues
0
列表
Board
标记
里程碑
合并请求
0
Merge Requests
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
Snippets
成员
Members
Collapse sidebar
Close sidebar
活动
图像
聊天
创建新问题
作业
提交
Issue Boards
Open sidebar
赵剑炜
jyzb_platformV2
Commits
b70e5944
Commit
b70e5944
authored
Mar 08, 2024
by
赵剑炜
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
盘点接口调整
parent
acfe256e
隐藏空白字符变更
内嵌
并排
正在显示
5 个修改的文件
包含
89 行增加
和
7 行删除
+89
-7
EquipmentListDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EquipmentListDto.java
+1
-0
InvSummaryDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/InvSummaryDto.java
+14
-0
InventoryMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventoryMapper.java
+3
-1
BussinessInventoryServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/BussinessInventoryServiceImpl.java
+50
-5
InventoryMapper.xml
jyzb-biz/src/main/resources/mapper/InventoryMapper.xml
+21
-1
没有找到文件。
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EquipmentListDto.java
View file @
b70e5944
...
...
@@ -17,6 +17,7 @@ public class EquipmentListDto {
private
String
fixNumber
;
private
String
num
;
private
String
state
;
private
String
price
;
private
String
accountNumber
;
private
List
<
PriceInfo
>
priceInfo
;
@Data
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/InvSummaryDto.java
0 → 100644
View file @
b70e5944
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
public
class
InvSummaryDto
{
private
String
typeId
;
private
String
sizeId
;
private
String
locationId
;
private
Integer
count
;
private
BigDecimal
price
;
}
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventoryMapper.java
View file @
b70e5944
...
...
@@ -24,13 +24,15 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
//根据单警柜统计装备信息
List
<
WarehouseInvDto
>
GetViewWarehouseInv
(
@Param
(
"
orgId"
)
Long
org
Id
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"sizeIds"
)
List
<
String
>
sizeIds
);
List
<
WarehouseInvDto
>
GetViewWarehouseInv
(
@Param
(
"
warehouseId"
)
String
warehouse
Id
,
@Param
(
"typeIdsList"
)
List
<
String
>
typeIdsList
,
@Param
(
"sizeIds"
)
List
<
String
>
sizeIds
);
List
<
ViewEquipmentDto
>
GetViewEquipment
(
@Param
(
"epcList"
)
List
<
String
>
epcList
);
List
<
EpcListDto
>
GetViewCountByepcs
(
@Param
(
"epcList"
)
List
<
String
>
epcList
);
List
<
InventoryMapDto
>
GetViewInventoryMap
(
@Param
(
"warehouseId"
)
String
warehouseId
);
Boolean
deleteByEpcs
(
@Param
(
"list"
)
List
<
String
>
epcs
);
List
<
InvSummaryDto
>
selectWarehouseByEpcs
(
@Param
(
"list"
)
List
<
String
>
epcs
,
@Param
(
"orgId"
)
String
orgId
);
//根据单警柜统计装备信息
boolean
SetCabinetInventory
(
@Param
(
"brokenNumberDays"
)
Integer
brokenNumberDays
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/BussinessInventoryServiceImpl.java
View file @
b70e5944
...
...
@@ -684,17 +684,14 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
}
List
<
WarehouseInvDto
>
DeleteFakeEpc
=
inventoryMapper
.
GetViewWarehouseInv
(
BI
.
get
Org
Id
(),
typeIds
,
sizeIds
);
List
<
WarehouseInvDto
>
DeleteFakeEpc
=
inventoryMapper
.
GetViewWarehouseInv
(
BI
.
get
Warehouse
Id
(),
typeIds
,
sizeIds
);
List
<
Inventory
>
addInvList
=
new
ArrayList
<>();
List
<
WarehouseInventory
>
addWareInvList
=
new
ArrayList
<>();
List
<
InventoryMapDto
>
InvFakeList
=
inventoryMapper
.
GetViewInventoryMap
(
BI
.
getWarehouseId
());
List
<
BussinessInventoryChildrenDetail
>
updateInvChilred
=
new
ArrayList
<>();
for
(
InventoryMapDto
detail
:
InvFakeList
)
{
BussinessInventoryChildrenDetail
ChildrenDetail
=
bussinessInventoryChildrenDetailService
.
getById
(
new
LambdaQueryWrapper
<
BussinessInventoryChildrenDetail
>().
eq
(
BussinessInventoryChildrenDetail:
:
getId
,
detail
.
getChildrenId
())
);
BussinessInventoryChildrenDetail
ChildrenDetail
=
bussinessInventoryChildrenDetailService
.
getById
(
detail
.
getChildrenId
());
updateInvChilred
.
add
(
ChildrenDetail
);
}
if
(
updateInvChilred
.
size
()>
0
)
...
...
@@ -764,8 +761,47 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
}
else
{
UpdateInventorys
=
new
ArrayList
<>(
Collections
.
singletonList
(
epcUpdate
));
}
//需要对Summary表得数据进行更新
List
<
InvSummaryDto
>
Summary
=
inventoryMapper
.
selectWarehouseByEpcs
(
UpdateInventorys
,
String
.
valueOf
(
BI
.
getOrgId
()));
//删除同组织机构下EPC所在
List
<
InventorySummary
>
UpdateSummary
=
new
ArrayList
<>();
List
<
InventorySummary
>
DeleteSummary
=
new
ArrayList
<>();
for
(
InvSummaryDto
Isum:
Summary
)
{
InventorySumReq
summaryreq
=
new
InventorySumReq
();
summaryreq
.
setLocationId
(
Isum
.
getLocationId
());
summaryreq
.
setUnitPrice
(
String
.
valueOf
(
Isum
.
getPrice
()));
summaryreq
.
setTypeId
(
Isum
.
getTypeId
());
summaryreq
.
setSizeId
(
Isum
.
getSizeId
());
InventorySummary
InvSum
=
inventorySummaryService
.
getOne
(
summaryreq
);
if
(
InvSum
!=
null
)
//同组织原有仓库需要减少数量和价格
{
Integer
currentNumber
=
InvSum
.
getNumber
()-
Isum
.
getCount
();
BigDecimal
count
=
new
BigDecimal
(
Isum
.
getCount
());
BigDecimal
price
=
Isum
.
getPrice
();
BigDecimal
result
=
count
.
multiply
(
price
);
BigDecimal
currentPrice
=
InvSum
.
getPrice
().
subtract
(
result
);
//当前价格
InvSum
.
setPrice
(
currentPrice
);
InvSum
.
setNumber
(
currentNumber
);
InvSum
.
setStockNumber
(
currentNumber
);
InvSum
.
setStockNumberPrice
(
currentPrice
);
InvSum
.
setUpdateTime
(
DateTimeUtil
.
getCurrentDateTime
());
if
(
InvSum
.
getStockNumber
()==
0
&&
InvSum
.
getNumber
()==
0
&&
InvSum
.
getFixNumber
()==
0
&&
InvSum
.
getBrokenNumber
()==
0
&&
InvSum
.
getDestructionNumber
()==
0
&&
InvSum
.
getOutboundNumber
()==
0
)
{
DeleteSummary
.
add
(
InvSum
);
}
else
{
UpdateSummary
.
add
(
InvSum
);
}
}
//同组织机构当前仓库需要增加价格和数量
InventorySumReq
summaryNowReq
=
new
InventorySumReq
();
summaryNowReq
.
setLocationId
(
BI
.
getWarehouseId
());
summaryNowReq
.
setUnitPrice
(
String
.
valueOf
(
Isum
.
getPrice
()));
summaryNowReq
.
setTypeId
(
Isum
.
getTypeId
());
summaryNowReq
.
setSizeId
(
Isum
.
getSizeId
());
}
List
<
ViewEquipmentDto
>
viewEd
=
inventoryMapper
.
GetViewEquipment
(
UpdateInventorys
);
for
(
ViewEquipmentDto
inv:
viewEd
)
{
...
...
@@ -795,6 +831,15 @@ public class BussinessInventoryServiceImpl extends ServiceImpl<BussinessInventor
{
warehouseInventoryService
.
removeBatchByIds
(
DeleteList
);
}
if
(
DeleteSummary
.
size
()>
0
)
{
inventorySummaryService
.
removeBatchByIds
(
DeleteSummary
);
}
if
(
UpdateSummary
.
size
()>
0
)
{
inventorySummaryService
.
updateBatchById
(
UpdateSummary
);
}
if
(
SaveEpcList
.
size
()>
0
)
{
warehouseInventoryService
.
saveBatch
(
SaveEpcList
);
...
...
jyzb-biz/src/main/resources/mapper/InventoryMapper.xml
View file @
b70e5944
...
...
@@ -76,7 +76,7 @@
FROM
view_warehouse_inv
WHERE
orgId = #{org
Id}
locationId = #{warehouse
Id}
<if
test=
"typeIdsList!=null and typeIdsList.size() > 0"
>
AND type_id IN
...
...
@@ -108,6 +108,26 @@
</foreach>
</delete>
<select
id=
"selectWarehouseByEpcs"
resultType=
"com.junmp.jyzb.api.bean.dto.InvSummaryDto"
>
SELECT
bi.type_id as typeId,
bi.size_id as sizeId,
COUNT(bi.id) AS count,
bwi.location_id as locationId,
bi.price
FROM
`base_inventory` `bi`
JOIN
`base_warehouse_inventory` `bwi` ON `bi`.`epc` = `bwi`.`epc`
WHERE bi.epc IN
<foreach
item=
"item"
index=
"index"
collection=
"list"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
and bwi.org_id=#{orgId}
GROUP BY
bi.size_id, bi.type_id, bi.price,bwi.location_id
</select>
<insert
id=
"SetCabinetInventory"
>
INSERT INTO base_inventory_summary_type2 (id,org_id_int,org_name, org_code,type_id,type_name,size_id,size_name,location_id,location_name,
number,unit_price,price,stock_number, outbound_number,destruction_number,expire_number,
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论