Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
server
Overview
Overview
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
vanke
server
Commits
ee58df50
Commit
ee58df50
authored
Aug 14, 2020
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
万科接口修复
parent
38361b63
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
617 additions
and
135 deletions
+617
-135
Swagger2Config.java
...n/src/main/java/com/macro/mall/config/Swagger2Config.java
+2
-3
UmsAdminController.java
...in/java/com/macro/mall/controller/UmsAdminController.java
+1
-1
UmsMemberController.java
...n/java/com/macro/mall/controller/UmsMemberController.java
+12
-0
ValidateCode.java
...n/java/com/macro/mall/controller/system/ValidateCode.java
+26
-8
ValidateCodeController.java
.../macro/mall/controller/system/ValidateCodeController.java
+22
-13
VankeGoodsCategoryController.java
...o/mall/controller/vanke/VankeGoodsCategoryController.java
+3
-2
VankeInboundOrderController.java
...ro/mall/controller/vanke/VankeInboundOrderController.java
+23
-5
VankeOutboundRecordController.java
.../mall/controller/vanke/VankeOutboundRecordController.java
+24
-10
UmsAdminLoginParam.java
.../src/main/java/com/macro/mall/dto/UmsAdminLoginParam.java
+11
-0
application.yml
mall-admin/src/main/resources/application.yml
+2
-2
admin-dev.yml
mall-config/src/main/resources/config/admin/admin-dev.yml
+2
-2
portal-dev.yml
mall-config/src/main/resources/config/portal/portal-dev.yml
+2
-2
portal-prod.yml
mall-config/src/main/resources/config/portal/portal-prod.yml
+2
-2
VankeGoods.java
mall-mbg/src/main/java/com/macro/mall/model/VankeGoods.java
+6
-6
VankeGoodsExample.java
...src/main/java/com/macro/mall/model/VankeGoodsExample.java
+24
-24
UmsMemberDto.java
.../java/com/macro/mall/model/dto/quanxing/UmsMemberDto.java
+2
-0
VankeGoodsCategoryDto.java
...com/macro/mall/model/dto/vanke/VankeGoodsCategoryDto.java
+15
-0
VankeInboundRecordDto.java
...com/macro/mall/model/dto/vanke/VankeInboundRecordDto.java
+8
-0
VankeOutboundRecordDto.java
...om/macro/mall/model/dto/vanke/VankeOutboundRecordDto.java
+8
-0
VankeGoodsMapper.xml
...main/resources/com/macro/mall/mapper/VankeGoodsMapper.xml
+14
-14
VankeGoodsCategoryController.java
...ortal/controller/member/VankeGoodsCategoryController.java
+3
-2
application.yml
mall-portal/src/main/resources/application.yml
+2
-2
VankeGoodsCategoryDao.java
.../java/com/macro/mall/dao/vanke/VankeGoodsCategoryDao.java
+15
-0
UmsMemberService.java
.../java/com/macro/mall/service/member/UmsMemberService.java
+7
-0
UmsMemberServiceImpl.java
.../macro/mall/service/member/impl/UmsMemberServiceImpl.java
+14
-0
UmsAdminService.java
...n/java/com/macro/mall/service/system/UmsAdminService.java
+1
-1
UmsAdminServiceImpl.java
...m/macro/mall/service/system/impl/UmsAdminServiceImpl.java
+25
-17
IADService.java
...rc/main/java/com/macro/mall/service/vanke/IADService.java
+15
-0
IVankeGoodsCategoryService.java
.../macro/mall/service/vanke/IVankeGoodsCategoryService.java
+2
-1
IVankeInboundOrderService.java
...m/macro/mall/service/vanke/IVankeInboundOrderService.java
+16
-0
IVankeOutboundRecordService.java
...macro/mall/service/vanke/IVankeOutboundRecordService.java
+12
-1
ADServiceImpl.java
...java/com/macro/mall/service/vanke/impl/ADServiceImpl.java
+71
-0
StaffServiceImpl.java
...a/com/macro/mall/service/vanke/impl/StaffServiceImpl.java
+1
-1
VankeGoodsCategoryServiceImpl.java
...all/service/vanke/impl/VankeGoodsCategoryServiceImpl.java
+7
-5
VankeGoodsServiceImpl.java
.../macro/mall/service/vanke/impl/VankeGoodsServiceImpl.java
+15
-6
VankeInboundOrderServiceImpl.java
...mall/service/vanke/impl/VankeInboundOrderServiceImpl.java
+112
-2
VankeOutboundRecordServiceImpl.java
...ll/service/vanke/impl/VankeOutboundRecordServiceImpl.java
+58
-1
UmsMemberDao.xml
...ce/src/main/resources/com/macro/mall/dao/UmsMemberDao.xml
+3
-1
VankeOutboundRecordDao.xml
...n/resources/com/macro/mall/dao/VankeOutboundRecordDao.xml
+6
-0
VankeGoodsCategoryDao.xml
...ources/com/macro/mall/dao/vanke/VankeGoodsCategoryDao.xml
+15
-0
VankeGoodsDao.xml
...main/resources/com/macro/mall/dao/vanke/VankeGoodsDao.xml
+1
-0
VankeInboundRecordDao.xml
...ources/com/macro/mall/dao/vanke/VankeInboundRecordDao.xml
+7
-1
No files found.
mall-admin/src/main/java/com/macro/mall/config/Swagger2Config.java
View file @
ee58df50
...
@@ -42,9 +42,8 @@ public class Swagger2Config {
...
@@ -42,9 +42,8 @@ public class Swagger2Config {
private
ApiInfo
apiInfo
()
{
private
ApiInfo
apiInfo
()
{
return
new
ApiInfoBuilder
()
return
new
ApiInfoBuilder
()
.
title
(
"haihaigo后台系统"
)
.
title
(
"万科后台管理系统"
)
.
description
(
"haihaigo后台系统"
)
.
description
(
"万科后台管理系统"
)
.
contact
(
"chenwf"
)
.
version
(
"1.0"
)
.
version
(
"1.0"
)
.
build
();
.
build
();
}
}
...
...
mall-admin/src/main/java/com/macro/mall/controller/UmsAdminController.java
View file @
ee58df50
...
@@ -66,7 +66,7 @@ public class UmsAdminController {
...
@@ -66,7 +66,7 @@ public class UmsAdminController {
//获取session 中的验证码 然后传给Sevice校验
//获取session 中的验证码 然后传给Sevice校验
HttpSession
session
=
request
.
getSession
();
HttpSession
session
=
request
.
getSession
();
Object
sessionAuthCode
=
session
.
getAttribute
(
"RANDOMKEY"
);
Object
sessionAuthCode
=
session
.
getAttribute
(
"RANDOMKEY"
);
return
adminService
.
login
(
umsAdminLoginParam
.
getUsername
(),
umsAdminLoginParam
.
getPassword
(),
umsAdminLoginParam
.
getAuthCode
(),
(
String
)
sessionAuthCode
,
1
);
return
adminService
.
login
(
umsAdminLoginParam
.
getUsername
(),
umsAdminLoginParam
.
getPassword
(),
umsAdminLoginParam
.
getAuthCode
(),
umsAdminLoginParam
.
getUuid
()
,
1
);
}
}
@ApiOperation
(
value
=
"刷新token"
)
@ApiOperation
(
value
=
"刷新token"
)
...
...
mall-admin/src/main/java/com/macro/mall/controller/UmsMemberController.java
View file @
ee58df50
...
@@ -3,6 +3,7 @@ package com.macro.mall.controller;
...
@@ -3,6 +3,7 @@ package com.macro.mall.controller;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.model.UmsAdmin
;
import
com.macro.mall.model.UmsAdmin
;
import
com.macro.mall.model.UmsMember
;
import
com.macro.mall.model.VankeSupplier
;
import
com.macro.mall.model.VankeSupplier
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.UmsAdminDto
;
import
com.macro.mall.model.dto.UmsAdminDto
;
...
@@ -88,5 +89,16 @@ public class UmsMemberController {
...
@@ -88,5 +89,16 @@ public class UmsMemberController {
return
CommonResult
.
success
(
this
.
umsMemberService
.
selectOneByMemberId
(
memberId
));
return
CommonResult
.
success
(
this
.
umsMemberService
.
selectOneByMemberId
(
memberId
));
}
}
@ApiOperation
(
"万科后台_根据id修改一条会员数据"
)
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
CommonResult
updateById
(
@ApiParam
(
value
=
"会员对象"
)
@RequestBody
UmsMember
umsMember
){
ResultMsg
res
=
this
.
umsMemberService
.
updateById
(
umsMember
);
if
(
res
.
isFlag
()){
return
CommonResult
.
success
(
null
,
res
.
getMsg
());
}
return
CommonResult
.
failed
(
res
.
getMsg
());
}
}
}
mall-admin/src/main/java/com/macro/mall/
dto/Vo
/ValidateCode.java
→
mall-admin/src/main/java/com/macro/mall/
controller/system
/ValidateCode.java
View file @
ee58df50
package
com
.
macro
.
mall
.
dto
.
Vo
;
package
com
.
macro
.
mall
.
controller
.
system
;
import
com.macro.mall.service.system.RedisService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Component
;
import
javax.imageio.ImageIO
;
import
javax.imageio.ImageIO
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpSession
;
import
javax.servlet.http.HttpSession
;
import
java.awt.*
;
import
java.awt.image.BufferedImage
;
import
java.awt.image.BufferedImage
;
import
java.io.ByteArrayOutputStream
;
import
java.io.ByteArrayOutputStream
;
import
java.util.Base64
;
import
java.util.Base64
;
import
java.util.Random
;
import
java.util.Random
;
import
java.awt.*
;
@Component
public
class
ValidateCode
{
public
class
ValidateCode
{
private
static
Random
random
=
new
Random
();
private
static
Random
random
=
new
Random
();
...
@@ -23,6 +28,13 @@ public class ValidateCode {
...
@@ -23,6 +28,13 @@ public class ValidateCode {
private
final
String
sessionKey
=
"RANDOMKEY"
;
private
final
String
sessionKey
=
"RANDOMKEY"
;
private
static
RedisService
redisService
;
@Autowired
public
void
setRedisService
(
RedisService
redisService
)
{
ValidateCode
.
redisService
=
redisService
;
}
/*
/*
* 获取字体
* 获取字体
*/
*/
...
@@ -81,7 +93,7 @@ public class ValidateCode {
...
@@ -81,7 +93,7 @@ public class ValidateCode {
/*
/*
* 生成随机图片
* 生成随机图片
*/
*/
public
void
getRandomCodeImage
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
void
getRandomCodeImage
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
uuid
)
{
HttpSession
session
=
request
.
getSession
();
HttpSession
session
=
request
.
getSession
();
// BufferedImage类是具有缓冲区的Image类,Image类是用于描述图像信息的类
// BufferedImage类是具有缓冲区的Image类,Image类是用于描述图像信息的类
BufferedImage
image
=
new
BufferedImage
(
width
,
height
,
BufferedImage
.
TYPE_INT_BGR
);
BufferedImage
image
=
new
BufferedImage
(
width
,
height
,
BufferedImage
.
TYPE_INT_BGR
);
...
@@ -105,8 +117,11 @@ public class ValidateCode {
...
@@ -105,8 +117,11 @@ public class ValidateCode {
g
.
dispose
();
g
.
dispose
();
session
.
removeAttribute
(
sessionKey
);
//session.removeAttribute(sessionKey);
session
.
setAttribute
(
sessionKey
,
random_string
);
//session.setAttribute(sessionKey, random_string);
//将验证码 set到redis里,并且设置60秒有效期
this
.
redisService
.
set
(
uuid
,
random_string
,
60
);
String
base64String
=
""
;
String
base64String
=
""
;
try
{
try
{
...
@@ -121,7 +136,7 @@ public class ValidateCode {
...
@@ -121,7 +136,7 @@ public class ValidateCode {
/*
/*
* 生成随机图片,返回 base64 字符串
* 生成随机图片,返回 base64 字符串
*/
*/
public
String
getRandomCodeBase64
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
String
getRandomCodeBase64
(
HttpServletRequest
request
,
HttpServletResponse
response
,
String
uuid
)
{
HttpSession
session
=
request
.
getSession
();
HttpSession
session
=
request
.
getSession
();
// BufferedImage类是具有缓冲区的Image类,Image类是用于描述图像信息的类
// BufferedImage类是具有缓冲区的Image类,Image类是用于描述图像信息的类
BufferedImage
image
=
new
BufferedImage
(
width
,
height
,
BufferedImage
.
TYPE_INT_BGR
);
BufferedImage
image
=
new
BufferedImage
(
width
,
height
,
BufferedImage
.
TYPE_INT_BGR
);
...
@@ -145,8 +160,11 @@ public class ValidateCode {
...
@@ -145,8 +160,11 @@ public class ValidateCode {
g
.
dispose
();
g
.
dispose
();
session
.
removeAttribute
(
sessionKey
);
//session.removeAttribute(sessionKey);
session
.
setAttribute
(
sessionKey
,
random_string
);
//session.setAttribute(sessionKey, random_string);
//将验证码 set到redis里,并且设置60秒有效期
redisService
.
set
(
uuid
,
random_string
,
60
);
String
base64String
=
""
;
String
base64String
=
""
;
try
{
try
{
...
...
mall-admin/src/main/java/com/macro/mall/controller/system/ValidateCodeController.java
View file @
ee58df50
package
com
.
macro
.
mall
.
controller
.
system
;
package
com
.
macro
.
mall
.
controller
.
system
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.
dto.Vo.ValidateCod
e
;
import
com.macro.mall.
service.system.RedisServic
e
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestMethod
;
...
@@ -14,16 +15,23 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -14,16 +15,23 @@ import javax.servlet.http.HttpServletResponse;
import
javax.servlet.http.HttpSession
;
import
javax.servlet.http.HttpSession
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
@Controller
@Controller
@Api
(
tags
=
"万科物资_验证码相关接口"
,
description
=
"验证码控制器"
)
@Api
(
tags
=
"万科物资_验证码相关接口"
,
description
=
"验证码控制器"
)
@RequestMapping
(
"/validateCode"
)
@RequestMapping
(
"/validateCode"
)
public
class
ValidateCodeController
{
public
class
ValidateCodeController
{
@Autowired
private
RedisService
redisService
;
@ApiOperation
(
value
=
"生成验证码,返回的是图片"
)
@ApiOperation
(
value
=
"生成验证码,返回的是图片"
)
@RequestMapping
(
value
=
"/getCaptchaImage"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getCaptchaImage"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
void
getCaptcha
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
String
getCaptcha
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
//生成uuid
String
uuid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
try
{
try
{
response
.
setContentType
(
"image/png"
);
response
.
setContentType
(
"image/png"
);
response
.
setHeader
(
"Cache-Control"
,
"no-cache"
);
response
.
setHeader
(
"Cache-Control"
,
"no-cache"
);
...
@@ -31,13 +39,14 @@ public class ValidateCodeController {
...
@@ -31,13 +39,14 @@ public class ValidateCodeController {
response
.
setHeader
(
"Pragma"
,
"no-cache"
);
response
.
setHeader
(
"Pragma"
,
"no-cache"
);
ValidateCode
validateCode
=
new
ValidateCode
();
ValidateCode
validateCode
=
new
ValidateCode
();
this
.
redisService
.
get
(
""
);
// 直接返回图片
// 直接返回图片
validateCode
.
getRandomCodeImage
(
request
,
response
);
validateCode
.
getRandomCodeImage
(
request
,
response
,
uuid
);
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
System
.
out
.
println
(
e
);
}
}
return
uuid
;
}
}
@ApiOperation
(
value
=
"生成验证码,返回的是 base64"
)
@ApiOperation
(
value
=
"生成验证码,返回的是 base64"
)
...
@@ -46,6 +55,9 @@ public class ValidateCodeController {
...
@@ -46,6 +55,9 @@ public class ValidateCodeController {
public
CommonResult
getCaptchaBase64
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
CommonResult
getCaptchaBase64
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
Map
result
=
new
HashMap
();
Map
result
=
new
HashMap
();
//生成uuid
String
uuid
=
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
);
result
.
put
(
"uuid"
,
uuid
);
try
{
try
{
response
.
setContentType
(
"image/png"
);
response
.
setContentType
(
"image/png"
);
...
@@ -59,9 +71,10 @@ public class ValidateCodeController {
...
@@ -59,9 +71,10 @@ public class ValidateCodeController {
// validateCode.getRandomCode(request, response);
// validateCode.getRandomCode(request, response);
// 返回base64
// 返回base64
String
base64String
=
validateCode
.
getRandomCodeBase64
(
request
,
response
);
String
base64String
=
validateCode
.
getRandomCodeBase64
(
request
,
response
,
uuid
);
result
.
put
(
"url"
,
"data:image/png;base64,"
+
base64String
);
result
.
put
(
"url"
,
"data:image/png;base64,"
+
base64String
);
result
.
put
(
"message"
,
"created successfull"
);
result
.
put
(
"message"
,
"created successfull"
);
System
.
out
.
println
(
"test="
+
result
.
get
(
"url"
));
System
.
out
.
println
(
"test="
+
result
.
get
(
"url"
));
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
e
);
System
.
out
.
println
(
e
);
...
@@ -69,15 +82,11 @@ public class ValidateCodeController {
...
@@ -69,15 +82,11 @@ public class ValidateCodeController {
return
CommonResult
.
success
(
result
,
"获取成功"
);
return
CommonResult
.
success
(
result
,
"获取成功"
);
}
}
@ApiOperation
(
value
=
"测试
sessionKey
,后续不用需要删除"
)
@ApiOperation
(
value
=
"测试
redis
,后续不用需要删除"
)
@RequestMapping
(
value
=
"/test
SessionKey
"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/test
Redis
"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
CommonResult
testSessionKey
(
HttpServletRequest
request
,
HttpServletResponse
response
)
{
public
CommonResult
testRedis
(
String
uuid
)
{
//获取session
return
CommonResult
.
success
(
this
.
redisService
.
get
(
uuid
),
(
String
)
"操作成功"
);
HttpSession
session
=
request
.
getSession
();
Object
obj
=
session
.
getAttribute
(
"RANDOMKEY"
);
return
CommonResult
.
success
(
null
,
(
String
)
obj
);
}
}
}
}
mall-admin/src/main/java/com/macro/mall/controller/vanke/VankeGoodsCategoryController.java
View file @
ee58df50
...
@@ -5,6 +5,7 @@ import com.macro.mall.common.api.CommonResult;
...
@@ -5,6 +5,7 @@ import com.macro.mall.common.api.CommonResult;
import
com.macro.mall.model.VankeGoodsCategory
;
import
com.macro.mall.model.VankeGoodsCategory
;
import
com.macro.mall.model.VankeStockRoom
;
import
com.macro.mall.model.VankeStockRoom
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeGoodsCategoryDto
;
import
com.macro.mall.service.vanke.IVankeGoodsCategoryService
;
import
com.macro.mall.service.vanke.IVankeGoodsCategoryService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -27,8 +28,8 @@ public class VankeGoodsCategoryController {
...
@@ -27,8 +28,8 @@ public class VankeGoodsCategoryController {
@ApiOperation
(
"万科后台_物品类别分页操作"
)
@ApiOperation
(
"万科后台_物品类别分页操作"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
CommonResult
<
CommonPage
<
VankeGoodsCategory
>>
list
(
@ApiParam
(
value
=
"分页大小"
)
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
public
CommonResult
<
CommonPage
<
VankeGoodsCategory
Dto
>>
list
(
@ApiParam
(
value
=
"分页大小"
)
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
@ApiParam
(
value
=
"分页页数"
)
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
@ApiParam
(
value
=
"分页页数"
)
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
)
{
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
vankeGoodsCategoryService
.
getPageList
(
pageNum
,
pageSize
)));
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
vankeGoodsCategoryService
.
getPageList
(
pageNum
,
pageSize
)));
}
}
...
...
mall-admin/src/main/java/com/macro/mall/controller/vanke/VankeInboundOrderController.java
View file @
ee58df50
package
com
.
macro
.
mall
.
controller
.
vanke
;
package
com
.
macro
.
mall
.
controller
.
vanke
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.model.VankeInboundOrder
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeInboundOrderDto
;
import
com.macro.mall.model.dto.vanke.VankeInboundOrderDto
;
import
com.macro.mall.model.dto.vanke.VankeOutboundOrderDto
;
import
com.macro.mall.model.dto.vanke.VankeOutboundOrderDto
;
import
com.macro.mall.service.vanke.IVankeInboundOrderService
;
import
com.macro.mall.service.vanke.IVankeInboundOrderService
;
...
@@ -10,10 +12,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -10,10 +12,7 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@Controller
@Controller
@Api
(
tags
=
"万科后台_入库单相关接口"
,
description
=
"入库单控制器"
)
@Api
(
tags
=
"万科后台_入库单相关接口"
,
description
=
"入库单控制器"
)
...
@@ -31,7 +30,26 @@ public class VankeInboundOrderController {
...
@@ -31,7 +30,26 @@ public class VankeInboundOrderController {
return
CommonResult
.
success
(
this
.
vankeInboundOrderService
.
getPageList
(
pageNum
,
pageSize
,
vankeInboundOrderDto
));
return
CommonResult
.
success
(
this
.
vankeInboundOrderService
.
getPageList
(
pageNum
,
pageSize
,
vankeInboundOrderDto
));
}
}
@ApiOperation
(
"万科后台_根据id修改订单数据"
)
@ResponseBody
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
POST
)
public
CommonResult
updateById
(
@ApiParam
(
value
=
"入库对象"
)
@RequestBody
VankeInboundOrder
vankeInboundOrder
){
ResultMsg
res
=
this
.
vankeInboundOrderService
.
updateById
(
vankeInboundOrder
);
if
(!
res
.
isFlag
()){
return
CommonResult
.
failed
(
res
.
getMsg
());
}
return
CommonResult
.
success
(
res
.
getMsg
());
}
@ApiOperation
(
"万科后台_传入入库单详情集合(只需要传vorList即可)"
)
@ResponseBody
@RequestMapping
(
value
=
"/updateInboundNum"
,
method
=
RequestMethod
.
POST
)
public
CommonResult
updateInboundNum
(
@ApiParam
(
value
=
"入库对象"
)
@RequestBody
VankeInboundOrderDto
vankeInboundOrderdto
){
ResultMsg
res
=
this
.
vankeInboundOrderService
.
updateInboundNum
(
vankeInboundOrderdto
);
if
(!
res
.
isFlag
()){
return
CommonResult
.
failed
(
res
.
getMsg
());
}
return
CommonResult
.
success
(
res
.
getMsg
());
}
}
}
mall-admin/src/main/java/com/macro/mall/controller/vanke/VankeOutboundRecordController.java
View file @
ee58df50
...
@@ -3,7 +3,10 @@ package com.macro.mall.controller.vanke;
...
@@ -3,7 +3,10 @@ package com.macro.mall.controller.vanke;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.model.VankeOutboundRecord
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeGoodsDto
;
import
com.macro.mall.model.dto.vanke.VankeGoodsDto
;
import
com.macro.mall.model.dto.vanke.VankeInboundOrderDto
;
import
com.macro.mall.model.dto.vanke.VankeOutboundRecordDto
;
import
com.macro.mall.model.dto.vanke.VankeOutboundRecordDto
;
import
com.macro.mall.service.vanke.IVankeOutboundRecordService
;
import
com.macro.mall.service.vanke.IVankeOutboundRecordService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -11,10 +14,7 @@ import io.swagger.annotations.ApiOperation;
...
@@ -11,10 +14,7 @@ import io.swagger.annotations.ApiOperation;
import
io.swagger.annotations.ApiParam
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@Controller
@Controller
@Api
(
tags
=
"万科后台_出库管理相关接口"
,
description
=
"出库管理控制器"
)
@Api
(
tags
=
"万科后台_出库管理相关接口"
,
description
=
"出库管理控制器"
)
...
@@ -30,12 +30,26 @@ public class VankeOutboundRecordController {
...
@@ -30,12 +30,26 @@ public class VankeOutboundRecordController {
@ResponseBody
@ResponseBody
public
CommonResult
<
CommonPage
<
VankeOutboundRecordDto
>>
list
(
@ApiParam
(
value
=
"分页大小"
)
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
public
CommonResult
<
CommonPage
<
VankeOutboundRecordDto
>>
list
(
@ApiParam
(
value
=
"分页大小"
)
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"5"
)
Integer
pageSize
,
@ApiParam
(
value
=
"分页页数"
)
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
,
@ApiParam
(
value
=
"分页页数"
)
@RequestParam
(
value
=
"pageNum"
,
defaultValue
=
"1"
)
Integer
pageNum
,
@ApiParam
(
value
=
"物品分类id"
)
@RequestParam
(
value
=
"goodsCategoryId"
)
Long
goodsCategoryId
,
@ApiParam
(
value
=
"物品分类id"
)
@RequestParam
(
value
=
"goodsCategoryId"
,
required
=
false
)
Long
goodsCategoryId
,
@ApiParam
(
value
=
"部门id"
)
@RequestParam
(
value
=
"departId"
)
Long
departId
,
@ApiParam
(
value
=
"部门id"
)
@RequestParam
(
value
=
"departId"
,
required
=
false
)
Long
departId
,
@ApiParam
(
value
=
"部门id"
)
@RequestParam
(
value
=
"stockRoomId"
)
Long
stockRoomId
,
@ApiParam
(
value
=
"部门id"
)
@RequestParam
(
value
=
"stockRoomId"
,
required
=
false
)
Long
stockRoomId
,
@ApiParam
(
value
=
"会员昵称"
)
@RequestParam
(
value
=
"memberName"
)
String
memberName
,
@ApiParam
(
value
=
"会员昵称"
)
@RequestParam
(
value
=
"memberName"
,
required
=
false
)
String
memberName
,
@ApiParam
(
value
=
"物品名称"
)
@RequestParam
(
value
=
"goodsMame"
)
String
goodsName
@ApiParam
(
value
=
"物品名称"
)
@RequestParam
(
value
=
"goodsMame"
,
required
=
false
)
String
goodsName
,
@ApiParam
(
value
=
"起始时间"
)
@RequestParam
(
value
=
"startTime"
,
required
=
false
)
String
startTime
,
@ApiParam
(
value
=
"结束时间"
)
@RequestParam
(
value
=
"endTime"
,
required
=
false
)
String
endTime
){
){
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
vankeOutboundRecordService
.
getPageList
(
pageNum
,
pageSize
,
goodsCategoryId
,
departId
,
stockRoomId
,
memberName
,
goodsName
)));
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
vankeOutboundRecordService
.
getPageList
(
pageNum
,
pageSize
,
goodsCategoryId
,
departId
,
stockRoomId
,
memberName
,
goodsName
,
startTime
,
endTime
)));
}
@ApiOperation
(
"万科后台_根据id修改一条出库数据"
)
@ResponseBody
@RequestMapping
(
value
=
"/updateById"
,
method
=
RequestMethod
.
POST
)
public
CommonResult
updateById
(
@ApiParam
(
value
=
"出库对象"
)
@RequestBody
VankeOutboundRecord
vankeOutboundRecord
){
ResultMsg
res
=
this
.
vankeOutboundRecordService
.
updateById
(
vankeOutboundRecord
);
if
(!
res
.
isFlag
()){
return
CommonResult
.
failed
(
res
.
getMsg
());
}
return
CommonResult
.
success
(
res
.
getMsg
());
}
}
}
}
mall-admin/src/main/java/com/macro/mall/dto/UmsAdminLoginParam.java
View file @
ee58df50
...
@@ -19,6 +19,9 @@ public class UmsAdminLoginParam {
...
@@ -19,6 +19,9 @@ public class UmsAdminLoginParam {
@ApiModelProperty
(
value
=
"验证码"
,
required
=
true
)
@ApiModelProperty
(
value
=
"验证码"
,
required
=
true
)
@NotEmpty
(
message
=
"验证码不能传入为空"
)
@NotEmpty
(
message
=
"验证码不能传入为空"
)
private
String
authCode
;
private
String
authCode
;
@ApiModelProperty
(
value
=
"uuid"
,
required
=
true
)
@NotEmpty
(
message
=
"uuid不能传入为空"
)
private
String
uuid
;
public
void
setAuthCode
(
String
authCode
)
{
public
void
setAuthCode
(
String
authCode
)
{
...
@@ -44,4 +47,12 @@ public class UmsAdminLoginParam {
...
@@ -44,4 +47,12 @@ public class UmsAdminLoginParam {
public
void
setPassword
(
String
password
)
{
public
void
setPassword
(
String
password
)
{
this
.
password
=
password
;
this
.
password
=
password
;
}
}
public
String
getUuid
()
{
return
uuid
;
}
public
void
setUuid
(
String
uuid
)
{
this
.
uuid
=
uuid
;
}
}
}
mall-admin/src/main/resources/application.yml
View file @
ee58df50
...
@@ -2,9 +2,9 @@ server:
...
@@ -2,9 +2,9 @@ server:
port
:
8180
port
:
8180
spring
:
spring
:
datasource
:
datasource
:
url
:
jdbc:mysql://1
27.0.0.1
:3306/vanke?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://1
15.29.198.90
:3306/vanke?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username
:
root
username
:
root
password
:
123
password
:
root
druid
:
druid
:
initial-size
:
5
#连接池初始化大小
initial-size
:
5
#连接池初始化大小
min-idle
:
10
#最小空闲连接数
min-idle
:
10
#最小空闲连接数
...
...
mall-config/src/main/resources/config/admin/admin-dev.yml
View file @
ee58df50
...
@@ -12,9 +12,9 @@ aliyun:
...
@@ -12,9 +12,9 @@ aliyun:
prefix
:
mall/images/
# 上传文件夹路径前缀
prefix
:
mall/images/
# 上传文件夹路径前缀
spring
:
spring
:
datasource
:
datasource
:
url
:
jdbc:mysql://1
27.0.0.1
:3306/vanke?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://1
15.29.198.90
:3306/vanke?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username
:
root
username
:
root
password
:
123
password
:
root
logging
:
logging
:
level
:
level
:
root
:
info
#日志配置DEBUG,INFO,WARN,ERROR
root
:
info
#日志配置DEBUG,INFO,WARN,ERROR
...
...
mall-config/src/main/resources/config/portal/portal-dev.yml
View file @
ee58df50
spring
:
spring
:
datasource
:
datasource
:
url
:
jdbc:mysql://1
27.0.0.1
:3306/vanke?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://1
15.29.198.90
:3306/vanke?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username
:
root
username
:
root
password
:
123
password
:
root
redis
:
redis
:
host
:
127.0.0.1
# Redis服务器地址
host
:
127.0.0.1
# Redis服务器地址
database
:
0
# Redis数据库索引(默认为0)
database
:
0
# Redis数据库索引(默认为0)
...
...
mall-config/src/main/resources/config/portal/portal-prod.yml
View file @
ee58df50
...
@@ -4,8 +4,8 @@ spring:
...
@@ -4,8 +4,8 @@ spring:
username
:
root
username
:
root
password
:
2017gzMM
password
:
2017gzMM
redis
:
redis
:
host
:
1
0.27.33.4
# Redis服务器地址
host
:
1
27.0.0.1
# Redis服务器地址
database
:
0
# Redis数据库索引(默认为0)
database
:
0
# Redis数据库索引(默认为0)
port
:
63
80
# Redis服务器连接端口
port
:
63
79
# Redis服务器连接端口
password
:
#不设置密码
password
:
#不设置密码
mall-mbg/src/main/java/com/macro/mall/model/VankeGoods.java
View file @
ee58df50
...
@@ -27,7 +27,7 @@ public class VankeGoods implements Serializable {
...
@@ -27,7 +27,7 @@ public class VankeGoods implements Serializable {
private
String
barCode
;
private
String
barCode
;
@ApiModelProperty
(
value
=
"物品价格"
)
@ApiModelProperty
(
value
=
"物品价格"
)
private
BigDecimal
pric
t
;
private
BigDecimal
pric
e
;
@ApiModelProperty
(
value
=
"供应商id"
)
@ApiModelProperty
(
value
=
"供应商id"
)
private
Long
supplierId
;
private
Long
supplierId
;
...
@@ -103,12 +103,12 @@ public class VankeGoods implements Serializable {
...
@@ -103,12 +103,12 @@ public class VankeGoods implements Serializable {
this
.
barCode
=
barCode
;
this
.
barCode
=
barCode
;
}
}
public
BigDecimal
getPric
t
()
{
public
BigDecimal
getPric
e
()
{
return
pric
t
;
return
pric
e
;
}
}
public
void
setPric
t
(
BigDecimal
prict
)
{
public
void
setPric
e
(
BigDecimal
price
)
{
this
.
pric
t
=
prict
;
this
.
pric
e
=
price
;
}
}
public
Long
getSupplierId
()
{
public
Long
getSupplierId
()
{
...
@@ -202,7 +202,7 @@ public class VankeGoods implements Serializable {
...
@@ -202,7 +202,7 @@ public class VankeGoods implements Serializable {
sb
.
append
(
", goodsNo="
).
append
(
goodsNo
);
sb
.
append
(
", goodsNo="
).
append
(
goodsNo
);
sb
.
append
(
", goodsNum="
).
append
(
goodsNum
);
sb
.
append
(
", goodsNum="
).
append
(
goodsNum
);
sb
.
append
(
", barCode="
).
append
(
barCode
);
sb
.
append
(
", barCode="
).
append
(
barCode
);
sb
.
append
(
", pric
t="
).
append
(
prict
);
sb
.
append
(
", pric
e="
).
append
(
price
);
sb
.
append
(
", supplierId="
).
append
(
supplierId
);
sb
.
append
(
", supplierId="
).
append
(
supplierId
);
sb
.
append
(
", stockRoomId="
).
append
(
stockRoomId
);
sb
.
append
(
", stockRoomId="
).
append
(
stockRoomId
);
sb
.
append
(
", goodsCategoryId="
).
append
(
goodsCategoryId
);
sb
.
append
(
", goodsCategoryId="
).
append
(
goodsCategoryId
);
...
...
mall-mbg/src/main/java/com/macro/mall/model/VankeGoodsExample.java
View file @
ee58df50
...
@@ -436,63 +436,63 @@ public class VankeGoodsExample {
...
@@ -436,63 +436,63 @@ public class VankeGoodsExample {
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
IsNull
()
{
public
Criteria
andPric
e
IsNull
()
{
addCriterion
(
"pric
t
is null"
);
addCriterion
(
"pric
e
is null"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
IsNotNull
()
{
public
Criteria
andPric
e
IsNotNull
()
{
addCriterion
(
"pric
t
is not null"
);
addCriterion
(
"pric
e
is not null"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
EqualTo
(
BigDecimal
value
)
{
public
Criteria
andPric
e
EqualTo
(
BigDecimal
value
)
{
addCriterion
(
"pric
t ="
,
value
,
"prict
"
);
addCriterion
(
"pric
e ="
,
value
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
NotEqualTo
(
BigDecimal
value
)
{
public
Criteria
andPric
e
NotEqualTo
(
BigDecimal
value
)
{
addCriterion
(
"pric
t <>"
,
value
,
"prict
"
);
addCriterion
(
"pric
e <>"
,
value
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
GreaterThan
(
BigDecimal
value
)
{
public
Criteria
andPric
e
GreaterThan
(
BigDecimal
value
)
{
addCriterion
(
"pric
t >"
,
value
,
"prict
"
);
addCriterion
(
"pric
e >"
,
value
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
GreaterThanOrEqualTo
(
BigDecimal
value
)
{
public
Criteria
andPric
e
GreaterThanOrEqualTo
(
BigDecimal
value
)
{
addCriterion
(
"pric
t >="
,
value
,
"prict
"
);
addCriterion
(
"pric
e >="
,
value
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
LessThan
(
BigDecimal
value
)
{
public
Criteria
andPric
e
LessThan
(
BigDecimal
value
)
{
addCriterion
(
"pric
t <"
,
value
,
"prict
"
);
addCriterion
(
"pric
e <"
,
value
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
LessThanOrEqualTo
(
BigDecimal
value
)
{
public
Criteria
andPric
e
LessThanOrEqualTo
(
BigDecimal
value
)
{
addCriterion
(
"pric
t <="
,
value
,
"prict
"
);
addCriterion
(
"pric
e <="
,
value
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
In
(
List
<
BigDecimal
>
values
)
{
public
Criteria
andPric
e
In
(
List
<
BigDecimal
>
values
)
{
addCriterion
(
"pric
t in"
,
values
,
"prict
"
);
addCriterion
(
"pric
e in"
,
values
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
NotIn
(
List
<
BigDecimal
>
values
)
{
public
Criteria
andPric
e
NotIn
(
List
<
BigDecimal
>
values
)
{
addCriterion
(
"pric
t not in"
,
values
,
"prict
"
);
addCriterion
(
"pric
e not in"
,
values
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
Between
(
BigDecimal
value1
,
BigDecimal
value2
)
{
public
Criteria
andPric
e
Between
(
BigDecimal
value1
,
BigDecimal
value2
)
{
addCriterion
(
"pric
t between"
,
value1
,
value2
,
"prict
"
);
addCriterion
(
"pric
e between"
,
value1
,
value2
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
public
Criteria
andPric
t
NotBetween
(
BigDecimal
value1
,
BigDecimal
value2
)
{
public
Criteria
andPric
e
NotBetween
(
BigDecimal
value1
,
BigDecimal
value2
)
{
addCriterion
(
"pric
t not between"
,
value1
,
value2
,
"prict
"
);
addCriterion
(
"pric
e not between"
,
value1
,
value2
,
"price
"
);
return
(
Criteria
)
this
;
return
(
Criteria
)
this
;
}
}
...
...
mall-mbg/src/main/java/com/macro/mall/model/dto/quanxing/UmsMemberDto.java
View file @
ee58df50
...
@@ -18,4 +18,6 @@ public class UmsMemberDto extends UmsMember implements Serializable {
...
@@ -18,4 +18,6 @@ public class UmsMemberDto extends UmsMember implements Serializable {
private
String
stockRoomName
;
private
String
stockRoomName
;
@ApiModelProperty
(
value
=
"分类名称"
)
@ApiModelProperty
(
value
=
"分类名称"
)
private
String
categoryName
;
private
String
categoryName
;
@ApiModelProperty
(
value
=
"后台管理员id"
)
private
Long
adminId
;
}
}
mall-mbg/src/main/java/com/macro/mall/model/dto/vanke/VankeGoodsCategoryDto.java
0 → 100644
View file @
ee58df50
package
com
.
macro
.
mall
.
model
.
dto
.
vanke
;
import
com.macro.mall.model.VankeGoodsCategory
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
VankeGoodsCategoryDto
extends
VankeGoodsCategory
implements
Serializable
{
@ApiModelProperty
(
value
=
"创建人名称"
)
private
String
createName
;
}
mall-mbg/src/main/java/com/macro/mall/model/dto/vanke/VankeInboundRecordDto.java
View file @
ee58df50
...
@@ -4,6 +4,8 @@ import com.macro.mall.model.VankeInboundRecord;
...
@@ -4,6 +4,8 @@ import com.macro.mall.model.VankeInboundRecord;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.math.BigDecimal
;
@Data
@Data
public
class
VankeInboundRecordDto
extends
VankeInboundRecord
{
public
class
VankeInboundRecordDto
extends
VankeInboundRecord
{
...
@@ -19,4 +21,10 @@ public class VankeInboundRecordDto extends VankeInboundRecord {
...
@@ -19,4 +21,10 @@ public class VankeInboundRecordDto extends VankeInboundRecord {
private
String
categoryName
;
private
String
categoryName
;
@ApiModelProperty
(
value
=
"总数"
)
@ApiModelProperty
(
value
=
"总数"
)
private
Integer
totalNum
;
private
Integer
totalNum
;
@ApiModelProperty
(
value
=
"价格"
)
private
BigDecimal
price
;
@ApiModelProperty
(
value
=
"供应商名称"
)
private
String
supplierName
;
@ApiModelProperty
(
value
=
"货号"
)
private
String
goodsNo
;
}
}
mall-mbg/src/main/java/com/macro/mall/model/dto/vanke/VankeOutboundRecordDto.java
View file @
ee58df50
...
@@ -4,6 +4,8 @@ import com.macro.mall.model.VankeOutboundRecord;
...
@@ -4,6 +4,8 @@ import com.macro.mall.model.VankeOutboundRecord;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.util.List
;
@Data
@Data
public
class
VankeOutboundRecordDto
extends
VankeOutboundRecord
{
public
class
VankeOutboundRecordDto
extends
VankeOutboundRecord
{
...
@@ -25,4 +27,10 @@ public class VankeOutboundRecordDto extends VankeOutboundRecord {
...
@@ -25,4 +27,10 @@ public class VankeOutboundRecordDto extends VankeOutboundRecord {
private
String
categoryName
;
private
String
categoryName
;
@ApiModelProperty
(
value
=
"总数"
)
@ApiModelProperty
(
value
=
"总数"
)
private
Integer
totalNum
;
private
Integer
totalNum
;
@ApiModelProperty
(
value
=
"出库详情集合"
)
private
List
<
VankeOutboundRecord
>
vorList
;
@ApiModelProperty
(
value
=
"起始时间"
)
private
String
startTime
;
@ApiModelProperty
(
value
=
"结束时间"
)
private
String
endTime
;
}
}
mall-mbg/src/main/resources/com/macro/mall/mapper/VankeGoodsMapper.xml
View file @
ee58df50
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
<result
column=
"goods_no"
jdbcType=
"VARCHAR"
property=
"goodsNo"
/>
<result
column=
"goods_no"
jdbcType=
"VARCHAR"
property=
"goodsNo"
/>
<result
column=
"goods_num"
jdbcType=
"INTEGER"
property=
"goodsNum"
/>
<result
column=
"goods_num"
jdbcType=
"INTEGER"
property=
"goodsNum"
/>
<result
column=
"bar_code"
jdbcType=
"VARCHAR"
property=
"barCode"
/>
<result
column=
"bar_code"
jdbcType=
"VARCHAR"
property=
"barCode"
/>
<result
column=
"pric
t"
jdbcType=
"DECIMAL"
property=
"prict
"
/>
<result
column=
"pric
e"
jdbcType=
"DECIMAL"
property=
"price
"
/>
<result
column=
"supplier_id"
jdbcType=
"BIGINT"
property=
"supplierId"
/>
<result
column=
"supplier_id"
jdbcType=
"BIGINT"
property=
"supplierId"
/>
<result
column=
"stock_room_id"
jdbcType=
"BIGINT"
property=
"stockRoomId"
/>
<result
column=
"stock_room_id"
jdbcType=
"BIGINT"
property=
"stockRoomId"
/>
<result
column=
"goods_category_id"
jdbcType=
"BIGINT"
property=
"goodsCategoryId"
/>
<result
column=
"goods_category_id"
jdbcType=
"BIGINT"
property=
"goodsCategoryId"
/>
...
@@ -78,7 +78,7 @@
...
@@ -78,7 +78,7 @@
</where>
</where>
</sql>
</sql>
<sql
id=
"Base_Column_List"
>
<sql
id=
"Base_Column_List"
>
id, name, goods_no, goods_num, bar_code, pric
t
, supplier_id, stock_room_id, goods_category_id,
id, name, goods_no, goods_num, bar_code, pric
e
, supplier_id, stock_room_id, goods_category_id,
remarks, delete_status, status, create_by, update_by, createtime, updatetime
remarks, delete_status, status, create_by, update_by, createtime, updatetime
</sql>
</sql>
<select
id=
"selectByExample"
parameterType=
"com.macro.mall.model.VankeGoodsExample"
resultMap=
"BaseResultMap"
>
<select
id=
"selectByExample"
parameterType=
"com.macro.mall.model.VankeGoodsExample"
resultMap=
"BaseResultMap"
>
...
@@ -116,13 +116,13 @@
...
@@ -116,13 +116,13 @@
SELECT LAST_INSERT_ID()
SELECT LAST_INSERT_ID()
</selectKey>
</selectKey>
insert into vanke_goods (name, goods_no, goods_num,
insert into vanke_goods (name, goods_no, goods_num,
bar_code, pric
t
, supplier_id,
bar_code, pric
e
, supplier_id,
stock_room_id, goods_category_id, remarks,
stock_room_id, goods_category_id, remarks,
delete_status, status, create_by,
delete_status, status, create_by,
update_by, createtime, updatetime
update_by, createtime, updatetime
)
)
values (#{name,jdbcType=VARCHAR}, #{goodsNo,jdbcType=VARCHAR}, #{goodsNum,jdbcType=INTEGER},
values (#{name,jdbcType=VARCHAR}, #{goodsNo,jdbcType=VARCHAR}, #{goodsNum,jdbcType=INTEGER},
#{barCode,jdbcType=VARCHAR}, #{pric
t
,jdbcType=DECIMAL}, #{supplierId,jdbcType=BIGINT},
#{barCode,jdbcType=VARCHAR}, #{pric
e
,jdbcType=DECIMAL}, #{supplierId,jdbcType=BIGINT},
#{stockRoomId,jdbcType=BIGINT}, #{goodsCategoryId,jdbcType=BIGINT}, #{remarks,jdbcType=VARCHAR},
#{stockRoomId,jdbcType=BIGINT}, #{goodsCategoryId,jdbcType=BIGINT}, #{remarks,jdbcType=VARCHAR},
#{deleteStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createBy,jdbcType=BIGINT},
#{deleteStatus,jdbcType=INTEGER}, #{status,jdbcType=INTEGER}, #{createBy,jdbcType=BIGINT},
#{updateBy,jdbcType=BIGINT}, #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}
#{updateBy,jdbcType=BIGINT}, #{createtime,jdbcType=TIMESTAMP}, #{updatetime,jdbcType=TIMESTAMP}
...
@@ -146,8 +146,8 @@
...
@@ -146,8 +146,8 @@
<if
test=
"barCode != null"
>
<if
test=
"barCode != null"
>
bar_code,
bar_code,
</if>
</if>
<if
test=
"pric
t
!= null"
>
<if
test=
"pric
e
!= null"
>
pric
t
,
pric
e
,
</if>
</if>
<if
test=
"supplierId != null"
>
<if
test=
"supplierId != null"
>
supplier_id,
supplier_id,
...
@@ -193,8 +193,8 @@
...
@@ -193,8 +193,8 @@
<if
test=
"barCode != null"
>
<if
test=
"barCode != null"
>
#{barCode,jdbcType=VARCHAR},
#{barCode,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"pric
t
!= null"
>
<if
test=
"pric
e
!= null"
>
#{pric
t
,jdbcType=DECIMAL},
#{pric
e
,jdbcType=DECIMAL},
</if>
</if>
<if
test=
"supplierId != null"
>
<if
test=
"supplierId != null"
>
#{supplierId,jdbcType=BIGINT},
#{supplierId,jdbcType=BIGINT},
...
@@ -252,8 +252,8 @@
...
@@ -252,8 +252,8 @@
<if
test=
"record.barCode != null"
>
<if
test=
"record.barCode != null"
>
bar_code = #{record.barCode,jdbcType=VARCHAR},
bar_code = #{record.barCode,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"record.pric
t
!= null"
>
<if
test=
"record.pric
e
!= null"
>
pric
t = #{record.prict
,jdbcType=DECIMAL},
pric
e = #{record.price
,jdbcType=DECIMAL},
</if>
</if>
<if
test=
"record.supplierId != null"
>
<if
test=
"record.supplierId != null"
>
supplier_id = #{record.supplierId,jdbcType=BIGINT},
supplier_id = #{record.supplierId,jdbcType=BIGINT},
...
@@ -297,7 +297,7 @@
...
@@ -297,7 +297,7 @@
goods_no = #{record.goodsNo,jdbcType=VARCHAR},
goods_no = #{record.goodsNo,jdbcType=VARCHAR},
goods_num = #{record.goodsNum,jdbcType=INTEGER},
goods_num = #{record.goodsNum,jdbcType=INTEGER},
bar_code = #{record.barCode,jdbcType=VARCHAR},
bar_code = #{record.barCode,jdbcType=VARCHAR},
pric
t = #{record.prict
,jdbcType=DECIMAL},
pric
e = #{record.price
,jdbcType=DECIMAL},
supplier_id = #{record.supplierId,jdbcType=BIGINT},
supplier_id = #{record.supplierId,jdbcType=BIGINT},
stock_room_id = #{record.stockRoomId,jdbcType=BIGINT},
stock_room_id = #{record.stockRoomId,jdbcType=BIGINT},
goods_category_id = #{record.goodsCategoryId,jdbcType=BIGINT},
goods_category_id = #{record.goodsCategoryId,jdbcType=BIGINT},
...
@@ -327,8 +327,8 @@
...
@@ -327,8 +327,8 @@
<if
test=
"barCode != null"
>
<if
test=
"barCode != null"
>
bar_code = #{barCode,jdbcType=VARCHAR},
bar_code = #{barCode,jdbcType=VARCHAR},
</if>
</if>
<if
test=
"pric
t
!= null"
>
<if
test=
"pric
e
!= null"
>
pric
t = #{prict
,jdbcType=DECIMAL},
pric
e = #{price
,jdbcType=DECIMAL},
</if>
</if>
<if
test=
"supplierId != null"
>
<if
test=
"supplierId != null"
>
supplier_id = #{supplierId,jdbcType=BIGINT},
supplier_id = #{supplierId,jdbcType=BIGINT},
...
@@ -369,7 +369,7 @@
...
@@ -369,7 +369,7 @@
goods_no = #{goodsNo,jdbcType=VARCHAR},
goods_no = #{goodsNo,jdbcType=VARCHAR},
goods_num = #{goodsNum,jdbcType=INTEGER},
goods_num = #{goodsNum,jdbcType=INTEGER},
bar_code = #{barCode,jdbcType=VARCHAR},
bar_code = #{barCode,jdbcType=VARCHAR},
pric
t = #{prict
,jdbcType=DECIMAL},
pric
e = #{price
,jdbcType=DECIMAL},
supplier_id = #{supplierId,jdbcType=BIGINT},
supplier_id = #{supplierId,jdbcType=BIGINT},
stock_room_id = #{stockRoomId,jdbcType=BIGINT},
stock_room_id = #{stockRoomId,jdbcType=BIGINT},
goods_category_id = #{goodsCategoryId,jdbcType=BIGINT},
goods_category_id = #{goodsCategoryId,jdbcType=BIGINT},
...
...
mall-portal/src/main/java/com/macro/mall/portal/controller/member/VankeGoodsCategoryController.java
View file @
ee58df50
...
@@ -4,6 +4,7 @@ import com.macro.mall.common.api.CommonPage;
...
@@ -4,6 +4,7 @@ import com.macro.mall.common.api.CommonPage;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.model.VankeGoodsCategory
;
import
com.macro.mall.model.VankeGoodsCategory
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeGoodsCategoryDto
;
import
com.macro.mall.service.vanke.IVankeGoodsCategoryService
;
import
com.macro.mall.service.vanke.IVankeGoodsCategoryService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
...
@@ -26,8 +27,8 @@ public class VankeGoodsCategoryController {
...
@@ -26,8 +27,8 @@ public class VankeGoodsCategoryController {
@ApiOperation
(
"万科h5_物品类别分页操作"
)
@ApiOperation
(
"万科h5_物品类别分页操作"
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/list"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
@ResponseBody
public
CommonResult
<
CommonPage
<
VankeGoodsCategory
>>
list
(
@ApiParam
(
value
=
"分页大小"
)
@RequestParam
(
value
=
"pageSize"
,
required
=
false
)
Integer
pageSize
,
public
CommonResult
<
CommonPage
<
VankeGoodsCategory
Dto
>>
list
(
@ApiParam
(
value
=
"分页大小"
)
@RequestParam
(
value
=
"pageSize"
,
required
=
false
)
Integer
pageSize
,
@ApiParam
(
value
=
"分页页数"
)
@RequestParam
(
value
=
"pageNum"
,
required
=
false
)
Integer
pageNum
)
{
@ApiParam
(
value
=
"分页页数"
)
@RequestParam
(
value
=
"pageNum"
,
required
=
false
)
Integer
pageNum
)
{
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
vankeGoodsCategoryService
.
getPageList
(
pageNum
,
pageSize
)));
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
vankeGoodsCategoryService
.
getPageList
(
pageNum
,
pageSize
)));
}
}
...
...
mall-portal/src/main/resources/application.yml
View file @
ee58df50
...
@@ -2,9 +2,9 @@ server:
...
@@ -2,9 +2,9 @@ server:
port
:
8085
port
:
8085
spring
:
spring
:
datasource
:
datasource
:
url
:
jdbc:mysql://1
27.0.0.1
:3306/vanke?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
url
:
jdbc:mysql://1
15.29.198.90
:3306/vanke?useUnicode=true&characterEncoding=utf-8&serverTimezone=Asia/Shanghai
username
:
root
username
:
root
password
:
123
password
:
root
druid
:
druid
:
initial-size
:
5
#连接池初始化大小
initial-size
:
5
#连接池初始化大小
min-idle
:
10
#最小空闲连接数
min-idle
:
10
#最小空闲连接数
...
...
mall-service/src/main/java/com/macro/mall/dao/vanke/VankeGoodsCategoryDao.java
0 → 100644
View file @
ee58df50
package
com
.
macro
.
mall
.
dao
.
vanke
;
import
com.macro.mall.model.dto.vanke.VankeGoodsCategoryDto
;
import
java.util.List
;
public
interface
VankeGoodsCategoryDao
{
/**
* 查询多条数据
* @param vankeGoodsCategoryDto
* @return
*/
List
<
VankeGoodsCategoryDto
>
selectList
(
VankeGoodsCategoryDto
vankeGoodsCategoryDto
);
}
mall-service/src/main/java/com/macro/mall/service/member/UmsMemberService.java
View file @
ee58df50
...
@@ -221,4 +221,11 @@ public interface UmsMemberService {
...
@@ -221,4 +221,11 @@ public interface UmsMemberService {
* @return
* @return
*/
*/
ResultMsg
batchImportMember
(
List
<
VankeImportMemberDto
>
vimdList
);
ResultMsg
batchImportMember
(
List
<
VankeImportMemberDto
>
vimdList
);
/**
* 根据id修改一条 会员数据
* @param umsMember
* @return
*/
ResultMsg
updateById
(
UmsMember
umsMember
);
}
}
mall-service/src/main/java/com/macro/mall/service/member/impl/UmsMemberServiceImpl.java
View file @
ee58df50
...
@@ -850,4 +850,18 @@ public class UmsMemberServiceImpl implements UmsMemberService {
...
@@ -850,4 +850,18 @@ public class UmsMemberServiceImpl implements UmsMemberService {
return
new
ResultMsg
(
true
,
"操作成功"
);
return
new
ResultMsg
(
true
,
"操作成功"
);
}
}
/**
* 根据id修改一条 会员数据
* @param umsMember
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultMsg
updateById
(
UmsMember
umsMember
){
if
(
umsMember
.
getId
()
==
null
){
return
new
ResultMsg
(
false
,
"传入id为空"
);
}
this
.
umsMemberMapper
.
updateByPrimaryKeySelective
(
umsMember
);
return
new
ResultMsg
(
true
,
"操作成功"
);
}
}
}
mall-service/src/main/java/com/macro/mall/service/system/UmsAdminService.java
View file @
ee58df50
...
@@ -61,7 +61,7 @@ public interface UmsAdminService {
...
@@ -61,7 +61,7 @@ public interface UmsAdminService {
* @param type
* @param type
* @return 生成的JWT的token
* @return 生成的JWT的token
*/
*/
CommonResult
login
(
String
username
,
String
password
,
String
authCode
,
String
sessionAuthCode
,
Integer
type
);
CommonResult
login
(
String
username
,
String
password
,
String
authCode
,
String
uuid
,
Integer
type
);
/**
/**
* 刷新token的功能
* 刷新token的功能
...
...
mall-service/src/main/java/com/macro/mall/service/system/impl/UmsAdminServiceImpl.java
View file @
ee58df50
...
@@ -19,9 +19,12 @@ import com.macro.mall.security.admin.DgbSecurityUserHelper;
...
@@ -19,9 +19,12 @@ import com.macro.mall.security.admin.DgbSecurityUserHelper;
import
com.macro.mall.security.util.JwtTokenUtil
;
import
com.macro.mall.security.util.JwtTokenUtil
;
import
com.macro.mall.service.mcht.PmsMchtShopInfoService
;
import
com.macro.mall.service.mcht.PmsMchtShopInfoService
;
import
com.macro.mall.service.member.UmsMemberService
;
import
com.macro.mall.service.member.UmsMemberService
;
import
com.macro.mall.service.system.RedisService
;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.vanke.IADService
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.authentication.UsernamePasswordAuthenticationToken
;
import
org.springframework.security.core.Authentication
;
import
org.springframework.security.core.Authentication
;
...
@@ -74,6 +77,10 @@ public class UmsAdminServiceImpl implements UmsAdminService {
...
@@ -74,6 +77,10 @@ public class UmsAdminServiceImpl implements UmsAdminService {
private
UmsMemberMapper
umsMemberMapper
;
private
UmsMemberMapper
umsMemberMapper
;
@Resource
@Resource
private
UmsMemberService
memberService
;
private
UmsMemberService
memberService
;
@Resource
private
RedisService
redisService
;
@Autowired
private
IADService
aDService
;
@Value
(
"${jwt.tokenHead}"
)
@Value
(
"${jwt.tokenHead}"
)
private
String
tokenHead
;
private
String
tokenHead
;
...
@@ -141,7 +148,7 @@ public class UmsAdminServiceImpl implements UmsAdminService {
...
@@ -141,7 +148,7 @@ public class UmsAdminServiceImpl implements UmsAdminService {
}
}
@Override
@Override
public
CommonResult
login
(
String
username
,
String
password
,
String
authCode
,
String
sessionAuthCode
,
Integer
type
)
{
public
CommonResult
login
(
String
username
,
String
password
,
String
authCode
,
String
uuid
,
Integer
type
)
{
String
token
=
null
;
String
token
=
null
;
//密码需要客户端加密后传递
//密码需要客户端加密后传递
boolean
isMcht
=
false
;
boolean
isMcht
=
false
;
...
@@ -150,26 +157,31 @@ public class UmsAdminServiceImpl implements UmsAdminService {
...
@@ -150,26 +157,31 @@ public class UmsAdminServiceImpl implements UmsAdminService {
UmsAdmin
admin
=
getAdminByUsername
(
username
);
UmsAdmin
admin
=
getAdminByUsername
(
username
);
if
(
admin
==
null
)
{
if
(
admin
==
null
)
{
return
CommonResult
.
failed
(
"用户不存在"
);
return
CommonResult
.
failed
(
"用户不存在"
);
}
}
else
if
(
admin
.
getDeleteStatus
().
equals
(
1
))
{
if
(
admin
.
getDeleteStatus
().
equals
(
1
))
{
return
CommonResult
.
failed
(
"用户不存在"
);
return
CommonResult
.
failed
(
"用户不存在"
);
}
else
if
(
admin
.
getStatus
()
==
0
)
{
return
CommonResult
.
failed
(
"您已被禁用请联系平台管理员!"
);
}
}
UserDetails
userDetails
=
loadUserByUsername
(
username
,
type
);
UserDetails
userDetails
=
loadUserByUsername
(
username
,
type
);
if
(!
passwordEncoder
.
matches
(
password
,
userDetails
.
getPassword
()))
{
return
CommonResult
.
failed
(
"密码不正确"
);
}
//校验验证码
//校验验证码
if
(
authCode
==
null
||
""
.
equals
(
authCode
)){
if
(
authCode
==
null
||
""
.
equals
(
authCode
)){
return
CommonResult
.
failed
(
"验证码为空"
);
return
CommonResult
.
failed
(
"验证码为空"
);
}
}
if
(
!
authCode
.
toLowerCase
().
equals
(
sessionAuthCode
))
{
if
(
!
authCode
.
toLowerCase
().
equals
(
this
.
redisService
.
get
(
uuid
)
))
{
return
CommonResult
.
failed
(
"输入验证码错误"
);
return
CommonResult
.
failed
(
"输入验证码错误"
);
}
}
//如果是admin 登录 则默认为超管登录 判断账号密码即可 其他账号登录均为域登录
Integer
status
=
admin
.
getStatus
();
//if("admin".equals(username)){
if
(
status
==
0
)
{
if
(!
passwordEncoder
.
matches
(
password
,
userDetails
.
getPassword
()))
{
return
CommonResult
.
failed
(
"您已被禁用请联系平台管理员!"
);
return
CommonResult
.
failed
(
"密码不正确"
);
}
}
/*}else{ //否则通过域登录判断
ResultMsg res = this.aDService.loginAd(username,password);
if(!res.isFlag()){
return CommonResult.failed(res.getMsg());
}
}*/
UsernamePasswordAuthenticationToken
authentication
=
new
UsernamePasswordAuthenticationToken
(
userDetails
,
null
,
userDetails
.
getAuthorities
());
UsernamePasswordAuthenticationToken
authentication
=
new
UsernamePasswordAuthenticationToken
(
userDetails
,
null
,
userDetails
.
getAuthorities
());
SecurityContextHolder
.
getContext
().
setAuthentication
(
authentication
);
SecurityContextHolder
.
getContext
().
setAuthentication
(
authentication
);
token
=
jwtTokenUtil
.
generateToken
(
userDetails
);
token
=
jwtTokenUtil
.
generateToken
(
userDetails
);
...
@@ -400,7 +412,7 @@ public class UmsAdminServiceImpl implements UmsAdminService {
...
@@ -400,7 +412,7 @@ public class UmsAdminServiceImpl implements UmsAdminService {
List
<
UmsResource
>
resourceList
=
getResourceList
(
admin
.
getId
());
List
<
UmsResource
>
resourceList
=
getResourceList
(
admin
.
getId
());
return
new
AdminUserDetails
(
admin
,
resourceList
);
return
new
AdminUserDetails
(
admin
,
resourceList
);
}
}
throw
new
UsernameNotFoundException
(
"用户名
或密码错误
"
);
throw
new
UsernameNotFoundException
(
"用户名
不存在
"
);
}
}
@Override
@Override
...
@@ -705,7 +717,6 @@ public class UmsAdminServiceImpl implements UmsAdminService {
...
@@ -705,7 +717,6 @@ public class UmsAdminServiceImpl implements UmsAdminService {
umsAdmin
.
setIcon
(
umsAdminDto
.
getIcon
());
umsAdmin
.
setIcon
(
umsAdminDto
.
getIcon
());
umsAdmin
.
setPhone
(
umsAdminDto
.
getPhone
());
umsAdmin
.
setPhone
(
umsAdminDto
.
getPhone
());
umsAdmin
.
setUsername
(
umsAdminDto
.
getUsername
());
umsAdmin
.
setUsername
(
umsAdminDto
.
getUsername
());
umsAdmin
.
setPassword
(
passwordEncoder
.
encode
(
umsAdminDto
.
getPassword
()));
umsAdmin
.
setName
(
umsAdminDto
.
getName
());
umsAdmin
.
setName
(
umsAdminDto
.
getName
());
umsAdmin
.
setMemberId
(
umsAdminDto
.
getMemberId
());
umsAdmin
.
setMemberId
(
umsAdminDto
.
getMemberId
());
umsAdmin
.
setDepartId
(
umsAdminDto
.
getDepartId
());
umsAdmin
.
setDepartId
(
umsAdminDto
.
getDepartId
());
...
@@ -744,9 +755,6 @@ public class UmsAdminServiceImpl implements UmsAdminService {
...
@@ -744,9 +755,6 @@ public class UmsAdminServiceImpl implements UmsAdminService {
if
(
umsAdmin
.
getUsername
()
==
null
||
""
.
equals
(
umsAdmin
.
getUsername
())){
if
(
umsAdmin
.
getUsername
()
==
null
||
""
.
equals
(
umsAdmin
.
getUsername
())){
return
new
ResultMsg
(
false
,
"传入用户名为空"
);
return
new
ResultMsg
(
false
,
"传入用户名为空"
);
}
}
if
(
umsAdmin
.
getPassword
()
==
null
||
""
.
equals
(
umsAdmin
.
getPassword
())){
return
new
ResultMsg
(
false
,
"传入密码为空"
);
}
if
(
umsAdmin
.
getMemberId
()
==
null
){
if
(
umsAdmin
.
getMemberId
()
==
null
){
return
new
ResultMsg
(
false
,
"传入会员id为空"
);
return
new
ResultMsg
(
false
,
"传入会员id为空"
);
}
}
...
...
mall-service/src/main/java/com/macro/mall/service/vanke/IADService.java
0 → 100644
View file @
ee58df50
package
com
.
macro
.
mall
.
service
.
vanke
;
import
com.macro.mall.model.common.ResultMsg
;
public
interface
IADService
{
/**
* 登录ad域
* @param username
* @param password
* @return
*/
ResultMsg
loginAd
(
String
username
,
String
password
);
}
mall-service/src/main/java/com/macro/mall/service/vanke/IVankeGoodsCategoryService.java
View file @
ee58df50
...
@@ -2,6 +2,7 @@ package com.macro.mall.service.vanke;
...
@@ -2,6 +2,7 @@ package com.macro.mall.service.vanke;
import
com.macro.mall.model.VankeGoodsCategory
;
import
com.macro.mall.model.VankeGoodsCategory
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeGoodsCategoryDto
;
import
java.util.List
;
import
java.util.List
;
...
@@ -27,5 +28,5 @@ public interface IVankeGoodsCategoryService {
...
@@ -27,5 +28,5 @@ public interface IVankeGoodsCategoryService {
* @param pageSize
* @param pageSize
* @return
* @return
*/
*/
List
<
VankeGoodsCategory
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
);
List
<
VankeGoodsCategory
Dto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
);
}
}
mall-service/src/main/java/com/macro/mall/service/vanke/IVankeInboundOrderService.java
View file @
ee58df50
package
com
.
macro
.
mall
.
service
.
vanke
;
package
com
.
macro
.
mall
.
service
.
vanke
;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.model.VankeInboundOrder
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeInboundOrderDto
;
import
com.macro.mall.model.dto.vanke.VankeInboundOrderDto
;
public
interface
IVankeInboundOrderService
{
public
interface
IVankeInboundOrderService
{
...
@@ -13,4 +15,18 @@ public interface IVankeInboundOrderService {
...
@@ -13,4 +15,18 @@ public interface IVankeInboundOrderService {
* @return
* @return
*/
*/
CommonPage
<
VankeInboundOrderDto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
VankeInboundOrderDto
vankeInboundOrderDto
);
CommonPage
<
VankeInboundOrderDto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
VankeInboundOrderDto
vankeInboundOrderDto
);
/**
* 根据id 修改一条数据
* @param vankeInboundOrder
* @return
*/
ResultMsg
updateById
(
VankeInboundOrder
vankeInboundOrder
);
/**
* 修改入库单内的入库数量
* @param vankeInboundOrderDto
* @return
*/
ResultMsg
updateInboundNum
(
VankeInboundOrderDto
vankeInboundOrderDto
);
}
}
mall-service/src/main/java/com/macro/mall/service/vanke/IVankeOutboundRecordService.java
View file @
ee58df50
package
com
.
macro
.
mall
.
service
.
vanke
;
package
com
.
macro
.
mall
.
service
.
vanke
;
import
com.macro.mall.model.VankeOutboundRecord
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeOutboundRecordDto
;
import
com.macro.mall.model.dto.vanke.VankeOutboundRecordDto
;
import
java.util.List
;
import
java.util.List
;
...
@@ -17,5 +19,14 @@ public interface IVankeOutboundRecordService {
...
@@ -17,5 +19,14 @@ public interface IVankeOutboundRecordService {
* @param goodsMame
* @param goodsMame
* @return
* @return
*/
*/
List
<
VankeOutboundRecordDto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
Long
goodsCategoryId
,
Long
departId
,
Long
stockRoomId
,
String
memberName
,
String
goodsMame
);
List
<
VankeOutboundRecordDto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
Long
goodsCategoryId
,
Long
departId
,
Long
stockRoomId
,
String
memberName
,
String
goodsMame
,
String
startTime
,
String
endTime
);
/**
* 根据id修改一条数据
* @param vankeOutboundRecord
* @return
*/
ResultMsg
updateById
(
VankeOutboundRecord
vankeOutboundRecord
);
}
}
mall-service/src/main/java/com/macro/mall/service/vanke/impl/ADServiceImpl.java
0 → 100644
View file @
ee58df50
package
com
.
macro
.
mall
.
service
.
vanke
.
impl
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.service.vanke.IADService
;
import
org.junit.Test
;
import
org.springframework.stereotype.Service
;
import
javax.naming.AuthenticationException
;
import
javax.naming.Context
;
import
javax.naming.directory.DirContext
;
import
javax.naming.directory.InitialDirContext
;
import
java.util.Hashtable
;
@Service
public
class
ADServiceImpl
implements
IADService
{
private
static
String
host
=
"182.61.50.234"
;
//AD域IP,必须填写正确
private
static
String
domain
=
"@tengfeikeji.club"
;
//域名后缀,例.@noker.cn.com
private
static
String
port
=
"389"
;
//端口,一般默认389
/**
* 登录ad域
* @param username
* @param password
* @return
*/
@Override
public
ResultMsg
loginAd
(
String
username
,
String
password
){
String
url
=
new
String
(
"ldap://"
+
host
+
":"
+
port
);
//固定写法
String
user
=
username
.
indexOf
(
domain
)
>
0
?
username
:
username
+
domain
;
//网上有别的方法,但是在我这儿都不好使,建议这么使用
Hashtable
env
=
new
Hashtable
();
//实例化一个Env
DirContext
ctx
=
null
;
env
.
put
(
Context
.
SECURITY_AUTHENTICATION
,
"simple"
);
//LDAP访问安全级别(none,simple,strong),一种模式,这么写就行
env
.
put
(
Context
.
SECURITY_PRINCIPAL
,
user
);
//用户名
env
.
put
(
Context
.
SECURITY_CREDENTIALS
,
password
);
//密码
env
.
put
(
Context
.
INITIAL_CONTEXT_FACTORY
,
"com.sun.jndi.ldap.LdapCtxFactory"
);
// LDAP工厂类
env
.
put
(
Context
.
PROVIDER_URL
,
url
);
//Url
try
{
ctx
=
new
InitialDirContext
(
env
);
// 初始化上下文
return
new
ResultMsg
(
true
,
"登录验证成功!"
);
}
catch
(
AuthenticationException
e
)
{
e
.
printStackTrace
();
return
new
ResultMsg
(
false
,
"登录验证失败!账户或密码有误!"
);
}
catch
(
javax
.
naming
.
CommunicationException
e
)
{
e
.
printStackTrace
();
return
new
ResultMsg
(
false
,
"AD域连接失败!请检查IP与端口正确性,是否能连上!"
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
new
ResultMsg
(
false
,
"身份验证未知异常!"
);
}
finally
{
if
(
null
!=
ctx
){
try
{
ctx
.
close
();
ctx
=
null
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
}
@Test
public
void
test
(){
ResultMsg
res
=
this
.
loginAd
(
"admin"
,
"root123!!"
);
System
.
out
.
println
(
res
.
getMsg
());
}
}
mall-service/src/main/java/com/macro/mall/service/vanke/impl/StaffServiceImpl.java
View file @
ee58df50
...
@@ -10,6 +10,7 @@ import org.junit.Test;
...
@@ -10,6 +10,7 @@ import org.junit.Test;
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.Date
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.UUID
;
import
java.util.UUID
;
...
@@ -61,5 +62,4 @@ public class StaffServiceImpl implements IStaffService {
...
@@ -61,5 +62,4 @@ public class StaffServiceImpl implements IStaffService {
}
}
return
new
ResultMsg
(
true
,
"二维码校验成功"
);
return
new
ResultMsg
(
true
,
"二维码校验成功"
);
}
}
}
}
mall-service/src/main/java/com/macro/mall/service/vanke/impl/VankeGoodsCategoryServiceImpl.java
View file @
ee58df50
package
com
.
macro
.
mall
.
service
.
vanke
.
impl
;
package
com
.
macro
.
mall
.
service
.
vanke
.
impl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.macro.mall.dao.vanke.VankeGoodsCategoryDao
;
import
com.macro.mall.mapper.VankeGoodsCategoryMapper
;
import
com.macro.mall.mapper.VankeGoodsCategoryMapper
;
import
com.macro.mall.model.*
;
import
com.macro.mall.model.*
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeGoodsCategoryDto
;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.vanke.IVankeBackLogService
;
import
com.macro.mall.service.vanke.IVankeBackLogService
;
import
com.macro.mall.service.vanke.IVankeGoodsCategoryService
;
import
com.macro.mall.service.vanke.IVankeGoodsCategoryService
;
...
@@ -24,6 +26,8 @@ public class VankeGoodsCategoryServiceImpl implements IVankeGoodsCategoryService
...
@@ -24,6 +26,8 @@ public class VankeGoodsCategoryServiceImpl implements IVankeGoodsCategoryService
private
UmsAdminService
umsAdminService
;
private
UmsAdminService
umsAdminService
;
@Autowired
@Autowired
private
IVankeBackLogService
vankeBackLogService
;
private
IVankeBackLogService
vankeBackLogService
;
@Resource
private
VankeGoodsCategoryDao
vankeGoodsCategoryDao
;
@Override
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
@Transactional
(
rollbackFor
=
Exception
.
class
)
...
@@ -76,13 +80,11 @@ public class VankeGoodsCategoryServiceImpl implements IVankeGoodsCategoryService
...
@@ -76,13 +80,11 @@ public class VankeGoodsCategoryServiceImpl implements IVankeGoodsCategoryService
* @return
* @return
*/
*/
@Override
@Override
public
List
<
VankeGoodsCategory
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
)
{
public
List
<
VankeGoodsCategory
Dto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
)
{
if
(
pageNum
!=
null
&&
pageSize
!=
null
){
if
(
pageNum
!=
null
&&
pageSize
!=
null
){
PageHelper
.
startPage
(
pageNum
,
pageSize
);
PageHelper
.
startPage
(
pageNum
,
pageSize
);
}
}
VankeGoodsCategoryExample
example
=
new
VankeGoodsCategoryExample
();
VankeGoodsCategoryDto
vankeGoodsCategoryDto
=
new
VankeGoodsCategoryDto
();
VankeGoodsCategoryExample
.
Criteria
criteria
=
example
.
createCriteria
();
return
this
.
vankeGoodsCategoryDao
.
selectList
(
vankeGoodsCategoryDto
);
criteria
.
andDeleteStatusEqualTo
(
1
);
//1未删除 0已删除
return
this
.
vankeGoodsCategoryMapper
.
selectByExample
(
example
);
}
}
}
}
mall-service/src/main/java/com/macro/mall/service/vanke/impl/VankeGoodsServiceImpl.java
View file @
ee58df50
...
@@ -106,16 +106,25 @@ public class VankeGoodsServiceImpl implements IVankeGoodsService {
...
@@ -106,16 +106,25 @@ public class VankeGoodsServiceImpl implements IVankeGoodsService {
if
(
vankeGoods
.
getId
()
==
null
){
if
(
vankeGoods
.
getId
()
==
null
){
return
new
ResultMsg
(
false
,
"传入id为空"
);
return
new
ResultMsg
(
false
,
"传入id为空"
);
}
}
if
(
vankeGoods
.
getDeleteStatus
()
==
0
){
//如果传入的状态为删除
//通过id获得之前数据
//通过id获得之前名称
VankeGoods
vg
=
this
.
vankeGoodsMapper
.
selectByPrimaryKey
(
vankeGoods
.
getId
());
VankeGoods
vg
=
this
.
vankeGoodsMapper
.
selectByPrimaryKey
(
vankeGoods
.
getId
());
if
(
vankeGoods
.
getGoodsNum
()
!=
null
){
//如果传入库存数量不为空
String
msg
=
"将物品名称:"
+
vg
.
getName
()
+
"删除"
;
//插入日志表
this
.
vankeBackLogService
.
insertVankeBackLog
(
"将物品名称为:"
+
vg
.
getName
()
+
"库存数量由:"
+
vg
.
getGoodsNum
()
+
"改为:"
+
vankeGoods
.
getGoodsNum
());
}
if
(
vankeGoods
.
getName
()
!=
null
&&
!
vankeGoods
.
getName
().
isEmpty
()){
//如果名字不为空
//插入日志表
this
.
vankeBackLogService
.
insertVankeBackLog
(
"将物品名称为:"
+
vg
.
getName
()+
"改为:"
+
vankeGoods
.
getName
());
}
if
(
vankeGoods
.
getDeleteStatus
()
!=
null
&&
vankeGoods
.
getDeleteStatus
()
==
0
){
//如果传入的状态为删除
String
msg
=
"将物品名称:"
+
vg
.
getName
()
+
"删除"
;
//插入日志表
//插入日志表
this
.
vankeBackLogService
.
insertVankeBackLog
(
msg
);
this
.
vankeBackLogService
.
insertVankeBackLog
(
msg
);
}
}
UmsAdmin
admin
=
umsAdminService
.
getCurrentUmsAdmin
();
UmsAdmin
admin
=
umsAdminService
.
getCurrentUmsAdmin
();
vankeGoods
.
setUpdateBy
(
admin
.
getId
());
vankeGoods
.
setUpdateBy
(
admin
.
getId
());
this
.
vankeGoodsMapper
.
insert
Selective
(
vankeGoods
);
this
.
vankeGoodsMapper
.
updateByPrimaryKey
Selective
(
vankeGoods
);
return
new
ResultMsg
(
true
,
"操作成功"
);
return
new
ResultMsg
(
true
,
"操作成功"
);
}
}
...
@@ -135,7 +144,7 @@ public class VankeGoodsServiceImpl implements IVankeGoodsService {
...
@@ -135,7 +144,7 @@ public class VankeGoodsServiceImpl implements IVankeGoodsService {
if
(
vankeGoods
.
getStockRoomId
()
==
null
){
if
(
vankeGoods
.
getStockRoomId
()
==
null
){
return
new
ResultMsg
(
false
,
"传入库房Id为空"
);
return
new
ResultMsg
(
false
,
"传入库房Id为空"
);
}
}
if
(
vankeGoods
.
getPric
t
()
==
null
){
if
(
vankeGoods
.
getPric
e
()
==
null
){
return
new
ResultMsg
(
false
,
"传入价格为空"
);
return
new
ResultMsg
(
false
,
"传入价格为空"
);
}
}
if
(
vankeGoods
.
getBarCode
()
==
null
){
if
(
vankeGoods
.
getBarCode
()
==
null
){
...
...
mall-service/src/main/java/com/macro/mall/service/vanke/impl/VankeInboundOrderServiceImpl.java
View file @
ee58df50
...
@@ -5,14 +5,21 @@ import com.github.pagehelper.PageInfo;
...
@@ -5,14 +5,21 @@ import com.github.pagehelper.PageInfo;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.dao.vanke.VankeInboundOrderDao
;
import
com.macro.mall.dao.vanke.VankeInboundOrderDao
;
import
com.macro.mall.dao.vanke.VankeInboundRecordDao
;
import
com.macro.mall.dao.vanke.VankeInboundRecordDao
;
import
com.macro.mall.model.UmsAdmin
;
import
com.macro.mall.mapper.VankeGoodsMapper
;
import
com.macro.mall.model.UmsMember
;
import
com.macro.mall.mapper.VankeInboundOrderMapper
;
import
com.macro.mall.mapper.VankeInboundRecordMapper
;
import
com.macro.mall.model.*
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeInboundOrderDto
;
import
com.macro.mall.model.dto.vanke.VankeInboundOrderDto
;
import
com.macro.mall.model.dto.vanke.VankeInboundRecordDto
;
import
com.macro.mall.model.dto.vanke.VankeOutboundOrderDto
;
import
com.macro.mall.model.dto.vanke.VankeOutboundOrderDto
;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.vanke.IVankeBackLogService
;
import
com.macro.mall.service.vanke.IVankeInboundOrderService
;
import
com.macro.mall.service.vanke.IVankeInboundOrderService
;
import
org.junit.Test
;
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
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
...
@@ -26,6 +33,15 @@ public class VankeInboundOrderServiceImpl implements IVankeInboundOrderService {
...
@@ -26,6 +33,15 @@ public class VankeInboundOrderServiceImpl implements IVankeInboundOrderService {
private
VankeInboundRecordDao
vankeInboundRecordDao
;
private
VankeInboundRecordDao
vankeInboundRecordDao
;
@Autowired
@Autowired
private
UmsAdminService
umsAdminService
;
private
UmsAdminService
umsAdminService
;
@Resource
private
VankeInboundOrderMapper
vankeInboundOrderMapper
;
@Resource
private
VankeGoodsMapper
vankeGoodsMapper
;
@Resource
private
VankeInboundRecordMapper
vankeInboundRecordMapper
;
@Autowired
private
IVankeBackLogService
vankeBackLogService
;
/**
/**
* 分页查询入记录
* 分页查询入记录
...
@@ -59,4 +75,98 @@ public class VankeInboundOrderServiceImpl implements IVankeInboundOrderService {
...
@@ -59,4 +75,98 @@ public class VankeInboundOrderServiceImpl implements IVankeInboundOrderService {
return
result
;
return
result
;
}
}
/**
* 根据id 修改一条数据
* @param vankeInboundOrder
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultMsg
updateById
(
VankeInboundOrder
vankeInboundOrder
){
if
(
vankeInboundOrder
.
getId
()
==
null
){
return
new
ResultMsg
(
false
,
"传入id为空"
);
}
if
(
vankeInboundOrder
.
getDeleteStatus
()
==
0
){
//如果是删除操作 同时也要将商品的对应数量扣除
VankeInboundOrder
vio
=
this
.
vankeInboundOrderMapper
.
selectByPrimaryKey
(
vankeInboundOrder
.
getId
());
//初始化 VankeInboundRecordExample对象
VankeInboundRecord
vir
=
new
VankeInboundRecord
();
VankeInboundRecordExample
example
=
new
VankeInboundRecordExample
();
VankeInboundRecordExample
.
Criteria
criteria
=
example
.
createCriteria
();
//通过入库单号 查询子订单
criteria
.
andInboundNoEqualTo
(
vio
.
getInboundNo
());
//设置入库单号
List
<
VankeInboundRecord
>
virList
=
this
.
vankeInboundRecordMapper
.
selectByExample
(
example
);
//如果得到集合不为空 继续下面业务
if
(
virList
!=
null
&&
virList
.
size
()
>
0
){
virList
.
forEach
(
item
->{
//根据物品id 查询物品 扣除物品的入库库存
VankeGoods
vg
=
this
.
vankeGoodsMapper
.
selectByPrimaryKey
(
item
.
getGoodsId
());
if
(
vg
!=
null
){
vg
.
setGoodsNum
(
vg
.
getGoodsNum
()
-
item
.
getInboundNum
());
//现有库存 扣除入库库存
this
.
vankeGoodsMapper
.
updateByPrimaryKeySelective
(
vg
);
//记录删除入库记录
this
.
vankeBackLogService
.
insertVankeBackLog
(
"删除入库记录单,单号为: "
+
item
.
getInboundNo
()
+
"--物品名为:"
+
vg
.
getName
()+
"--扣除库存:"
+
item
.
getInboundNum
());
}
});
//将入库详情对应的数据也改为删除
vir
.
setDeleteStatus
(
0
);
//将删除标记设为0
this
.
vankeInboundRecordMapper
.
updateByExampleSelective
(
vir
,
example
);
}
}
//根据传入的id修改一条数据
this
.
vankeInboundOrderMapper
.
updateByPrimaryKey
(
vankeInboundOrder
);
return
new
ResultMsg
(
true
,
"操作成功"
);
}
/**
* 修改入库单内的入库数量
* @param vankeInboundOrderDto
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultMsg
updateInboundNum
(
VankeInboundOrderDto
vankeInboundOrderDto
){
//判断是否有传入 入库单集合
if
(
vankeInboundOrderDto
.
getVorList
()
==
null
||
vankeInboundOrderDto
.
getVorList
().
size
()
<=
0
){
return
new
ResultMsg
(
false
,
"传入入库单详情集合为空"
);
}
//初始化入库单记录表
VankeInboundRecord
vankeInboundRecord
;
//初始化入库单记录表
VankeInboundRecord
vir
=
new
VankeInboundRecord
();
;
//初始化物品
VankeGoods
vankeGoods
;
//初始化差额
Integer
difference
=
0
;
//遍历传入的集合 判断修改后的值 是增加还是减少 并且记录下来
for
(
VankeInboundRecordDto
vor
:
vankeInboundOrderDto
.
getVorList
()){
//判断当前传入的值 和数据库里的值 比对
vankeInboundRecord
=
this
.
vankeInboundRecordMapper
.
selectByPrimaryKey
(
vor
.
getId
());
if
(
vankeInboundRecord
==
null
){
return
new
ResultMsg
(
false
,
"不存在此入库单物品,id为:"
+
vor
.
getId
());
}
if
(
vor
.
getInboundNum
()
==
null
){
//如果传入的修改入库数为空 则返回
return
new
ResultMsg
(
false
,
"传入入库数为空,id为:"
+
vor
.
getId
());
}
//计算修改后的差额 之前入库数 减去 修改入库数
difference
=
vankeInboundRecord
.
getInboundNum
()
-
vor
.
getInboundNum
();
//否则 通过物品id去 查询物品 修改库存
vankeGoods
=
this
.
vankeGoodsMapper
.
selectByPrimaryKey
(
vankeInboundRecord
.
getGoodsId
());
//修改物品库存
vankeGoods
.
setGoodsNum
(
vankeGoods
.
getGoodsNum
()
-
difference
);
this
.
vankeGoodsMapper
.
updateByPrimaryKeySelective
(
vankeGoods
);
//修改入库数量
vir
.
setId
(
vor
.
getId
());
vir
.
setInboundNum
(
vor
.
getInboundNum
());
this
.
vankeInboundRecordMapper
.
updateByPrimaryKeySelective
(
vir
);
//记录修改入库记录
this
.
vankeBackLogService
.
insertVankeBackLog
(
"入库单号:"
+
vankeInboundRecord
.
getInboundNo
()+
"物品名为:"
+
vankeGoods
.
getName
()
+
"--由之前入库数量:"
+
vankeInboundRecord
.
getInboundNum
()+
"改为:"
+
vor
.
getInboundNum
());
}
return
new
ResultMsg
(
true
,
"操作成功"
);
}
}
}
mall-service/src/main/java/com/macro/mall/service/vanke/impl/VankeOutboundRecordServiceImpl.java
View file @
ee58df50
...
@@ -2,12 +2,19 @@ package com.macro.mall.service.vanke.impl;
...
@@ -2,12 +2,19 @@ package com.macro.mall.service.vanke.impl;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.macro.mall.dao.VankeOutBoundRecordDao
;
import
com.macro.mall.dao.VankeOutBoundRecordDao
;
import
com.macro.mall.mapper.VankeGoodsMapper
;
import
com.macro.mall.mapper.VankeOutboundRecordMapper
;
import
com.macro.mall.model.UmsAdmin
;
import
com.macro.mall.model.UmsAdmin
;
import
com.macro.mall.model.VankeGoods
;
import
com.macro.mall.model.VankeOutboundRecord
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.vanke.VankeOutboundRecordDto
;
import
com.macro.mall.model.dto.vanke.VankeOutboundRecordDto
;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.vanke.IVankeBackLogService
;
import
com.macro.mall.service.vanke.IVankeOutboundRecordService
;
import
com.macro.mall.service.vanke.IVankeOutboundRecordService
;
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
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.util.List
;
import
java.util.List
;
...
@@ -19,6 +26,12 @@ public class VankeOutboundRecordServiceImpl implements IVankeOutboundRecordServi
...
@@ -19,6 +26,12 @@ public class VankeOutboundRecordServiceImpl implements IVankeOutboundRecordServi
private
VankeOutBoundRecordDao
vankeOutBoundRecordDao
;
private
VankeOutBoundRecordDao
vankeOutBoundRecordDao
;
@Autowired
@Autowired
private
UmsAdminService
umsAdminService
;
private
UmsAdminService
umsAdminService
;
@Resource
private
VankeOutboundRecordMapper
vankeOutboundRecordMapper
;
@Resource
private
VankeGoodsMapper
vankeGoodsMapper
;
@Autowired
private
IVankeBackLogService
vankeBackLogService
;
/**
/**
* 出库记录分页操作
* 出库记录分页操作
...
@@ -29,7 +42,8 @@ public class VankeOutboundRecordServiceImpl implements IVankeOutboundRecordServi
...
@@ -29,7 +42,8 @@ public class VankeOutboundRecordServiceImpl implements IVankeOutboundRecordServi
* @return
* @return
*/
*/
@Override
@Override
public
List
<
VankeOutboundRecordDto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
Long
goodsCategoryId
,
Long
departId
,
Long
stockRoomId
,
String
memberName
,
String
goodsMame
){
public
List
<
VankeOutboundRecordDto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
Long
goodsCategoryId
,
Long
departId
,
Long
stockRoomId
,
String
memberName
,
String
goodsMame
,
String
startTime
,
String
endTime
){
//获取管理员对象
//获取管理员对象
UmsAdmin
ua
=
umsAdminService
.
getCurrentUmsAdmin
();
UmsAdmin
ua
=
umsAdminService
.
getCurrentUmsAdmin
();
PageHelper
.
startPage
(
pageNum
,
pageSize
);
PageHelper
.
startPage
(
pageNum
,
pageSize
);
...
@@ -39,10 +53,53 @@ public class VankeOutboundRecordServiceImpl implements IVankeOutboundRecordServi
...
@@ -39,10 +53,53 @@ public class VankeOutboundRecordServiceImpl implements IVankeOutboundRecordServi
vord
.
setMemberName
(
memberName
);
vord
.
setMemberName
(
memberName
);
vord
.
setGoodsName
(
goodsMame
);
vord
.
setGoodsName
(
goodsMame
);
vord
.
setStockRoomId
(
stockRoomId
);
vord
.
setStockRoomId
(
stockRoomId
);
vord
.
setStartTime
(
startTime
);
vord
.
setEndTime
(
endTime
);
if
(
ua
.
getMemberId
()
!=
null
){
//如果管理的会员id不为空说明是普通会员 只能查看自己的入库
if
(
ua
.
getMemberId
()
!=
null
){
//如果管理的会员id不为空说明是普通会员 只能查看自己的入库
vord
.
setReceptOutboundMemberId
(
ua
.
getMemberId
());
vord
.
setReceptOutboundMemberId
(
ua
.
getMemberId
());
}
}
return
this
.
vankeOutBoundRecordDao
.
getPageList
(
vord
);
return
this
.
vankeOutBoundRecordDao
.
getPageList
(
vord
);
}
}
/**
* 根据id修改一条数据
* @param vankeOutboundRecord
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultMsg
updateById
(
VankeOutboundRecord
vankeOutboundRecord
){
//
if
(
vankeOutboundRecord
.
getId
()
==
null
){
return
new
ResultMsg
(
false
,
"传入id为空"
);
}
//查询之前的数据
VankeOutboundRecord
vor
=
this
.
vankeOutboundRecordMapper
.
selectByPrimaryKey
(
vankeOutboundRecord
.
getId
());
if
(
vankeOutboundRecord
.
getOutboundNum
()
!=
null
){
//如果是修改出库数量
Integer
updateNum
=
vor
.
getOutboundNum
()
-
vankeOutboundRecord
.
getOutboundNum
()
;
//之前出库记录 减去现在修改数量
//修改出库记录的数量后 需要更改对应的 库存数量
VankeGoods
vg
=
this
.
vankeGoodsMapper
.
selectByPrimaryKey
(
vor
.
getGoodsId
());
if
(
vg
!=
null
){
vg
.
setGoodsNum
(
vg
.
getGoodsNum
()
+
updateNum
);
//现有库存 + 回之前的出库数
this
.
vankeGoodsMapper
.
updateByPrimaryKeySelective
(
vg
);
//记录删除出库记录
this
.
vankeBackLogService
.
insertVankeBackLog
(
"出库单号:"
+
vor
.
getOutboundNo
()+
"物品名为:"
+
vg
.
getName
()
+
"--由之前出库数量:"
+
vor
.
getOutboundNum
()+
"改为:"
+
vankeOutboundRecord
.
getOutboundNum
());
}
}
if
(
vankeOutboundRecord
.
getDeleteStatus
()
!=
null
&&
vankeOutboundRecord
.
getDeleteStatus
()
==
0
){
//如果是删除状态
//根据物品id 查询物品 扣除物品的入库库存
VankeGoods
vg
=
this
.
vankeGoodsMapper
.
selectByPrimaryKey
(
vor
.
getGoodsId
());
if
(
vg
!=
null
){
vg
.
setGoodsNum
(
vg
.
getGoodsNum
()
+
vor
.
getOutboundNum
()
);
//现有库存 + 回之前的出库数
this
.
vankeGoodsMapper
.
updateByPrimaryKeySelective
(
vg
);
//记录删除出库记录
this
.
vankeBackLogService
.
insertVankeBackLog
(
"删除出库记录单,单号为: "
+
vor
.
getOutboundNum
()
+
"--物品名为:"
+
vg
.
getName
()+
"--增加库存:"
+
vor
.
getOutboundNum
());
}
}
this
.
vankeOutboundRecordMapper
.
updateByPrimaryKeySelective
(
vankeOutboundRecord
);
return
new
ResultMsg
(
true
,
"操作成功"
);
}
}
}
mall-service/src/main/resources/com/macro/mall/dao/UmsMemberDao.xml
View file @
ee58df50
...
@@ -46,6 +46,7 @@
...
@@ -46,6 +46,7 @@
<result
column=
"departName"
jdbcType=
"VARCHAR"
property=
"departName"
/>
<result
column=
"departName"
jdbcType=
"VARCHAR"
property=
"departName"
/>
<result
column=
"categoryName"
jdbcType=
"VARCHAR"
property=
"categoryName"
/>
<result
column=
"categoryName"
jdbcType=
"VARCHAR"
property=
"categoryName"
/>
<result
column=
"stockRoomName"
jdbcType=
"VARCHAR"
property=
"stockRoomName"
/>
<result
column=
"stockRoomName"
jdbcType=
"VARCHAR"
property=
"stockRoomName"
/>
<result
column=
"adminId"
jdbcType=
"BIGINT"
property=
"adminId"
/>
</resultMap>
</resultMap>
<sql
id=
"Example_Where_Clause"
>
<sql
id=
"Example_Where_Clause"
>
...
@@ -852,9 +853,10 @@
...
@@ -852,9 +853,10 @@
</select>
</select>
<select
id=
"selectUmsMember"
parameterType=
"com.macro.mall.model.dto.quanxing.UmsMemberDto"
resultMap=
"BaseResultMap2"
>
<select
id=
"selectUmsMember"
parameterType=
"com.macro.mall.model.dto.quanxing.UmsMemberDto"
resultMap=
"BaseResultMap2"
>
select a.* ,b.name departName,c.name stockRoomName from ums_member a
select a.* ,b.name departName,c.name stockRoomName
,d.id adminId
from ums_member a
left join vanke_department b ON a.depart_id = b.id
left join vanke_department b ON a.depart_id = b.id
left join vanke_stock_room c ON a.stock_room_id = c.id
left join vanke_stock_room c ON a.stock_room_id = c.id
left join ums_admin d ON a.id = d.member_id
where a.delete_status = 0
where a.delete_status = 0
<if
test=
"accouuntType != null"
>
<if
test=
"accouuntType != null"
>
and a.accouunt_type = #{accouuntType}
and a.accouunt_type = #{accouuntType}
...
...
mall-service/src/main/resources/com/macro/mall/dao/VankeOutboundRecordDao.xml
View file @
ee58df50
...
@@ -43,6 +43,12 @@
...
@@ -43,6 +43,12 @@
<if
test=
"receptOutboundMemberId != null"
>
<if
test=
"receptOutboundMemberId != null"
>
and a.recept_outbound_member_id = #{receptOutboundMemberId}
and a.recept_outbound_member_id = #{receptOutboundMemberId}
</if>
</if>
<if
test=
"startTime != null and startTime != ''"
>
and #{startTime}
<
= date_format( a.createtime, '%Y-%m-%d' )
</if>
<if
test=
"endTime != null and endTime != ''"
>
and date_format( a.createtime, '%Y-%m-%d' )
<
= #{endTime}
</if>
order by a.createtime desc
order by a.createtime desc
</select>
</select>
...
...
mall-service/src/main/resources/com/macro/mall/dao/vanke/VankeGoodsCategoryDao.xml
0 → 100644
View file @
ee58df50
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.macro.mall.dao.vanke.VankeGoodsCategoryDao"
>
<resultMap
id=
"BaseResultMap"
type=
"com.macro.mall.model.dto.vanke.VankeGoodsCategoryDto"
extends=
"com.macro.mall.mapper.VankeGoodsCategoryMapper.BaseResultMap"
>
<result
column=
"createName"
jdbcType=
"VARCHAR"
property=
"createName"
/>
</resultMap>
<select
id=
"selectList"
parameterType=
"com.macro.mall.model.dto.vanke.VankeGoodsCategoryDto"
resultMap=
"BaseResultMap"
>
select a.* ,b.nick_name createName from vanke_goods_category a
left join ums_admin b ON a.create_by = b.id
where a.delete_status = 1
</select>
</mapper>
\ No newline at end of file
mall-service/src/main/resources/com/macro/mall/dao/vanke/VankeGoodsDao.xml
View file @
ee58df50
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
<if
test=
"stockWarning != null"
>
<if
test=
"stockWarning != null"
>
and a.goods_num
<
= #{stockWarning}
and a.goods_num
<
= #{stockWarning}
</if>
</if>
order by a.createtime desc
</select>
</select>
<select
id=
"selectSupplierCategory"
parameterType=
"com.macro.mall.model.dto.vanke.VankeGoodsDto"
resultMap=
"BaseResultMap"
>
<select
id=
"selectSupplierCategory"
parameterType=
"com.macro.mall.model.dto.vanke.VankeGoodsDto"
resultMap=
"BaseResultMap"
>
...
...
mall-service/src/main/resources/com/macro/mall/dao/vanke/VankeInboundRecordDao.xml
View file @
ee58df50
...
@@ -8,6 +8,9 @@
...
@@ -8,6 +8,9 @@
<result
column=
"stockRoomName"
jdbcType=
"VARCHAR"
property=
"stockRoomName"
/>
<result
column=
"stockRoomName"
jdbcType=
"VARCHAR"
property=
"stockRoomName"
/>
<result
column=
"categoryName"
jdbcType=
"VARCHAR"
property=
"categoryName"
/>
<result
column=
"categoryName"
jdbcType=
"VARCHAR"
property=
"categoryName"
/>
<result
column=
"totalNum"
jdbcType=
"INTEGER"
property=
"totalNum"
/>
<result
column=
"totalNum"
jdbcType=
"INTEGER"
property=
"totalNum"
/>
<result
column=
"price"
jdbcType=
"DECIMAL"
property=
"price"
/>
<result
column=
"supplierName"
jdbcType=
"VARCHAR"
property=
"supplierName"
/>
<result
column=
"goodsNo"
jdbcType=
"VARCHAR"
property=
"goodsNo"
/>
</resultMap>
</resultMap>
<select
id=
"getPageList"
parameterType=
"com.macro.mall.model.dto.vanke.VankeInboundRecordDto"
resultMap=
"BaseResultMap"
>
<select
id=
"getPageList"
parameterType=
"com.macro.mall.model.dto.vanke.VankeInboundRecordDto"
resultMap=
"BaseResultMap"
>
...
@@ -55,8 +58,10 @@
...
@@ -55,8 +58,10 @@
</select>
</select>
<select
id=
"selectListByInboundNo"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
<select
id=
"selectListByInboundNo"
parameterType=
"java.lang.String"
resultMap=
"BaseResultMap"
>
select a.*,b.name goodsName,b.goods_no goodsNo
from vanke_inbound_record a
select a.*,b.name goodsName,b.goods_no goodsNo
,b.price,c.name categoryName ,d.name supplierName
from vanke_inbound_record a
left join vanke_goods b ON a.goods_id = b.id
left join vanke_goods b ON a.goods_id = b.id
left join vanke_goods_category c ON b.goods_category_id = c.id
left join vanke_supplier d ON d.id = b.supplier_id
where a.inbound_no =#{inboundNo}
where a.inbound_no =#{inboundNo}
</select>
</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