Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fileServe
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
fileServe
Commits
8b4bd64b
Commit
8b4bd64b
authored
Jun 11, 2020
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权星相关接口修复
parent
013ce465
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
113 additions
and
20 deletions
+113
-20
PmsProductController.java
.../java/com/macro/mall/controller/PmsProductController.java
+1
-1
PmsSupplierAuditController.java
.../mall/controller/quanxing/PmsSupplierAuditController.java
+3
-3
PmsSupplierAuditRequest.java
...acro/mall/model/dto/quanxing/PmsSupplierAuditRequest.java
+17
-0
PmsProductController.java
...mall/portal/controller/quanxing/PmsProductController.java
+38
-0
PmsSupplierAuditController.java
...ortal/controller/quanxing/PmsSupplierAuditController.java
+1
-1
PmsProductService.java
...ava/com/macro/mall/service/product/PmsProductService.java
+9
-0
PmsProductServiceImpl.java
...acro/mall/service/product/impl/PmsProductServiceImpl.java
+34
-4
IPmsSupplierAuditService.java
...macro/mall/service/quanxing/IPmsSupplierAuditService.java
+2
-1
PmsSupplierAuditServiceImpl.java
...ll/service/quanxing/impl/PmsSupplierAuditServiceImpl.java
+8
-10
No files found.
mall-admin/src/main/java/com/macro/mall/controller/PmsProductController.java
View file @
8b4bd64b
...
...
@@ -67,7 +67,7 @@ public class PmsProductController {
@RequestMapping
(
value
=
"/getPageList"
,
method
=
RequestMethod
.
POST
)
public
CommonResult
<
CommonPage
<
PmsProduct
>>
getPageList
(
@ApiParam
(
"页数"
)
@RequestParam
(
"page"
)
Integer
page
,
@ApiParam
(
"每页大小"
)
@RequestParam
(
"size"
)
Integer
size
,
@ApiParam
(
"模糊查询商品名称 "
)
@RequestParam
(
"name"
)
String
name
,
@ApiParam
(
"审核状态 0待审核 1审核通过 2审核未通过 "
)
@RequestParam
(
"
audit
Status"
)
Integer
verifyStatus
){
@ApiParam
(
"审核状态 0待审核 1审核通过 2审核未通过 "
)
@RequestParam
(
"
verify
Status"
)
Integer
verifyStatus
){
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
productService
.
getPageList
(
page
,
size
,
name
,
verifyStatus
)));
}
...
...
mall-admin/src/main/java/com/macro/mall/controller/quanxing/PmsSupplierAuditController.java
View file @
8b4bd64b
...
...
@@ -4,6 +4,7 @@ import com.macro.mall.common.api.CommonPage;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.PmsSupplierAuditDto
;
import
com.macro.mall.model.dto.quanxing.PmsSupplierAuditRequest
;
import
com.macro.mall.service.quanxing.IPmsSupplierAuditService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -23,9 +24,8 @@ public class PmsSupplierAuditController {
@ApiOperation
(
"权星后台_审核申请供应商"
)
@ResponseBody
@RequestMapping
(
value
=
"/auditSupplier"
,
method
=
RequestMethod
.
POST
)
public
CommonResult
auditSupplier
(
@ApiParam
(
"审核id"
)
@RequestParam
(
"id"
)
Long
id
,
@ApiParam
(
"审核状态 0待审核 1审核通过 2审核不通过"
)
@RequestParam
(
"stauts"
)
Integer
stauts
,
@ApiParam
(
"备注"
)
@RequestParam
(
"remarks"
)
String
remarks
){
ResultMsg
res
=
this
.
pmsSupplierAuditService
.
auditSupplier
(
id
,
stauts
,
remarks
);
public
CommonResult
auditSupplier
(
@RequestBody
PmsSupplierAuditRequest
pmsSupplierAuditRequest
){
ResultMsg
res
=
this
.
pmsSupplierAuditService
.
auditSupplier
(
pmsSupplierAuditRequest
);
if
(
res
.
isFlag
()){
return
CommonResult
.
success
(
null
,
res
.
getMsg
());
}
...
...
mall-mbg/src/main/java/com/macro/mall/model/dto/quanxing/PmsSupplierAuditRequest.java
0 → 100644
View file @
8b4bd64b
package
com
.
macro
.
mall
.
model
.
dto
.
quanxing
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
PmsSupplierAuditRequest
implements
Serializable
{
@ApiModelProperty
(
value
=
"审核id"
)
private
Long
id
;
@ApiModelProperty
(
value
=
"审核状态 0待审核 1审核通过 2审核不通过"
)
private
Integer
status
;
@ApiModelProperty
(
value
=
"备注"
)
private
String
remarks
;
}
mall-portal/src/main/java/com/macro/mall/portal/controller/quanxing/PmsProductController.java
0 → 100644
View file @
8b4bd64b
package
com
.
macro
.
mall
.
portal
.
controller
.
quanxing
;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.model.PmsProduct
;
import
com.macro.mall.service.product.PmsProductService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
@Controller
@RequestMapping
(
"/pmsSupplierAudit"
)
@Api
(
tags
=
"权星小程序_商品相关接口"
,
description
=
"商品控制器"
)
public
class
PmsProductController
{
@Autowired
private
PmsProductService
pmsProductService
;
@ApiOperation
(
"权星小程序_商品分页查询"
)
@ResponseBody
@RequestMapping
(
value
=
"/getPageList"
,
method
=
RequestMethod
.
POST
)
public
CommonResult
<
CommonPage
<
PmsProduct
>>
getPageList
(
@ApiParam
(
"页数"
)
@RequestParam
(
"page"
)
Integer
page
,
@ApiParam
(
"每页大小"
)
@RequestParam
(
"size"
)
Integer
size
,
@ApiParam
(
"模糊查询商品名称 "
)
@RequestParam
(
"name"
)
String
name
,
@ApiParam
(
"是否新品 新品状态:0->不是新品;1->新品 "
)
@RequestParam
(
"newStatus"
)
Integer
newStatus
,
@ApiParam
(
"供应商id"
)
@RequestParam
(
"mchtId"
)
Long
mchtId
,
@ApiParam
(
"排序:(例如根据价格降序 传入price DESC 根据价格升序传入price ASC) "
)
@RequestParam
(
"orderBy"
)
String
orderBy
){
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
pmsProductService
.
getAppPageList
(
page
,
size
,
newStatus
,
mchtId
,
orderBy
)));
}
}
mall-portal/src/main/java/com/macro/mall/portal/controller/quanxing/PmsSupplierAuditController.java
View file @
8b4bd64b
...
...
@@ -16,7 +16,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
@Controller
@RequestMapping
(
"/pmsSupplierAudit"
)
@Api
(
tags
=
"
申请供应商
"
,
description
=
"申请供应商控制器"
)
@Api
(
tags
=
"
权星小程序_供应商相关接口
"
,
description
=
"申请供应商控制器"
)
public
class
PmsSupplierAuditController
{
@Autowired
...
...
mall-service/src/main/java/com/macro/mall/service/product/PmsProductService.java
View file @
8b4bd64b
...
...
@@ -197,4 +197,13 @@ public interface PmsProductService {
* @return
*/
ResultMsg
batchOperationByPublishStatus
(
BatchOperationDto
batchOperationDto
);
/**
* 小程序获取分页数据
* @param pageNum
* @param pageSize
* @param newStatus
* @return
*/
List
<
PmsProduct
>
getAppPageList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
newStatus
,
Long
mchtId
,
String
orderBy
);
}
mall-service/src/main/java/com/macro/mall/service/product/impl/PmsProductServiceImpl.java
View file @
8b4bd64b
...
...
@@ -787,6 +787,7 @@ public class PmsProductServiceImpl implements PmsProductService {
if
(
verifyStatus
!=
null
){
criteria
.
andVerifyStatusEqualTo
(
verifyStatus
);
}
criteria
.
andDeleteStatusEqualTo
(
0
);
//删除标识0 未删除 1已删除(彻底删除)
return
this
.
pmsProductMapper
.
selectByExample
(
example
);
}
...
...
@@ -825,13 +826,13 @@ public class PmsProductServiceImpl implements PmsProductService {
List
idList
=
Arrays
.
asList
(
batchOperationDto
.
getIds
().
split
(
","
));
//根据逗号分隔转化为list
if
(
batchOperationDto
.
getIsDelete
()
==
1
){
//如果为真删除
idList
.
forEach
(
id
->{
this
.
pmsProductMapper
.
deleteByPrimaryKey
(
(
Long
)
id
);
this
.
pmsProductMapper
.
deleteByPrimaryKey
(
Long
.
valueOf
((
String
)
id
)
);
});
}
else
{
//假删除 操作
PmsProduct
pmsProduct
=
new
PmsProduct
();
pmsProduct
.
setDeleteStatus
(
batchOperationDto
.
getStatus
());
idList
.
forEach
(
id
->{
pmsProduct
.
setId
(
(
Long
)
id
);
pmsProduct
.
setId
(
Long
.
valueOf
((
String
)
id
)
);
this
.
pmsProductMapper
.
updateByPrimaryKeySelective
(
pmsProduct
);
});
}
...
...
@@ -858,16 +859,45 @@ public class PmsProductServiceImpl implements PmsProductService {
List
idList
=
Arrays
.
asList
(
batchOperationDto
.
getIds
().
split
(
","
));
//根据逗号分隔转化为list
if
(
batchOperationDto
.
getIsDelete
()
==
1
){
//如果为真删除
idList
.
forEach
(
id
->{
this
.
pmsProductMapper
.
deleteByPrimaryKey
(
(
Long
)
id
);
this
.
pmsProductMapper
.
deleteByPrimaryKey
(
Long
.
valueOf
((
String
)
id
)
);
});
}
else
{
//假删除 操作
PmsProduct
pmsProduct
=
new
PmsProduct
();
pmsProduct
.
setPublishStatus
(
batchOperationDto
.
getStatus
());
idList
.
forEach
(
id
->{
pmsProduct
.
setId
(
(
Long
)
id
);
pmsProduct
.
setId
(
Long
.
valueOf
((
String
)
id
)
);
this
.
pmsProductMapper
.
updateByPrimaryKeySelective
(
pmsProduct
);
});
}
return
new
ResultMsg
(
true
,
"操作成功"
);
}
/**
* 小程序商品分页查询
* @param pageNum
* @param pageSize
* @param newStatus
* @return
*/
@Override
public
List
<
PmsProduct
>
getAppPageList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
newStatus
,
Long
mchtId
,
String
orderBy
){
PageHelper
.
startPage
(
pageNum
,
pageSize
);
PmsProductExample
example
=
new
PmsProductExample
();
PmsProductExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
newStatus
!=
null
){
criteria
.
andNewStatusEqualTo
(
newStatus
);
}
if
(
mchtId
!=
null
){
criteria
.
andCreateByEqualTo
(
mchtId
);
}
criteria
.
andVerifyStatusEqualTo
(
1
);
//审核状态:0->未审核;1->审核通过 2->驳回 3->审核失败
criteria
.
andDeleteStatusEqualTo
(
0
);
//删除标识0 未删除 1已删除(彻底删除)
criteria
.
andPublishStatusEqualTo
(
1
);
//上架状态:0->下架;1->上架
//注意:排序使用的是列名
example
.
setOrderByClause
(
orderBy
);
return
this
.
pmsProductMapper
.
selectByExample
(
example
);
}
}
mall-service/src/main/java/com/macro/mall/service/quanxing/IPmsSupplierAuditService.java
View file @
8b4bd64b
...
...
@@ -3,6 +3,7 @@ package com.macro.mall.service.quanxing;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.PmsSupplierAuditDto
;
import
com.macro.mall.model.dto.quanxing.PmsSupplierAuditRequest
;
import
java.util.List
;
...
...
@@ -19,7 +20,7 @@ public interface IPmsSupplierAuditService {
* 审核供应商
* @return
*/
ResultMsg
auditSupplier
(
Long
id
,
Integer
status
,
String
remarks
);
ResultMsg
auditSupplier
(
PmsSupplierAuditRequest
pmsSupplierAuditRequest
);
/**
* 得到UUID 随机八位数
...
...
mall-service/src/main/java/com/macro/mall/service/quanxing/impl/PmsSupplierAuditServiceImpl.java
View file @
8b4bd64b
...
...
@@ -12,6 +12,7 @@ import com.macro.mall.model.PmsSupplierAuditExample;
import
com.macro.mall.model.UmsMember
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.PmsSupplierAuditDto
;
import
com.macro.mall.model.dto.quanxing.PmsSupplierAuditRequest
;
import
com.macro.mall.service.member.UmsMemberService
;
import
com.macro.mall.service.quanxing.IPmsSupplierAuditService
;
import
org.springframework.beans.BeanUtils
;
...
...
@@ -43,27 +44,24 @@ public class PmsSupplierAuditServiceImpl implements IPmsSupplierAuditService {
/**
* 审核供应商
* @param id
* @param status
* @param remarks
* @return
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
ResultMsg
auditSupplier
(
Long
id
,
Integer
status
,
String
remarks
){
PmsSupplierAudit
psa
=
this
.
pmsSupplierAuditMapper
.
selectByPrimaryKey
(
id
);
public
ResultMsg
auditSupplier
(
PmsSupplierAuditRequest
pmsSupplierAuditRequest
){
PmsSupplierAudit
psa
=
this
.
pmsSupplierAuditMapper
.
selectByPrimaryKey
(
pmsSupplierAuditRequest
.
getId
()
);
if
(
psa
==
null
){
return
new
ResultMsg
(
false
,
"传入id 不存在对应的审核记录"
);
}
if
(
status
==
null
){
if
(
pmsSupplierAuditRequest
.
getStatus
()
==
null
){
return
new
ResultMsg
(
false
,
"请传入对应的审核状态"
);
}
PmsSupplierAudit
pmsSupplierAudit
=
new
PmsSupplierAuditDto
();
pmsSupplierAudit
.
setId
(
id
);
pmsSupplierAudit
.
setStatus
(
status
);
pmsSupplierAudit
.
setRemarks
(
remarks
);
pmsSupplierAudit
.
setId
(
pmsSupplierAuditRequest
.
getId
()
);
pmsSupplierAudit
.
setStatus
(
pmsSupplierAuditRequest
.
getStatus
()
);
pmsSupplierAudit
.
setRemarks
(
pmsSupplierAuditRequest
.
getRemarks
()
);
if
(
status
==
1
){
//审核通过还需将信息写入会员表
if
(
pmsSupplierAuditRequest
.
getStatus
()
==
1
){
//审核通过还需将信息写入会员表
//补充会员信息
UmsMember
umsMember
=
new
UmsMember
();
umsMember
.
setUsername
(
this
.
getUsername
());
//系统根据时间生成账号
...
...
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