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
1b14068f
Commit
1b14068f
authored
Sep 15, 2023
by
李小惠
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改任务单接口和装备树接口代码
parent
d53b5303
全部展开
显示空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
90 行增加
和
75 行删除
+90
-75
EquipmentTreeDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EquipmentTreeDto.java
+3
-0
EquipmentTypeDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EquipmentTypeDto.java
+2
-0
OrderMainDto.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/OrderMainDto.java
+12
-0
OrderMainReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/OrderMainReq.java
+4
-1
UpdateOrderReq.java
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateOrderReq.java
+0
-4
EquipmentTypeMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/EquipmentTypeMapper.java
+2
-2
OrderMainMapper.java
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/OrderMainMapper.java
+2
-7
EquipmentTypeServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentTypeServiceImpl.java
+38
-44
OrderMainServiceImpl.java
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/OrderMainServiceImpl.java
+0
-0
EquipmentTypeMapper.xml
jyzb-biz/src/main/resources/mapper/EquipmentTypeMapper.xml
+2
-0
OrderMainMapper.xml
jyzb-biz/src/main/resources/mapper/OrderMainMapper.xml
+25
-17
没有找到文件。
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EquipmentTreeDto.java
View file @
1b14068f
...
@@ -19,5 +19,8 @@ public class EquipmentTreeDto {
...
@@ -19,5 +19,8 @@ public class EquipmentTreeDto {
private
String
maintenancePeriod
;
private
String
maintenancePeriod
;
private
Boolean
isLeaf
;
private
Boolean
isLeaf
;
private
List
<
EquipmentTreeDto
>
children
=
new
ArrayList
<>();
private
List
<
EquipmentTreeDto
>
children
=
new
ArrayList
<>();
public
void
addChildren
(
EquipmentTreeDto
treeDto
){
children
.
add
(
treeDto
);
}
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/EquipmentTypeDto.java
View file @
1b14068f
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
package
com
.
junmp
.
jyzb
.
api
.
bean
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
import
java.util.List
;
...
...
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/dto/OrderMainDto.java
View file @
1b14068f
...
@@ -15,16 +15,22 @@ public class OrderMainDto implements Serializable {
...
@@ -15,16 +15,22 @@ public class OrderMainDto implements Serializable {
private
String
processId
;
private
String
processId
;
//单据类型(入库类型)
private
String
bussinessType
;
private
String
bussinessType
;
//订单编号
private
String
orderCode
;
private
String
orderCode
;
//发物单位
private
Long
startOrgId
;
private
Long
startOrgId
;
//发物单位
private
String
startOrgName
;
private
String
startOrgName
;
//收物单位
private
Long
endOrgId
;
private
Long
endOrgId
;
//收物单位
private
String
endOrgName
;
private
String
endOrgName
;
private
String
startOrgUserId
;
private
String
startOrgUserId
;
...
@@ -37,6 +43,7 @@ public class OrderMainDto implements Serializable {
...
@@ -37,6 +43,7 @@ public class OrderMainDto implements Serializable {
private
BigDecimal
price
;
private
BigDecimal
price
;
//应入数量
private
Integer
inventoryQuantity
;
private
Integer
inventoryQuantity
;
private
String
invList
;
private
String
invList
;
...
@@ -48,5 +55,10 @@ public class OrderMainDto implements Serializable {
...
@@ -48,5 +55,10 @@ public class OrderMainDto implements Serializable {
private
String
note
;
private
String
note
;
private
Date
createTime
;
private
Date
createTime
;
//审核状态(审批状态)
private
String
examineState
;
//单据状态(入库状态)
private
String
orderState
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/query/OrderMainReq.java
View file @
1b14068f
...
@@ -81,5 +81,8 @@ public class OrderMainReq extends BaseRequest {
...
@@ -81,5 +81,8 @@ public class OrderMainReq extends BaseRequest {
private
String
typeId
;
private
String
typeId
;
//排序字段
private
String
sortTableField
;
//排序规则
private
String
sortRules
;
}
}
jyzb-api/src/main/java/com/junmp/jyzb/api/bean/req/UpdateOrderReq.java
View file @
1b14068f
...
@@ -32,10 +32,6 @@ public class UpdateOrderReq extends BaseRequest implements Serializable {
...
@@ -32,10 +32,6 @@ public class UpdateOrderReq extends BaseRequest implements Serializable {
*/
*/
private
String
bussinessType
;
private
String
bussinessType
;
/**
/**
* 业务类型中文简写(用于设置单据单号(订单号))
*/
private
String
bussinessBrief
;
/**
* 订单号
* 订单号
*/
*/
private
String
orderCode
;
private
String
orderCode
;
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/EquipmentTypeMapper.java
View file @
1b14068f
package
com
.
junmp
.
jyzb
.
mapper
;
package
com
.
junmp
.
jyzb
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.junmp.jyzb.api.bean.dto.EquipmentTypeDto
;
import
com.junmp.jyzb.api.bean.query.QueryEquipmentTypeReq
;
import
com.junmp.jyzb.entity.EquipmentType
;
import
com.junmp.jyzb.entity.EquipmentType
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
...
@@ -17,5 +19,4 @@ public interface EquipmentTypeMapper extends BaseMapper<EquipmentType> {
...
@@ -17,5 +19,4 @@ public interface EquipmentTypeMapper extends BaseMapper<EquipmentType> {
void
setTypeParentIds
();
void
setTypeParentIds
();
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/mapper/OrderMainMapper.java
View file @
1b14068f
...
@@ -21,12 +21,6 @@ public interface OrderMainMapper extends BaseMapper<OrderMain> {
...
@@ -21,12 +21,6 @@ public interface OrderMainMapper extends BaseMapper<OrderMain> {
void
updateOrder
(
OrderMain
order
);
void
updateOrder
(
OrderMain
order
);
IPage
<
OrderMain
>
getOrderPage
(
Page
<
OrderMain
>
page1
,
@Param
(
"bussinessType"
)
String
bussinessType
,
IPage
<
OrderMain
>
getOrderPage
(
Page
<
OrderMain
>
page1
,
@Param
(
"req"
)
OrderMainReq
req
);
@Param
(
"startOrgId"
)
Long
startOrgId
,
@Param
(
"endOrgId"
)
Long
endOrgId
,
@Param
(
"orderState"
)
String
orderState
,
@Param
(
"examineState"
)
String
examineState
,
@Param
(
"startTime"
)
String
startTime
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"typeId"
)
String
typeId
,
@Param
(
"orderType"
)
String
orderType
);
IPage
<
OrderMain
>
getOrderPage
(
Page
<
OrderMain
>
page1
,
OrderMainReq
req
);
}
}
\ No newline at end of file
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/EquipmentTypeServiceImpl.java
View file @
1b14068f
...
@@ -43,18 +43,16 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
...
@@ -43,18 +43,16 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
public
List
<
EquipmentTypeDto
>
getEquipmentList
(
QueryEquipmentTypeReq
req
)
{
public
List
<
EquipmentTypeDto
>
getEquipmentList
(
QueryEquipmentTypeReq
req
)
{
LambdaQueryWrapper
<
EquipmentType
>
wp
=
this
.
createWrapper
(
req
);
List
<
EquipmentType
>
list
=
list
(
new
LambdaQueryWrapper
<
EquipmentType
>()
List
<
EquipmentType
>
list
=
this
.
list
(
wp
);
.
eq
(
EquipmentType:
:
getType
,
req
.
getType
()));
List
<
EquipmentTypeDto
>
orgs
=
new
ArrayList
<>();
List
<
EquipmentTypeDto
>
collect
=
list
.
stream
().
map
(
equipmentType
->
{
list
.
forEach
(
p
->{
EquipmentTypeDto
org
=
new
EquipmentTypeDto
();
EquipmentTypeDto
org
=
new
EquipmentTypeDto
();
BeanPlusUtil
.
copyProperties
(
equipmentType
,
org
);
BeanPlusUtil
.
copyProperties
(
p
,
org
);
return
org
;
orgs
.
add
(
org
);
}).
collect
(
Collectors
.
toList
());
});
return
collect
;
return
orgs
;
}
}
@Transactional
@Transactional
@Override
@Override
public
String
addEquipment
(
UpdateEquipmentTypeReq
req
)
{
public
String
addEquipment
(
UpdateEquipmentTypeReq
req
)
{
...
@@ -258,45 +256,41 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
...
@@ -258,45 +256,41 @@ public class EquipmentTypeServiceImpl extends ServiceImpl<EquipmentTypeMapper, E
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
return
new
ResponseResult
(
HttpStatus
.
SUCCESS
,
ReturnMsg
.
PASS
);
}
}
//获取type整棵树
//获取整棵type树
@Override
public
List
<
EquipmentTreeDto
>
GetTypeTree
()
{
public
List
<
EquipmentTreeDto
>
GetTypeTree
()
{
//创建一个list存放整棵树
//获取第一层数据
List
<
EquipmentType
>
list
=
list
(
new
LambdaQueryWrapper
<
EquipmentType
>()
List
<
EquipmentType
>
list
=
list
(
new
LambdaQueryWrapper
<
EquipmentType
>()
.
eq
(
EquipmentType:
:
getParentId
,
"00000000-0000-0000-0000-000000000000"
)
.
ne
(
EquipmentType:
:
getId
,
"00000000-0000-0000-0000-000000000000"
));
.
ne
(
EquipmentType:
:
getId
,
"00000000-0000-0000-0000-000000000000"
));
List
<
EquipmentTreeDto
>
dtoList
=
new
ArrayList
<>();
//遍历第一层数据
// 构建根节点列表
List
<
EquipmentTreeDto
>
collect
=
list
.
stream
().
map
(
equipmentType
->
{
List
<
EquipmentType
>
rootEntities
=
new
ArrayList
<>();
EquipmentTreeDto
equipmentTreeDto
=
new
EquipmentTreeDto
();
for
(
EquipmentType
entity
:
list
)
{
BeanPlusUtil
.
copyProperties
(
equipmentType
,
equipmentTreeDto
);
if
(
entity
.
getParentId
().
equals
(
"00000000-0000-0000-0000-000000000000"
))
{
equipmentTreeDto
.
setIsLeaf
(
false
);
rootEntities
.
add
(
entity
);
//遍历第二层数据
List
<
EquipmentTreeDto
>
collect1
=
queryChildren
(
equipmentTreeDto
.
getId
()).
stream
().
map
(
equipmentType1
->
{
EquipmentTreeDto
equipmentTreeDto1
=
new
EquipmentTreeDto
();
BeanPlusUtil
.
copyProperties
(
equipmentType1
,
equipmentTreeDto1
);
equipmentTreeDto1
.
setIsLeaf
(
false
);
//遍历第三层数据
List
<
EquipmentTreeDto
>
collect2
=
queryChildren
(
equipmentTreeDto1
.
getId
()).
stream
().
map
(
equipmentType2
->
{
EquipmentTreeDto
equipmentTreeDto2
=
new
EquipmentTreeDto
();
BeanPlusUtil
.
copyProperties
(
equipmentType2
,
equipmentTreeDto2
);
equipmentTreeDto2
.
setIsLeaf
(
true
);
return
equipmentTreeDto2
;
}).
collect
(
Collectors
.
toList
());
equipmentTreeDto1
.
setChildren
(
collect2
);
return
equipmentTreeDto1
;
}).
collect
(
Collectors
.
toList
());
equipmentTreeDto
.
setChildren
(
collect1
);
return
equipmentTreeDto
;
}).
collect
(
Collectors
.
toList
());
return
collect
;
}
}
private
List
<
EquipmentType
>
queryChildren
(
String
parentId
){
}
return
list
(
new
LambdaQueryWrapper
<
EquipmentType
>().
eq
(
EquipmentType:
:
getParentId
,
parentId
));
// 递归转换为输出类节点
for
(
EquipmentType
rootEntity
:
rootEntities
)
{
EquipmentTreeDto
dto
=
convertNode
(
rootEntity
,
list
);
dtoList
.
add
(
dto
);
}
return
dtoList
;
}
}
private
EquipmentTreeDto
convertNode
(
EquipmentType
entity
,
List
<
EquipmentType
>
entityList
)
{
EquipmentTreeDto
dto
=
new
EquipmentTreeDto
();
BeanPlusUtil
.
copyProperties
(
entity
,
dto
);
dto
.
setIsLeaf
(
true
);
// 默认为叶子节点
List
<
EquipmentTreeDto
>
children
=
new
ArrayList
<>();
for
(
EquipmentType
childEntity
:
entityList
)
{
if
(
childEntity
.
getParentId
().
equals
(
entity
.
getId
()))
{
EquipmentTreeDto
childDto
=
convertNode
(
childEntity
,
entityList
);
children
.
add
(
childDto
);
dto
.
setIsLeaf
(
false
);
// 存在子节点,当前节点不是叶子节点
}
}
dto
.
setChildren
(
children
);
return
dto
;
}
private
LambdaQueryWrapper
<
EquipmentType
>
createWrapper
(
QueryEquipmentTypeReq
req
)
{
private
LambdaQueryWrapper
<
EquipmentType
>
createWrapper
(
QueryEquipmentTypeReq
req
)
{
LambdaQueryWrapper
<
EquipmentType
>
wrapper
=
new
LambdaQueryWrapper
<>();
LambdaQueryWrapper
<
EquipmentType
>
wrapper
=
new
LambdaQueryWrapper
<>();
...
...
jyzb-biz/src/main/java/com/junmp/jyzb/service/impl/OrderMainServiceImpl.java
View file @
1b14068f
差异被折叠。
点击展开。
jyzb-biz/src/main/resources/mapper/EquipmentTypeMapper.xml
View file @
1b14068f
...
@@ -45,4 +45,5 @@ JOIN cte ON p.id = cte.id
...
@@ -45,4 +45,5 @@ JOIN cte ON p.id = cte.id
SET p.parent_ids = cte.parent_ids;
SET p.parent_ids = cte.parent_ids;
</update>
</update>
</mapper>
</mapper>
\ No newline at end of file
jyzb-biz/src/main/resources/mapper/OrderMainMapper.xml
View file @
1b14068f
...
@@ -64,30 +64,38 @@
...
@@ -64,30 +64,38 @@
where o.id =#{id}
where o.id =#{id}
</update>
</update>
<select
id=
"getOrderPage"
resultType=
"com.junmp.jyzb.entity.OrderMain"
>
<select
id=
"getOrderPage"
resultType=
"com.junmp.jyzb.entity.OrderMain"
>
select * FROM bussiness_order_main WHERE
id in(
select * FROM bussiness_order_main WHERE
order_type=#{req.orderType}
SELECT order_id FROM bussiness_order_detail WHERE equipment_type = #{typeId}) and order_type=#{orderType}
<if
test=
"req.typeId != null and req.typeId != ''"
>
<if
test=
"null != bussinessType and '' != bussinessType "
>
and id in(
and bussiness_type = #{bussinessType}
SELECT order_id FROM bussiness_order_detail WHERE equipment_type = #{req.typeId})
</if>
</if>
<if
test=
"
startOrgId != null and startOrgId != ''
"
>
<if
test=
"
null != req.bussinessType and '' != req.bussinessType
"
>
and
start_org_id = #{startOrgId
}
and
bussiness_type = #{req.bussinessType
}
</if>
</if>
<if
test=
"
endOrgId != null and end
OrgId != ''"
>
<if
test=
"
req.startOrgId != null and req.start
OrgId != ''"
>
and end_org_id = #{end
OrgId}
and start_org_id = #{req.start
OrgId}
</if>
</if>
<if
test=
"
orderState !=null and orderState
!= ''"
>
<if
test=
"
req.endOrgId != null and req.endOrgId
!= ''"
>
and order_state = #{orderState
}
and end_org_id = #{req.endOrgId
}
</if>
</if>
<if
test=
"
examineState !=null and examine
State != ''"
>
<if
test=
"
req.orderState !=null and req.order
State != ''"
>
and examine_state = #{examine
State}
and order_state = #{req.order
State}
</if>
</if>
<if
test=
"
startTime != null and startTim
e != ''"
>
<if
test=
"
req.examineState !=null and req.examineStat
e != ''"
>
and
create_time
>
= #{startTim
e}
and
examine_state = #{req.examineStat
e}
</if>
</if>
<if
test=
"endTime != null and endTime != ''"
>
<if
test=
"req.startTime != null and req.startTime != ''"
>
and create_time
<
= #{endTime}
and create_time
>
= #{req.startTime}
</if>
<if
test=
"req.endTime != null and req.endTime != ''"
>
and create_time
<
= #{req.endTime}
</if>
<if
test=
"req.sortTableField != null and req.sortTableField != '' and req.sortRules != null and req.sortRules != '' "
>
ORDER BY #{req.sortTableField} #{req.sortRules}
</if>
<if
test=
"(req.sortTableField == null || req.sortTableField == '') and (req.sortRules == null || req.sortRules == '') "
>
order by create_time desc
</if>
</if>
ORDER BY create_time DESC
</select>
</select>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论