Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
E
easy-affair-show
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
赵啸非
easy-affair-show
Commits
75a53265
Commit
75a53265
authored
Feb 16, 2023
by
廖旭伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化自动保存上传图片逻辑;增加管理员修改用户密码接口
parent
41a75d10
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
67 additions
and
3 deletions
+67
-3
eas-manager/src/main/java/com/mortals/xhx/base/system/upload/service/impl/UploadServiceImpl.java
...hx/base/system/upload/service/impl/UploadServiceImpl.java
+5
-2
eas-manager/src/main/java/com/mortals/xhx/module/customer/service/CustomerService.java
.../mortals/xhx/module/customer/service/CustomerService.java
+8
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/service/impl/CustomerServiceImpl.java
...xhx/module/customer/service/impl/CustomerServiceImpl.java
+19
-0
eas-manager/src/main/java/com/mortals/xhx/module/customer/web/CustomerController.java
...m/mortals/xhx/module/customer/web/CustomerController.java
+31
-0
eas-manager/src/main/java/com/mortals/xhx/module/masterplate/service/impl/MasterplateUseInfoServiceImpl.java
...sterplate/service/impl/MasterplateUseInfoServiceImpl.java
+4
-1
No files found.
eas-manager/src/main/java/com/mortals/xhx/base/system/upload/service/impl/UploadServiceImpl.java
View file @
75a53265
...
...
@@ -69,8 +69,11 @@ public class UploadServiceImpl implements UploadService {
if
(!
pathDir
.
exists
())
{
pathDir
.
mkdirs
();
}
//判断是否重复上传
File
oldFile
=
new
File
(
filePath
+
fileName
);
if
(
oldFile
.
exists
())
{
oldFile
.
delete
();
}
String
newName
=
IdUtil
.
fastSimpleUUID
()
+
"."
+
extension
;
String
filePathAll
=
filePath
+
newName
;
...
...
eas-manager/src/main/java/com/mortals/xhx/module/customer/service/CustomerService.java
View file @
75a53265
...
...
@@ -49,4 +49,12 @@ public interface CustomerService extends ICRUDService<CustomerEntity,Long>{
*/
CustomerEntity
changePassword
(
CustomerEntity
params
,
Context
context
)
throws
AppException
;
/**
* 管理员修改密码
* @param params
* @param context
* @throws AppException
*/
void
changePasswordByAdmin
(
CustomerEntity
params
,
Context
context
)
throws
AppException
;
}
\ No newline at end of file
eas-manager/src/main/java/com/mortals/xhx/module/customer/service/impl/CustomerServiceImpl.java
View file @
75a53265
...
...
@@ -180,4 +180,23 @@ public class CustomerServiceImpl extends AbstractCRUDServiceImpl<CustomerDao, Cu
}
return
old
;
}
@Override
public
void
changePasswordByAdmin
(
CustomerEntity
params
,
Context
context
)
throws
AppException
{
CustomerEntity
old
=
this
.
get
(
params
.
getId
());
if
(
old
==
null
){
throw
new
AppException
(
"客户信息不存在"
);
}
String
newPwd
=
""
;
String
oldPwd
=
""
;
try
{
newPwd
=
SecurityUtil
.
md5DoubleEncoding
(
params
.
getNewPassword
());
}
catch
(
Exception
e
)
{
throw
new
AppException
(
"密码转换异常"
);
}
CustomerEntity
update
=
new
CustomerEntity
();
update
.
setId
(
params
.
getId
());
update
.
setPassword
(
newPwd
);
this
.
update
(
update
,
context
);
}
}
\ No newline at end of file
eas-manager/src/main/java/com/mortals/xhx/module/customer/web/CustomerController.java
View file @
75a53265
...
...
@@ -269,4 +269,35 @@ public class CustomerController extends BaseCRUDJsonBodyMappingController<Custom
return
ret
.
toJSONString
();
}
@RequestMapping
(
value
=
{
"admin/change/password"
},
method
=
{
RequestMethod
.
POST
})
public
String
changePasswordByAdmin
(
@RequestBody
CustomerEntity
entity
)
{
Map
<
String
,
Object
>
model
=
new
HashMap
();
Context
context
=
this
.
getContext
();
IUser
user
=
this
.
getCurUser
();
if
(
user
==
null
){
return
this
.
createFailJsonResp
(
"请先登录"
);
}
String
busiDesc
=
"管理员修改密码"
;
int
code
=
1
;
try
{
this
.
service
.
changePasswordByAdmin
(
entity
,
context
);
model
.
put
(
"id"
,
entity
.
getId
());
model
.
put
(
"entity"
,
entity
);
model
.
put
(
"message_info"
,
busiDesc
+
"成功"
);
this
.
recordSysLog
(
this
.
request
,
busiDesc
+
" 【成功】 [id:"
+
entity
.
getId
()
+
"]"
);
}
catch
(
Exception
var7
)
{
this
.
doException
(
this
.
request
,
busiDesc
,
model
,
var7
);
model
.
put
(
"entity"
,
entity
);
this
.
init
(
model
,
context
);
code
=
this
.
saveException
(
entity
,
model
,
context
,
var7
);
}
this
.
init
(
model
,
context
);
JSONObject
ret
=
new
JSONObject
();
ret
.
put
(
"code"
,
code
);
ret
.
put
(
"msg"
,
model
.
remove
(
"message_info"
));
ret
.
put
(
"data"
,
model
);
return
ret
.
toJSONString
();
}
}
\ No newline at end of file
eas-manager/src/main/java/com/mortals/xhx/module/masterplate/service/impl/MasterplateUseInfoServiceImpl.java
View file @
75a53265
...
...
@@ -34,6 +34,9 @@ public class MasterplateUseInfoServiceImpl extends AbstractCRUDServiceImpl<Maste
DesignMasterplateQuery
update
=
new
DesignMasterplateQuery
();
update
.
setId
(
entity
.
getMasterplateId
());
update
.
setMasterplateUseNumIncrement
(
1
);
designMasterplateService
.
update
(
update
);
DesignMasterplateEntity
designMasterplateEntity
=
designMasterplateService
.
get
(
entity
.
getMasterplateId
());
if
(
designMasterplateEntity
!=
null
)
{
designMasterplateService
.
update
(
update
);
}
}
}
\ 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