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
2e656b7e
Commit
2e656b7e
authored
Aug 24, 2023
by
李小惠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
添加库存模块的page分页接口
parent
286b6e39
隐藏空白字符变更
内嵌
并排
正在显示
24 个修改的文件
包含
356 行增加
和
117 行删除
+356
-117
.gitignore
.gitignore
+2
-0
InventorySumReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InventorySumReq.java
+8
-0
OrderMainReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/OrderMainReq.java
+6
-0
UpdateOrderReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateOrderReq.java
+1
-0
InventoryController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/InventoryController.java
+33
-8
OrderController.java
jyzb-biz/src/main/java/com/junmp/jyzb/controller/OrderController.java
+10
-7
InventoryMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventoryMapper.java
+21
-3
OrderMainMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/OrderMainMapper.java
+2
-2
WarehouseMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/WarehouseMapper.java
+0
-5
OrderMQSender.java
jyzb-biz/src/main/java/com/junmp/jyzb/rabbitmq/OrderMQSender.java
+0
-2
InventoryService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/InventoryService.java
+17
-2
OrderService.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/OrderService.java
+1
-2
EquipmentTypeServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentTypeServiceImpl.java
+13
-12
InventoryServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventoryServiceImpl.java
+69
-2
InventorySummaryServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventorySummaryServiceImpl.java
+5
-5
OrderServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/OrderServiceImpl.java
+8
-29
SupplierServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/SupplierServiceImpl.java
+6
-0
InventoryMapper.xml
jyzb-biz/src/main/resources/mapper/InventoryMapper.xml
+133
-0
OrderMainMapper.xml
jyzb-biz/src/main/resources/mapper/OrderMainMapper.xml
+2
-4
WarehouseMapper.xml
jyzb-biz/src/main/resources/mapper/WarehouseMapper.xml
+0
-28
pom.xml
jyzb-boot/pom.xml
+6
-0
application-local.yml
jyzb-boot/src/main/resources/application-local.yml
+3
-3
application.yml
jyzb-boot/src/main/resources/application.yml
+3
-3
pom.xml
pom.xml
+7
-0
没有找到文件。
.gitignore
View file @
2e656b7e
...
...
@@ -105,3 +105,5 @@ Thumbs.db
/jyzb-boot/src/main/resources/application-local.yml
/jyzb-boot/src/main/resources/application.yml
/jyzb-boot/src/main/resources/application-local.yml
/jyzb-boot/src/main/resources/application.yml
/jyzb-boot/src/main/resources/application-local.yml
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/InventorySumReq.java
View file @
2e656b7e
...
...
@@ -28,8 +28,16 @@ public class InventorySumReq {
*/
private
String
typeId
;
/**
* 类型名称
*/
private
String
typeName
;
/**
* 号型ID
*/
private
String
sizeId
;
/**
* 号型名称
*/
private
String
sizeName
;
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/OrderMainReq.java
View file @
2e656b7e
...
...
@@ -5,6 +5,7 @@ import lombok.Data;
import
lombok.EqualsAndHashCode
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
java.math.BigDecimal
;
import
java.util.Date
;
...
...
@@ -53,6 +54,11 @@ public class OrderMainReq extends BaseRequest {
private
String
attachmentLocation
;
private
String
invList
;
/**
* 组织机构id
*/
@NotNull
(
message
=
"组织机构不能为空"
,
groups
=
{
edit
.
class
})
private
Long
orgId
;
/**
* 创建时间
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateOrderReq.java
View file @
2e656b7e
...
...
@@ -88,6 +88,7 @@ public class UpdateOrderReq extends BaseRequest implements Serializable {
* 表单内容
*/
private
String
formItem
;
// /**
// * 表单内容
// */
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/InventoryController.java
View file @
2e656b7e
...
...
@@ -86,13 +86,19 @@ public class InventoryController {
return
ApiRes
.
success
(
inventorySummaryService
.
getEquipmentInfo
(
req
));
}
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息
√
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息
(返回结果是List)
@PostMapping
(
"/EqsBySearchType"
)
@ApiOperation
(
"查询库存装备详细信息"
)
@ApiOperation
(
"查询库存装备详细信息
(list)
"
)
public
ApiRes
<
List
<
InventoryDto
>>
EqsBySearchType
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
InventoryReq
req
){
return
ApiRes
.
success
(
inventoryService
.
EqsBySearchType
(
req
));
}
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是page)
@PostMapping
(
"/EqsByTypePage"
)
@ApiOperation
(
"查询库存装备详细信息(page)"
)
public
ApiRes
<
PageResult
<
InventoryDto
>>
EqsByTypePage
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
InventoryReq
req
){
return
ApiRes
.
success
(
inventoryService
.
EqsByTypePage
(
req
));
}
//根据装备id查询出装备的详细信息
@PostMapping
(
"/GetDetail"
)
...
...
@@ -110,30 +116,49 @@ public class InventoryController {
//查询单警柜箱门下的汇总信息(传递cabinetBoxId)
@PostMapping
(
"/EqsByCabinetBoxId"
)
@ApiOperation
(
"查询箱门下的汇总信息"
)
public
ApiRes
<
List
<
InventorySummary
>>
EqsByCabinetId
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
CabinetBoxReq
req
){
@ApiOperation
(
"查询箱门下的汇总信息
(list)
"
)
public
ApiRes
<
List
<
InventorySummary
>>
EqsByCabinet
Box
Id
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
CabinetBoxReq
req
){
return
ApiRes
.
success
(
inventoryService
.
EqsByCabinetBoxId
(
req
));
}
//查询单警柜箱门下的汇总信息(传递cabinetBoxId)
@PostMapping
(
"/EqsByCabinetBoxIdPage"
)
@ApiOperation
(
"查询箱门下的汇总信息(page)"
)
public
ApiRes
<
PageResult
<
InventorySummary
>>
EqsByCabinetBoxIdPage
(
@RequestBody
@Validated
(
ValidationApi
.
detail
.
class
)
CabinetBoxReq
req
){
return
ApiRes
.
success
(
inventoryService
.
EqsByCabinetBoxIdPage
(
req
));
}
//根据货架id查询装备信息汇总(list)
@PostMapping
(
"/ShelfInventoryList"
)
@ApiOperation
(
"根据货架id查询装备信息汇总"
)
@ApiOperation
(
"根据货架id查询装备信息汇总
(list)
"
)
public
ApiRes
<
List
<
InventorySummary
>>
ShelfInventoryList
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
ShelfReq
req
){
return
ApiRes
.
success
(
inventoryService
.
ShelfInventoryList
(
req
));
}
//根据货架id查询装备信息汇总 (page)
@PostMapping
(
"/ShelfInventoryPage"
)
@ApiOperation
(
"根据货架id查询装备信息汇总(page)"
)
public
ApiRes
<
PageResult
<
InventorySummary
>>
ShelfInventoryPage
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
ShelfReq
req
){
return
ApiRes
.
success
(
inventoryService
.
ShelfInventoryPage
(
req
));
}
@PostMapping
(
"/ShelfInventoryDetail"
)
@ApiOperation
((
"/通过货架id查询每件装备信息简要"
))
public
ApiRes
<
List
<
EqsBriefDto
>>
AreaInventoryDetail
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
ShelfReq
req
){
return
ApiRes
.
success
(
inventoryService
.
ShelfInventoryDetail
(
req
));
}
//根据区域id查询装备信息汇总(list)
@PostMapping
(
"/AreaInventoryList"
)
@ApiOperation
(
"根据区域id查询装备信息汇总"
)
@ApiOperation
(
"根据区域id查询装备信息汇总
(list)
"
)
public
ApiRes
<
List
<
InventorySummary
>>
AreaInventoryList
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
WarehouseAreaReq
req
){
return
ApiRes
.
success
(
inventoryService
.
AreaInventoryList
(
req
));
}
//根据区域id查询装备信息汇总(page)
@PostMapping
(
"/AreaInventoryPage"
)
@ApiOperation
(
"根据区域id查询装备信息汇总(list)"
)
public
ApiRes
<
PageResult
<
InventorySummary
>>
AreaInventoryPage
(
@RequestBody
@Validated
(
ValidationApi
.
edit
.
class
)
WarehouseAreaReq
req
){
return
ApiRes
.
success
(
inventoryService
.
AreaInventoryPage
(
req
));
}
//导出,通过传递组织机构id,将该组织机构下的所有装备信息进行导出
@PostMapping
(
"/ExportInventoryExcel"
)
@ApiOperation
(
"组织机构装备导出"
)
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/controller/OrderController.java
View file @
2e656b7e
package
com
.
junmp
.
jyzb
.
controller
;
import
cn.hutool.core.util.ObjectUtil
;
import
cn.hutool.db.PageResult
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.junmp.jyzb.api.bean.dto.LogSummaryDto
;
import
com.junmp.jyzb.api.bean.dto.OrderDetailDto
;
...
...
@@ -9,6 +10,7 @@ import com.junmp.jyzb.api.bean.dto.OrderMainDto;
import
com.junmp.jyzb.api.bean.query.OrderDetailReq
;
import
com.junmp.jyzb.api.bean.query.OrderMainReq
;
import
com.junmp.jyzb.api.bean.req.UpdateOrderReq
;
import
com.junmp.jyzb.entity.OrderMain
;
import
com.junmp.jyzb.service.LogSummaryService
;
import
com.junmp.jyzb.service.OrderLogService
;
import
com.junmp.jyzb.service.OrderService
;
...
...
@@ -35,13 +37,6 @@ import java.util.List;
public
class
OrderController
{
@Resource
public
OrderService
orderService
;
@Resource
private
RabbitTemplate
rabbitTemplate
;
@Resource
private
LogSummaryService
logSummaryService
;
@Resource
private
OrderLogService
orderLogService
;
//通过工作流进行操作处理的
@PostMapping
(
"/AddOrder"
)
...
...
@@ -60,6 +55,7 @@ public class OrderController {
}
//内部处理,任务单状态直接设置成finished 添加到数据并且直接推送到消息队列中去
@PostMapping
(
"/AddFinishOrder"
)
@ApiOperation
(
"新增已完成的任务单"
)
...
...
@@ -91,6 +87,13 @@ public class OrderController {
return
ApiRes
.
success
(
orderDetail
);
}
//查询任务列表
// @PostMapping("/GetOrgderPage")
// @ApiOperation("/查询任务列表")
// public ApiRes<PageResult<OrderMain>> getOrgderPage(@RequestBody @Validated(ValidationApi.edit.class)OrderMainReq req ){
// return ApiRes.success();
// }
// //将工作单添加到rabbitmq中去
// @PostMapping("/AddOrderRabbitMq")
// @ApiOperation("将工作单添加到rabbitmq消息队列中去")
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/InventoryMapper.java
View file @
2e656b7e
package
com
.
junmp
.
jyzb
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.junmp.jyzb.api.bean.dto.EqsBriefDto
;
import
com.junmp.jyzb.api.bean.dto.EqsSumDto
;
import
com.junmp.jyzb.api.bean.dto.InventoryDto
;
...
...
@@ -30,17 +32,32 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
List
<
InventoryDto
>
EqsBySearchType
(
InventoryReq
req
);
//根据货架id查询汇总信息
//根据货架id查询汇总信息
(list)
List
<
InventorySummary
>
getSumByShelf
(
String
shelfId
);
//根据区域id查询汇总信息
//根据货架id查询汇总信息(page)
IPage
<
InventorySummary
>
ShelfInventoryPage
(
Page
<
InventorySummary
>
page
,
String
shelfId
);
//根据区域id查询汇总信息(list)
List
<
InventorySummary
>
getSumByArea
(
String
id
);
//通过单警柜箱门id获取箱门下的装备汇总信息
//根据区域id查询汇总信息(page)
IPage
<
InventorySummary
>
AreaInventoryPage
(
Page
<
InventorySummary
>
page
,
String
id
);
//通过单警柜箱门id获取箱门下的装备汇总信息(list)
List
<
InventorySummary
>
getSumByCabinetBox
(
String
id
);
//通过查询条件查询出装备数量报表
List
<
EqsSumDto
>
GetListEquipment
(
InventoryReq
req
);
//查询组织机构下面的装备信息
List
<
InventoryVo
>
selectListByOrg
(
Long
orgId
);
IPage
<
InventoryDto
>
EqsByTypePage
(
Page
<
InventoryDto
>
page
,
@Param
(
"queryType"
)
String
queryType
,
@Param
(
"orgId"
)
Long
orgId
,
@Param
(
"warehouseId"
)
String
warehouseId
,
@Param
(
"cabinetId"
)
String
cabinetId
);
//通过单警柜箱门id获取箱门下的装备汇总信息(page)
IPage
<
InventorySummary
>
EqsByCabinetBoxIdPage
(
Page
<
InventorySummary
>
page
,
String
id
);
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/OrderMainMapper.java
View file @
2e656b7e
...
...
@@ -15,6 +15,5 @@ public interface OrderMainMapper extends BaseMapper<OrderMain> {
void
updateOrder
(
OrderMain
order
);
//生成没有被上传过的任务单
List
<
OrderMain
>
getList
();
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/WarehouseMapper.java
View file @
2e656b7e
...
...
@@ -22,11 +22,6 @@ public interface WarehouseMapper extends BaseMapper<Warehouse> {
List
<
String
>
getAllWarehouseId
(
String
orgId
);
void
changeWarehouseState
(
Warehouse
warehouse
);
List
<
String
>
getAllWarehouseIdByHighest
();
List
<
Map
<
String
,
Object
>>
getAllWarehouse
();
List
<
Warehouse
>
getAllWarehouseByOrgList
(
List
<
String
>
allOrgId
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/rabbitmq/OrderMQSender.java
View file @
2e656b7e
...
...
@@ -18,8 +18,6 @@ public class OrderMQSender {
public
void
send
(){
//将审核状态为finished的任务单放入rabbitmq中
List
<
OrderDto
>
order
=
orderService
.
getOrder
();
rabbitTemplate
.
convertAndSend
(
"OrderExchange"
,
"Test1Routing"
,
order
);
}
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/InventoryService.java
View file @
2e656b7e
...
...
@@ -8,6 +8,7 @@ import com.junmp.jyzb.api.bean.req.EquipmentBindReq;
import
com.junmp.jyzb.entity.Inventory
;
import
com.junmp.jyzb.entity.InventorySummary
;
import
com.junmp.jyzb.utils.ResponseResult
;
import
com.junmp.v2.db.api.page.PageResult
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.IOException
;
...
...
@@ -30,8 +31,11 @@ public interface InventoryService extends IService<Inventory> {
List
<
InventoryDto
>
GetInvInfoByEpc
(
InventoryReq
req
);
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是List)
List
<
InventoryDto
>
EqsBySearchType
(
InventoryReq
req
);
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是page)
PageResult
<
InventoryDto
>
EqsByTypePage
(
InventoryReq
req
);
//查询箱门(cabinetBox下)所有装备简要信息列表(传递cabinetBoxId)
List
<
EqsBriefDto
>
searchEqsByBoxId
(
CabinetBoxReq
req
);
...
...
@@ -40,19 +44,27 @@ public interface InventoryService extends IService<Inventory> {
//通过货架id查询装备信息汇总
List
<
InventorySummary
>
ShelfInventoryList
(
ShelfReq
req
);
//根据货架id查询装备信息汇总 (page)
PageResult
<
InventorySummary
>
ShelfInventoryPage
(
ShelfReq
req
);
//通过货架id查询装备简要信息
List
<
EqsBriefDto
>
ShelfInventoryDetail
(
ShelfReq
req
);
//通过区域id查询装备信息汇总
//通过区域id查询装备信息汇总
(list)
List
<
InventorySummary
>
AreaInventoryList
(
WarehouseAreaReq
req
);
//通过区域id查询装备信息汇总(page)
PageResult
<
InventorySummary
>
AreaInventoryPage
(
WarehouseAreaReq
req
);
//通过装备id判断装备是否存在
Inventory
InventoryExist
(
String
id
);
//通过单警柜箱门id获取箱门下的装备汇总信息
//通过单警柜箱门id获取箱门下的装备汇总信息
(list)
List
<
InventorySummary
>
EqsByCabinetBoxId
(
CabinetBoxReq
req
);
//通过单警柜箱门id获取箱门下的装备汇总信息(page)
PageResult
<
InventorySummary
>
EqsByCabinetBoxIdPage
(
CabinetBoxReq
req
);
//通过组织机构id对该组织机构下的装备进行导出
void
ExportInventoryExcel
(
InventoryReq
req
);
...
...
@@ -61,4 +73,7 @@ public interface InventoryService extends IService<Inventory> {
//通过条件查询装备数量报表
List
<
EqsSumDto
>
GetListEquipment
(
InventoryReq
req
);
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/OrderService.java
View file @
2e656b7e
...
...
@@ -31,6 +31,5 @@ public interface OrderService extends IService<OrderMain> {
//根据任务单id查询详细信息
List
<
OrderDetailDto
>
getOrderDetail
(
OrderDetailReq
req
);
//获取审核状态为finished的任务单,将其推送到rabbitmq中
List
<
OrderDto
>
getOrder
();
}
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentTypeServiceImpl.java
View file @
2e656b7e
...
...
@@ -69,8 +69,6 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
public
String
addEquipment
(
UpdateEquipmentTypeReq
req
)
{
EquipmentType
type
=
new
EquipmentType
();
List
<
String
>
chekResult
=
supplierService
.
CheckSupplierList
(
req
.
getSupplierList
());
if
(
chekResult
.
size
()
==
0
)
{
...
...
@@ -83,16 +81,19 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
parentType
.
setMaxCode
(
newcode
);
parentType
.
setCode
(
String
.
valueOf
(
newcode
));
List
<
SupplierType
>
supplierType
=
new
ArrayList
<>();
req
.
getSupplierList
().
forEach
(
supply
->
{
SupplierType
st
=
new
SupplierType
();
st
.
setId
(
String
.
valueOf
(
UUID
.
randomUUID
()));
st
.
setState
(
0
);
st
.
setSupplierId
(
supply
);
st
.
setTypeId
(
String
.
valueOf
(
newcode
));
supplierType
.
add
(
st
);
}
);
supplierTypeService
.
saveBatch
(
supplierType
);
//判断req.getSupplierList()是否为空,如果为空则不进行循环
if
(
req
.
getSupplierList
().
size
()!=
0
){
req
.
getSupplierList
().
forEach
(
supply
->
{
SupplierType
st
=
new
SupplierType
();
st
.
setId
(
String
.
valueOf
(
UUID
.
randomUUID
()));
st
.
setState
(
0
);
st
.
setSupplierId
(
supply
);
st
.
setTypeId
(
String
.
valueOf
(
newcode
));
supplierType
.
add
(
st
);
}
);
supplierTypeService
.
saveBatch
(
supplierType
);
}
this
.
updateById
(
parentType
);
this
.
save
(
type
);
return
String
.
valueOf
(
newcode
);
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventoryServiceImpl.java
View file @
2e656b7e
...
...
@@ -3,6 +3,8 @@ package com.junmp.jyzb.service.impl;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.util.ObjectUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.junmp.jyzb.api.bean.dto.*
;
...
...
@@ -18,6 +20,8 @@ import com.junmp.jyzb.service.*;
import
com.junmp.v2.common.exception.base.ServiceException
;
import
com.junmp.v2.common.util.BeanPlusUtil
;
import
com.junmp.v2.common.util.HttpServletUtil
;
import
com.junmp.v2.db.api.factory.PageResultFactory
;
import
com.junmp.v2.db.api.page.PageResult
;
import
com.junmp.v2.office.api.OfficeExcelApi
;
import
com.junmp.v2.office.api.bean.ExcelExportParam
;
import
lombok.extern.slf4j.Slf4j
;
...
...
@@ -173,6 +177,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return
inventoryDtoList
;
}
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是List)
@Override
public
List
<
InventoryDto
>
EqsBySearchType
(
InventoryReq
req
)
{
//判断传入的queryType参数是否是正确的
...
...
@@ -192,6 +197,30 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return
inventoryMapper
.
EqsBySearchType
(
req
);
}
//根据组织机构/单警柜id/仓库id查询每件装备细信的详息(返回结果是page)
public
PageResult
<
InventoryDto
>
EqsByTypePage
(
InventoryReq
req
)
{
//判断传入的queryType参数是否是正确的
if
(!
req
.
getQueryType
().
equals
(
"org"
)
&&
!
req
.
getQueryType
().
equals
(
"warehouse"
)
&&
!
req
.
getQueryType
().
equals
(
"cabinet"
)){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
//判断如果传递了类别,判断传递的值是否为空或者是否不存在
if
(
ObjectUtil
.
isNotNull
(
req
.
getOrgId
())){
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
}
else
if
(
ObjectUtil
.
isNotNull
(
req
.
getWarehouseId
())){
warehouseService
.
WarehoustExist
(
req
.
getWarehouseId
());
}
else
if
(
ObjectUtil
.
isNotNull
(
req
.
getCabinetId
())){
cabinetService
.
CabinetExist
(
req
.
getCabinetId
());
}
else
{
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
long
pageSize
=
20L
;
long
pageNo
=
1L
;
Page
<
InventoryDto
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
IPage
<
InventoryDto
>
pages
=
inventoryMapper
.
EqsByTypePage
(
page
,
req
.
getQueryType
(),
req
.
getOrgId
(),
req
.
getWarehouseId
(),
req
.
getCabinetId
());
page
.
setRecords
(
pages
.
getRecords
());
return
PageResultFactory
.
createPageResult
(
page
);
}
//查询箱门(cabinetBox下)所有装备简要信息列表(传递cabinetBoxId)
@Override
public
List
<
EqsBriefDto
>
searchEqsByBoxId
(
CabinetBoxReq
req
)
{
...
...
@@ -221,7 +250,7 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
}
//根据货架id获取装备列表汇总信息
//根据货架id获取装备列表汇总信息
(list)
@Override
public
List
<
InventorySummary
>
ShelfInventoryList
(
ShelfReq
req
)
{
//判断货架是否存在
...
...
@@ -231,6 +260,20 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return
inventoryMapper
.
getSumByShelf
(
req
.
getShelfId
());
}
//根据货架id获取装备列表汇总信息(page)
@Override
public
PageResult
<
InventorySummary
>
ShelfInventoryPage
(
ShelfReq
req
)
{
//判断货架是否存在
Shelf
shelf
=
shelfService
.
ShelfExist
(
req
.
getShelfId
());
warehouseService
.
WarehoustExist
(
shelf
.
getWarehouseId
());
long
pageSize
=
20L
;
long
pageNo
=
1L
;
Page
<
InventorySummary
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
IPage
<
InventorySummary
>
pages
=
inventoryMapper
.
ShelfInventoryPage
(
page
,
req
.
getShelfId
());
pages
.
setRecords
(
pages
.
getRecords
());
return
PageResultFactory
.
createPageResult
(
page
);
}
//通过货架id查询装备简要信息
@Override
public
List
<
EqsBriefDto
>
ShelfInventoryDetail
(
ShelfReq
req
)
{
...
...
@@ -271,15 +314,39 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return
inventoryMapper
.
getSumByArea
(
req
.
getId
());
}
@Override
public
PageResult
<
InventorySummary
>
AreaInventoryPage
(
WarehouseAreaReq
req
)
{
//判断区域是否存在
WarehouseArea
warehouseArea
=
warehouseAreaService
.
WarehouseAreaExist
(
req
.
getId
());
warehouseService
.
WarehoustExist
(
warehouseArea
.
getWarehouseId
());
long
pageSize
=
20L
;
long
pageNo
=
1L
;
Page
<
InventorySummary
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
IPage
<
InventorySummary
>
pages
=
inventoryMapper
.
AreaInventoryPage
(
page
,
req
.
getId
());
page
.
setRecords
(
pages
.
getRecords
());
return
PageResultFactory
.
createPageResult
(
page
);
}
//通过单警柜箱门id获取箱门下的装备汇总信息
//通过单警柜箱门id获取箱门下的装备汇总信息
(list)
@Override
public
List
<
InventorySummary
>
EqsByCabinetBoxId
(
CabinetBoxReq
req
)
{
cabinetBoxService
.
CabinetBoxExist
(
req
.
getId
());
return
inventoryMapper
.
getSumByCabinetBox
(
req
.
getId
());
}
//通过单警柜箱门id获取箱门下的装备汇总信息(page)
@Override
public
PageResult
<
InventorySummary
>
EqsByCabinetBoxIdPage
(
CabinetBoxReq
req
)
{
cabinetBoxService
.
CabinetBoxExist
(
req
.
getId
());
long
pageSize
=
20L
;
long
pageNo
=
1L
;
Page
<
InventorySummary
>
page
=
new
Page
<>(
pageNo
,
pageSize
);
IPage
<
InventorySummary
>
pages
=
inventoryMapper
.
EqsByCabinetBoxIdPage
(
page
,
req
.
getId
());
page
.
setRecords
(
pages
.
getRecords
());
return
PageResultFactory
.
createPageResult
(
page
);
}
//通过组织机构id将该组织下的装备进行导出
@Override
public
void
ExportInventoryExcel
(
InventoryReq
req
){
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/InventorySummaryServiceImpl.java
View file @
2e656b7e
...
...
@@ -28,10 +28,7 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
//根据条件查询库存汇总信息
@Override
public
PageResult
<
InventorySummary
>
getEquipmentInfo
(
InventorySumReq
req
)
{
//判断传递参数是否不为空
if
(
ObjectUtil
.
isNull
(
req
.
getOrgId
())
&&
ObjectUtil
.
isNull
(
req
.
getLocationId
())){
throw
new
ServiceException
(
CabinetExceptionEnum
.
PARAMETER_ERROR
);
}
//当没有参数传递的时候默认查询全部,但是如果传递了条件,根据条件查询并且如果是根据id进行查询,则需要判断该id是否存在
//判断组织机构是否存在
if
(
ObjectUtil
.
isNotNull
(
req
.
getOrgId
())){
pubOrgService
.
PubOrgExist
(
req
.
getOrgId
());
...
...
@@ -60,11 +57,14 @@ public class InventorySummaryServiceImpl extends ServiceImpl<InventorySummaryMa
wrapper
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getLocationId
()),
InventorySummary:
:
getLocationId
,
req
.
getLocationId
());
//位置信息
wrapper
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getLocationName
()),
InventorySummary:
:
getLocationName
,
req
.
getLocationName
());
//装备类别名称
wrapper
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getTypeName
()),
InventorySummary:
:
getTypeName
,
req
.
getTypeName
());
//根据类别
wrapper
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getTypeId
()),
InventorySummary:
:
getTypeId
,
req
.
getTypeId
());
//型号名称
wrapper
.
like
(
ObjectUtil
.
isNotEmpty
(
req
.
getSizeName
()),
InventorySummary:
:
getSizeName
,
req
.
getSizeName
());
//号型
wrapper
.
eq
(
ObjectUtil
.
isNotEmpty
(
req
.
getSizeId
()),
InventorySummary:
:
getSizeId
,
req
.
getSizeId
());
wrapper
.
orderByDesc
(
InventorySummary:
:
getUpdateTime
);
return
wrapper
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/OrderServiceImpl.java
View file @
2e656b7e
...
...
@@ -67,6 +67,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain> i
detailList
.
add
(
detail
);
});
orderDetailService
.
saveBatch
(
detailList
);
//设置采购单号,需要先判断改组织机构的采购单号是否存在,如果存在则将数量进行增加,如果不存在则新增一条对应的数据
return
order
.
getId
();
}
...
...
@@ -101,20 +102,20 @@ public class OrderServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain> i
String
exchangeName
=
"123456"
;
//需要判断是入库单还是出库单,入库单传发物单位id,出库单传收物单位id
if
(
req
.
getOrderType
().
equals
(
"in"
)){
Queue
queue
=
new
Queue
(
req
.
get
Start
OrgId
(),
true
,
false
,
false
);
Queue
queue
=
new
Queue
(
req
.
get
End
OrgId
(),
true
,
false
,
false
);
Exchange
exchange
=
new
DirectExchange
(
exchangeName
,
true
,
false
);
rabbitAdmin
.
declareQueue
(
queue
);
rabbitAdmin
.
declareExchange
(
exchange
);
rabbitAdmin
.
declareBinding
(
BindingBuilder
.
bind
(
queue
).
to
(
exchange
).
with
(
req
.
get
Start
OrgId
()).
noargs
());
rabbitTemplate
.
convertAndSend
(
exchangeName
,
req
.
get
Start
OrgId
(),
req
);
rabbitAdmin
.
declareBinding
(
BindingBuilder
.
bind
(
queue
).
to
(
exchange
).
with
(
req
.
get
End
OrgId
()).
noargs
());
rabbitTemplate
.
convertAndSend
(
exchangeName
,
req
.
get
End
OrgId
(),
req
);
}
else
{
Queue
queue
=
new
Queue
(
req
.
get
End
OrgId
(),
true
,
false
,
false
);
Queue
queue
=
new
Queue
(
req
.
get
Start
OrgId
(),
true
,
false
,
false
);
Exchange
exchange
=
new
DirectExchange
(
exchangeName
,
true
,
false
);
rabbitAdmin
.
declareQueue
(
queue
);
rabbitAdmin
.
declareExchange
(
exchange
);
rabbitAdmin
.
declareBinding
(
BindingBuilder
.
bind
(
queue
).
to
(
exchange
).
with
(
req
.
get
End
OrgId
()).
noargs
());
rabbitTemplate
.
convertAndSend
(
exchangeName
,
req
.
get
End
OrgId
(),
req
);
rabbitAdmin
.
declareBinding
(
BindingBuilder
.
bind
(
queue
).
to
(
exchange
).
with
(
req
.
get
Start
OrgId
()).
noargs
());
rabbitTemplate
.
convertAndSend
(
exchangeName
,
req
.
get
Start
OrgId
(),
req
);
}
...
...
@@ -214,29 +215,7 @@ public class OrderServiceImpl extends ServiceImpl<OrderMainMapper, OrderMain> i
return
orderDetailDtoList
;
}
//获取审核状态为finished的任务单,将其推送到rabbitmq中
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
List
<
OrderDto
>
getOrder
()
{
List
<
OrderDto
>
orderDtoList
=
new
ArrayList
<>();
//创建方法直接查询到所有审核状态为finished的对应的任务单的id并且是没有被上传到rabbitmq中的单据
List
<
OrderMain
>
finishedList
=
orderMainMapper
.
getList
();
List
<
OrderDetailDto
>
orderDetailDtoList
=
new
ArrayList
<>();
finishedList
.
forEach
(
f
->{
OrderDto
orderDto
=
new
OrderDto
();
BeanPlusUtil
.
copyProperties
(
f
,
orderDto
);
List
<
OrderDetail
>
list
=
orderDetailService
.
list
(
new
LambdaQueryWrapper
<
OrderDetail
>()
.
eq
(
OrderDetail:
:
getOrderId
,
f
.
getId
()));
list
.
forEach
(
l
->{
OrderDetailDto
orderDetailDto
=
new
OrderDetailDto
();
BeanPlusUtil
.
copyProperties
(
l
,
orderDetailDto
);
orderDetailDtoList
.
add
(
orderDetailDto
);
});
orderDto
.
setDetailList
(
orderDetailDtoList
);
orderDtoList
.
add
(
orderDto
);
});
return
orderDtoList
;
}
//判断任务单是否存在
@Override
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/SupplierServiceImpl.java
View file @
2e656b7e
...
...
@@ -6,6 +6,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import
com.junmp.jyzb.api.bean.dto.SupplierDto
;
import
com.junmp.jyzb.api.bean.query.QuerySupplierReq
;
import
com.junmp.jyzb.api.bean.req.UpdateSupplierReq
;
import
com.junmp.jyzb.api.exception.JYZBAppException
;
import
com.junmp.jyzb.api.exception.enums.EquipmentTypeExceptionEnum
;
import
com.junmp.jyzb.api.exception.enums.SupplierExceptionEnum
;
import
com.junmp.jyzb.entity.Supplier
;
import
com.junmp.jyzb.service.SupplierService
;
...
...
@@ -57,6 +59,10 @@ public class SupplierServiceImpl extends ServiceImpl<SupplierMapper, Supplier> i
public
List
<
String
>
CheckSupplierList
(
List
<
String
>
req
){
if
(
ObjectUtil
.
isNull
(
req
)){
String
msg
=
"以下供应商不存在:"
+
String
.
join
(
","
,
req
);
throw
new
JYZBAppException
(
EquipmentTypeExceptionEnum
.
SUPPLIER_NOT_EXIST
,
msg
);
}
LambdaQueryWrapper
<
Supplier
>
wp
=
new
LambdaQueryWrapper
<>();
wp
.
in
(
ObjectUtil
.
isNotEmpty
(
req
),
Supplier:
:
getId
,
req
);
List
<
Supplier
>
st
=
list
(
wp
);
...
...
jyzb-biz/src/main/resources/mapper/InventoryMapper.xml
View file @
2e656b7e
...
...
@@ -350,6 +350,138 @@ delete from base_inventory_summary
join pub_org po on i.org_id_int=po.org_id
where org_id_int=#{orgId}
</select>
<select
id=
"EqsByTypePage"
resultType=
"com.junmp.jyzb.api.bean.dto.InventoryDto"
>
select
i.id as id,
i.package_id as package_id,
i.epc as epc,
i.size_id as sizeId,
es.name as sizeName,
i.type_id as typeId,
et.name as typeName,
i.supplier_id as supplierId,
s.name as supplierName,
i.state as state,
i.location_state as locationState,
i.production_date as productionDate,
i.location_type as locationType,
<if
test=
"queryType=='warehouse'"
>
i.location_id as locationId,
</if>
<if
test=
"queryType=='cabinet'"
>
bcb.cabinet_id as locationId,
</if>
i.price as price,
i.shelf_id as shelfId,
i.shelf_location as shelfLocation,
i.bussiness_state as bussinessState,
i.warranty_period as warrantyPeriod,
i.maintenance_period as maintenancePeriod,
i.tid as tid,
i.note as note,
i.fix_count as fixCount,
i.lost_flag as lostFlag,
i.create_time as createTime,
i.update_time as updateTime,
i.update_user as updateUser,
i.create_user as create_user,
i.org_id_int as orgId,
po.org_name as orgName
from base_inventory i
join base_equipment_type et on et.id = i.type_id
join base_equipment_size es on es.id = i.size_id
join base_supplier s on s.id = i.supplier_id
join pub_org po on i.org_id_int=po.org_id
join base_cabinet_box bcb on bcb.id=i.location_id
<if
test=
"queryType == 'org'"
>
where org_id_int = #{orgId}
</if>
<if
test=
"queryType == 'warehouse' "
>
where location_id = #{warehouseId}
</if>
<if
test=
"queryType == 'cabinet'"
>
where location_id in (select id from base_cabinet_box where cabinet_id =#{cabinetId})
</if>
</select>
<select
id=
"EqsByCabinetBoxIdPage"
resultType=
"com.junmp.jyzb.entity.InventorySummary"
>
SELECT
UUID() as id,
bi.org_id_int as orgId,
po.org_name as orgName,
bcb.cabinet_id as locationId,
bi.location_id as locationBoxId,
bc.name as locationName,
bi.type_id,
t.name as typeName,
bi.size_id,
s.name as sizeName,
count(*) as number,
sum(bi.price) as price,
SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS stockNumber,
count(*) - SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS outboundNumber,
bi.location_type
FROM base_inventory bi
join base_cabinet_box bcb on bi.location_id = bcb.id
join base_cabinet bc on bcb.cabinet_id = bc.id
join base_equipment_type t on t.id = bi.type_id
join base_equipment_size s on s.id = bi.size_id
join pub_org po on bi.org_id_int = po.org_id
WHERE bi.location_type = 1 and bi.location_id=#{id}
GROUP BY location_id, type_id,size_id,bi.org_id_int
</select>
<select
id=
"ShelfInventoryPage"
resultType=
"com.junmp.jyzb.entity.InventorySummary"
>
select t.id,t.orgId,t.orgName,t.locationId,t.locationName,t.shelf_id,t.type_id,t.typeName,t.size_id,t.sizeName,t.number,t.price,t.stockNumber,t.outboundNumber,t.location_type
FROM
(SELECT
UUID() as id,
bi.org_id_int as orgId,
po.org_name as orgName,
MAX(bi.location_id) as locationId,
bi.shelf_id,
MAX(bw.name) as locationName,
bi.type_id,
t.name as typeName,
bi.size_id,
s.name as sizeName,
count(*) as number,
sum(bi.price) as price,
SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS stockNumber,
count(*) - SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS outboundNumber,
bi.location_type
FROM base_inventory bi
join base_warehouse bw on bi.location_id = bw.id
join base_equipment_type t on t.id = bi.type_id
join base_equipment_size s on s.id = bi.size_id
join pub_org po on bi.org_id_int = po.org_id
WHERE location_type = 0
GROUP BY type_id,size_id,bi.org_id_int,shelf_id)as t
where shelf_id=#{shelfId}
</select>
<select
id=
"AreaInventoryPage"
resultType=
"com.junmp.jyzb.entity.InventorySummary"
>
SELECT
UUID() as id,
bi.org_id_int as orgId,
po.org_name as orgName,
MAX(bi.location_id) as locationId,
bi.area_id,
MAX(bw.name) as locationName,
bi.type_id,
t.name as typeName,
bi.size_id,
s.name as sizeName,
count(*) as number,
sum(bi.price) as price,
SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS stockNumber,
count(*) - SUM(CASE WHEN location_state = 'in' THEN 1 ELSE 0 END) AS outboundNumber,
bi.location_type
FROM base_inventory bi
join base_warehouse bw on bi.location_id = bw.id
join base_equipment_type t on t.id = bi.type_id
join base_equipment_size s on s.id = bi.size_id
join pub_org po on bi.org_id_int = po.org_id
WHERE location_type = 0 and bi.area_id=#{id}
GROUP BY type_id,size_id,bi.org_id_int,bi.area_id
</select>
</mapper>
\ No newline at end of file
jyzb-biz/src/main/resources/mapper/OrderMainMapper.xml
View file @
2e656b7e
...
...
@@ -63,10 +63,7 @@
update_time=#{updateTime}
where o.id =#{id}
</update>
<select
id=
"getList"
resultType=
"com.junmp.jyzb.entity.OrderMain"
>
select * from bussiness_order_main
WHERE examine_state="finished" and id not in (select order_id FROM bussiness_order_log )
</select>
</mapper>
\ No newline at end of file
jyzb-biz/src/main/resources/mapper/WarehouseMapper.xml
View file @
2e656b7e
...
...
@@ -44,11 +44,6 @@
where w.id=#{id}
</select>
<update
id=
"changeWarehouseState"
>
update base_warehouse w
set state = #{state}
where w.id =#{id}
</update>
<delete
id=
"deleteWarehouse"
>
delete from base_warehouse w
...
...
@@ -67,29 +62,6 @@
where org_id_int=#{orgId}
</select>
<select
id=
"getAllWarehouseIdByHighest"
resultType=
"String"
>
select id
from base_warehouse w
</select>
<select
id=
"getAllWarehouse"
resultType=
"Map"
>
select
w.id as warehouseId,
o.org_id as orgId,
o.org_name as orgName,
w.name as name,
w.state,
location,
w.phone,
is_locked as isLocked,
sum,
in_sum as inSum,
out_sum as outSum,
w.update_time as updateTime
from base_warehouse w
LEFT JOIN pub_org o on w.org_id_int=o.org_id
</select>
<select
id=
"getAllWarehouseByOrgList"
resultType=
"com.junmp.jyzb.entity.Warehouse"
>
select
w.id as warehouseId,
...
...
jyzb-boot/pom.xml
View file @
2e656b7e
...
...
@@ -110,6 +110,12 @@
<groupId>
org.springframework.integration
</groupId>
<artifactId>
spring-integration-mqtt
</artifactId>
</dependency>
<!--字典配置-->
<dependency>
<groupId>
com.junmp.v2
</groupId>
<artifactId>
dict-boot-starter
</artifactId>
</dependency>
</dependencies>
<build>
...
...
jyzb-boot/src/main/resources/application-local.yml
View file @
2e656b7e
...
...
@@ -26,9 +26,9 @@ knife4j:
spring
:
datasource
:
driver-class-name
:
com.mysql.cj.jdbc.Driver
url
:
jdbc:mysql://1
27.0.0.1:3306/junmp
?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username
:
root
password
:
vkeline
url
:
jdbc:mysql://1
92.168.3.128/db_jyzb
?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true
username
:
junmp
password
:
123456
redis
:
#host: 192.168.3.188
...
...
jyzb-boot/src/main/resources/application.yml
View file @
2e656b7e
...
...
@@ -12,10 +12,10 @@ spring:
application
:
name
:
jyzb-app
rabbitmq
:
host
:
1
27.0.0.1
host
:
1
92.168.3.188
port
:
5672
username
:
gues
t
password
:
guest
username
:
roo
t
password
:
123456
listener
:
simple
:
acknowledge-mode
:
MANUAL
...
...
pom.xml
View file @
2e656b7e
...
...
@@ -295,6 +295,13 @@
<artifactId>
ws-api
</artifactId>
<version>
${junmp.v2.version}
</version>
</dependency>
<!--字典配置-->
<dependency>
<groupId>
com.junmp.v2
</groupId>
<artifactId>
dict-boot-starter
</artifactId>
<version>
${junmp.v2.version}
</version>
</dependency>
</dependencies>
</dependencyManagement>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论