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
ce4bed83
Commit
ce4bed83
authored
Mar 11, 2021
by
mengmeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改文件上传功能
parent
4b4d641c
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
100 additions
and
24 deletions
+100
-24
PensionOrderDocumentController.java
...rviceOrder/controller/PensionOrderDocumentController.java
+7
-3
PensionOrderEvaluationController.java
...iceOrder/controller/PensionOrderEvaluationController.java
+1
-1
PensionOrderDocumentDTO.java
...mit/modules/serviceOrder/dto/PensionOrderDocumentDTO.java
+36
-3
PensionOrderEvaluationDTO.java
...t/modules/serviceOrder/dto/PensionOrderEvaluationDTO.java
+5
-1
PensionOrderService.java
...mit/modules/serviceOrder/service/PensionOrderService.java
+5
-1
PensionOrderServiceImpl.java
...es/serviceOrder/service/impl/PensionOrderServiceImpl.java
+46
-15
No files found.
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionOrderDocumentController.java
View file @
ce4bed83
...
@@ -11,6 +11,7 @@ import io.hmit.common.validator.group.AddGroup;
...
@@ -11,6 +11,7 @@ import io.hmit.common.validator.group.AddGroup;
import
io.hmit.common.validator.group.DefaultGroup
;
import
io.hmit.common.validator.group.DefaultGroup
;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.common.validator.group.UpdateGroup
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dto.PensionDocumentDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDocumentDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDocumentDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionDocumentEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionDocumentEntity
;
import
io.hmit.modules.serviceOrder.service.PensionDocumentService
;
import
io.hmit.modules.serviceOrder.service.PensionDocumentService
;
...
@@ -108,9 +109,11 @@ public class PensionOrderDocumentController {
...
@@ -108,9 +109,11 @@ public class PensionOrderDocumentController {
*/
*/
@PostMapping
(
"/uploadFile"
)
@PostMapping
(
"/uploadFile"
)
@ApiOperation
(
"附件上传"
)
@ApiOperation
(
"附件上传"
)
public
Result
<
Map
<
String
,
Object
>>
uploadFile
(
@RequestParam
(
"file"
)
MultipartFile
file
,
public
Result
<
Map
<
String
,
Object
>>
uploadFile
(
@RequestParam
(
"file"
)
MultipartFile
file
){
@RequestParam
(
"orderId"
)
Long
orderId
){
Map
<
String
,
Object
>
fileMap
=
pensionDocumentService
.
uploadFile
(
file
);
Map
<
String
,
Object
>
fileMap
=
pensionDocumentService
.
uploadFile
(
file
);
// PensionOrderDocumentDTO dto = new PensionOrderDocumentDTO().assemblePensionOrder(fileMap,orderId,roleId);
/*
if (null != fileMap) {
if (null != fileMap) {
PensionOrderDocumentDTO dto = new PensionOrderDocumentDTO();
PensionOrderDocumentDTO dto = new PensionOrderDocumentDTO();
dto.setCreateDate(new Date());
dto.setCreateDate(new Date());
...
@@ -122,6 +125,7 @@ public class PensionOrderDocumentController {
...
@@ -122,6 +125,7 @@ public class PensionOrderDocumentController {
} else {
} else {
return null;
return null;
}
}
*/
return
new
Result
<
Map
<
String
,
Object
>>().
ok
(
fileMap
);
return
new
Result
<
Map
<
String
,
Object
>>().
ok
(
fileMap
);
}
}
}
}
\ No newline at end of file
hmit-api/src/main/java/io/hmit/modules/serviceOrder/controller/PensionOrderEvaluationController.java
View file @
ce4bed83
...
@@ -65,7 +65,7 @@ public class PensionOrderEvaluationController {
...
@@ -65,7 +65,7 @@ public class PensionOrderEvaluationController {
pensionOrderEvaluationService
.
save
(
dto
);
pensionOrderEvaluationService
.
save
(
dto
);
pensionOrderService
.
evaluationDone
(
dto
.
getOrderId
()
);
pensionOrderService
.
evaluationDone
(
dto
);
return
new
Result
();
return
new
Result
();
}
}
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dto/PensionOrderDocumentDTO.java
View file @
ce4bed83
package
io
.
hmit
.
modules
.
serviceOrder
.
dto
;
package
io
.
hmit
.
modules
.
serviceOrder
.
dto
;
import
io.hmit.modules.serviceOrder.service.RoleService
;
import
io.hmit.modules.serviceOrder.service.RoleUserService
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.Map
;
/**
/**
...
@@ -17,6 +22,9 @@ import java.util.Date;
...
@@ -17,6 +22,9 @@ import java.util.Date;
@Data
@Data
@ApiModel
(
value
=
"订单及相关图片附件关联表"
)
@ApiModel
(
value
=
"订单及相关图片附件关联表"
)
public
class
PensionOrderDocumentDTO
implements
Serializable
{
public
class
PensionOrderDocumentDTO
implements
Serializable
{
@Autowired
private
RoleService
roleService
;
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
""
)
@ApiModelProperty
(
value
=
""
)
...
@@ -34,7 +42,7 @@ public class PensionOrderDocumentDTO implements Serializable {
...
@@ -34,7 +42,7 @@ public class PensionOrderDocumentDTO implements Serializable {
@ApiModelProperty
(
value
=
"文件链接"
)
@ApiModelProperty
(
value
=
"文件链接"
)
private
String
filePath
;
private
String
filePath
;
@ApiModelProperty
(
value
=
"备注"
)
@ApiModelProperty
(
value
=
"备注
1 服务人员图片;2 服务人员录音; 3 老人/子女评价图片
"
)
private
String
remark
;
private
String
remark
;
@ApiModelProperty
(
value
=
"创建者"
)
@ApiModelProperty
(
value
=
"创建者"
)
...
@@ -49,5 +57,30 @@ public class PensionOrderDocumentDTO implements Serializable {
...
@@ -49,5 +57,30 @@ public class PensionOrderDocumentDTO implements Serializable {
@ApiModelProperty
(
value
=
"更新时间"
)
@ApiModelProperty
(
value
=
"更新时间"
)
private
Date
updateDate
;
private
Date
updateDate
;
public
PensionOrderDocumentDTO
assemblePensionOrder
(
Map
<
String
,
Object
>
fileMap
,
Long
orderId
,
Long
roleId
)
{
}
PensionOrderDocumentDTO
dto
=
new
PensionOrderDocumentDTO
();
\ No newline at end of file
if
(
null
!=
fileMap
)
{
dto
.
setCreateDate
(
new
Date
());
dto
.
setOrderId
(
orderId
);
dto
.
setDocId
(
Long
.
parseLong
(
fileMap
.
get
(
"docId"
).
toString
()));
dto
.
setFileName
(
fileMap
.
get
(
"fileName"
).
toString
());
dto
.
setFilePath
(
fileMap
.
get
(
"filePath"
).
toString
());
RoleDTO
roleDTO
=
roleService
.
get
(
roleId
);
if
(
roleDTO
!=
null
&&
roleDTO
.
getName
().
contains
(
"老人"
)){
dto
.
setRemark
(
"3"
);
}
if
(
roleDTO
!=
null
&&
roleDTO
.
getName
().
contains
(
"服务"
)){
String
fileName
=
fileMap
.
get
(
"filePath"
).
toString
().
toLowerCase
();
dto
.
setRemark
(
"1"
);
if
(
fileName
.
endsWith
(
".mp3"
))
{
dto
.
setRemark
(
"2"
);
}
}
}
return
dto
;
}
}
hmit-api/src/main/java/io/hmit/modules/serviceOrder/dto/PensionOrderEvaluationDTO.java
View file @
ce4bed83
...
@@ -6,6 +6,7 @@ import lombok.Data;
...
@@ -6,6 +6,7 @@ import lombok.Data;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
...
@@ -25,6 +26,9 @@ public class PensionOrderEvaluationDTO implements Serializable {
...
@@ -25,6 +26,9 @@ public class PensionOrderEvaluationDTO implements Serializable {
@ApiModelProperty
(
value
=
"订单所属的服务id"
)
@ApiModelProperty
(
value
=
"订单所属的服务id"
)
private
Long
orderId
;
private
Long
orderId
;
@ApiModelProperty
(
value
=
"角色id"
)
private
Long
roleId
;
@ApiModelProperty
(
value
=
"好差评 1 好评; 2 中评; 3 差评"
)
@ApiModelProperty
(
value
=
"好差评 1 好评; 2 中评; 3 差评"
)
private
Integer
evaluationReview
;
private
Integer
evaluationReview
;
...
@@ -35,7 +39,7 @@ public class PensionOrderEvaluationDTO implements Serializable {
...
@@ -35,7 +39,7 @@ public class PensionOrderEvaluationDTO implements Serializable {
private
String
content
;
private
String
content
;
@ApiModelProperty
(
value
=
"评价文件地址"
)
@ApiModelProperty
(
value
=
"评价文件地址"
)
private
String
file
;
private
String
[]
files
;
@ApiModelProperty
(
value
=
"创建者"
)
@ApiModelProperty
(
value
=
"创建者"
)
private
Long
creator
;
private
Long
creator
;
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/PensionOrderService.java
View file @
ce4bed83
...
@@ -3,6 +3,7 @@ package io.hmit.modules.serviceOrder.service;
...
@@ -3,6 +3,7 @@ package io.hmit.modules.serviceOrder.service;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.page.PageData
;
import
io.hmit.common.service.CrudService
;
import
io.hmit.common.service.CrudService
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.PensionOrderEvaluationDTO
;
import
io.hmit.modules.serviceOrder.entity.PensionOrderEntity
;
import
io.hmit.modules.serviceOrder.entity.PensionOrderEntity
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -49,7 +50,10 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
...
@@ -49,7 +50,10 @@ public interface PensionOrderService extends CrudService<PensionOrderEntity, Pen
PageData
<
PensionOrderDTO
>
getOrganizationOrder
(
Map
<
String
,
Object
>
params
,
Long
userId
);
PageData
<
PensionOrderDTO
>
getOrganizationOrder
(
Map
<
String
,
Object
>
params
,
Long
userId
);
//老人/子女完成评价
//老人/子女完成评价
void
evaluationDone
(
Long
orderId
);
void
evaluationDone
(
PensionOrderEvaluationDTO
dto
);
//文件保存到数据库
void
saveFilesToDB
(
Long
orderId
,
String
files
[],
Long
roleId
);
//机构处理订单状态
//机构处理订单状态
Boolean
organizationHandle
(
Map
<
String
,
Object
>
params
,
Long
userId
);
Boolean
organizationHandle
(
Map
<
String
,
Object
>
params
,
Long
userId
);
...
...
hmit-api/src/main/java/io/hmit/modules/serviceOrder/service/impl/PensionOrderServiceImpl.java
View file @
ce4bed83
...
@@ -8,21 +8,16 @@ import io.hmit.common.service.impl.CrudServiceImpl;
...
@@ -8,21 +8,16 @@ import io.hmit.common.service.impl.CrudServiceImpl;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.common.utils.ConvertUtils
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.entity.UserEntity
;
import
io.hmit.modules.serviceOrder.dao.PensionOrderDao
;
import
io.hmit.modules.serviceOrder.dao.PensionOrderDao
;
import
io.hmit.modules.serviceOrder.dto.
PensionOrderDTO
;
import
io.hmit.modules.serviceOrder.dto.
*
;
import
io.hmit.modules.serviceOrder.
dto.PensionOrderServiceDTO
;
import
io.hmit.modules.serviceOrder.
entity.PensionOrderDocumentEntity
;
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.*
;
import
io.hmit.modules.serviceOrder.service.PensionOrderServiceService
;
import
io.hmit.modules.serviceOrder.service.PensionOrganizationService
;
import
io.hmit.service.UserService
;
import
io.hmit.service.UserService
;
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
;
import
java.util.ArrayList
;
import
java.util.*
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
/**
* 订单表
* 订单表
...
@@ -42,6 +37,8 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -42,6 +37,8 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return
wrapper
;
return
wrapper
;
}
}
@Autowired
private
RoleService
roleService
;
@Autowired
@Autowired
private
PensionOrderDao
pensionOrderDao
;
private
PensionOrderDao
pensionOrderDao
;
...
@@ -49,6 +46,9 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -49,6 +46,9 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
@Autowired
@Autowired
private
PensionOrderServiceService
pensionOrderServiceService
;
private
PensionOrderServiceService
pensionOrderServiceService
;
@Autowired
private
PensionOrderDocumentService
PensionOrderDocumentService
;
@Autowired
@Autowired
private
PensionOrganizationService
pensionOrganizationService
;
private
PensionOrganizationService
pensionOrganizationService
;
...
@@ -233,14 +233,45 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
...
@@ -233,14 +233,45 @@ public class PensionOrderServiceImpl extends CrudServiceImpl<PensionOrderDao, Pe
return
list2
;
return
list2
;
}
}
//将文件保存到数据库
@Override
public
void
saveFilesToDB
(
Long
orderId
,
String
files
[],
Long
roleId
){
Arrays
.
stream
(
files
).
forEach
(
item
->{
PensionOrderDocumentDTO
orderDocumentDTO
=
new
PensionOrderDocumentDTO
();
orderDocumentDTO
.
setFilePath
(
item
);
orderDocumentDTO
.
setOrderId
(
orderId
);
orderDocumentDTO
.
setCreateDate
(
new
Date
());
RoleDTO
roleDTO
=
roleService
.
get
(
roleId
);
if
(
roleDTO
!=
null
&&
roleDTO
.
getName
().
contains
(
"老人"
)){
orderDocumentDTO
.
setRemark
(
"3"
);
}
if
(
roleDTO
!=
null
&&
roleDTO
.
getName
().
contains
(
"服务"
)){
String
fileName
=
item
.
toLowerCase
();
orderDocumentDTO
.
setRemark
(
"1"
);
if
(
fileName
.
endsWith
(
".mp3"
))
{
orderDocumentDTO
.
setRemark
(
"2"
);
}
}
PensionOrderDocumentService
.
save
(
orderDocumentDTO
);
});
}
@Override
@Override
public
void
evaluationDone
(
Long
orderId
)
{
public
void
evaluationDone
(
PensionOrderEvaluationDTO
dto
)
{
PensionOrderDTO
dto
=
get
(
orderId
);
PensionOrderDTO
pensionOrderDTO
=
get
(
dto
.
getOrderId
()
);
if
(
dto
!=
null
){
if
(
pensionOrderDTO
!=
null
){
dto
.
setStatus
(
Constant
.
OrderStatus
.
DONE
.
geStatus
());
pensionOrderDTO
.
setStatus
(
Constant
.
OrderStatus
.
DONE
.
geStatus
());
dto
.
setStatusName
(
Constant
.
OrderStatus
.
DONE
.
getMessage
());
pensionOrderDTO
.
setStatusName
(
Constant
.
OrderStatus
.
DONE
.
getMessage
());
}
}
update
(
dto
);
update
(
pensionOrderDTO
);
saveFilesToDB
(
dto
.
getOrderId
(),
dto
.
getFiles
(),
dto
.
getRoleId
());
}
}
}
}
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