Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
wms_api
Project
Project
Details
Activity
Releases
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
高宇
wms_api
Commits
6934f120
Commit
6934f120
authored
Jun 14, 2024
by
hubaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.4
parent
32dab0d1
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
333 additions
and
100 deletions
+333
-100
WmsGoodsController.java
...g/rcisoft/bus/wmsgoods/controller/WmsGoodsController.java
+11
-1
WmsGoodsRepository.java
...java/org/rcisoft/bus/wmsgoods/dao/WmsGoodsRepository.java
+14
-4
WmsGoods.java
src/main/java/org/rcisoft/bus/wmsgoods/entity/WmsGoods.java
+16
-0
WmsGoodsService.java
...ava/org/rcisoft/bus/wmsgoods/service/WmsGoodsService.java
+8
-1
WmsGoodsServiceImpl.java
...cisoft/bus/wmsgoods/service/impl/WmsGoodsServiceImpl.java
+138
-56
WmsGoodsApplyController.java
...bus/wmsgoodsapply/controller/WmsGoodsApplyController.java
+11
-2
WmsGoodsApplyService.java
...isoft/bus/wmsgoodsapply/service/WmsGoodsApplyService.java
+3
-1
WmsGoodsApplyServiceImpl.java
.../wmsgoodsapply/service/impl/WmsGoodsApplyServiceImpl.java
+23
-6
WmsGoodsStock.java
...a/org/rcisoft/bus/wmsgoodsstock/entity/WmsGoodsStock.java
+16
-13
application-spbt.yml
src/main/resources/application-spbt.yml
+2
-2
WmsGoodsMapper.xml
src/main/resources/mapper/bus/wmsGoods/WmsGoodsMapper.xml
+87
-14
WmsGoodsStockMapper.xml
...esources/mapper/bus/wmsGoodsStock/WmsGoodsStockMapper.xml
+4
-0
No files found.
src/main/java/org/rcisoft/bus/wmsgoods/controller/WmsGoodsController.java
View file @
6934f120
...
...
@@ -51,6 +51,7 @@ public class WmsGoodsController extends CyPaginationController<WmsGoods> {
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoods
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goods:delete')")
@CyOpeLogAnno
(
title
=
"system-商品信息表管理-删除商品信息表"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@ApiOperation
(
value
=
"逻辑删除商品信息表"
,
notes
=
"逻辑删除商品信息表"
)
...
...
@@ -103,7 +104,16 @@ public class WmsGoodsController extends CyPaginationController<WmsGoods> {
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsServiceImpl
.
findById
(
businessId
));
}
@CyOpeLogAnno
(
title
=
"system-商品信息表管理-查询商品信息表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询单一商品信息表"
,
notes
=
"查询单一商品信息表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@GetMapping
(
"/detailGoods/{businessId:\\w+}"
)
public
CyResult
detailGoods
(
@PathVariable
int
businessId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsServiceImpl
.
findByOss
(
businessId
));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goods:list')")
@CyOpeLogAnno
(
title
=
"system-商品信息表管理-查询商品信息表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询商品信息表集合"
,
notes
=
"查询商品信息表集合"
)
...
...
src/main/java/org/rcisoft/bus/wmsgoods/dao/WmsGoodsRepository.java
View file @
6934f120
...
...
@@ -6,12 +6,14 @@ import org.rcisoft.core.mapper.CyBaseMapper;
import
org.rcisoft.bus.wmsgoods.entity.WmsGoods
;
import
org.apache.ibatis.annotations.ResultMap
;
import
org.apache.ibatis.annotations.Select
;
import
org.rcisoft.sys.ossInfo.entity.OssInfo
;
import
org.springframework.stereotype.Repository
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.apache.ibatis.annotations.Param
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created with cy on 2024年5月29日 下午1:21:49.
...
...
@@ -23,11 +25,19 @@ public interface WmsGoodsRepository extends CyBaseMapper<WmsGoods> {
List
<
WmsGoods
>
queryWmsGoods
(
@Param
(
"entity"
)
WmsGoods
wmsGoods
);
/**
* 分页查询 wmsGoods
*
*/
IPage
<
WmsGoods
>
queryWmsGoodssPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
WmsGoods
wmsGoods
);
* 分页查询 wmsGoods
*/
IPage
<
WmsGoods
>
queryWmsGoodssPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
WmsGoods
wmsGoods
);
List
<
WmsGoods
>
queryWmsGoodsByAppId
(
@Param
(
"entity"
)
WmsGoodsApply
wmsGoodsLog
);
List
<
WmsGoods
>
queryWmsGoodsByAppIdOut
(
@Param
(
"entity"
)
WmsGoodsApply
wmsGoodsLog
);
List
<
WmsGoods
>
findByIdGoods
(
@Param
(
"entity"
)
WmsGoods
wmsGoods
);
int
insertOss
(
@Param
(
"entity"
)
List
<
Map
<
String
,
String
>>
wmsGoods
);
List
<
OssInfo
>
findOss
(
@Param
(
"entity"
)
WmsGoods
wmsGoods
);
}
src/main/java/org/rcisoft/bus/wmsgoods/entity/WmsGoods.java
View file @
6934f120
...
...
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
import
lombok.*
;
import
org.rcisoft.core.entity.CyIdIncreEntity
;
import
org.rcisoft.sys.ossInfo.entity.OssInfo
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.io.Serializable
;
...
...
@@ -103,5 +105,19 @@ public class WmsGoods extends CyIdIncreEntity<WmsGoods> {
*/
@TableField
(
exist
=
false
)
private
Integer
goodsCounts
;
@TableField
(
exist
=
false
)
private
List
<
OssInfo
>
ossInfoList
;
@TableField
(
exist
=
false
)
private
Integer
goodsId
;
@TableField
(
exist
=
false
)
private
Integer
ossId
;
/**
* 新增,修改 图片 ids , 分割
*/
@TableField
(
exist
=
false
)
private
String
urlIdList
;
}
src/main/java/org/rcisoft/bus/wmsgoods/service/WmsGoodsService.java
View file @
6934f120
...
...
@@ -2,12 +2,14 @@ package org.rcisoft.bus.wmsgoods.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.rcisoft.bus.wmsgoods.entity.WmsGoods
;
import
org.rcisoft.bus.wmsgoodsapply.entity.WmsGoodsApply
;
import
org.rcisoft.bus.wmsgoodslog.entity.WmsGoodsLog
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.aop.CyPageUtilAsp
;
import
org.rcisoft.core.model.CyPageInfo
;
import
org.rcisoft.sys.ossInfo.entity.OssInfo
;
import
java.util.List
;
...
...
@@ -57,7 +59,7 @@ public interface WmsGoodsService {
* @return
*/
IPage
<
WmsGoods
>
findAllByPagination
(
CyPageInfo
<
WmsGoods
>
paginationUtility
,
WmsGoods
wmsGoods
);
WmsGoods
wmsGoods
);
/**
...
...
@@ -80,5 +82,10 @@ public interface WmsGoodsService {
* @return
*/
List
<
WmsGoods
>
findByApplyId
(
WmsGoodsApply
wmsGoodsLog
);
List
<
WmsGoods
>
findByApplyIdOut
(
WmsGoodsApply
wmsGoodsLog
);
List
<
WmsGoods
>
findByIdGoods
(
int
id
);
WmsGoods
findByOss
(
int
id
);
List
<
OssInfo
>
findOss
(
WmsGoods
wmsGoods
);
}
src/main/java/org/rcisoft/bus/wmsgoods/service/impl/WmsGoodsServiceImpl.java
View file @
6934f120
package
org
.
rcisoft
.
bus
.
wmsgoods
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.bus.wmsgoodsapply.entity.WmsGoodsApply
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.bus.wmsgoods.dao.WmsGoodsRepository
;
import
org.rcisoft.bus.wmsgoods.entity.WmsGoods
;
import
org.rcisoft.bus.wmsgoods.service.WmsGoodsService
;
import
org.rcisoft.sys.ossInfo.dao.OssInfoMapper
;
import
org.rcisoft.sys.ossInfo.entity.OssInfo
;
import
org.rcisoft.sys.ossInfo.service.OssInfoService
;
import
org.rcisoft.sys.ossInfo.service.impl.OssInfoServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.List
;
import
java.util.*
;
import
lombok.extern.slf4j.Slf4j
;
/**
* Created by cy on 2024年5月29日 下午1:21:49.
*/
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
public
class
WmsGoodsServiceImpl
extends
ServiceImpl
<
WmsGoodsRepository
,
WmsGoods
>
implements
WmsGoodsService
{
public
class
WmsGoodsServiceImpl
extends
ServiceImpl
<
WmsGoodsRepository
,
WmsGoods
>
implements
WmsGoodsService
{
/**
* 保存 商品信息表
* @param wmsGoods
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
* 保存 商品信息表
*
* @param wmsGoods
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
persist
(
WmsGoods
wmsGoods
){
public
CyPersistModel
persist
(
WmsGoods
wmsGoods
)
{
WmsGoods
existingGoods
=
baseMapper
.
selectOne
(
new
QueryWrapper
<
WmsGoods
>().
eq
(
"goods_code"
,
wmsGoods
.
getGoodsCode
()));
if
(
existingGoods
!=
null
)
{
throw
new
CyServiceException
(
1001
,
"商品已存在"
);
}
//增加操作
int
line
=
baseMapper
.
insert
(
wmsGoods
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"新增了ID为"
+
wmsGoods
.
getBusinessId
()+
"的商品信息表信息"
);
//插入图片
if
(
StringUtils
.
isNotBlank
(
wmsGoods
.
getUrlIdList
())){
List
<
Map
<
String
,
String
>>
params
=
new
ArrayList
<>();
String
[]
oss_ids
=
wmsGoods
.
getUrlIdList
().
split
(
","
);
Map
<
String
,
String
>
param
=
null
;
for
(
String
id
:
oss_ids
)
{
param
=
new
HashMap
<>();
param
.
put
(
"gid"
,
wmsGoods
.
getBusinessId
()
+
""
);
param
.
put
(
"oid"
,
id
);
params
.
add
(
param
);
}
baseMapper
.
insertOss
(
params
);
}
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
wmsGoods
.
getBusinessId
()
+
"的商品信息表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 删除 商品信息表
* @param wmsGoods
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
* 删除 商品信息表
*
* @param wmsGoods
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
remove
(
WmsGoods
wmsGoods
){
public
CyPersistModel
remove
(
WmsGoods
wmsGoods
)
{
int
line
=
baseMapper
.
realDelete
(
wmsGoods
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"删除了ID为"
+
wmsGoods
.
getBusinessId
()+
"的商品信息表信息"
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"删除了ID为"
+
wmsGoods
.
getBusinessId
()
+
"的商品信息表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 逻辑删除 商品信息表
* @param wmsGoods
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
* 逻辑删除 商品信息表
*
* @param wmsGoods
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
removeLogical
(
WmsGoods
wmsGoods
){
public
CyPersistModel
removeLogical
(
WmsGoods
wmsGoods
)
{
wmsGoods
.
setDeleted
();
int
line
=
baseMapper
.
deleteById
(
wmsGoods
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"逻辑删除了ID为"
+
wmsGoods
.
getBusinessId
()
+
"的商品信息表信息"
);
return
new
CyPersistModel
(
line
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"逻辑删除了ID为"
+
wmsGoods
.
getBusinessId
()
+
"的商品信息表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 修改 商品信息表
* @param wmsGoods
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
* 修改 商品信息表
*
* @param wmsGoods
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
merge
(
WmsGoods
wmsGoods
){
public
CyPersistModel
merge
(
WmsGoods
wmsGoods
)
{
int
line
=
baseMapper
.
updateById
(
wmsGoods
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"修改了ID为"
+
wmsGoods
.
getBusinessId
()+
"的商品信息表信息"
);
// 删除一下 goods_oss by goods
//插入图片
if
(
StringUtils
.
isNotBlank
(
wmsGoods
.
getUrlIdList
())){
List
<
Map
<
String
,
String
>>
params
=
new
ArrayList
<>();
String
[]
oss_ids
=
wmsGoods
.
getUrlIdList
().
split
(
","
);
Map
<
String
,
String
>
param
=
null
;
for
(
String
id
:
oss_ids
)
{
param
=
new
HashMap
<>();
param
.
put
(
"gid"
,
wmsGoods
.
getBusinessId
()
+
""
);
param
.
put
(
"oid"
,
id
);
params
.
add
(
param
);
}
baseMapper
.
insertOss
(
params
);
}
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
wmsGoods
.
getBusinessId
()
+
"的商品信息表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 根据id查询 商品信息表
* @param id
* @return
*/
* 根据id查询 商品信息表
*
* @param id
* @return
*/
// @Override
// public WmsGoods findById(int id) {
// WmsGoods wmsGoods = baseMapper.selectById(id);
// ossInfoMapper.selectBatchIds()
// return wmsGoods;
// }
@Override
public
WmsGoods
findById
(
int
id
){
public
WmsGoods
findById
(
int
id
)
{
return
baseMapper
.
selectById
(
id
);
}
/**
* 分页查询 商品信息表
* @param wmsGoods
* @return
*/
* 分页查询 商品信息表
*
* @param wmsGoods
* @return
*/
@Override
public
IPage
<
WmsGoods
>
findAllByPagination
(
CyPageInfo
<
WmsGoods
>
paginationUtility
,
WmsGoods
wmsGoods
){
return
baseMapper
.
queryWmsGoodssPaged
(
paginationUtility
,
wmsGoods
);
WmsGoods
wmsGoods
)
{
IPage
<
WmsGoods
>
wmsGoodsIPage
=
baseMapper
.
queryWmsGoodssPaged
(
paginationUtility
,
wmsGoods
);
wmsGoodsIPage
.
getRecords
().
forEach
(
record
->{
record
.
setOssInfoList
(
baseMapper
.
findOss
(
record
));
});
return
wmsGoodsIPage
;
}
/**
* 查询list 商品信息表
* @param wmsGoods
* @return
*/
* 查询list 商品信息表
*
* @param wmsGoods
* @return
*/
@Override
public
List
<
WmsGoods
>
findAll
(
WmsGoods
wmsGoods
){
public
List
<
WmsGoods
>
findAll
(
WmsGoods
wmsGoods
)
{
return
baseMapper
.
queryWmsGoods
(
wmsGoods
);
}
/**
* 导出商品信息表
* @return
*/
* 导出商品信息表
*
* @return
*/
@Override
public
List
<
WmsGoods
>
export
(
WmsGoods
wmsGoods
)
{
List
<
WmsGoods
>
wmsGoodsList
=
baseMapper
.
queryWmsGoods
(
wmsGoods
);
...
...
@@ -133,4 +191,28 @@ public class WmsGoodsServiceImpl extends ServiceImpl<WmsGoodsRepository,WmsGoods
return
baseMapper
.
queryWmsGoodsByAppId
(
wmsGoodsLog
);
}
@Override
public
List
<
WmsGoods
>
findByApplyIdOut
(
WmsGoodsApply
wmsGoodsLog
)
{
return
baseMapper
.
queryWmsGoodsByAppIdOut
(
wmsGoodsLog
);
}
@Override
public
List
<
WmsGoods
>
findByIdGoods
(
int
id
)
{
WmsGoods
wmsGoods
=
new
WmsGoods
();
wmsGoods
.
setGoodsId
(
id
);
return
baseMapper
.
findByIdGoods
(
wmsGoods
);
}
@Override
public
WmsGoods
findByOss
(
int
id
)
{
WmsGoods
goods
=
baseMapper
.
selectById
(
id
);
goods
.
setOssInfoList
(
baseMapper
.
findOss
(
goods
));
return
goods
;
}
@Override
public
List
<
OssInfo
>
findOss
(
WmsGoods
wmsGoods
)
{
return
baseMapper
.
findOss
(
wmsGoods
);
}
}
src/main/java/org/rcisoft/bus/wmsgoodsapply/controller/WmsGoodsApplyController.java
View file @
6934f120
...
...
@@ -97,7 +97,7 @@ public class WmsGoodsApplyController extends CyPaginationController<WmsGoodsAppl
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsApplyServiceImpl
.
A
ppCode
());
wmsGoodsApplyServiceImpl
.
a
ppCode
());
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsApply:delete')")
@CyOpeLogAnno
(
title
=
"system-商品申请表管理-删除商品申请表"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
...
...
@@ -151,7 +151,16 @@ public class WmsGoodsApplyController extends CyPaginationController<WmsGoodsAppl
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsApplyServiceImpl
.
findById
(
businessId
));
}
@CyOpeLogAnno
(
title
=
"system-商品申请表管理-查询商品申请表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询单一商品申请表"
,
notes
=
"查询单一商品申请表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)})
@GetMapping
(
"/detailOut/{businessId:\\w+}"
)
public
CyResult
detailOut
(
@PathVariable
int
businessId
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsApplyServiceImpl
.
findByIdOut
(
businessId
));
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsApply:list')")
@CyOpeLogAnno
(
title
=
"system-商品申请表管理-查询商品申请表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询商品申请表集合"
,
notes
=
"查询商品申请表集合"
)
...
...
src/main/java/org/rcisoft/bus/wmsgoodsapply/service/WmsGoodsApplyService.java
View file @
6934f120
...
...
@@ -20,7 +20,7 @@ public interface WmsGoodsApplyService {
*/
CyPersistModel
persist
(
WmsGoodsApply
wmsGoodsApply
);
String
A
ppCode
();
String
a
ppCode
();
/**
* 删除 商品申请表
...
...
@@ -77,4 +77,6 @@ public interface WmsGoodsApplyService {
CyPersistModel
batchPersist
(
AddWmsGoodsApplyDTO
wmsGoodsApply
);
CyPersistModel
batchOutPersist
(
AddWmsGoodsApplyDTO
wmsGoodsApply
);
WmsGoodsApply
findByIdOut
(
int
id
);
}
src/main/java/org/rcisoft/bus/wmsgoodsapply/service/impl/WmsGoodsApplyServiceImpl.java
View file @
6934f120
package
org
.
rcisoft
.
bus
.
wmsgoodsapply
.
service
.
impl
;
import
cn.afterturn.easypoi.exception.excel.ExcelImportException
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.rcisoft.bus.wmsgoods.entity.WmsGoods
;
...
...
@@ -34,6 +35,7 @@ import java.util.Date;
import
java.util.List
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.CollectionUtils
;
/**
* Created by cy on 2024年5月29日 下午1:21:49.
...
...
@@ -53,6 +55,7 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
/**
* 保存 商品申请表
*
* @param wmsGoodsApply
* @return
*/
...
...
@@ -78,6 +81,9 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
wmsGoodsApply
.
setDealStatus
(
"0"
);
baseMapper
.
insert
(
wmsGoodsApply
);
//空
if
(
CollectionUtil
.
isEmpty
(
addwmsGoodsApply
.
getBoxList
()))
{
throw
new
CyServiceException
(
1001
,
"出库单为空"
);
}
List
<
WmsGoodsLog
>
logList
=
new
ArrayList
<>();
WmsGoodsLog
log
=
null
;
for
(
WmsGoods
box
:
addwmsGoodsApply
.
getBoxList
())
{
...
...
@@ -88,7 +94,7 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
WmsGoodsStock
goodsStock
=
wmsGoodsStockRepositoryImpl
.
findById
(
box
.
getBusinessId
());
if
(
goodsStock
==
null
)
{
WmsGoodsStock
newGoodsStock
=
new
WmsGoodsStock
();
newGoodsStock
.
setGoodsId
(
addwmsGoodsApply
.
getBoxList
().
get
(
0
)
.
getBusinessId
());
newGoodsStock
.
setGoodsId
(
box
.
getBusinessId
());
newGoodsStock
.
setGoodsCounts
(
box
.
getInCounts
());
wmsGoodsStockRepositoryImpl
.
persist
(
newGoodsStock
);
}
else
{
...
...
@@ -96,14 +102,14 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
wmsGoodsStockRepositoryImpl
.
updateCounts
(
goodsStock
);
}
//日志
WmsGoodsStock
wmsgoodsStock
=
wmsGoodsStockRepositoryImpl
.
findById
(
box
.
getBusinessId
());
log
.
setApplyId
(
wmsGoodsApply
.
getBusinessId
());
log
.
setGoodsId
(
box
.
getBusinessId
());
log
.
setGoodsCounts
(
box
.
getInCounts
());
log
.
setIoType
(
"0"
);
log
.
setUpdateCounts
(
wmsgoodsStock
.
getGoods
Counts
());
log
.
setUpdateCounts
(
goodsStock
!=
null
?
goodsStock
.
getGoodsCounts
()
:
box
.
getIn
Counts
());
logList
.
add
(
log
);
}
wmsGoodsLogServiceImpl
.
batchPersist
(
logList
);
return
new
CyPersistModel
(
1
);
}
...
...
@@ -120,6 +126,8 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
// 1. 集合空 判断
if
(
CollectionUtil
.
isEmpty
(
addwmsGoodsApply
.
getBoxList
()))
throw
new
CyServiceException
(
1001
,
"入库商品为空!"
);
// 出库
WmsGoodsApply
wmsGoodsApplyOut
=
new
WmsGoodsApply
();
BeanUtils
.
copyProperties
(
addwmsGoodsApply
,
wmsGoodsApplyOut
);
...
...
@@ -160,9 +168,18 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
return
new
CyPersistModel
(
1
);
}
@Override
public
WmsGoodsApply
findByIdOut
(
int
id
)
{
WmsGoodsApply
apply
=
baseMapper
.
selectById
(
id
);
if
(
apply
==
null
)
{
throw
new
CyServiceException
(
1001
,
"入库申请不存在"
);
}
apply
.
setWmsGoods
(
wmsGoodsServiceImpl
.
findByApplyIdOut
(
apply
));
return
apply
;
}
@Override
public
String
A
ppCode
()
{
public
String
a
ppCode
()
{
// 获取当前时间
Date
date
=
new
Date
();
// 设置日期格式
...
...
@@ -175,8 +192,8 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
// 获取当前日期
LocalDate
currentDate
=
LocalDate
.
now
();
// 编号前缀
String
A
ppCode
=
codePrefix
+
formattedDate
+
formattedCount
;
return
A
ppCode
;
String
a
ppCode
=
codePrefix
+
formattedDate
+
formattedCount
;
return
a
ppCode
;
}
/**
...
...
src/main/java/org/rcisoft/bus/wmsgoodsstock/entity/WmsGoodsStock.java
View file @
6934f120
package
org
.
rcisoft
.
bus
.
wmsgoodsstock
.
entity
;
import
cn.afterturn.easypoi.excel.annotation.Excel
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.*
;
import
org.rcisoft.core.entity.CyIdIncreEntity
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
import
java.io.Serializable
;
...
...
@@ -11,29 +14,29 @@ import java.util.Date;
import
java.util.List
;
/**
* Created with cy on 2024年5月29日 下午1:21:49.
*/
* Created with cy on 2024年5月29日 下午1:21:49.
*/
@Data
@TableName
(
"wms_goods_stock"
)
public
class
WmsGoodsStock
extends
CyIdIncreEntity
<
WmsGoodsStock
>
{
public
class
WmsGoodsStock
extends
CyIdIncreEntity
<
WmsGoodsStock
>
{
/**
/**
* @desc 商品id
* @column goods_id
* @default
* @default
*/
@Excel
(
name
=
"商品id"
,
orderNum
=
"0"
,
width
=
20
)
private
Integer
goodsId
;
@Excel
(
name
=
"商品id"
,
orderNum
=
"0"
,
width
=
20
)
private
Integer
goodsId
;
/**
/**
* @desc 商品数量
* @column goods_counts
* @default
* @default
*/
@Excel
(
name
=
"商品数量"
,
orderNum
=
"1"
,
width
=
20
)
private
Integer
goodsCounts
;
@Excel
(
name
=
"商品数量"
,
orderNum
=
"1"
,
width
=
20
)
private
Integer
goodsCounts
;
@TableField
(
exist
=
false
)
private
Integer
inventoryValue
;
}
src/main/resources/application-spbt.yml
View file @
6934f120
...
...
@@ -109,8 +109,8 @@ cy:
stringOutputType
:
base64
global
:
path
:
base_upload_location
:
D:\
14406\Pictures
base_discovery
:
'
http://192.168.1
.12:8888/eduServer
/'
base_upload_location
:
D:\
soft\nginx-1.24.0\html\upload
base_discovery
:
'
http://192.168.1
0.185/upload
/'
code_generate_location
:
/code
video_location
:
/video
temp_location
:
/temp
...
...
src/main/resources/mapper/bus/wmsGoods/WmsGoodsMapper.xml
View file @
6934f120
...
...
@@ -24,6 +24,14 @@
<!--回显 入库/出库 列表-->
<result
column=
"goods_counts"
jdbcType=
"VARCHAR"
property=
"goodsCounts"
/>
</resultMap>
<insert
id=
"insertOss"
>
insert into
wms_goods_oss(goods_id,oss_id)
values
<foreach
collection=
"entity"
item=
"item"
separator=
","
>
(#{item.gid},#{item.oid})
</foreach>
</insert>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select
id=
"queryWmsGoods"
resultMap=
"BaseResultMap"
>
...
...
@@ -67,42 +75,46 @@
</select>
<select
id=
"queryWmsGoodssPaged"
resultMap=
"BaseResultMap"
>
select * from wms_goods
where 1=1
and del_flag = '0'
SELECT
wg.*
FROM
wms_goods wg
WHERE
wg.del_flag = '0'
<if
test=
"entity.flag !=null and entity.flag != '' "
>
and flag = #{entity.flag}
and
wg.
flag = #{entity.flag}
</if>
<if
test=
"entity.goodsName !=null and entity.goodsName != '' "
>
and goods_name like concat('%',#{entity.goodsName},'%')
and
wg.
goods_name like concat('%',#{entity.goodsName},'%')
</if>
<if
test=
"entity.goodsDictName !=null and entity.goodsDictName != '' "
>
and goods_dict_name like concat('%',#{entity.goodsDictName},'%')
and
wg.
goods_dict_name like concat('%',#{entity.goodsDictName},'%')
</if>
<if
test=
"entity.goodsCode !=null and entity.goodsCode != '' "
>
and
goods_code like concat('%',#{entity.goodsCode},'%')
and
wg.goods_code = #{entity.goodsCode}
</if>
<if
test=
"entity.goodsStyle !=null and entity.goodsStyle != '' "
>
and goods_style like concat('%',#{entity.goodsStyle},'%')
and
wg.
goods_style like concat('%',#{entity.goodsStyle},'%')
</if>
<if
test=
"entity.goodsArtNumber !=null and entity.goodsArtNumber != '' "
>
and goods_art_number like concat('%',#{entity.goodsArtNumber},'%')
and
wg.
goods_art_number like concat('%',#{entity.goodsArtNumber},'%')
</if>
<if
test=
"entity.goodsSeason !=null and entity.goodsSeason != '' "
>
and goods_season like concat('%',#{entity.goodsSeason},'%')
and
wg.
goods_season like concat('%',#{entity.goodsSeason},'%')
</if>
<if
test=
"entity.goodsColour !=null and entity.goodsColour != '' "
>
and goods_colour like concat('%',#{entity.goodsColour},'%')
and
wg.
goods_colour like concat('%',#{entity.goodsColour},'%')
</if>
<if
test=
"entity.goodsNorms !=null and entity.goodsNorms != '' "
>
and goods_norms like concat('%',#{entity.goodsNorms},'%')
and
wg.
goods_norms like concat('%',#{entity.goodsNorms},'%')
</if>
<if
test=
"entity.goodsSize !=null and entity.goodsSize != '' "
>
and goods_size like concat('%',#{entity.goodsSize},'%')
and
wg.
goods_size like concat('%',#{entity.goodsSize},'%')
</if>
<if
test=
"entity.goodsBrand !=null and entity.goodsBrand != '' "
>
and goods_brand like concat('%',#{entity.goodsBrand},'%')
and
wg.
goods_brand like concat('%',#{entity.goodsBrand},'%')
</if>
ORDER BY business_id DESC
</select>
...
...
@@ -118,4 +130,65 @@
where log.apply_id = #{entity.businessId}
</select>
<select
id=
"queryWmsGoodsByAppIdOut"
resultMap=
"BaseResultMap"
>
SELECT
log.goods_counts as outCounts,
goods.*
FROM
wms_goods_log log
LEFT JOIN wms_goods goods ON log.goods_id = goods.business_id
where log.apply_id = #{entity.businessId}
</select>
<select
id=
"findByIdGoods"
resultMap=
"BaseResultMap"
>
select wg.*,oi.url from wms_goods_oss wgo join wms_goods wg on wg.business_id = wgo.goods_id
join oss_info oi on wgo.oss_id = oi.business_id
where 1=1
and wg.del_flag = '0' and oi.del_flag = '0'
<if
test=
"entity.flag !=null and entity.flag != '' "
>
and wg.flag = #{entity.flag}
</if>
<if
test=
"entity.goodsName !=null and entity.goodsName != '' "
>
and wg.goods_name like concat('%',#{entity.goodsName},'%')
</if>
<if
test=
"entity.goodsDictName !=null and entity.goodsDictName != '' "
>
and wg.goods_dict_name like concat('%',#{entity.goodsDictName},'%')
</if>
<if
test=
"entity.goodsCode !=null and entity.goodsCode != '' "
>
and wg.goods_code = #{entity.goodsCode}
</if>
<if
test=
"entity.goodsStyle !=null and entity.goodsStyle != '' "
>
and wg.goods_style like concat('%',#{entity.goodsStyle},'%')
</if>
<if
test=
"entity.goodsArtNumber !=null and entity.goodsArtNumber != '' "
>
and wg.goods_art_number like concat('%',#{entity.goodsArtNumber},'%')
</if>
<if
test=
"entity.goodsSeason !=null and entity.goodsSeason != '' "
>
and wg.goods_season like concat('%',#{entity.goodsSeason},'%')
</if>
<if
test=
"entity.goodsColour !=null and entity.goodsColour != '' "
>
and wg.goods_colour like concat('%',#{entity.goodsColour},'%')
</if>
<if
test=
"entity.goodsNorms !=null and entity.goodsNorms != '' "
>
and wg.goods_norms like concat('%',#{entity.goodsNorms},'%')
</if>
<if
test=
"entity.goodsSize !=null and entity.goodsSize != '' "
>
and wg.goods_size like concat('%',#{entity.goodsSize},'%')
</if>
<if
test=
"entity.goodsBrand !=null and entity.goodsBrand != '' "
>
and wg.goods_brand like concat('%',#{entity.goodsBrand},'%')
</if>
ORDER BY business_id DESC
</select>
<select
id=
"findOss"
resultType=
"org.rcisoft.sys.ossInfo.entity.OssInfo"
>
select oi.* from wms_goods_oss wgo
join wms_goods wg on wg.business_id = wgo.goods_id
join oss_info oi on wgo.oss_id = oi.business_id
where 1=1
and wg.del_flag='0' and oi.del_flag='0'
and wgo.goods_id = #{entity.businessId}
</select>
</mapper>
src/main/resources/mapper/bus/wmsGoodsStock/WmsGoodsStockMapper.xml
View file @
6934f120
...
...
@@ -36,6 +36,7 @@
<result
column=
"goods_norms"
jdbcType=
"VARCHAR"
property=
"goodsNorms"
/>
<result
column=
"goods_size"
jdbcType=
"VARCHAR"
property=
"goodsSize"
/>
<result
column=
"goods_brand"
jdbcType=
"VARCHAR"
property=
"goodsBrand"
/>
<result
column=
"inventoryValue"
jdbcType=
"INTEGER"
property=
"inventoryValue"
/>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
...
...
@@ -123,6 +124,9 @@
<if
test=
"entity.goodsBrand !=null and entity.goodsBrand != '' "
>
and wg.goods_brand = #{entity.goodsBrand}
</if>
<if
test=
"entity.inventoryValue != null and entity.inventoryValue != ''"
>
and wgs.goods_counts
<
#{entity.inventoryValue}
</if>
ORDER BY wgs.business_id ASC
</select>
</mapper>
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