Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
P
pms
概览
概览
详情
活动
周期分析
版本库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程表
图表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
作业
提交
问题看板
Open sidebar
iuav
pms
Commits
262bfee5
提交
262bfee5
authored
6月 09, 2023
作者:
xiaowang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
新增:租赁设备列表条件查询
上级
e15f88ea
隐藏空白字符变更
内嵌
并排
正在显示
11 个修改的文件
包含
795 行增加
和
624 行删除
+795
-624
BackstageProductSpecController.java
...om/mmc/pms/controller/BackstageProductSpecController.java
+124
-115
LeaseGoodsController.java
...a/com/mmc/pms/controller/common/LeaseGoodsController.java
+16
-11
ProductDao.java
src/main/java/com/mmc/pms/dao/ProductDao.java
+53
-54
LeaseGoodsDetailDTO.java
...java/com/mmc/pms/model/lease/dto/LeaseGoodsDetailDTO.java
+70
-0
ProductSpecDTO.java
src/main/java/com/mmc/pms/model/sale/dto/ProductSpecDTO.java
+19
-15
ProductServiceImpl.java
...ain/java/com/mmc/pms/service/Impl/ProductServiceImpl.java
+248
-224
WebDeviceServiceImpl.java
...n/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
+210
-173
ProductSkuService.java
src/main/java/com/mmc/pms/service/ProductSkuService.java
+15
-15
ProductDao.xml
src/main/resources/mapper/ProductDao.xml
+35
-12
WebDeviceDao.xml
src/main/resources/mapper/WebDeviceDao.xml
+3
-5
not-check.yml
src/main/resources/not-check.yml
+2
-0
没有找到文件。
src/main/java/com/mmc/pms/controller/BackstageProductSpecController.java
浏览文件 @
262bfee5
...
@@ -17,124 +17,133 @@ import java.math.BigDecimal;
...
@@ -17,124 +17,133 @@ import java.math.BigDecimal;
/**
/**
* @Author LW
* @Author LW
*
@date 2022/9/22 10:28
*
* 概要:
*
@date 2022/9/22 10:28
概要:
*/
*/
@RestController
@RestController
@RequestMapping
(
"/product/spec/"
)
@RequestMapping
(
"/product/spec/"
)
@Api
(
tags
=
{
"产品管理模块-相关接口"
})
@Api
(
tags
=
{
"产品管理模块-相关接口"
})
public
class
BackstageProductSpecController
{
public
class
BackstageProductSpecController
{
@Autowired
@Autowired
private
ProductSkuService
productSkuService
;
private
ProductSkuService
productSkuService
;
@ApiOperation
(
value
=
"新增产品sku"
)
@ApiOperation
(
value
=
"新增产品sku"
)
@PostMapping
(
"addProductSku"
)
@PostMapping
(
"addProductSku"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
addProductSku
(
public
ResultBody
addProductSku
(
@Validated
(
Create
.
class
)
@ApiParam
(
"产品skuVO"
)
@RequestBody
ProductSkuVO
param
)
{
@Validated
(
Create
.
class
)
@ApiParam
(
"产品skuVO"
)
@RequestBody
ProductSkuVO
param
)
{
return
productSkuService
.
addProductSku
(
param
);
return
productSkuService
.
addProductSku
(
param
);
}
}
@ApiOperation
(
value
=
"产品sku详情"
)
@ApiOperation
(
value
=
"产品sku详情"
)
@GetMapping
(
"getProductSkuDetail"
)
@GetMapping
(
"getProductSkuDetail"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSkuDTO
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSkuDTO
.
class
)})
public
ResultBody
getProductSkuDetail
(
@ApiParam
(
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
public
ResultBody
getProductSkuDetail
(
@ApiParam
(
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
return
productSkuService
.
getProductSkuDetail
(
id
);
return
productSkuService
.
getProductSkuDetail
(
id
);
}
}
@ApiOperation
(
value
=
"编辑产品sku"
)
@ApiOperation
(
value
=
"编辑产品sku"
)
@PostMapping
(
"editProductSku"
)
@PostMapping
(
"editProductSku"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
ResultBody
editProductSku
(
@Validated
(
Update
.
class
)
@ApiParam
(
"产品skuVO"
)
@RequestBody
ProductSkuVO
param
)
{
public
ResultBody
editProductSku
(
return
productSkuService
.
editProductSku
(
param
);
@Validated
(
Update
.
class
)
@ApiParam
(
"产品skuVO"
)
@RequestBody
ProductSkuVO
param
)
{
}
return
productSkuService
.
editProductSku
(
param
);
}
@ApiOperation
(
value
=
"产品sku分页列表"
)
@PostMapping
(
"listPageProductSku"
)
@ApiOperation
(
value
=
"产品sku分页列表"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSkuDTO
.
class
)})
@PostMapping
(
"listPageProductSku"
)
public
ResultBody
listPageProductSku
(
@ApiParam
(
"条件参数"
)
@RequestBody
ProductSkuQO
productSkuQO
)
{
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSkuDTO
.
class
)})
return
productSkuService
.
listPageProductSku
(
productSkuQO
);
public
ResultBody
listPageProductSku
(
@ApiParam
(
"条件参数"
)
@RequestBody
ProductSkuQO
productSkuQO
)
{
}
return
productSkuService
.
listPageProductSku
(
productSkuQO
);
}
@ApiOperation
(
value
=
"删除产品sku"
)
@GetMapping
(
"removeProductSku"
)
@ApiOperation
(
value
=
"删除产品sku"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@GetMapping
(
"removeProductSku"
)
public
ResultBody
removeProductSku
(
@ApiParam
(
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
return
productSkuService
.
removeProductSku
(
id
);
public
ResultBody
removeProductSku
(
@ApiParam
(
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
}
return
productSkuService
.
removeProductSku
(
id
);
}
@ApiOperation
(
value
=
"新增or修改产品规格"
)
@PostMapping
(
"addOrEditProductSpec"
)
@ApiOperation
(
value
=
"新增or修改产品规格"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@PostMapping
(
"addOrEditProductSpec"
)
public
ResultBody
addOrEditProductSpec
(
@Validated
({
Create
.
class
,
Update
.
class
})
@ApiParam
(
"产品规格VO"
)
@RequestBody
ProductSpecVO
param
)
{
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
return
productSkuService
.
addOrEditProductSpec
(
param
);
public
ResultBody
addOrEditProductSpec
(
}
@Validated
({
Create
.
class
,
Update
.
class
})
@ApiParam
(
"产品规格VO"
)
@RequestBody
ProductSpecVO
param
)
{
@ApiOperation
(
value
=
"产品规格编辑回显"
)
return
productSkuService
.
addOrEditProductSpec
(
param
);
@GetMapping
(
"getProductSpecDetail"
)
}
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSpecDTO
.
class
)})
public
ResultBody
getProductSpecDetail
(
@ApiParam
(
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
@ApiOperation
(
value
=
"产品规格编辑回显"
)
return
productSkuService
.
getProductSpecDetail
(
id
);
@GetMapping
(
"getProductSpecDetail"
)
}
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSpecDTO
.
class
)})
public
ResultBody
getProductSpecDetail
(
@ApiParam
(
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
@ApiOperation
(
value
=
"产品规格分页列表"
)
return
productSkuService
.
getProductSpecDetail
(
id
);
@GetMapping
(
"listPageProductSpec"
)
}
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSpecDTO
.
class
)})
public
ResultBody
listPageProductSpec
(
@ApiParam
(
value
=
"页码"
)
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@ApiOperation
(
value
=
"产品规格分页列表"
)
@ApiParam
(
value
=
"每页显示数"
)
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
,
@GetMapping
(
"listPageProductSpec"
)
@ApiParam
(
value
=
"产品skuId"
)
@RequestParam
(
value
=
"productSkuId"
)
Integer
productSkuId
)
{
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSpecDTO
.
class
)})
return
productSkuService
.
listPageProductSpec
(
pageNo
,
pageSize
,
productSkuId
);
public
ResultBody
listPageProductSpec
(
}
@ApiParam
(
value
=
"页码"
)
@RequestParam
(
value
=
"pageNo"
)
Integer
pageNo
,
@ApiParam
(
value
=
"每页显示数"
)
@RequestParam
(
value
=
"pageSize"
)
Integer
pageSize
,
@ApiOperation
(
value
=
"产品规格管理-价格配置"
)
@ApiParam
(
value
=
"产品skuId"
)
@RequestParam
(
value
=
"productSkuId"
)
Integer
productSkuId
,
@PostMapping
(
"productSpecCPQ"
)
@ApiParam
(
value
=
"关键字"
)
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
)
{
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
return
productSkuService
.
listPageProductSpec
(
pageNo
,
pageSize
,
productSkuId
,
keyword
);
public
ResultBody
productSpecCPQ
(
@RequestBody
ProductSpecCPQVO
productSpecCPQVO
)
{
}
return
productSkuService
.
productSpecCPQ
(
productSpecCPQVO
);
}
@ApiOperation
(
value
=
"产品规格管理-价格配置"
)
@PostMapping
(
"productSpecCPQ"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiOperation
(
value
=
"价格配置信息的修改"
)
public
ResultBody
productSpecCPQ
(
@RequestBody
ProductSpecCPQVO
productSpecCPQVO
)
{
@PostMapping
(
"updateProductSpecCPQ"
)
return
productSkuService
.
productSpecCPQ
(
productSpecCPQVO
);
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
}
public
ResultBody
updateProductSpecCPQ
(
@RequestBody
ProductSpecCPQVO
productSpecCPQVO
)
{
return
productSkuService
.
updateProductSpecCPQ
(
productSpecCPQVO
);
@ApiOperation
(
value
=
"价格配置信息的修改"
)
}
@PostMapping
(
"updateProductSpecCPQ"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
@ApiOperation
(
value
=
"产品规格管理---获取价格配置信息"
)
public
ResultBody
updateProductSpecCPQ
(
@RequestBody
ProductSpecCPQVO
productSpecCPQVO
)
{
@PostMapping
(
"getProductSpecCPQ"
)
return
productSkuService
.
updateProductSpecCPQ
(
productSpecCPQVO
);
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSpecPriceDTO
.
class
)})
}
public
ResultBody
getProductSpecCPQ
(
@RequestBody
ProductSpecCPQVO
productSpecCPQVO
)
{
return
productSkuService
.
getProductSpecCPQ
(
productSpecCPQVO
);
@ApiOperation
(
value
=
"产品规格管理---获取价格配置信息"
)
}
@PostMapping
(
"getProductSpecCPQ"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ProductSpecPriceDTO
.
class
)})
//
public
ResultBody
getProductSpecCPQ
(
@RequestBody
ProductSpecCPQVO
productSpecCPQVO
)
{
// @ApiOperation(value = "价格配置信息--恢复全局默认设置")
return
productSkuService
.
getProductSpecCPQ
(
productSpecCPQVO
);
// @GetMapping("getDefaultSettings")
}
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response = ProductSpecPriceDTO.class)})
// public ResultBody getDefaultSettings(@ApiParam(value = "规格id") @RequestParam(value = "productSpecId") Integer productSpecId) {
//
// return productSpecService.getDefaultSettings(productSpecId);
// @ApiOperation(value = "价格配置信息--恢复全局默认设置")
// }
// @GetMapping("getDefaultSettings")
//
// @ApiResponses({@ApiResponse(code = 200, message = "OK", response =
@ApiOperation
(
value
=
"产品规格管理---删除规格"
)
// ProductSpecPriceDTO.class)})
@GetMapping
(
"removeProductSpec"
)
// public ResultBody getDefaultSettings(@ApiParam(value = "规格id") @RequestParam(value =
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RemoveSkuDTO
.
class
)})
// "productSpecId") Integer productSpecId) {
public
ResultBody
removeProductSpec
(
@ApiParam
(
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
// return productSpecService.getDefaultSettings(productSpecId);
return
productSkuService
.
removeProductSpec
(
id
);
// }
}
//
//
@ApiOperation
(
value
=
"产品规格管理---删除规格"
)
// @ApiOperation(value = "feign根据渠道等级获取单价信息")
@GetMapping
(
"removeProductSpec"
)
// @GetMapping("feignGetUnitPriceByTag")
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
RemoveSkuDTO
.
class
)})
// @ApiIgnore
public
ResultBody
removeProductSpec
(
@ApiParam
(
"id"
)
@RequestParam
(
value
=
"id"
)
Integer
id
)
{
// @ApiResponses({@ApiResponse(code = 200, message = "OK",response = ProductSpecPriceDTO.class)})
return
productSkuService
.
removeProductSpec
(
id
);
// public ProductSpecPriceDTO feignGetUnitPriceByTag(@RequestParam(value = "specId")Integer specId,
}
// @RequestParam(value = "tagId")Integer tagId) {
//
// return productSpecService.feignGetUnitPriceByTag(specId,tagId);
// @ApiOperation(value = "feign根据渠道等级获取单价信息")
// }
// @GetMapping("feignGetUnitPriceByTag")
// @ApiIgnore
@ApiOperation
(
value
=
"feign根据渠道等级获取单价信息"
)
// @ApiResponses({@ApiResponse(code = 200, message = "OK",response =
@PostMapping
(
"feignGetSpecLeaseUnitPrice"
)
// ProductSpecPriceDTO.class)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
// public ProductSpecPriceDTO feignGetUnitPriceByTag(@RequestParam(value = "specId")Integer
public
BigDecimal
feignGetUnitPriceByTag
(
@RequestBody
PriceAcquisition
priceAcquisition
)
{
// specId,
return
productSkuService
.
feignGetUnitPriceByTag
(
priceAcquisition
);
// @RequestParam(value = "tagId")Integer
}
// tagId) {
// return productSpecService.feignGetUnitPriceByTag(specId,tagId);
// }
@ApiOperation
(
value
=
"feign根据渠道等级获取单价信息"
)
@PostMapping
(
"feignGetSpecLeaseUnitPrice"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
ResultBody
.
class
)})
public
BigDecimal
feignGetUnitPriceByTag
(
@RequestBody
PriceAcquisition
priceAcquisition
)
{
return
productSkuService
.
feignGetUnitPriceByTag
(
priceAcquisition
);
}
}
}
src/main/java/com/mmc/pms/controller/
mini/Mini
LeaseGoodsController.java
→
src/main/java/com/mmc/pms/controller/
common/
LeaseGoodsController.java
浏览文件 @
262bfee5
package
com
.
mmc
.
pms
.
controller
.
mini
;
package
com
.
mmc
.
pms
.
controller
.
common
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.common.Page
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.controller.BaseController
;
import
com.mmc.pms.controller.BaseController
;
import
com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO
;
import
com.mmc.pms.model.lease.dto.LeaseGoodsInfoDTO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
import
com.mmc.pms.model.qo.WareInfoQO
;
...
@@ -21,20 +22,24 @@ import javax.servlet.http.HttpServletRequest;
...
@@ -21,20 +22,24 @@ import javax.servlet.http.HttpServletRequest;
/**
/**
* @Author LW
* @Author LW
*
@date 2023/6/8 17:16
*
* 概要:
*
@date 2023/6/8 17:16
概要:
*/
*/
@Api
(
tags
=
{
"v1.0.1-设备租赁-相关接口"
})
@Api
(
tags
=
{
"v1.0.1-设备租赁-相关接口"
})
@RestController
@RestController
@RequestMapping
(
"/lease/goods"
)
@RequestMapping
(
"/lease/goods"
)
public
class
MiniLeaseGoodsController
extends
BaseController
{
public
class
LeaseGoodsController
extends
BaseController
{
@Autowired
@Autowired
private
WebDeviceService
webDeviceService
;
private
WebDeviceService
webDeviceService
;
@ApiOperation
(
value
=
"设备列表筛选"
)
@ApiOperation
(
value
=
"设备列表筛选"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LeaseGoodsInfoDTO
.
class
)})
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"OK"
,
response
=
LeaseGoodsInfoDTO
.
class
)})
@PostMapping
(
"/deviceList"
)
@PostMapping
(
"/deviceList"
)
public
ResultBody
listWareInfoPage
(
@RequestBody
@Validated
(
Page
.
class
)
WareInfoQO
param
,
HttpServletRequest
request
)
{
public
ResultBody
listWareInfoPage
(
return
webDeviceService
.
listWareInfoPage
(
param
,
request
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
@RequestBody
@Validated
(
Page
.
class
)
WareInfoQO
param
,
HttpServletRequest
request
)
{
if
(
request
.
getHeader
(
TokenConstant
.
TOKEN
)
==
null
)
{
return
webDeviceService
.
listWareInfoPage
(
param
,
null
,
null
);
}
}
return
webDeviceService
.
listWareInfoPage
(
param
,
request
,
this
.
getUserLoginInfoFromRedis
(
request
).
getUserAccountId
());
}
}
}
src/main/java/com/mmc/pms/dao/ProductDao.java
浏览文件 @
262bfee5
...
@@ -19,102 +19,101 @@ import java.util.Set;
...
@@ -19,102 +19,101 @@ import java.util.Set;
/**
/**
* @author 23214
* @author 23214
* @description 针对表【product_sku(产品sku表)】的数据库操作Mapper
* @description 针对表【product_sku(产品sku表)】的数据库操作Mapper
* @createDate 2023-05-25 14:55:56
* @createDate 2023-05-25 14:55:56 @Entity com.mmc.pms.entity.ProductSku
* @Entity com.mmc.pms.entity.ProductSku
*/
*/
@Mapper
@Mapper
public
interface
ProductDao
{
public
interface
ProductDao
{
int
countSkuName
(
ProductSkuVO
param
);
int
countSkuName
(
ProductSkuVO
param
);
int
insertProductSku
(
ProductSkuDO
productSkuDO
);
int
insertProductSku
(
ProductSkuDO
productSkuDO
);
int
countSkuIsExist
(
Integer
id
);
int
countSkuIsExist
(
Integer
id
);
ProductSkuDO
getProductSkuDetail
(
Integer
id
);
ProductSkuDO
getProductSkuDetail
(
Integer
id
);
int
updateProductSku
(
ProductSkuDO
productSkuDO
);
int
updateProductSku
(
ProductSkuDO
productSkuDO
);
int
countListPageProductSku
(
ProductSkuQO
productSkuQO
);
int
countListPageProductSku
(
ProductSkuQO
productSkuQO
);
List
<
ProductSkuDO
>
listPageProductSku
(
ProductSkuQO
productSkuQO
);
List
<
ProductSkuDO
>
listPageProductSku
(
ProductSkuQO
productSkuQO
);
int
countSpecName
(
ProductSpecVO
param
);
int
countSpecName
(
ProductSpecVO
param
);
int
insertProductSpec
(
ProductSpecDO
productSpecDO
);
int
insertProductSpec
(
ProductSpecDO
productSpecDO
);
int
updateProductSpec
(
ProductSpecDO
productSpecDO
);
int
updateProductSpec
(
ProductSpecDO
productSpecDO
);
int
countSpecIsExist
(
Integer
id
);
int
countSpecIsExist
(
Integer
id
);
ProductSpecDO
getProductSpecDetail
(
Integer
id
);
ProductSpecDO
getProductSpecDetail
(
Integer
id
);
int
countListPageProductSpec
(
Integer
productSkuI
d
);
int
countListPageProductSpec
(
@Param
(
"id"
)
Integer
id
,
@Param
(
"keyword"
)
String
keywor
d
);
List
<
ProductSpecDO
>
listPageProductSpec
(
int
pageNo
,
Integer
pageSize
,
Integer
productSkuId
);
List
<
ProductSpecDO
>
listPageProductSpec
(
@Param
(
value
=
"pageNo"
)
Integer
pageNo
,
@Param
(
value
=
"pageSize"
)
Integer
pageSize
,
@Param
(
value
=
"productSkuId"
)
Integer
productSkuId
,
@Param
(
value
=
"keyword"
)
String
keyword
);
int
batchInsertSpecPrice
(
List
<
ProductSpecPriceDO
>
list
);
int
batchInsertSpecPrice
(
List
<
ProductSpecPriceDO
>
list
);
void
batchInsertLeaseSpecPrice
(
List
<
ProductSpecPriceDO
>
list
);
void
batchInsertLeaseSpecPrice
(
List
<
ProductSpecPriceDO
>
list
);
void
removeProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
);
void
removeProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
);
List
<
ProductSpecPriceDO
>
getProductSpecPrice
(
ProductSpecCPQVO
productSpecCPQVO
);
List
<
ProductSpecPriceDO
>
getProductSpecPrice
(
ProductSpecCPQVO
productSpecCPQV
O
);
void
insertMallProdSkuInfo
(
MallProdInfoDO
mallProdInfoD
O
);
void
insertMallProdSkuInfo
(
MallProdInfoDO
mallProdInfoDO
);
List
<
ProductSpecDO
>
listProductSpec
(
Integer
id
);
List
<
ProductSpecDO
>
listProductSpec
(
Integer
i
d
);
List
<
ProductSkuDO
>
listProductSkuDO
(
List
<
Integer
>
productSkuI
d
);
List
<
ProductSkuDO
>
listProductSkuDO
(
List
<
Integer
>
productSkuId
);
List
<
InventorySpecDO
>
listInventorySpecInfo
(
List
<
Integer
>
industryProductInventoryIds
);
List
<
InventorySpecDO
>
listInventorySpecInfo
(
List
<
Integer
>
industryProductInventory
Ids
);
List
<
ProductSpecDO
>
listProductSpecInfo
(
List
<
Integer
>
productSpec
Ids
);
List
<
ProductSpecDO
>
listProductSpecInfo
(
List
<
Integer
>
productSpecIds
);
void
batchUpdateMallProdSpec
(
List
<
Integer
>
delProductSpecId
);
void
batchUpdateMallProdSpec
(
List
<
Integer
>
delProductSpecI
d
);
int
countProductSpecByBrandId
(
Integer
i
d
);
int
countProductSpecByBrand
Id
(
Integer
id
);
int
countSpecByProdSku
Id
(
Integer
id
);
int
countSpecByProdSkuId
(
Integer
id
);
void
removeProductSku
(
Integer
id
);
void
removeProductSku
(
Integer
id
);
List
<
MallProdInfoDO
>
listMallProdInfo
(
String
id
);
List
<
MallProdInfoDO
>
listMallProdInfo
(
String
id
);
void
removeProductSpec
(
Integer
id
);
void
removeProductSpec
(
Integer
id
);
List
<
IndustrySpecDO
>
listIndustrySpec
(
@Param
(
"industrySpecIds"
)
Set
<
Integer
>
industrySpecIds
);
List
<
IndustrySpecDO
>
listIndustrySpec
(
@Param
(
"industrySpecIds"
)
Set
<
Integer
>
industrySpecIds
);
List
<
InventorySpecDO
>
listInventorySpec
(
Integer
id
);
List
<
InventorySpecDO
>
listInventorySpec
(
Integer
id
);
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
);
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
);
List
<
MallGoodsSpecInfoDO
>
listProdSpecInfo
(
@Param
(
"prodIds"
)
Set
<
Integer
>
prodIds
);
List
<
MallGoodsSpecInfoDO
>
listProdSpecInfo
(
@Param
(
"prodIds"
)
Set
<
Integer
>
prodIds
);
/**
* 根据渠道等级、商品specId获取price信息
*
* @param tagInfoId
* @param prodSkuSpecIds
* @return
*/
List
<
ProductSpecPriceDO
>
listProductSpecPrice
(
Integer
tagInfoId
,
Set
<
Integer
>
prodSkuSpecIds
);
/**
ProductSpecPriceDTO
feignGetUnitPrice
(
Integer
id
,
Integer
tagId
);
* 根据渠道等级、商品specId获取price信息
*
* @param tagInfoId
* @param prodSkuSpecIds
* @return
*/
List
<
ProductSpecPriceDO
>
listProductSpecPrice
(
Integer
tagInfoId
,
Set
<
Integer
>
prodSkuSpecIds
);
ProductSpecPriceDTO
feignGetUnitPrice
(
Integer
id
,
Integer
tagId
);
List
<
ProductSpecDO
>
getProductSpecList
(
List
<
Integer
>
productSkuIds
);
List
<
ProductSpecDO
>
getProductSpecList
(
List
<
Integer
>
productSkuIds
);
List
<
MallProdSkuInfoSpecDO
>
getProductSpecByIds
(
List
<
Integer
>
delProductSpecId
);
List
<
MallProdSkuInfoSpecDO
>
getProductSpecByIds
(
List
<
Integer
>
delProductSpecId
);
Set
<
Integer
>
listProductSpecIds
(
@Param
(
"mallProdSkuSpecIds"
)
Set
<
Integer
>
mallProdSkuSpecIds
);
Set
<
Integer
>
listProductSpecIds
(
@Param
(
"mallProdSkuSpecIds"
)
Set
<
Integer
>
mallProdSkuSpecIds
);
List
<
OrderGoodsProdDTO
>
listProdGoodsSkuInfo
(
MallOrderGoodsInfoQO
mallOrderGoodsInfoQO
);
List
<
OrderGoodsProdDTO
>
listProdGoodsSkuInfo
(
MallOrderGoodsInfoQO
mallOrderGoodsInfoQO
);
List
<
MallProdSkuInfoSpecDO
>
listMallProductSpec
(
Integer
id
);
List
<
MallProdSkuInfoSpecDO
>
listMallProductSpec
(
Integer
id
);
List
<
ProductSpecPriceDO
>
getProductSpecPriceList
(
List
<
Integer
>
specIds
);
}
}
src/main/java/com/mmc/pms/model/lease/dto/LeaseGoodsDetailDTO.java
0 → 100644
浏览文件 @
262bfee5
package
com
.
mmc
.
pms
.
model
.
lease
.
dto
;
import
com.mmc.pms.model.sale.dto.GoodsDetailInfoDTO
;
import
com.mmc.pms.model.sale.dto.GoodsImgDTO
;
import
com.mmc.pms.model.sale.dto.GoodsOtherServiceDTO
;
import
com.mmc.pms.model.sale.dto.GoodsSpecDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
java.io.Serializable
;
import
java.util.List
;
/**
* @Author LW
*
* @date 2022/11/8 15:57 概要:
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Accessors
(
chain
=
true
)
public
class
LeaseGoodsDetailDTO
implements
Serializable
{
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
@ApiModelProperty
(
value
=
"pid"
)
private
Integer
pid
;
@ApiModelProperty
(
value
=
"商品名称"
)
private
String
goodsName
;
@ApiModelProperty
(
value
=
"云享飞服务id"
)
private
Integer
shareFlyServiceId
;
@ApiModelProperty
(
value
=
"云仓配件id"
)
private
Integer
repoId
;
@ApiModelProperty
(
value
=
"规格信息"
)
private
List
<
GoodsSpecDTO
>
goodsSpec
;
@ApiModelProperty
(
value
=
"商品图片"
)
private
List
<
GoodsImgDTO
>
images
;
@ApiModelProperty
(
value
=
"商品视频"
)
private
String
goodsVideo
;
@ApiModelProperty
(
value
=
"商品视频id"
)
private
Integer
goodsVideoId
;
@ApiModelProperty
(
value
=
"商品详情"
)
private
GoodsDetailInfoDTO
goodsDetail
;
@ApiModelProperty
(
value
=
"所属目录"
)
private
Integer
sortTypeId
;
@ApiModelProperty
(
value
=
"一级分类id"
)
private
Integer
categoryByOne
;
@ApiModelProperty
(
value
=
"二级分类id"
)
private
Integer
categoryByTwo
;
@ApiModelProperty
(
value
=
"商品标签"
)
private
String
tag
;
@ApiModelProperty
(
value
=
"其他服务: 1:免费配送,2:专业飞手培训2日, 3:半年保修, 4:一年保修 "
)
private
List
<
GoodsOtherServiceDTO
>
otherService
;
}
src/main/java/com/mmc/pms/model/sale/dto/ProductSpecDTO.java
浏览文件 @
262bfee5
...
@@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
...
@@ -9,6 +9,7 @@ import lombok.experimental.Accessors;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
/**
/**
* @Author small @Date 2023/5/16 15:30 @Version 1.0
* @Author small @Date 2023/5/16 15:30 @Version 1.0
...
@@ -19,26 +20,29 @@ import java.util.Date;
...
@@ -19,26 +20,29 @@ import java.util.Date;
@Builder
@Builder
@Accessors
@Accessors
public
class
ProductSpecDTO
implements
Serializable
{
public
class
ProductSpecDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
-
2681122778843398310L
;
private
static
final
long
serialVersionUID
=
-
2681122778843398310L
;
@ApiModelProperty
(
value
=
"id"
)
@ApiModelProperty
(
value
=
"id"
)
private
Integer
id
;
private
Integer
id
;
@ApiModelProperty
(
value
=
"productSkuId"
)
@ApiModelProperty
(
value
=
"productSkuId"
)
private
Integer
productSkuId
;
private
Integer
productSkuId
;
@ApiModelProperty
(
value
=
"规格名称"
)
@ApiModelProperty
(
value
=
"规格名称"
)
private
String
specName
;
private
String
specName
;
@ApiModelProperty
(
value
=
"规格图片"
)
@ApiModelProperty
(
value
=
"规格图片"
)
private
String
specImage
;
private
String
specImage
;
@ApiModelProperty
(
value
=
"料号"
)
@ApiModelProperty
(
value
=
"料号"
)
private
String
partNo
;
private
String
partNo
;
@ApiModelProperty
(
value
=
"版本描述"
)
@ApiModelProperty
(
value
=
"版本描述"
)
private
String
versionDesc
;
private
String
versionDesc
;
@ApiModelProperty
(
value
=
"创建时间"
)
@ApiModelProperty
(
value
=
"创建时间"
)
private
Date
createTime
;
private
Date
createTime
;
@ApiModelProperty
(
value
=
"价格配置"
)
private
List
<
ProductSpecPriceDTO
>
priceList
;
}
}
src/main/java/com/mmc/pms/service/Impl/ProductServiceImpl.java
浏览文件 @
262bfee5
...
@@ -27,257 +27,281 @@ import java.util.stream.Collectors;
...
@@ -27,257 +27,281 @@ import java.util.stream.Collectors;
*/
*/
@Service
@Service
public
class
ProductServiceImpl
implements
ProductSkuService
{
public
class
ProductServiceImpl
implements
ProductSkuService
{
@Autowired
@Autowired
private
ProductDao
productDao
;
private
ProductDao
productDao
;
@Autowired
private
IndustrySpecDao
industrySpecDao
;
@Autowired
private
IndustrySpecDao
industrySpecDao
;
@Override
@Override
public
ResultBody
addProductSku
(
ProductSkuVO
param
)
{
public
ResultBody
addProductSku
(
ProductSkuVO
param
)
{
// 获取名称判断此前是否已经存在
// 获取名称判断此前是否已经存在
int
count
=
productDao
.
countSkuName
(
param
);
int
count
=
productDao
.
countSkuName
(
param
);
if
(
count
>
0
)
{
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
}
ProductSkuDO
productSkuDO
=
new
ProductSkuDO
(
param
);
// 新增产品sku
int
status
=
productDao
.
insertProductSku
(
productSkuDO
);
if
(
status
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_ADD_DATA
);
}
return
ResultBody
.
success
();
}
}
ProductSkuDO
productSkuDO
=
new
ProductSkuDO
(
param
);
@Override
// 新增产品sku
public
ResultBody
getProductSkuDetail
(
Integer
id
)
{
int
status
=
productDao
.
insertProductSku
(
productSkuDO
);
// 校验此sku是否还存在或已删除
if
(
status
<=
0
)
{
int
count
=
productDao
.
countSkuIsExist
(
id
);
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_ADD_DATA
);
if
(
count
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
SKU_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED
);
}
ProductSkuDO
productSkuDO
=
productDao
.
getProductSkuDetail
(
id
);
return
ResultBody
.
success
(
productSkuDO
.
buildProductSkuDTO
());
}
}
return
ResultBody
.
success
();
}
@Override
@Override
public
ResultBody
editProductSku
(
ProductSkuVO
param
)
{
public
ResultBody
getProductSkuDetail
(
Integer
id
)
{
// 获取名称判断此前是否已经存在
// 校验此sku是否还存在或已删除
int
count
=
productDao
.
countSkuName
(
param
);
int
count
=
productDao
.
countSkuIsExist
(
id
);
if
(
count
>
0
)
{
if
(
count
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
return
ResultBody
.
error
(
ResultEnum
.
SKU_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED
);
}
ProductSkuDO
productSkuDO
=
new
ProductSkuDO
(
param
);
int
status
=
productDao
.
updateProductSku
(
productSkuDO
);
if
(
status
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_EDIT_DATA
);
}
return
ResultBody
.
success
();
}
}
ProductSkuDO
productSkuDO
=
productDao
.
getProductSkuDetail
(
id
);
return
ResultBody
.
success
(
productSkuDO
.
buildProductSkuDTO
());
}
@Override
@Override
public
ResultBody
listPageProductSku
(
ProductSkuQO
productSkuQO
)
{
public
ResultBody
editProductSku
(
ProductSkuVO
param
)
{
int
count
=
productDao
.
countListPageProductSku
(
productSkuQO
);
// 获取名称判断此前是否已经存在
if
(
count
==
0
)
{
int
count
=
productDao
.
countSkuName
(
param
);
return
ResultBody
.
success
(
PageResult
.
buildPage
(
productSkuQO
.
getPageNo
(),
productSkuQO
.
getPageSize
(),
count
));
if
(
count
>
0
)
{
}
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
Integer
pageNo
=
productSkuQO
.
getPageNo
();
productSkuQO
.
buildCurrentPage
();
List
<
ProductSkuDO
>
productSkuList
=
productDao
.
listPageProductSku
(
productSkuQO
);
List
<
Integer
>
productSkuIds
=
productSkuList
.
stream
().
map
(
ProductSkuDO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
ProductSpecDO
>
productSpecList
=
productDao
.
getProductSpecList
(
productSkuIds
);
Map
<
Integer
,
List
<
ProductSpecDO
>>
productSpecMap
=
productSpecList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ProductSpecDO:
:
getProductSkuId
));
List
<
ProductSkuDTO
>
list
=
productSkuList
.
stream
()
.
map
(
ProductSkuDO:
:
buildProductSkuDTO
)
.
collect
(
Collectors
.
toList
());
list
.
stream
().
peek
(
d
->
{
List
<
ProductSpecDO
>
productSpecDOS
=
productSpecMap
.
get
(
d
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
productSpecDOS
))
{
d
.
setProductSpecList
(
null
);
}
else
{
d
.
setProductSpecList
(
productSpecDOS
.
stream
().
map
(
ProductSpecDO:
:
buildProductSpecDTO
).
collect
(
Collectors
.
toList
()));
}
}).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
productSkuQO
.
getPageSize
(),
count
,
list
));
}
}
ProductSkuDO
productSkuDO
=
new
ProductSkuDO
(
param
);
@Override
int
status
=
productDao
.
updateProductSku
(
productSkuDO
);
public
ResultBody
addOrEditProductSpec
(
ProductSpecVO
param
)
{
if
(
status
<=
0
)
{
// 获取名称判断此前是否已经存在
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_EDIT_DATA
);
int
count
=
productDao
.
countSpecName
(
param
);
if
(
count
>
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
}
if
(
param
.
getId
()
==
null
)
{
ProductSpecDO
productSpecDO
=
new
ProductSpecDO
(
param
);
// 新增产品sku
int
status
=
productDao
.
insertProductSpec
(
productSpecDO
);
if
(
status
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_ADD_DATA
);
}
}
else
{
ProductSpecDO
productSpecDO
=
new
ProductSpecDO
(
param
);
int
status
=
productDao
.
updateProductSpec
(
productSpecDO
);
if
(
status
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_EDIT_DATA
);
}
}
return
ResultBody
.
success
();
}
}
return
ResultBody
.
success
();
}
@Override
@Override
public
ResultBody
getProductSpecDetail
(
Integer
id
)
{
public
ResultBody
listPageProductSku
(
ProductSkuQO
productSkuQO
)
{
// 校验此sku是否还存在或已删除
int
count
=
productDao
.
countListPageProductSku
(
productSkuQO
);
int
count
=
productDao
.
countSpecIsExist
(
id
);
if
(
count
==
0
)
{
if
(
count
<=
0
)
{
return
ResultBody
.
success
(
return
ResultBody
.
error
(
ResultEnum
.
SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED
);
PageResult
.
buildPage
(
productSkuQO
.
getPageNo
(),
productSkuQO
.
getPageSize
(),
count
));
}
ProductSpecDO
productSpecDO
=
productDao
.
getProductSpecDetail
(
id
);
return
ResultBody
.
success
(
productSpecDO
.
buildProductSpecDTO
());
}
}
Integer
pageNo
=
productSkuQO
.
getPageNo
();
productSkuQO
.
buildCurrentPage
();
List
<
ProductSkuDO
>
productSkuList
=
productDao
.
listPageProductSku
(
productSkuQO
);
List
<
Integer
>
productSkuIds
=
productSkuList
.
stream
().
map
(
ProductSkuDO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
ProductSpecDO
>
productSpecList
=
productDao
.
getProductSpecList
(
productSkuIds
);
Map
<
Integer
,
List
<
ProductSpecDO
>>
productSpecMap
=
productSpecList
.
stream
().
collect
(
Collectors
.
groupingBy
(
ProductSpecDO:
:
getProductSkuId
));
List
<
ProductSkuDTO
>
list
=
productSkuList
.
stream
().
map
(
ProductSkuDO:
:
buildProductSkuDTO
).
collect
(
Collectors
.
toList
());
list
.
stream
()
.
peek
(
d
->
{
List
<
ProductSpecDO
>
productSpecDOS
=
productSpecMap
.
get
(
d
.
getId
());
if
(
CollectionUtils
.
isEmpty
(
productSpecDOS
))
{
d
.
setProductSpecList
(
null
);
}
else
{
d
.
setProductSpecList
(
productSpecDOS
.
stream
()
.
map
(
ProductSpecDO:
:
buildProductSpecDTO
)
.
collect
(
Collectors
.
toList
()));
}
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
productSkuQO
.
getPageSize
(),
count
,
list
));
}
@Override
@Override
public
ResultBody
listPageProductSpec
(
Integer
pageNo
,
Integer
pageSize
,
Integer
productSkuId
)
{
public
ResultBody
addOrEditProductSpec
(
ProductSpecVO
param
)
{
int
count
=
productDao
.
countListPageProductSpec
(
productSkuId
);
// 获取名称判断此前是否已经存在
if
(
count
==
0
)
{
int
count
=
productDao
.
countSpecName
(
param
);
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
));
if
(
count
>
0
)
{
}
return
ResultBody
.
error
(
ResultEnum
.
GOODS_CATEGORY_NAME_EXIST_ERROR
);
List
<
ProductSpecDO
>
productSpecList
=
productDao
.
listPageProductSpec
((
pageNo
-
1
)
*
pageSize
,
pageSize
,
productSkuId
);
List
<
ProductSpecDTO
>
list
=
productSpecList
.
stream
().
map
(
ProductSpecDO:
:
buildProductSpecDTO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
,
list
));
}
}
if
(
param
.
getId
()
==
null
)
{
@Override
ProductSpecDO
productSpecDO
=
new
ProductSpecDO
(
param
);
public
ResultBody
productSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
)
{
// 新增产品sku
// 判断该规格是否存在
int
status
=
productDao
.
insertProductSpec
(
productSpecDO
);
int
count
=
productDao
.
countSpecIsExist
(
productSpecCPQVO
.
getProductSpecId
());
if
(
status
<=
0
)
{
if
(
count
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_ADD_DATA
);
return
ResultBody
.
error
(
ResultEnum
.
SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED
);
}
}
}
else
{
// 批量插入规格销售或租赁价格
ProductSpecDO
productSpecDO
=
new
ProductSpecDO
(
param
);
return
insertSpecPrice
(
productSpecCPQVO
);
int
status
=
productDao
.
updateProductSpec
(
productSpecDO
);
if
(
status
<=
0
)
{
return
ResultBody
.
error
(
ResultEnum
.
FAILED_TO_EDIT_DATA
);
}
}
}
return
ResultBody
.
success
();
}
@Override
@Override
public
List
<
ProductSpecPriceDO
>
getProductSpecPriceDOS
(
ProductSpecCPQVO
productSpecCPQVO
)
{
public
ResultBody
getProductSpecDetail
(
Integer
id
)
{
// 批量插入规格价格
// 校验此sku是否还存在或已删除
return
productSpecCPQVO
.
getSpecPrice
().
stream
().
map
(
d
->
{
int
count
=
productDao
.
countSpecIsExist
(
id
);
ProductSpecPriceDO
productSpecPriceDO
=
new
ProductSpecPriceDO
();
if
(
count
<=
0
)
{
productSpecPriceDO
.
setCooperationTag
(
d
.
getCooperationTag
());
return
ResultBody
.
error
(
ResultEnum
.
SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED
);
productSpecPriceDO
.
setPrice
(
d
.
getPrice
());
productSpecPriceDO
.
setType
(
productSpecCPQVO
.
getType
());
productSpecPriceDO
.
setProductSpecId
(
productSpecCPQVO
.
getProductSpecId
());
if
(
productSpecCPQVO
.
getType
().
equals
(
1
))
{
productSpecPriceDO
.
setLeaseTerm
(
productSpecCPQVO
.
getLeaseTerm
());
}
return
productSpecPriceDO
;
}).
collect
(
Collectors
.
toList
());
}
}
ProductSpecDO
productSpecDO
=
productDao
.
getProductSpecDetail
(
id
);
return
ResultBody
.
success
(
productSpecDO
.
buildProductSpecDTO
());
}
@Override
@Override
public
ResultBody
updateProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
)
{
public
ResultBody
listPageProductSpec
(
// 先删除原来该规格下的所有价格配置信息
Integer
pageNo
,
Integer
pageSize
,
Integer
productSkuId
,
String
keyword
)
{
productDao
.
removeProductSpecCPQ
(
productSpecCPQVO
);
int
count
=
productDao
.
countListPageProductSpec
(
productSkuId
,
keyword
);
// 批量插入规格销售或租赁价格
if
(
count
==
0
)
{
return
insertSpecPrice
(
productSpecCPQVO
);
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
)
);
}
}
List
<
ProductSpecDO
>
productSpecList
=
productDao
.
listPageProductSpec
((
pageNo
-
1
)
*
pageSize
,
pageSize
,
productSkuId
,
keyword
);
List
<
ProductSpecDTO
>
list
=
productSpecList
.
stream
()
.
map
(
ProductSpecDO:
:
buildProductSpecDTO
)
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
pageSize
,
count
,
list
));
}
@NotNull
@Override
public
ResultBody
insertSpecPrice
(
ProductSpecCPQVO
productSpecCPQVO
)
{
public
ResultBody
productSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
)
{
List
<
ProductSpecPriceDO
>
list
=
getProductSpecPriceDOS
(
productSpecCPQVO
);
// 判断该规格是否存在
if
(
productSpecCPQVO
.
getType
().
equals
(
1
)
&&
productSpecCPQVO
.
getLeaseTerm
()
==
null
)
{
int
count
=
productDao
.
countSpecIsExist
(
productSpecCPQVO
.
getProductSpecId
());
return
ResultBody
.
error
(
"租赁期限不能为空!"
);
if
(
count
<=
0
)
{
}
return
ResultBody
.
error
(
ResultEnum
.
SPEC_DOES_NOT_EXIST_OR_HAS_BEEN_DELETED
);
// 批量插入规格销售价格
if
(
productSpecCPQVO
.
getType
().
equals
(
0
))
{
productDao
.
batchInsertSpecPrice
(
list
);
}
else
{
// 批量插入租赁价格
productDao
.
batchInsertLeaseSpecPrice
(
list
);
}
return
ResultBody
.
success
();
}
}
// 批量插入规格销售或租赁价格
return
insertSpecPrice
(
productSpecCPQVO
);
}
@Override
public
List
<
ProductSpecPriceDO
>
getProductSpecPriceDOS
(
ProductSpecCPQVO
productSpecCPQVO
)
{
// 批量插入规格价格
return
productSpecCPQVO
.
getSpecPrice
().
stream
()
.
map
(
d
->
{
ProductSpecPriceDO
productSpecPriceDO
=
new
ProductSpecPriceDO
();
productSpecPriceDO
.
setCooperationTag
(
d
.
getCooperationTag
());
productSpecPriceDO
.
setPrice
(
d
.
getPrice
());
productSpecPriceDO
.
setType
(
productSpecCPQVO
.
getType
());
productSpecPriceDO
.
setProductSpecId
(
productSpecCPQVO
.
getProductSpecId
());
if
(
productSpecCPQVO
.
getType
().
equals
(
1
))
{
productSpecPriceDO
.
setLeaseTerm
(
productSpecCPQVO
.
getLeaseTerm
());
}
return
productSpecPriceDO
;
})
.
collect
(
Collectors
.
toList
());
}
@Override
public
ResultBody
updateProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
)
{
// 先删除原来该规格下的所有价格配置信息
productDao
.
removeProductSpecCPQ
(
productSpecCPQVO
);
// 批量插入规格销售或租赁价格
return
insertSpecPrice
(
productSpecCPQVO
);
}
@Override
@NotNull
public
ResultBody
getProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
)
{
public
ResultBody
insertSpecPrice
(
ProductSpecCPQVO
productSpecCPQVO
)
{
if
(
productSpecCPQVO
.
getType
().
equals
(
1
)
&&
productSpecCPQVO
.
getLeaseTerm
()
==
null
)
{
List
<
ProductSpecPriceDO
>
list
=
getProductSpecPriceDOS
(
productSpecCPQVO
);
return
ResultBody
.
error
(
"租赁期限不能为空!"
);
if
(
productSpecCPQVO
.
getType
().
equals
(
1
)
&&
productSpecCPQVO
.
getLeaseTerm
()
==
null
)
{
}
return
ResultBody
.
error
(
"租赁期限不能为空!"
);
List
<
ProductSpecPriceDO
>
productSpecPriceList
=
productDao
.
getProductSpecPrice
(
productSpecCPQVO
);
List
<
ProductSpecPriceDTO
>
list
=
productSpecPriceList
.
stream
()
.
map
(
ProductSpecPriceDO:
:
buildProductSpecPriceDTO
).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
list
);
}
}
// 批量插入规格销售价格
@Override
if
(
productSpecCPQVO
.
getType
().
equals
(
0
))
{
public
ResultBody
removeProductSku
(
Integer
id
)
{
productDao
.
batchInsertSpecPrice
(
list
);
// 判断该sku下是否有规格,没有则删除,有则不能删除
}
else
{
int
specCount
=
productDao
.
countSpecByProdSkuId
(
id
);
// 批量插入租赁价格
if
(
specCount
<=
0
)
{
productDao
.
batchInsertLeaseSpecPrice
(
list
);
// 删除
productDao
.
removeProductSku
(
id
);
return
ResultBody
.
success
();
}
else
{
return
ResultBody
.
error
(
ResultEnum
.
SPEC_EXIST_UNDER_THE_SKU
);
}
}
}
return
ResultBody
.
success
();
}
@Override
@Override
public
ResultBody
removeProductSpec
(
Integer
id
)
{
public
ResultBody
getProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
)
{
// 根据规格id查询绑定的商品或者行业的sku
if
(
productSpecCPQVO
.
getType
().
equals
(
1
)
&&
productSpecCPQVO
.
getLeaseTerm
()
==
null
)
{
RemoveSkuDTO
removeSkuDTO
=
new
RemoveSkuDTO
();
return
ResultBody
.
error
(
"租赁期限不能为空!"
);
List
<
MallProdSkuInfoSpecDO
>
mallProdSkuInfoSpecList
=
productDao
.
listMallProductSpec
(
id
);
// 拿到清单的id
List
<
InventorySpecDO
>
inventorySpecList
=
productDao
.
listInventorySpec
(
id
);
if
(
mallProdSkuInfoSpecList
.
size
()
!=
0
||
inventorySpecList
.
size
()
!=
0
)
{
if
(
inventorySpecList
.
size
()
!=
0
)
{
// 根据清单id 获取行业规格id
Set
<
Integer
>
inventoryIds
=
inventorySpecList
.
stream
().
map
(
InventorySpecDO:
:
getIndustryProductInventoryId
).
collect
(
Collectors
.
toSet
());
List
<
IndustryProductInventoryDO
>
industryProductInventoryList
=
industrySpecDao
.
listIndustryProdInventory
(
inventoryIds
);
// 获取行业规格id
Set
<
Integer
>
industrySpecIds
=
industryProductInventoryList
.
stream
().
map
(
IndustryProductInventoryDO:
:
getIndustrySpecId
).
collect
(
Collectors
.
toSet
());
// 分别获取规格对应的sku信息
List
<
IndustrySpecDO
>
industrySpecList
=
industrySpecDao
.
listIndustrySpec
(
industrySpecIds
);
List
<
SkuAndSpecDTO
>
industrySkuNameList
=
new
ArrayList
<>();
industrySpecList
.
stream
().
peek
(
d
->
{
SkuAndSpecDTO
skuAndSpecDTO
=
new
SkuAndSpecDTO
();
skuAndSpecDTO
.
setIndustrySkuName
(
d
.
getSolutionName
());
skuAndSpecDTO
.
setIndustrySpecNames
(
d
.
getSpecName
());
industrySkuNameList
.
add
(
skuAndSpecDTO
);
}).
collect
(
Collectors
.
toList
());
removeSkuDTO
.
setIndustrySkuName
(
industrySkuNameList
);
}
if
(
mallProdSkuInfoSpecList
.
size
()
!=
0
)
{
// 获取商品名称
List
<
String
>
goodsNameList
=
new
ArrayList
<>();
mallProdSkuInfoSpecList
.
forEach
(
d
->
goodsNameList
.
add
(
d
.
getGoodsName
()));
removeSkuDTO
.
setGoodsName
(
goodsNameList
);
}
return
ResultBody
.
success
(
removeSkuDTO
);
}
else
{
productDao
.
removeProductSpec
(
id
);
return
ResultBody
.
success
();
}
}
}
List
<
ProductSpecPriceDO
>
productSpecPriceList
=
productDao
.
getProductSpecPrice
(
productSpecCPQVO
);
List
<
ProductSpecPriceDTO
>
list
=
productSpecPriceList
.
stream
()
.
map
(
ProductSpecPriceDO:
:
buildProductSpecPriceDTO
)
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
list
);
}
@Override
@Override
public
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
)
{
public
ResultBody
removeProductSku
(
Integer
id
)
{
Map
<
Integer
,
Integer
>
dayMap
=
new
HashMap
<>();
// 判断该sku下是否有规格,没有则删除,有则不能删除
dayMap
.
put
(
0
,
7
);
int
specCount
=
productDao
.
countSpecByProdSkuId
(
id
);
dayMap
.
put
(
8
,
15
);
if
(
specCount
<=
0
)
{
dayMap
.
put
(
16
,
30
);
// 删除
dayMap
.
put
(
31
,
Integer
.
MAX_VALUE
);
productDao
.
removeProductSku
(
id
);
return
ResultBody
.
success
();
Integer
dayRange
=
dayMap
.
entrySet
().
stream
()
}
else
{
.
filter
(
entry
->
priceAcquisition
.
getDay
()
<=
entry
.
getKey
())
return
ResultBody
.
error
(
ResultEnum
.
SPEC_EXIST_UNDER_THE_SKU
);
.
findFirst
()
.
map
(
Map
.
Entry
::
getValue
)
.
orElseThrow
(()
->
new
RuntimeException
(
"租赁期限错误错误!"
));
priceAcquisition
.
setDay
(
dayRange
);
return
productDao
.
feignGetUnitPriceByTag
(
priceAcquisition
);
}
}
}
}
@Override
public
ResultBody
removeProductSpec
(
Integer
id
)
{
// 根据规格id查询绑定的商品或者行业的sku
RemoveSkuDTO
removeSkuDTO
=
new
RemoveSkuDTO
();
List
<
MallProdSkuInfoSpecDO
>
mallProdSkuInfoSpecList
=
productDao
.
listMallProductSpec
(
id
);
// 拿到清单的id
List
<
InventorySpecDO
>
inventorySpecList
=
productDao
.
listInventorySpec
(
id
);
if
(
mallProdSkuInfoSpecList
.
size
()
!=
0
||
inventorySpecList
.
size
()
!=
0
)
{
if
(
inventorySpecList
.
size
()
!=
0
)
{
// 根据清单id 获取行业规格id
Set
<
Integer
>
inventoryIds
=
inventorySpecList
.
stream
()
.
map
(
InventorySpecDO:
:
getIndustryProductInventoryId
)
.
collect
(
Collectors
.
toSet
());
List
<
IndustryProductInventoryDO
>
industryProductInventoryList
=
industrySpecDao
.
listIndustryProdInventory
(
inventoryIds
);
// 获取行业规格id
Set
<
Integer
>
industrySpecIds
=
industryProductInventoryList
.
stream
()
.
map
(
IndustryProductInventoryDO:
:
getIndustrySpecId
)
.
collect
(
Collectors
.
toSet
());
// 分别获取规格对应的sku信息
List
<
IndustrySpecDO
>
industrySpecList
=
industrySpecDao
.
listIndustrySpec
(
industrySpecIds
);
List
<
SkuAndSpecDTO
>
industrySkuNameList
=
new
ArrayList
<>();
industrySpecList
.
stream
()
.
peek
(
d
->
{
SkuAndSpecDTO
skuAndSpecDTO
=
new
SkuAndSpecDTO
();
skuAndSpecDTO
.
setIndustrySkuName
(
d
.
getSolutionName
());
skuAndSpecDTO
.
setIndustrySpecNames
(
d
.
getSpecName
());
industrySkuNameList
.
add
(
skuAndSpecDTO
);
})
.
collect
(
Collectors
.
toList
());
removeSkuDTO
.
setIndustrySkuName
(
industrySkuNameList
);
}
if
(
mallProdSkuInfoSpecList
.
size
()
!=
0
)
{
// 获取商品名称
List
<
String
>
goodsNameList
=
new
ArrayList
<>();
mallProdSkuInfoSpecList
.
forEach
(
d
->
goodsNameList
.
add
(
d
.
getGoodsName
()));
removeSkuDTO
.
setGoodsName
(
goodsNameList
);
}
return
ResultBody
.
success
(
removeSkuDTO
);
}
else
{
productDao
.
removeProductSpec
(
id
);
return
ResultBody
.
success
();
}
}
@Override
public
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
)
{
Map
<
Integer
,
Integer
>
dayMap
=
new
HashMap
<>();
dayMap
.
put
(
0
,
7
);
dayMap
.
put
(
8
,
15
);
dayMap
.
put
(
16
,
30
);
dayMap
.
put
(
31
,
Integer
.
MAX_VALUE
);
Integer
dayRange
=
dayMap
.
entrySet
().
stream
()
.
filter
(
entry
->
priceAcquisition
.
getDay
()
<=
entry
.
getKey
())
.
findFirst
()
.
map
(
Map
.
Entry
::
getValue
)
.
orElseThrow
(()
->
new
RuntimeException
(
"租赁期限错误错误!"
));
priceAcquisition
.
setDay
(
dayRange
);
return
productDao
.
feignGetUnitPriceByTag
(
priceAcquisition
);
}
}
src/main/java/com/mmc/pms/service/Impl/WebDeviceServiceImpl.java
浏览文件 @
262bfee5
...
@@ -2,6 +2,7 @@ package com.mmc.pms.service.Impl;
...
@@ -2,6 +2,7 @@ package com.mmc.pms.service.Impl;
import
com.mmc.pms.auth.dto.UserAccountSimpleDTO
;
import
com.mmc.pms.auth.dto.UserAccountSimpleDTO
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultBody
;
import
com.mmc.pms.common.ResultEnum
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.constant.TokenConstant
;
import
com.mmc.pms.dao.GoodsInfoDao
;
import
com.mmc.pms.dao.GoodsInfoDao
;
import
com.mmc.pms.dao.ProductDao
;
import
com.mmc.pms.dao.ProductDao
;
...
@@ -21,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
...
@@ -21,6 +22,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.Collections
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -31,184 +33,219 @@ import java.util.stream.Collectors;
...
@@ -31,184 +33,219 @@ import java.util.stream.Collectors;
@Service
@Service
public
class
WebDeviceServiceImpl
implements
WebDeviceService
{
public
class
WebDeviceServiceImpl
implements
WebDeviceService
{
@Autowired
@Autowired
WebDeviceDao
webDeviceDao
;
WebDeviceDao
webDeviceDao
;
@Autowired
UserAppApi
userAppApi
;
@Autowired
UserAppApi
userAppApi
;
@Autowired
ProductDao
productDao
;
@Autowired
@Autowired
GoodsInfoDao
goodsInfoDao
;
ProductDao
productDao
;
@Override
@Autowired
public
ResultBody
listSecondDistrict
()
{
GoodsInfoDao
goodsInfoDao
;
List
<
DistrictDO
>
list
=
webDeviceDao
.
listSecondDistrict
();
List
<
DistrictInfoDTO
>
dtoList
=
@Override
list
.
stream
().
map
(
DistrictDO:
:
builderDistrictInfoDTO
).
collect
(
Collectors
.
toList
());
public
ResultBody
listSecondDistrict
()
{
return
ResultBody
.
success
(
dtoList
);
List
<
DistrictDO
>
list
=
webDeviceDao
.
listSecondDistrict
();
}
List
<
DistrictInfoDTO
>
dtoList
=
list
.
stream
().
map
(
DistrictDO:
:
builderDistrictInfoDTO
).
collect
(
Collectors
.
toList
());
@Override
return
ResultBody
.
success
(
dtoList
);
public
ResultBody
category
()
{
}
List
<
DeviceCategory
>
category
=
webDeviceDao
.
category
();
List
<
DeviceCategoryDTO
>
collect
=
@Override
category
.
stream
()
public
ResultBody
category
()
{
.
map
(
List
<
DeviceCategory
>
category
=
webDeviceDao
.
category
();
t
->
{
List
<
DeviceCategoryDTO
>
collect
=
return
t
.
deviceCategory
();
category
.
stream
()
})
.
map
(
.
collect
(
Collectors
.
toList
());
t
->
{
return
ResultBody
.
success
(
collect
);
return
t
.
deviceCategory
();
}
})
.
collect
(
Collectors
.
toList
());
@Override
return
ResultBody
.
success
(
collect
);
public
ResultBody
brand
()
{
List
<
Brand
>
brand
=
webDeviceDao
.
brand
();
List
<
BrandDTO
>
collect
=
brand
.
stream
()
.
map
(
t
->
{
return
t
.
brandDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
deviceBrand
()
{
List
<
Brand
>
brand
=
webDeviceDao
.
deviceBrand
();
List
<
BrandDTO
>
collect
=
brand
.
stream
()
.
map
(
t
->
{
return
t
.
brandDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
model
()
{
List
<
Model
>
model
=
webDeviceDao
.
model
();
List
<
ModelDTO
>
collect
=
model
.
stream
()
.
map
(
t
->
{
return
t
.
modelDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
deviceModel
()
{
List
<
Model
>
model
=
webDeviceDao
.
deviceModel
();
List
<
ModelDTO
>
collect
=
model
.
stream
()
.
map
(
t
->
{
return
t
.
modelDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
deviceList
(
Integer
districtId
,
Integer
categoryId
,
Integer
brandId
,
Integer
modelId
)
{
List
<
DeviceListDO
>
deviceList
=
webDeviceDao
.
deviceList
(
districtId
,
categoryId
,
brandId
,
modelId
);
List
<
DeviceListDTO
>
collect
=
deviceList
.
stream
()
.
map
(
t
->
{
return
t
.
deviceListDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
update
(
LeaseVo
param
)
{
InventoryDO
inventory
=
webDeviceDao
.
findInventory
(
param
.
getInventoryId
());
Integer
residueCount
=
inventory
.
getResidueCount
();
Integer
count
=
residueCount
-
param
.
getInventoryUsage
();
param
.
setInventoryUsage
(
count
);
int
update
=
webDeviceDao
.
update
(
param
);
return
ResultBody
.
success
(
update
);
}
@Override
public
ResultBody
detail
(
Integer
id
)
{
List
<
WareInfoDO
>
list
=
webDeviceDao
.
detail
(
id
);
List
<
WareInfoItemDTO
>
pageList
=
list
.
stream
()
.
map
(
d
->
{
return
d
.
buildWareInfoItemDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
pageList
);
}
@Override
public
ResultBody
listWareInfoPage
(
WareInfoQO
param
,
HttpServletRequest
request
,
Integer
userAccountId
)
{
List
<
Integer
>
userIds
=
null
;
if
(
param
.
getProvinceId
()
!=
null
)
{
userIds
=
userAppApi
.
feignListUserAccountIds
(
param
.
getProvinceId
(),
null
,
null
,
request
==
null
?
null
:
request
.
getHeader
(
TokenConstant
.
TOKEN
));
if
(
userIds
==
null
||
userIds
.
size
()
==
0
)
{
userIds
=
Collections
.
singletonList
(-
1
);
}
}
}
int
count
=
webDeviceDao
.
countListWareInfoPage
(
param
.
getCategoryId
(),
userIds
);
@Override
if
(
count
==
0
)
{
public
ResultBody
brand
()
{
return
ResultBody
.
success
(
List
<
Brand
>
brand
=
webDeviceDao
.
brand
();
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
List
<
BrandDTO
>
collect
=
brand
.
stream
()
.
map
(
t
->
{
return
t
.
brandDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
ResultBody
deviceBrand
()
{
List
<
Brand
>
brand
=
webDeviceDao
.
deviceBrand
();
List
<
BrandDTO
>
collect
=
brand
.
stream
()
.
map
(
t
->
{
return
t
.
brandDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
}
int
pageNo
=
param
.
getPageNo
();
@Override
param
.
buildCurrentPage
();
public
ResultBody
model
()
{
if
(
request
==
null
)
{
List
<
Model
>
model
=
webDeviceDao
.
model
();
List
<
GoodsInfo
>
list
=
List
<
ModelDTO
>
collect
=
webDeviceDao
.
listWareInfoPage
(
model
.
stream
()
param
.
getCategoryId
(),
userIds
,
param
.
getPageNo
(),
param
.
getPageSize
());
.
map
(
List
<
LeaseGoodsInfoDTO
>
pageList
=
t
->
{
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
return
t
.
modelDTO
();
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
}
@Override
UserAccountSimpleDTO
userAccountSimpleDTO
=
public
ResultBody
deviceModel
()
{
userAppApi
.
feignGetUserSimpleInfo
(
userAccountId
,
request
.
getHeader
(
TokenConstant
.
TOKEN
));
List
<
Model
>
model
=
webDeviceDao
.
deviceModel
();
if
(
userAccountSimpleDTO
==
null
)
{
List
<
ModelDTO
>
collect
=
return
ResultBody
.
error
(
ResultEnum
.
INTERNAL_SERVER_ERROR
);
model
.
stream
()
.
map
(
t
->
{
return
t
.
modelDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
}
List
<
GoodsInfo
>
list
=
@Override
webDeviceDao
.
listWareInfoPage
(
public
ResultBody
deviceList
(
param
.
getCategoryId
(),
userIds
,
param
.
getPageNo
(),
param
.
getPageSize
());
Integer
districtId
,
Integer
categoryId
,
Integer
brandId
,
Integer
modelId
)
{
List
<
LeaseGoodsInfoDTO
>
pageList
=
List
<
DeviceListDO
>
deviceList
=
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
webDeviceDao
.
deviceList
(
districtId
,
categoryId
,
brandId
,
modelId
);
if
(
userAccountSimpleDTO
.
getCooperationTagId
()
==
null
)
{
List
<
DeviceListDTO
>
collect
=
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
deviceList
.
stream
()
.
map
(
t
->
{
return
t
.
deviceListDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
}
List
<
Integer
>
goodsId
=
@Override
pageList
.
stream
().
map
(
LeaseGoodsInfoDTO:
:
getId
).
collect
(
Collectors
.
toList
());
public
ResultBody
update
(
LeaseVo
param
)
{
List
<
MallProdSkuInfoSpecDO
>
mallProSkuInfoSpec
=
goodsInfoDao
.
listMallprodSpecById
(
goodsId
);
InventoryDO
inventory
=
webDeviceDao
.
findInventory
(
param
.
getInventoryId
());
Map
<
Integer
,
MallProdSkuInfoSpecDO
>
specMap
=
Integer
residueCount
=
inventory
.
getResidueCount
();
mallProSkuInfoSpec
.
stream
()
Integer
count
=
residueCount
-
param
.
getInventoryUsage
();
.
collect
(
param
.
setInventoryUsage
(
count
);
Collectors
.
toMap
(
MallProdSkuInfoSpecDO:
:
getGoodsInfoId
,
d
->
d
,
(
k1
,
k2
)
->
k1
));
int
update
=
webDeviceDao
.
update
(
param
);
pageList
.
stream
()
return
ResultBody
.
success
(
update
);
.
peek
(
d
->
{
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
=
specMap
.
get
(
d
.
getId
());
d
.
setPrice
(
mallProdSkuInfoSpecDO
.
getPrice
());
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
}
@Override
public
WareInfoDTO
getWareInfoById
(
Integer
id
)
{
WareInfoDO
wareInfoDO
=
webDeviceDao
.
getWareInfoById
(
id
);
WareDetailDO
wareDetailDO
=
webDeviceDao
.
getWareDetailById
(
id
);
if
(
wareInfoDO
!=
null
)
{
wareInfoDO
.
setWareDetailContent
(
wareDetailDO
.
getContent
());
}
}
return
wareInfoDO
==
null
?
null
:
wareInfoDO
.
buildWareInfoDTO
();
@Override
}
public
ResultBody
detail
(
Integer
id
)
{
List
<
WareInfoDO
>
list
=
webDeviceDao
.
detail
(
id
);
@Override
List
<
WareInfoItemDTO
>
pageList
=
public
ResultBody
<
AdDTO
>
ad
()
{
list
.
stream
()
List
<
AdDO
>
ad
=
webDeviceDao
.
ad
();
.
map
(
List
<
AdDTO
>
collect
=
d
->
{
ad
.
stream
()
return
d
.
buildWareInfoItemDTO
();
.
map
(
})
t
->
{
.
collect
(
Collectors
.
toList
());
return
t
.
adDTO
();
return
ResultBody
.
success
(
pageList
);
})
}
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
@Override
}
public
ResultBody
listWareInfoPage
(
WareInfoQO
param
,
HttpServletRequest
request
,
Integer
userAccountId
)
{
UserAccountSimpleDTO
userAccountSimpleDTO
=
userAppApi
.
feignGetUserSimpleInfo
(
userAccountId
,
request
.
getHeader
(
TokenConstant
.
TOKEN
));
@Override
List
<
Integer
>
userIds
=
userAppApi
.
feignListUserAccountIds
(
param
.
getProvinceId
(),
null
,
null
,
request
.
getHeader
(
TokenConstant
.
TOKEN
));
public
List
<
SkuInfoDTO
>
listWareSkuById
(
Integer
id
)
{
int
count
=
webDeviceDao
.
countListWareInfoPage
(
param
.
getCategoryId
(),
userIds
);
List
<
SkuInfoDO
>
skuInfoDOS
=
webDeviceDao
.
listSkuInfo
(
id
);
if
(
count
==
0
)
{
return
skuInfoDOS
.
isEmpty
()
return
ResultBody
.
success
(
?
null
PageResult
.
buildPage
(
param
.
getPageNo
(),
param
.
getPageSize
(),
count
));
:
skuInfoDOS
.
stream
()
}
.
map
(
int
pageNo
=
param
.
getPageNo
();
d
->
{
param
.
buildCurrentPage
();
return
d
.
buildSkuInfoDTO
();
List
<
GoodsInfo
>
list
=
webDeviceDao
.
listWareInfoPage
(
param
.
getCategoryId
(),
userIds
,
param
.
getPageNo
(),
param
.
getPageSize
());
})
List
<
LeaseGoodsInfoDTO
>
pageList
=
list
.
stream
().
map
(
GoodsInfo:
:
buildLeaseGoodsInfoDTO
).
collect
(
Collectors
.
toList
());
.
collect
(
Collectors
.
toList
());
if
(
userAccountSimpleDTO
.
getCooperationTagId
()
==
null
)
{
}
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
}
List
<
Integer
>
goodsId
=
pageList
.
stream
().
map
(
LeaseGoodsInfoDTO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
MallProdSkuInfoSpecDO
>
mallProSkuInfoSpec
=
goodsInfoDao
.
listMallprodSpecById
(
goodsId
);
Map
<
Integer
,
MallProdSkuInfoSpecDO
>
specMap
=
mallProSkuInfoSpec
.
stream
().
collect
(
Collectors
.
toMap
(
MallProdSkuInfoSpecDO:
:
getGoodsInfoId
,
d
->
d
,
(
k1
,
k2
)
->
k1
));
pageList
.
stream
().
peek
(
d
->
{
MallProdSkuInfoSpecDO
mallProdSkuInfoSpecDO
=
specMap
.
get
(
d
.
getId
());
d
.
setPrice
(
mallProdSkuInfoSpecDO
.
getPrice
());
}).
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
PageResult
.
buildPage
(
pageNo
,
param
.
getPageSize
(),
count
,
pageList
));
}
@Override
public
WareInfoDTO
getWareInfoById
(
Integer
id
)
{
WareInfoDO
wareInfoDO
=
webDeviceDao
.
getWareInfoById
(
id
);
WareDetailDO
wareDetailDO
=
webDeviceDao
.
getWareDetailById
(
id
);
if
(
wareInfoDO
!=
null
)
{
wareInfoDO
.
setWareDetailContent
(
wareDetailDO
.
getContent
());
}
return
wareInfoDO
==
null
?
null
:
wareInfoDO
.
buildWareInfoDTO
();
}
@Override
public
ResultBody
<
AdDTO
>
ad
()
{
List
<
AdDO
>
ad
=
webDeviceDao
.
ad
();
List
<
AdDTO
>
collect
=
ad
.
stream
()
.
map
(
t
->
{
return
t
.
adDTO
();
})
.
collect
(
Collectors
.
toList
());
return
ResultBody
.
success
(
collect
);
}
@Override
public
List
<
SkuInfoDTO
>
listWareSkuById
(
Integer
id
)
{
List
<
SkuInfoDO
>
skuInfoDOS
=
webDeviceDao
.
listSkuInfo
(
id
);
return
skuInfoDOS
.
isEmpty
()
?
null
:
skuInfoDOS
.
stream
().
map
(
d
->
{
return
d
.
buildSkuInfoDTO
();
}).
collect
(
Collectors
.
toList
());
}
}
}
src/main/java/com/mmc/pms/service/ProductSkuService.java
浏览文件 @
262bfee5
...
@@ -18,32 +18,32 @@ import java.util.List;
...
@@ -18,32 +18,32 @@ import java.util.List;
*/
*/
public
interface
ProductSkuService
{
public
interface
ProductSkuService
{
ResultBody
addProductSku
(
ProductSkuVO
param
);
ResultBody
addProductSku
(
ProductSkuVO
param
);
ResultBody
getProductSkuDetail
(
Integer
id
);
ResultBody
getProductSkuDetail
(
Integer
id
);
ResultBody
editProductSku
(
ProductSkuVO
param
);
ResultBody
editProductSku
(
ProductSkuVO
param
);
ResultBody
listPageProductSku
(
ProductSkuQO
productSkuQO
);
ResultBody
listPageProductSku
(
ProductSkuQO
productSkuQO
);
ResultBody
addOrEditProductSpec
(
ProductSpecVO
param
);
ResultBody
addOrEditProductSpec
(
ProductSpecVO
param
);
ResultBody
getProductSpecDetail
(
Integer
id
);
ResultBody
getProductSpecDetail
(
Integer
id
);
ResultBody
listPageProductSpec
(
Integer
pageNo
,
Integer
pageSize
,
Integer
productSkuId
);
ResultBody
listPageProductSpec
(
Integer
pageNo
,
Integer
pageSize
,
Integer
productSkuId
,
String
keyword
);
ResultBody
productSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
);
ResultBody
productSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
);
List
<
ProductSpecPriceDO
>
getProductSpecPriceDOS
(
ProductSpecCPQVO
productSpecCPQVO
);
List
<
ProductSpecPriceDO
>
getProductSpecPriceDOS
(
ProductSpecCPQVO
productSpecCPQVO
);
ResultBody
updateProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
);
ResultBody
updateProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
);
ResultBody
getProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
);
ResultBody
getProductSpecCPQ
(
ProductSpecCPQVO
productSpecCPQVO
);
ResultBody
removeProductSku
(
Integer
id
);
ResultBody
removeProductSku
(
Integer
id
);
ResultBody
removeProductSpec
(
Integer
id
);
ResultBody
removeProductSpec
(
Integer
id
);
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
);
BigDecimal
feignGetUnitPriceByTag
(
PriceAcquisition
priceAcquisition
);
}
}
src/main/resources/mapper/ProductDao.xml
浏览文件 @
262bfee5
...
@@ -111,7 +111,7 @@
...
@@ -111,7 +111,7 @@
and product_name like CONCAT ('%',#{productName},'%')
and product_name like CONCAT ('%',#{productName},'%')
</if>
</if>
<if
test=
"categoryId != null"
>
<if
test=
"categoryId != null"
>
and categories = #{categoryId}
and categories
_id
= #{categoryId}
</if>
</if>
<if
test=
"directoryId != null"
>
<if
test=
"directoryId != null"
>
and directory_id = #{directoryId}
and directory_id = #{directoryId}
...
@@ -178,22 +178,32 @@
...
@@ -178,22 +178,32 @@
<select
id=
"countListPageProductSpec"
resultType=
"java.lang.Integer"
>
<select
id=
"countListPageProductSpec"
resultType=
"java.lang.Integer"
>
select count(*)
select count(*)
from product_spec
from product_spec
where is_deleted = 0
<where>
and product_id = #{id}
is_deleted = 0
and product_sku_id = #{id}
<if
test=
"keyword != null and keyword != ''"
>
and spec_name like CONCAT('%',#{keyword},'%')
</if>
</where>
</select>
</select>
<select
id=
"listPageProductSpec"
resultType=
"com.mmc.pms.entity.ProductSpecDO"
>
<select
id=
"listPageProductSpec"
resultType=
"com.mmc.pms.entity.ProductSpecDO"
>
select id,
select id,
product_id
productSkuId,
product_id
productSkuId,
spec_name
specName,
spec_name
specName,
spec_image
specImage,
spec_image
specImage,
part_no
partNo,
part_no
partNo,
version_desc versionDesc,
version_desc versionDesc,
create_time
createTime
create_time
createTime
from product_spec
from product_spec
where is_deleted = 0
<where>
and product_id = #{productSkuId}
is_deleted = 0
and product_id = #{productSkuId}
<if
test=
"keyword != null and keyword != ''"
>
and spec_name like CONCAT('%',#{keyword},'%')
</if>
</where>
order by create_time desc
order by create_time desc
limit #{pageNo}, #{pageSize}
limit #{pageNo}, #{pageSize}
</select>
</select>
<select
id=
"getProductSpecPrice"
resultType=
"com.mmc.pms.entity.ProductSpecPriceDO"
>
<select
id=
"getProductSpecPrice"
resultType=
"com.mmc.pms.entity.ProductSpecPriceDO"
>
select id,
select id,
...
@@ -479,4 +489,17 @@
...
@@ -479,4 +489,17 @@
AND mp.is_deleted = 0
AND mp.is_deleted = 0
AND gi.is_deleted = 0
AND gi.is_deleted = 0
</select>
</select>
<select
id=
"getProductSpecPriceList"
resultType=
"com.mmc.pms.entity.ProductSpecPriceDO"
>
SELECT
id,
product_spec_id productSpecId,
tag_info_id tagInfoId,
price
FROM
product_spec_price
WHERE product_spec_id in (
<foreach
collection=
"list"
separator=
","
index=
"index"
item=
"d"
>
#{d}
</foreach>
)
</select>
</mapper>
</mapper>
src/main/resources/mapper/WebDeviceDao.xml
浏览文件 @
262bfee5
...
@@ -153,14 +153,12 @@
...
@@ -153,14 +153,12 @@
</select>
</select>
<select
id=
"countListWareInfoPage"
parameterType=
"com.mmc.pms.entity.GoodsInfo"
resultType=
"int"
>
<select
id=
"countListWareInfoPage"
parameterType=
"com.mmc.pms.entity.GoodsInfo"
resultType=
"int"
>
SELECT
SELECT count(*)
count(*)
FROM goods_info gi
FROM
goods_info gi
INNER JOIN goods_img img ON gi.id = img.goods_info_id
INNER JOIN goods_img img ON gi.id = img.goods_info_id
<where>
<where>
gi.is_deleted = 0 and gi.shelf_status = 0
gi.is_deleted = 0 and gi.shelf_status = 0
<if
test=
"categoryIds != null"
>
<if
test=
"categoryIds != null
and categoryIds.size != 0
"
>
<foreach
collection=
"categoryIds"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
<foreach
collection=
"categoryIds"
item=
"item"
index=
"index"
open=
"and gi.category_by_one IN ("
close=
")"
separator=
","
>
separator=
","
>
#{item}
#{item}
...
...
src/main/resources/not-check.yml
浏览文件 @
262bfee5
...
@@ -7,3 +7,5 @@ data-filter:
...
@@ -7,3 +7,5 @@ data-filter:
-
/pms/swagger-resources/**
-
/pms/swagger-resources/**
-
/pms/webjars/**
-
/pms/webjars/**
-
/pms/product/spec/feignGetSpecLeaseUnitPrice
-
/pms/product/spec/feignGetSpecLeaseUnitPrice
-
/pms//lease/goods/deviceList
-
/pms/classify/queryCategoryInfoByType
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论