Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
store-system
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
luoyangfei
store-system
Commits
28b33141
Commit
28b33141
authored
Dec 12, 2018
by
wangyihao
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改
parent
0a3f566f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
139 additions
and
18 deletions
+139
-18
IndexController.java
...main/java/cn/com/fqy/controller/mapi/IndexController.java
+17
-0
StoreController.java
.../main/java/cn/com/fqy/controller/mgt/StoreController.java
+24
-3
SysUserController.java
...ain/java/cn/com/fqy/controller/mgt/SysUserController.java
+30
-0
WorkerController.java
...main/java/cn/com/fqy/controller/mgt/WorkerController.java
+18
-2
SysUserService.java
...src/main/java/cn/com/fqy/core/service/SysUserService.java
+2
-0
SysUserServiceImpl.java
...java/cn/com/fqy/core/service/impl/SysUserServiceImpl.java
+17
-0
UploadController.java
...stem/src/main/java/cn/com/fqy/utils/UploadController.java
+16
-11
application.properties
...er/store-system/src/main/resources/application.properties
+15
-2
No files found.
2code/server/store-system/src/main/java/cn/com/fqy/controller/mapi/IndexController.java
View file @
28b33141
...
...
@@ -184,6 +184,13 @@ public class IndexController {
store
.
setIsShopping
(
1
);
// 店铺展示状态
int
firstNumber
=
0
;
int
lastNUmber
=
0
;
if
(
store
.
getConsumeInterval
()
!=
null
&&
!
""
.
equals
(
store
.
getConsumeInterval
()))
{
if
(
"-"
.
equals
(
store
.
getConsumeInterval
()))
{
store
.
setConsumeInterval
(
null
);
}
}
if
(
store
.
getConsumeInterval
()
!=
null
&&
!
""
.
equals
(
store
.
getConsumeInterval
()))
{
String
str
=
store
.
getConsumeInterval
();
String
[]
arrStr
=
str
.
split
(
"-"
);
...
...
@@ -261,6 +268,11 @@ public class IndexController {
int
lastNUmber1
=
0
;
// 身高区间过滤
if
(
worker
.
getWorkerHeight
()
!=
null
&&
!
""
.
equals
(
worker
.
getWorkerHeight
()))
{
if
(
"-"
.
equals
(
worker
.
getWorkerHeight
()))
{
worker
.
setWorkerHeight
(
null
);
}
}
if
(
worker
.
getWorkerHeight
()
!=
null
&&
!
""
.
equals
(
worker
.
getWorkerHeight
()))
{
String
str
=
worker
.
getWorkerHeight
();
String
[]
arrStr
=
str
.
split
(
"-"
);
firstNumber
=
Integer
.
valueOf
(
arrStr
[
0
]);
...
...
@@ -271,6 +283,11 @@ public class IndexController {
// 年龄区间过滤
if
(
worker
.
getWorkerAge
()
!=
null
&&
!
""
.
equals
(
worker
.
getWorkerAge
()))
{
if
(
"-"
.
equals
(
worker
.
getWorkerAge
()))
{
worker
.
setWorkerAge
(
null
);
}
}
if
(
worker
.
getWorkerAge
()
!=
null
&&
!
""
.
equals
(
worker
.
getWorkerAge
()))
{
String
str1
=
worker
.
getWorkerAge
();
String
[]
arrStr1
=
str1
.
split
(
"-"
);
firstNumber1
=
Integer
.
valueOf
(
arrStr1
[
0
]);
...
...
2code/server/store-system/src/main/java/cn/com/fqy/controller/mgt/StoreController.java
View file @
28b33141
...
...
@@ -59,7 +59,12 @@ public class StoreController extends BaseController {
Operator
op
=
getOperator
();
if
(
store
!=
null
&&
store
.
getStoreId
()!=
null
&&!
""
.
equals
(
store
.
getStoreId
()))
{
if
(
store
.
getUserId
()
!=
null
&&
!
""
.
equals
(
store
.
getUserId
()))
{
store
.
setUserId
(
null
);
if
(
store
.
getIsAuditing
()
!=
null
)
{
store
.
setUserId
(
null
);
}
if
(
store
.
getIsShopping
()
!=
null
)
{
store
.
setUserId
(
null
);
}
}
resultInfo
=
storeService
.
updateStore
(
store
,
op
);
}
else
{
...
...
@@ -124,7 +129,7 @@ public class StoreController extends BaseController {
}
}
store
.
setIsDeleted
(
0
);
store
.
setIsAuditing
(
1
);
//
store.setIsAuditing(1);
List
<
Store
>
storeList
=
storeService
.
getStoreList
(
new
Query
(
store
));
if
(
storeList
.
size
()>
0
&&
storeList
!=
null
)
{
for
(
Store
list:
storeList
)
{
...
...
@@ -166,6 +171,22 @@ public class StoreController extends BaseController {
@RequestMapping
(
"batchStoreShop"
)
@ResponseBody
public
ResultInfo
<
Store
>
batchStoreShop
(
String
[]
storeIds
)
{
return
storeService
.
batchStoreShopping
(
storeIds
,
getOperator
());
ResultInfo
<
Store
>
resultInfo
=
new
ResultInfo
<>();
List
<
String
>
listQuery
=
new
ArrayList
<>();
List
<
Store
>
storeList
=
storeService
.
getStoreByIds
(
storeIds
);
if
(
storeList
.
size
()>
0
&&
storeList
!=
null
)
{
for
(
Store
list:
storeList
)
{
if
(
list
.
getIsAuditing
()==
1
)
{
listQuery
.
add
(
list
.
getStoreId
());
}
}
}
if
(
listQuery
.
size
()==
0
)
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"所选店铺未审核"
);
return
resultInfo
;
}
String
[]
Ids
=
listQuery
.
toArray
(
new
String
[
listQuery
.
size
()]);
return
storeService
.
batchStoreShopping
(
Ids
,
getOperator
());
}
}
2code/server/store-system/src/main/java/cn/com/fqy/controller/mgt/SysUserController.java
View file @
28b33141
package
cn
.
com
.
fqy
.
controller
.
mgt
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -152,4 +154,32 @@ public class SysUserController extends BaseController {
public
SysUser
detail
(
@RequestParam
(
"userId"
)
String
userId
)
{
return
sysUserService
.
detail
(
userId
);
}
@RequestMapping
(
"getSysUsers"
)
@ResponseBody
public
ResultInfo
<
List
<
Map
<
String
,
String
>>>
getSysUsers
()
{
ResultInfo
<
List
<
Map
<
String
,
String
>>>
resultInfo
=
new
ResultInfo
<>();
List
<
Map
<
String
,
String
>>
listQuery
=
new
ArrayList
<>();
SysUser
user
=
new
SysUser
();
user
.
setIsDeleted
(
0
);
user
.
setIsAvailable
(
1
);
List
<
SysUser
>
userList
=
sysUserService
.
getSysUserList
(
new
Query
(
user
));
if
(
userList
.
size
()>
0
&&
userList
!=
null
)
{
for
(
SysUser
list:
userList
)
{
Map
<
String
,
String
>
map
=
new
HashMap
<>();
map
.
put
(
"userId"
,
list
.
getUserId
());
map
.
put
(
"userName"
,
list
.
getUserName
());
map
.
put
(
"realName"
,
list
.
getRealName
());
listQuery
.
add
(
map
);
}
resultInfo
.
setCode
(
"1"
);
resultInfo
.
setData
(
listQuery
);
}
else
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"暂无数据"
);
}
return
resultInfo
;
}
}
2code/server/store-system/src/main/java/cn/com/fqy/controller/mgt/WorkerController.java
View file @
28b33141
package
cn
.
com
.
fqy
.
controller
.
mgt
;
import
java.util.ArrayList
;
import
java.util.List
;
import
javax.annotation.Resource
;
...
...
@@ -66,7 +67,6 @@ public class WorkerController extends BaseController {
//操作人
Operator
op
=
getOperator
();
if
(
worker
!=
null
&&
worker
.
getWorkerId
()!=
null
&&!
""
.
equals
(
worker
.
getWorkerId
()))
{
if
(
worker
.
getUserId
()
!=
null
&&
!
""
.
equals
(
worker
.
getUserId
()))
{
worker
.
setUserId
(
null
);
}
...
...
@@ -152,6 +152,22 @@ public class WorkerController extends BaseController {
@RequestMapping
(
"batchWorkerShop"
)
@ResponseBody
public
ResultInfo
<
Worker
>
batchWorkerShop
(
String
[]
workerIds
)
{
return
workerService
.
batchWorkerShopping
(
workerIds
,
getOperator
());
ResultInfo
<
Worker
>
resultInfo
=
new
ResultInfo
<>();
List
<
String
>
listQuery
=
new
ArrayList
<>();
List
<
Worker
>
workerList
=
workerService
.
getWorkerByIds
(
workerIds
);
if
(
workerList
.
size
()>
0
&&
workerList
!=
null
)
{
for
(
Worker
list:
workerList
)
{
if
(
list
.
getIsAuditing
()==
1
)
{
listQuery
.
add
(
list
.
getWorkerId
());
}
}
}
if
(
listQuery
.
size
()==
0
)
{
resultInfo
.
setCode
(
"0"
);
resultInfo
.
setMsg
(
"所选员工未审核"
);
return
resultInfo
;
}
String
[]
Ids
=
listQuery
.
toArray
(
new
String
[
listQuery
.
size
()]);
return
workerService
.
batchWorkerShopping
(
Ids
,
getOperator
());
}
}
2code/server/store-system/src/main/java/cn/com/fqy/core/service/SysUserService.java
View file @
28b33141
...
...
@@ -56,4 +56,6 @@ public interface SysUserService extends BaseService{
*/
public
List
<
SysUser
>
getSysUserByIds
(
String
[]
ids
);
public
List
<
SysUser
>
getSysUserList
(
Query
q
);
}
2code/server/store-system/src/main/java/cn/com/fqy/core/service/impl/SysUserServiceImpl.java
View file @
28b33141
...
...
@@ -6,6 +6,8 @@ import java.util.List;
import
javax.annotation.Resource
;
import
org.apache.commons.logging.Log
;
import
org.apache.commons.logging.LogFactory
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
...
...
@@ -32,6 +34,8 @@ import cn.com.fqy.core.service.SysUserService;
@Service
public
class
SysUserServiceImpl
implements
SysUserService
{
private
static
final
Log
log
=
LogFactory
.
getLog
(
SysUserServiceImpl
.
class
);
@Resource
private
SysUserDao
sysUserDao
;
...
...
@@ -226,4 +230,17 @@ public class SysUserServiceImpl implements SysUserService {
return
list
;
}
@Transactional
(
propagation
=
Propagation
.
SUPPORTS
)
public
List
<
SysUser
>
getSysUserList
(
Query
q
)
{
List
<
SysUser
>
list
=
null
;
try
{
//直接调用Dao方法进行查询
list
=
sysUserDao
.
queryAll
(
q
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
}
//如list为null时,则改为返回一个空列表
list
=
list
==
null
?
new
ArrayList
<
SysUser
>(
0
)
:
list
;
return
list
;
}
}
2code/server/store-system/src/main/java/cn/com/fqy/utils/UploadController.java
View file @
28b33141
...
...
@@ -14,9 +14,11 @@ import org.apache.commons.logging.LogFactory;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Component
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.ExceptionHandler
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.multipart.MultipartException
;
import
org.springframework.web.multipart.MultipartFile
;
import
cn.com.fqy.common.ResultInfo
;
...
...
@@ -69,18 +71,12 @@ public class UploadController {
@ResponseBody
public
ResultInfo
<
String
>
uploadImg
(
@RequestParam
(
"files"
)
MultipartFile
file
,
@RequestParam
(
"resPath"
)
String
resPath
,
String
imageType
,
HttpServletRequest
request
)
throws
IOException
{
ResultInfo
<
String
>
result
=
new
ResultInfo
<>();
//判断车辆品牌log尺寸
if
(
"logo"
.
equals
(
imageType
))
{
InputStream
is
=
file
.
getInputStream
();
BufferedImage
image
=
ImageIO
.
read
(
is
);
//宽高比
double
proportion
=
ECCalculateUtils
.
div
(
Double
.
valueOf
(
image
.
getWidth
()),
Double
.
valueOf
(
image
.
getHeight
()));
if
(
proportion
!=
1
)
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"上传图片的宽高比必须是1"
);
return
result
;
}
if
(
file
.
getSize
()>
2
*
1048576
)
{
result
.
setCode
(
"0"
);
result
.
setMsg
(
"图片文件过大,大小不应超过2M"
);
return
result
;
}
//判断车系图片尺寸
if
(
"series"
.
equals
(
imageType
))
{
InputStream
is
=
file
.
getInputStream
();
...
...
@@ -127,4 +123,13 @@ public class UploadController {
result
.
setData
(
serverPath
+
resPath
+
"/"
+
fileName
);
return
result
;
}
// @ExceptionHandler(MultipartException.class)
// @ResponseBody
// public ResultInfo<String> handleAll(){
// ResultInfo<String> result = new ResultInfo<>();
// String errorMsg = "文件过大,不能超过4MB";
// result.setCode("0");
// result.setMsg(errorMsg);
// return result;
// }
}
2code/server/store-system/src/main/resources/application.properties
View file @
28b33141
# 服务启动端口
server.port
=
8
781
server.port
=
8
090
# 数据源驱动类
spring.datasource.driverClassName
=
com.mysql.jdbc.Driver
# 数据源URL
#spring.datasource.url=jdbc:mysql://101.1.31.63/fqy_store?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
## 数据源用户名
#spring.datasource.username=fqy_db_user
## 数据源密码
#spring.datasource.password=123456
# 数据源URL
spring.datasource.url
=
jdbc:mysql://47.105.32.6/fqy_store?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull
# 数据源用户名
spring.datasource.username
=
db_rw
...
...
@@ -17,7 +24,7 @@ sysparam.cache.available=1
spring.jmx.default-domain
=
store-system
#单个文件大小
#spring.http.multipart.maxFileSize=2Mb
spring.servlet.multipart.max-file-size
=
4MB
spring.servlet.multipart.max-file-size
=
-1
#设置总上传的数据大小
#spring.http.multipart.maxRequestSize=20Mb
spring.servlet.multipart.max-request-size
=
10MB
...
...
@@ -26,6 +33,12 @@ spring.servlet.multipart.max-request-size=10MB
mybatis.config-location
=
classpath:mybatis/mybatis-config.xml
# mybatis mapper配置文件
mybatis.mapper-locations
=
classpath:mybatis/mapper/*.xml
#image_path=https://101.1.31.63:8090/image-server/
#res_img_path=/opt/fqy/files/store/image/
#
#file_path=https://101.1.31.63:8090/file-server/
#res_file_path=/opt/fqy/files/store/files/
image_path
=
https://carnet.fqyxa.com/image-server/
res_img_path
=
/opt/fqy/files/carnet/image/
file_path
=
https://carnet.fqyxa.com/file-server/
...
...
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