Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
P
pension
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
mengmeng
pension
Commits
df0e88c8
Commit
df0e88c8
authored
Mar 11, 2021
by
mlchun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.机构订单接口完成
parent
31e4dbbc
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
77 additions
and
4 deletions
+77
-4
PensionOrderController.java
...dules/serviceOrder/controller/PensionOrderController.java
+3
-3
PensionOrderDao.java
...ava/io/hmit/modules/serviceOrder/dao/PensionOrderDao.java
+7
-0
PensionOrganizationServiceDao.java
...dules/serviceOrder/dao/PensionOrganizationServiceDao.java
+10
-1
PensionOrderService.java
...mit/modules/serviceOrder/service/PensionOrderService.java
+3
-0
PensionOrganizationService.java
...ules/serviceOrder/service/PensionOrganizationService.java
+4
-0
PensionOrderServiceImpl.java
...es/serviceOrder/service/impl/PensionOrderServiceImpl.java
+22
-0
PensionOrganizationServiceImpl.java
...iceOrder/service/impl/PensionOrganizationServiceImpl.java
+10
-0
PensionOrderDao.xml
...rc/main/resources/mapper/serviceOrder/PensionOrderDao.xml
+14
-0
PensionOrganizationServiceDao.xml
...ces/mapper/serviceOrder/PensionOrganizationServiceDao.xml
+4
-0
No files found.
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionOrderController.java
View file @
df0e88c8
...
@@ -209,14 +209,14 @@ public class PensionOrderController {
...
@@ -209,14 +209,14 @@ public class PensionOrderController {
@ApiImplicitParams
({
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
PAGE
,
value
=
"当前页码,从1开始"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
LIMIT
,
value
=
"每页显示记录数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
LIMIT
,
value
=
"每页显示记录数"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
"status"
,
value
=
"订单状态: 0未接单 1已派发 2已完成 3已取消 5已接单未派发"
,
paramType
=
"query"
,
required
=
true
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
"status"
,
value
=
"订单状态: 0未接单 1已派发 2已完成 3已取消 5已接单未派发"
,
paramType
=
"query"
,
dataType
=
"int"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER_FIELD
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER_FIELD
,
value
=
"排序字段"
,
paramType
=
"query"
,
dataType
=
"String"
)
,
@ApiImplicitParam
(
name
=
Constant
.
ORDER
,
value
=
"排序方式,可选值(asc、desc)"
,
paramType
=
"query"
,
dataType
=
"String"
)
@ApiImplicitParam
(
name
=
Constant
.
ORDER
,
value
=
"排序方式,可选值(asc、desc)"
,
paramType
=
"query"
,
dataType
=
"String"
)
})
})
public
Result
<
PageData
<
PensionOrderDTO
>>
organization
(
@ApiIgnore
@LoginUser
UserEntity
user
,
public
Result
<
PageData
<
PensionOrderDTO
>>
organization
(
@ApiIgnore
@LoginUser
UserEntity
user
,
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
@ApiIgnore
@RequestParam
Map
<
String
,
Object
>
params
){
//
TODO
登录->查询登录人员所属机构ID->机构ID查询服务ID(List)->服务ID + 状态查询订单(List)
//登录->查询登录人员所属机构ID->机构ID查询服务ID(List)->服务ID + 状态查询订单(List)
PageData
<
PensionOrderDTO
>
page
=
pensionOrderService
.
getOr
derPageByStatus
(
params
,
user
.
getId
(),
Integer
.
parseInt
(
params
.
get
(
"status"
).
toString
()
));
PageData
<
PensionOrderDTO
>
page
=
pensionOrderService
.
getOr
ganizationOrder
(
params
,
user
.
getId
(
));
return
new
Result
<
PageData
<
PensionOrderDTO
>>().
ok
(
page
);
return
new
Result
<
PageData
<
PensionOrderDTO
>>().
ok
(
page
);
}
}
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dao/PensionOrderDao.java
View file @
df0e88c8
...
@@ -64,4 +64,11 @@ public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {
...
@@ -64,4 +64,11 @@ public interface PensionOrderDao extends BaseDao<PensionOrderEntity> {
*/
*/
IPage
<
PensionOrderDTO
>
getElderAllOrderByCommunityUserIdPage
(
IPage
<
PensionOrderEntity
>
page
,
Long
userId
,
String
appointmentPerson
);
IPage
<
PensionOrderDTO
>
getElderAllOrderByCommunityUserIdPage
(
IPage
<
PensionOrderEntity
>
page
,
Long
userId
,
String
appointmentPerson
);
/**
* 根据服务Id查询订单
* @param serviceId
* @return
*/
List
<
PensionOrderDTO
>
getAllOrderByServiceId
(
Long
serviceId
,
Integer
status
);
}
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dao/PensionOrganizationServiceDao.java
View file @
df0e88c8
...
@@ -4,6 +4,8 @@ import io.hmit.common.dao.BaseDao;
...
@@ -4,6 +4,8 @@ import io.hmit.common.dao.BaseDao;
import
io.hmit.modules.serviceOrder.entity.PensionOrganizationServiceEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionOrganizationServiceEntity
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
java.util.List
;
/**
/**
* 机构服务关系
* 机构服务关系
*
*
...
@@ -12,5 +14,12 @@ import org.apache.ibatis.annotations.Mapper;
...
@@ -12,5 +14,12 @@ import org.apache.ibatis.annotations.Mapper;
*/
*/
@Mapper
@Mapper
public
interface
PensionOrganizationServiceDao
extends
BaseDao
<
PensionOrganizationServiceEntity
>
{
public
interface
PensionOrganizationServiceDao
extends
BaseDao
<
PensionOrganizationServiceEntity
>
{
/**
* 根据用户Id查询出机构的全部服务ID
* @param userId
* @return
*/
List
<
Long
>
findServiceIdListByServiceUserId
(
Long
userId
);
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/PensionOrderService.java
View file @
df0e88c8
...
@@ -44,4 +44,7 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
...
@@ -44,4 +44,7 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
//社工:查询本社区某老人全部订单(模糊查询)
//社工:查询本社区某老人全部订单(模糊查询)
PageData
<
PensionOrderDTO
>
getElderAllOrderByCommunityUserIdPage
(
Map
<
String
,
Object
>
params
,
Long
userId
,
String
appointmentPerson
);
PageData
<
PensionOrderDTO
>
getElderAllOrderByCommunityUserIdPage
(
Map
<
String
,
Object
>
params
,
Long
userId
,
String
appointmentPerson
);
//查询机构订单
PageData
<
PensionOrderDTO
>
getOrganizationOrder
(
Map
<
String
,
Object
>
params
,
Long
userId
);
}
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/PensionOrganizationService.java
View file @
df0e88c8
...
@@ -4,6 +4,8 @@ import io.hmit.common.service.CrudService;
...
@@ -4,6 +4,8 @@ import io.hmit.common.service.CrudService;
import
io.hmit.modules.serviceOrder.dto.PensionOrganizationDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrganizationDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity
;
import
java.util.List
;
/**
/**
* 机构表
* 机构表
*
*
...
@@ -12,4 +14,6 @@ import io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity;
...
@@ -12,4 +14,6 @@ import io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity;
*/
*/
public
interface
PensionOrganizationService
extends
CrudService
<
PensionOrganizationEntity
,
PensionOrganizationDTO
>
{
public
interface
PensionOrganizationService
extends
CrudService
<
PensionOrganizationEntity
,
PensionOrganizationDTO
>
{
List
<
Long
>
findServiceIdListByServiceUserId
(
Long
userId
);
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionOrderServiceImpl.java
View file @
df0e88c8
...
@@ -13,6 +13,7 @@ import io.hmit.modules.serviceOrder.dto.ReservationDTO;
...
@@ -13,6 +13,7 @@ import io.hmit.modules.serviceOrder.dto.ReservationDTO;
import
io.hmit.modules.serviceOrder.entity.PensionOrderEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionOrderEntity
;
import
io.hmit.modules.serviceOrder.service.PensionOrderService
;
import
io.hmit.modules.serviceOrder.service.PensionOrderService
;
import
io.hmit.modules.serviceOrder.service.PensionOrderServiceService
;
import
io.hmit.modules.serviceOrder.service.PensionOrderServiceService
;
import
io.hmit.modules.serviceOrder.service.PensionOrganizationService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -46,6 +47,9 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -46,6 +47,9 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
@Autowired
@Autowired
private
PensionOrderServiceService
pensionOrderServiceService
;
private
PensionOrderServiceService
pensionOrderServiceService
;
@Autowired
private
PensionOrganizationService
pensionOrganizationService
;
//查询全部订单
//查询全部订单
@Override
@Override
public
PageData
<
PensionOrderDTO
>
getAllOrderPage
(
Map
<
String
,
Object
>
params
,
Long
userId
)
{
public
PageData
<
PensionOrderDTO
>
getAllOrderPage
(
Map
<
String
,
Object
>
params
,
Long
userId
)
{
...
@@ -130,4 +134,22 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -130,4 +134,22 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return
getPageData
(
pensionOrderDTOIPage
,
PensionOrderDTO
.
class
);
return
getPageData
(
pensionOrderDTOIPage
,
PensionOrderDTO
.
class
);
}
}
@Override
public
PageData
<
PensionOrderDTO
>
getOrganizationOrder
(
Map
<
String
,
Object
>
params
,
Long
userId
)
{
//登录->查询登录人员所属机构ID->机构ID查询服务ID(List)->服务ID + 状态查询订单(List)
IPage
<
PensionOrderEntity
>
page
=
getPage
(
params
,
Constant
.
CREATE_DATE
,
false
);
List
<
Long
>
serviceIds
=
pensionOrganizationService
.
findServiceIdListByServiceUserId
(
userId
);
Integer
status
=
null
;
if
(
null
!=
params
.
get
(
"status"
))
{
status
=
Integer
.
parseInt
(
params
.
get
(
"status"
).
toString
());
}
List
<
PensionOrderDTO
>
result
=
new
ArrayList
<>();
for
(
Long
id
:
serviceIds
)
{
List
<
PensionOrderDTO
>
list
=
pensionOrderDao
.
getAllOrderByServiceId
(
id
,
status
);
result
.
addAll
(
list
);
}
page
.
setTotal
(
result
.
size
());
return
getPageData
(
result
,
page
.
getTotal
(),
PensionOrderDTO
.
class
);
}
}
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionOrganizationServiceImpl.java
View file @
df0e88c8
...
@@ -3,12 +3,15 @@ package io.hmit.modules.serviceOrder.service.impl;
...
@@ -3,12 +3,15 @@ package io.hmit.modules.serviceOrder.service.impl;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.common.service.impl.CrudServiceImpl
;
import
io.hmit.modules.serviceOrder.dao.PensionOrganizationDao
;
import
io.hmit.modules.serviceOrder.dao.PensionOrganizationDao
;
import
io.hmit.modules.serviceOrder.dao.PensionOrganizationServiceDao
;
import
io.hmit.modules.serviceOrder.dto.PensionOrganizationDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrganizationDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionOrganizationEntity
;
import
io.hmit.modules.serviceOrder.service.PensionOrganizationService
;
import
io.hmit.modules.serviceOrder.service.PensionOrganizationService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
/**
/**
...
@@ -30,5 +33,12 @@ public class PensionOrganizationServiceImpl extends CrudServiceImpl<PensionOrgan
...
@@ -30,5 +33,12 @@ public class PensionOrganizationServiceImpl extends CrudServiceImpl<PensionOrgan
return
wrapper
;
return
wrapper
;
}
}
@Autowired
private
PensionOrganizationServiceDao
pensionOrganizationServiceDao
;
@Override
public
List
<
Long
>
findServiceIdListByServiceUserId
(
Long
userId
)
{
return
pensionOrganizationServiceDao
.
findServiceIdListByServiceUserId
(
userId
);
}
}
}
\ No newline at end of file
hmit-api/src/main/resources/mapper/serviceOrder/PensionOrderDao.xml
View file @
df0e88c8
...
@@ -143,4 +143,18 @@
...
@@ -143,4 +143,18 @@
AND tu.id = #{userId} AND po.appointment_person LIKE CONCAT('%', #{appointmentPerson}, '%')
AND tu.id = #{userId} AND po.appointment_person LIKE CONCAT('%', #{appointmentPerson}, '%')
</select>
</select>
<select
id=
"getAllOrderByServiceId"
resultType=
"io.hmit.modules.serviceOrder.dto.PensionOrderDTO"
>
SELECT po.id, po.order_num, po.status, po.status_name, po.address, po.service_id, po.service_name,
po.appointment_person, po.appointment_phone, po.appointment_time, po.remark,
po.order_recipient_id, po.order_recipient_name, po.order_recipient_time, po.order_recipient_phone,
po.act_price, po.community_name, po.community_id, po.dept_id,
po.creator, po.creator_name, po.creator_tel, po.create_date,
ps.icon
FROM pension_order po, pension_service ps
WHERE po.service_id = ps.id AND po.service_id = #{serviceId}
<if
test=
"status != null"
>
AND po.status = #{status}
</if>
</select>
</mapper>
</mapper>
hmit-api/src/main/resources/mapper/serviceOrder/PensionOrganizationServiceDao.xml
View file @
df0e88c8
...
@@ -11,5 +11,9 @@
...
@@ -11,5 +11,9 @@
<result
property=
"createDate"
column=
"create_date"
/>
<result
property=
"createDate"
column=
"create_date"
/>
</resultMap>
</resultMap>
<select
id=
"findServiceIdListByServiceUserId"
resultType=
"Long"
>
SELECT pos.service_id FROM pension_organization_user pou, pension_organization_service pos
WHERE pou.organization_id = pos.organization_id and pou.user_id = #{userId}
</select>
</mapper>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment