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
8b871ec3
Commit
8b871ec3
authored
Jun 10, 2024
by
hubaoshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wms
parent
08e9c5c4
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
219 additions
and
332 deletions
+219
-332
WmsGoodsApplyController.java
...bus/wmsgoodsapply/controller/WmsGoodsApplyController.java
+19
-10
WmsGoodsApplyRepository.java
...cisoft/bus/wmsgoodsapply/dao/WmsGoodsApplyRepository.java
+2
-0
WmsGoodsApply.java
...a/org/rcisoft/bus/wmsgoodsapply/entity/WmsGoodsApply.java
+5
-64
WmsGoodsApplyService.java
...isoft/bus/wmsgoodsapply/service/WmsGoodsApplyService.java
+3
-1
WmsGoodsApplyServiceImpl.java
.../wmsgoodsapply/service/impl/WmsGoodsApplyServiceImpl.java
+39
-109
WmsGoodsLogController.java
...oft/bus/wmsgoodslog/controller/WmsGoodsLogController.java
+11
-0
WmsGoodsLogRepository.java
...rg/rcisoft/bus/wmsgoodslog/dao/WmsGoodsLogRepository.java
+2
-0
AddLogList.java
...main/java/org/rcisoft/bus/wmsgoodslog/dto/AddLogList.java
+10
-0
WmsGoodsLog.java
.../java/org/rcisoft/bus/wmsgoodslog/entity/WmsGoodsLog.java
+3
-31
WmsGoodsLogService.java
...g/rcisoft/bus/wmsgoodslog/service/WmsGoodsLogService.java
+2
-0
WmsGoodsLogServiceImpl.java
.../bus/wmsgoodslog/service/impl/WmsGoodsLogServiceImpl.java
+80
-53
WmsGoodsStockController.java
...bus/wmsgoodsstock/controller/WmsGoodsStockController.java
+12
-1
WmsGoodsStockService.java
...isoft/bus/wmsgoodsstock/service/WmsGoodsStockService.java
+1
-0
WmsGoodsStockServiceImpl.java
.../wmsgoodsstock/service/impl/WmsGoodsStockServiceImpl.java
+8
-0
WmsGoodsApplyMapper.xml
...esources/mapper/bus/wmsGoodsApply/WmsGoodsApplyMapper.xml
+10
-61
WmsGoodsLogMapper.xml
...in/resources/mapper/bus/wmsGoodsLog/WmsGoodsLogMapper.xml
+12
-2
No files found.
src/main/java/org/rcisoft/bus/wmsgoodsapply/controller/WmsGoodsApplyController.java
View file @
8b871ec3
...
...
@@ -71,6 +71,15 @@ public class WmsGoodsApplyController extends CyPaginationController<WmsGoodsAppl
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsApply
);
}
@CyOpeLogAnno
(
title
=
"获取单号"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"获取单号"
,
notes
=
"获取单号"
)
@GetMapping
(
value
=
"/getCode"
)
public
CyResult
getCode
()
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsApplyServiceImpl
.
AppCode
());
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsApply:delete')")
@CyOpeLogAnno
(
title
=
"system-商品申请表管理-删除商品申请表"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@ApiOperation
(
value
=
"逻辑删除商品申请表"
,
notes
=
"逻辑删除商品申请表"
)
...
...
@@ -246,14 +255,14 @@ public class WmsGoodsApplyController extends CyPaginationController<WmsGoodsAppl
}
@CyOpeLogAnno
(
title
=
"system-检查申请管理-导入检查申请数据"
,
businessType
=
CyLogTypeEnum
.
IMPORT
)
@ApiOperation
(
value
=
"导入检查申请数据"
,
notes
=
"导入检查申请数据"
)
@PostMapping
(
value
=
"/importGoodsData"
)
@CyEncryptSm4Anno
public
CyResult
importGoodsData
(
MultipartFile
file
)
{
return
CyResultGenUtil
.
builder
(
new
CyPersistModel
(
1
),
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsApplyServiceImpl
.
importGoodsExcel
(
file
));
}
//
@CyOpeLogAnno(title = "system-检查申请管理-导入检查申请数据", businessType = CyLogTypeEnum.IMPORT)
//
@ApiOperation(value = "导入检查申请数据", notes = "导入检查申请数据")
//
@PostMapping(value = "/importGoodsData")
//
@CyEncryptSm4Anno
//
public CyResult importGoodsData(MultipartFile file) {
//
return CyResultGenUtil.builder(new CyPersistModel(1),
//
CyMessCons.MESSAGE_ALERT_SUCCESS,
//
CyMessCons.MESSAGE_ALERT_ERROR,
//
wmsGoodsApplyServiceImpl.importGoodsExcel(file));
//
}
}
src/main/java/org/rcisoft/bus/wmsgoodsapply/dao/WmsGoodsApplyRepository.java
View file @
8b871ec3
...
...
@@ -30,5 +30,7 @@ public interface WmsGoodsApplyRepository extends CyBaseMapper<WmsGoodsApply> {
void
batchAdd
(
@Param
(
"list"
)
List
<
WmsGoodsApply
>
list
);
ImportGoodsTempDto
importGoodsExcel
(
MultipartFile
file
);
int
getOrderCodeCount
(
String
data
);
}
src/main/java/org/rcisoft/bus/wmsgoodsapply/entity/WmsGoodsApply.java
View file @
8b871ec3
...
...
@@ -3,6 +3,7 @@ import cn.afterturn.easypoi.excel.annotation.Excel;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.*
;
import
org.rcisoft.bus.wmsgoods.entity.WmsGoods
;
import
org.rcisoft.core.entity.CyIdIncreEntity
;
import
java.math.BigDecimal
;
import
java.math.BigInteger
;
...
...
@@ -18,62 +19,6 @@ import java.util.List;
public
class
WmsGoodsApply
extends
CyIdIncreEntity
<
WmsGoodsApply
>
{
/**
* @desc 商品编码
* @column goods_code
* @default
*/
@Excel
(
name
=
"商品编码"
,
orderNum
=
"0"
,
width
=
20
)
private
String
goodsCode
;
/**
* @desc 商品类型
* @column goods_type
* @default
*/
@Excel
(
name
=
"商品类型"
,
orderNum
=
"1"
,
width
=
20
)
private
String
goodsType
;
/**
* @desc 颜色
* @column goods_article_number
* @default
*/
@Excel
(
name
=
"颜色"
,
orderNum
=
"2"
,
width
=
20
)
private
String
goodsArticleNumber
;
/**
* @desc 小类
* @column goods_subclass
* @default
*/
@Excel
(
name
=
"小类"
,
orderNum
=
"3"
,
width
=
20
)
private
String
goodsSubclass
;
/**
* @desc 颜色
* @column goods_colour
* @default
*/
@Excel
(
name
=
"颜色"
,
orderNum
=
"4"
,
width
=
20
)
private
String
goodsColour
;
/**
* @desc 规格
* @column goods_norms
* @default
*/
@Excel
(
name
=
"规格"
,
orderNum
=
"5"
,
width
=
20
)
private
String
goodsNorms
;
/**
* @desc 编码
* @column goods_size
* @default
*/
@Excel
(
name
=
"编码"
,
orderNum
=
"6"
,
width
=
20
)
private
String
goodsSize
;
/**
* @desc 0出1入
* @column io_type
...
...
@@ -90,13 +35,7 @@ public class WmsGoodsApply extends CyIdIncreEntity<WmsGoodsApply> {
@Excel
(
name
=
"0 未出库 1 已出库"
,
orderNum
=
"8"
,
width
=
20
)
private
String
dealStatus
;
/**
* @desc 0 待确认 1 已确认
* @column sure_status
* @default
*/
@Excel
(
name
=
"0 待确认 1 已确认"
,
orderNum
=
"9"
,
width
=
20
)
private
String
sureStatus
;
/**
* @desc 数量
...
...
@@ -166,6 +105,8 @@ public class WmsGoodsApply extends CyIdIncreEntity<WmsGoodsApply> {
private
String
inGoods
;
@Excel
(
name
=
"出库"
,
orderNum
=
"17"
,
width
=
20
)
private
String
outGoods
;
private
String
goodsNumber
;
// private List<WmsGoods> enterTable;
//private Integer goodsId;
}
src/main/java/org/rcisoft/bus/wmsgoodsapply/service/WmsGoodsApplyService.java
View file @
8b871ec3
...
...
@@ -23,6 +23,8 @@ public interface WmsGoodsApplyService {
*/
CyPersistModel
persist
(
WmsGoodsApply
wmsGoodsApply
);
String
AppCode
();
/**
* 删除 商品申请表
* @param wmsGoodsApply
...
...
@@ -73,5 +75,5 @@ public interface WmsGoodsApplyService {
* @return
*/
List
<
WmsGoodsApply
>
export
(
WmsGoodsApply
wmsGoodsApply
);
ImportGoodsTempDto
importGoodsExcel
(
MultipartFile
file
);
}
src/main/java/org/rcisoft/bus/wmsgoodsapply/service/impl/WmsGoodsApplyServiceImpl.java
View file @
8b871ec3
package
org
.
rcisoft
.
bus
.
wmsgoodsapply
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.rcisoft.bus.util.EpExcelUtil
;
import
org.rcisoft.bus.wmsgoodsapply.dto.ExportEntryDto
;
import
org.rcisoft.bus.wmsgoodsapply.dto.ImportGoodsTempDto
;
import
org.rcisoft.core.exception.CyServiceException
;
import
org.rcisoft.bus.wmsgoodsstock.entity.WmsGoodsStock
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.aop.CyPageUtilAsp
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.util.CyEpExcelUtil
;
import
org.rcisoft.bus.wmsgoodsapply.dao.WmsGoodsApplyRepository
;
import
org.rcisoft.bus.wmsgoodsapply.entity.WmsGoodsApply
;
import
org.rcisoft.bus.wmsgoodsapply.service.WmsGoodsApplyService
;
import
org.rcisoft.
core.service.CyBase
Service
;
import
org.rcisoft.
bus.wmsgoodsstock.service.WmsGoodsStock
Service
;
import
org.rcisoft.sys.dictionary.dao.DictDataRepository
;
import
org.rcisoft.sys.dictionary.dto.DictDataDTO
;
import
org.rcisoft.sys.dictionary.entity.DictData
;
import
org.rcisoft.sys.rbac.user.enums.UserInfoExceptionEnums
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -31,13 +20,12 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.math.BigInteger
;
import
java.text.SimpleDateFormat
;
import
java.
util.ArrayList
;
import
java.
time.LocalDate
;
import
java.util.Date
;
import
java.util.List
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.util.ObjectUtils
;
import
org.springframework.web.multipart.MultipartFile
;
/**
* Created by cy on 2024年5月29日 下午1:21:49.
...
...
@@ -49,6 +37,10 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
@Autowired
private
DictDataRepository
dictDataRepository
;
@Autowired
private
WmsGoodsStockService
wmsGoodsStockRepositoryImpl
;
/**
* 保存 商品申请表
* @param wmsGoodsApply
...
...
@@ -58,12 +50,41 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
@Override
public
CyPersistModel
persist
(
WmsGoodsApply
wmsGoodsApply
){
//增加操作
//1.查库存表有没有对应的code 有则更新数量 没有则向库存表中插入
//2.向日志表中添加对应的信息
WmsGoodsStock
wmsGoodsStock
=
new
WmsGoodsStock
();
BeanUtils
.
copyProperties
(
wmsGoodsApply
,
wmsGoodsStock
);
List
<
WmsGoodsStock
>
wmsGoodsStockList
=
wmsGoodsStockRepositoryImpl
.
findAll
(
wmsGoodsStock
);
if
(
CollectionUtil
.
isEmpty
(
wmsGoodsStockList
)){
wmsGoodsStockRepositoryImpl
.
updateInCounts
(
wmsGoodsStock
);
}
else
{
wmsGoodsStockRepositoryImpl
.
persist
(
wmsGoodsStock
);
}
wmsGoodsApply
.
setIoType
(
"0"
);
wmsGoodsApply
.
setDealStatus
(
"0"
);
int
line
=
baseMapper
.
insert
(
wmsGoodsApply
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"新增了ID为"
+
wmsGoodsApply
.
getBusinessId
()+
"的商品申请表信息"
);
return
new
CyPersistModel
(
line
);
}
@Override
public
String
AppCode
()
{
// 获取当前时间
Date
date
=
new
Date
();
// 设置日期格式
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
// 格式化日期
String
formattedDate
=
sdf
.
format
(
date
);
String
codePrefix
=
"RX"
;
int
OrderCodeCount
=
baseMapper
.
getOrderCodeCount
(
codePrefix
+
formattedDate
)
+
1
;
String
formattedCount
=
String
.
format
(
"%03d"
,
OrderCodeCount
);
// 获取当前日期
LocalDate
currentDate
=
LocalDate
.
now
();
// 编号前缀
String
AppCode
=
codePrefix
+
formattedDate
+
formattedCount
;
return
AppCode
;
}
/**
* 删除 商品申请表
* @param wmsGoodsApply
...
...
@@ -149,98 +170,7 @@ public class WmsGoodsApplyServiceImpl extends ServiceImpl<WmsGoodsApplyRepositor
return
wmsGoodsApplyList
;
}
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Override
public
ImportGoodsTempDto
importGoodsExcel
(
MultipartFile
file
)
{
// 错误集合
List
<
String
>
errors
=
new
ArrayList
<>();
// 将excel文件转换为list集合
List
<
ExportEntryDto
>
dataList
=
EpExcelUtil
.
importExcelNotTitle
(
file
,
1
,
1
,
ExportEntryDto
.
class
);
// 判断文件的信息是否存在 这种方法的效率太慢 但是可以用
if
(
dataList
.
isEmpty
()){
throw
new
CyServiceException
(
UserInfoExceptionEnums
.
EXCEL_NULL
);
}
/**
* 进行校验 校验规则如下
* 1.单号 PN lot rank 数量 备注 都是必填 如果有一个为空 将其过滤掉
* 2.数量为正整数
* 3.仓库如果匹配不上 或者为空 按第一个仓库走
* 4.成功返回了多少条
* **/
// 要添加的数据集合
List
<
WmsGoodsApply
>
addGoodsList
=
new
ArrayList
<>();
// 获取code的初值
// 获取当前时间
Date
date
=
new
Date
();
// 设置日期格式
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMdd"
);
// 格式化日期
sdf
.
format
(
date
);
for
(
int
i
=
0
;
i
<
dataList
.
size
()
;
i
++)
{
WmsGoodsApply
one
=
new
WmsGoodsApply
();
// goodscode 都是必填 如果有一个为空 过滤起数据
if
(
StringUtils
.
isNotBlank
(
dataList
.
get
(
i
).
getGoodsCode
()))
{
BeanUtils
.
copyProperties
(
dataList
.
get
(
i
),
one
);
// 将空格和回车去掉
one
.
setGoodsCode
(
this
.
removeSymbol
(
one
.
getGoodsCode
()));
// 获取全部厂家的map
if
(!
ObjectUtils
.
isEmpty
(
one
))
{
addGoodsList
.
add
(
one
);
}
}
}
// 获取所有仓库数据
DictDataDTO
dictData
=
new
DictDataDTO
();
dictData
.
setFlag
(
"1"
);
dictData
.
setDictType
(
"GOODS_TYPE"
);
List
<
DictData
>
dictDataList
=
dictDataRepository
.
querySysDictDatas
(
dictData
);
if
(
dictDataList
.
isEmpty
())
errors
.
add
(
"请在数据字典中添加仓库字典数据"
);
if
(!
errors
.
isEmpty
())
{
throw
new
CyServiceException
(
503
,
errors
.
get
(
0
));
}
// 处理要添加的数据
log
.
info
(
"addJbapplyTempList: {}"
,
addGoodsList
);
ImportGoodsTempDto
importGoodsTempDto
=
new
ImportGoodsTempDto
();
if
(
addGoodsList
.
isEmpty
())
{
importGoodsTempDto
.
setRows
(
0
);
importGoodsTempDto
.
setTotal
(
dataList
.
size
());
return
importGoodsTempDto
;
}
addGoodsList
.
forEach
(
item
->
{
item
.
setCreateBy
(
CyUserUtil
.
getAuthenBusinessId
());
item
.
setCreateDate
(
new
Date
());
item
.
setUpdateBy
(
CyUserUtil
.
getAuthenBusinessId
());
item
.
setUpdateDate
(
new
Date
());
item
.
setDealStatus
(
"0"
);
item
.
setFlag
(
"1"
);
if
(
item
.
getGoodsType
()
==
null
)
{
item
.
setGoodsType
(
dictDataList
.
get
(
0
).
getDictValue
());
}
else
{
// 将仓库值转换成value值
QueryWrapper
<
DictData
>
queryWrapper
=
new
QueryWrapper
<>();
queryWrapper
.
eq
(
"dict_type"
,
"GOODS_TYPE"
);
queryWrapper
.
eq
(
"dict_label"
,
item
.
getGoodsType
());
List
<
DictData
>
GoodsTypeData
=
dictDataRepository
.
selectList
(
queryWrapper
);
if
(
GoodsTypeData
.
isEmpty
())
{
item
.
setGoodsType
(
dictDataList
.
get
(
0
).
getDictValue
());
}
else
{
item
.
setGoodsType
(
GoodsTypeData
.
get
(
0
).
getDictValue
());
}
}
});
// 批量插入
baseMapper
.
batchAdd
(
addGoodsList
);
importGoodsTempDto
.
setTotal
(
dataList
.
size
());
importGoodsTempDto
.
setRows
(
addGoodsList
.
size
());
return
importGoodsTempDto
;
}
private
String
removeSymbol
(
String
source
)
{
String
target
=
null
;
target
=
source
.
replaceAll
(
"\\s*|\r|\n|\t"
,
""
);
...
...
src/main/java/org/rcisoft/bus/wmsgoodslog/controller/WmsGoodsLogController.java
View file @
8b871ec3
...
...
@@ -5,6 +5,7 @@ package org.rcisoft.bus.wmsgoodslog.controller;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.bus.wmsgoodslog.dto.AddLogList
;
import
org.rcisoft.core.anno.CyOpeLogAnno
;
import
org.rcisoft.core.operlog.enums.CyLogTypeEnum
;
import
org.rcisoft.core.util.CyEpExcelUtil
;
...
...
@@ -51,6 +52,16 @@ public class WmsGoodsLogController extends CyPaginationController<WmsGoodsLog> {
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsLog
);
}
@CyOpeLogAnno
(
title
=
"system-库存管理管理-批量新增库存管理"
,
businessType
=
CyLogTypeEnum
.
INSERT
)
@ApiOperation
(
value
=
"批量添加库存管理"
,
notes
=
"批量添加库存管理"
)
@PostMapping
(
value
=
"/batchAdd"
)
public
CyResult
batchAdd
(
@RequestBody
AddLogList
addLogList
)
{
CyPersistModel
data
=
wmsGoodsLogServiceImpl
.
batchPersist
(
addLogList
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
addLogList
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsLog:delete')")
@CyOpeLogAnno
(
title
=
"system-商品记录表管理-删除商品记录表"
,
businessType
=
CyLogTypeEnum
.
DELETE
)
@ApiOperation
(
value
=
"逻辑删除商品记录表"
,
notes
=
"逻辑删除商品记录表"
)
...
...
src/main/java/org/rcisoft/bus/wmsgoodslog/dao/WmsGoodsLogRepository.java
View file @
8b871ec3
...
...
@@ -25,5 +25,7 @@ public interface WmsGoodsLogRepository extends CyBaseMapper<WmsGoodsLog> {
*
*/
IPage
<
WmsGoodsLog
>
queryWmsGoodsLogsPaged
(
CyPageInfo
cyPageInfo
,
@Param
(
"entity"
)
WmsGoodsLog
wmsGoodsLog
);
int
batchPersist
(
@Param
(
"list"
)
List
<
WmsGoodsLog
>
list
);
}
src/main/java/org/rcisoft/bus/wmsgoodslog/dto/AddLogList.java
0 → 100644
View file @
8b871ec3
package
org
.
rcisoft
.
bus
.
wmsgoodslog
.
dto
;
import
lombok.Data
;
import
org.rcisoft.bus.wmsgoodslog.entity.WmsGoodsLog
;
import
java.util.List
;
@Data
public
class
AddLogList
{
private
List
<
WmsGoodsLog
>
boxList
;
}
src/main/java/org/rcisoft/bus/wmsgoodslog/entity/WmsGoodsLog.java
View file @
8b871ec3
...
...
@@ -17,39 +17,11 @@ import java.util.List;
@TableName
(
"wms_goods_log"
)
public
class
WmsGoodsLog
extends
CyIdIncreEntity
<
WmsGoodsLog
>
{
/**
* @desc 1 入 2 出
* @column io_type
* @default
*/
@Excel
(
name
=
"出入库状态"
,
orderNum
=
"0"
,
width
=
20
,
replace
=
{
"出_2"
,
"入_1"
})
private
String
ioType
;
/**
* @desc 商品id
* @column goods_id
* @default
*/
@Excel
(
name
=
"商品id"
,
orderNum
=
"1"
,
width
=
20
)
private
Integer
goodsId
;
/**
* @desc 商品姓名
* @column goods_name
* @default
*/
@Excel
(
name
=
"商品姓名"
,
orderNum
=
"2"
,
width
=
20
)
private
String
goodsName
;
/**
* @desc 商品编码
* @column goods_code
* @default
*/
@Excel
(
name
=
"商品编码"
,
orderNum
=
"3"
,
width
=
20
)
private
String
goodsCode
;
private
Integer
applyId
;
private
Integer
goodsCounts
;
private
Integer
updateCounts
;
}
src/main/java/org/rcisoft/bus/wmsgoodslog/service/WmsGoodsLogService.java
View file @
8b871ec3
...
...
@@ -2,6 +2,7 @@ package org.rcisoft.bus.wmsgoodslog.service;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.rcisoft.bus.wmsgoodslog.dto.AddLogList
;
import
org.rcisoft.bus.wmsgoodslog.entity.WmsGoodsLog
;
import
org.rcisoft.core.model.CyPersistModel
;
import
org.rcisoft.core.aop.CyPageUtilAsp
;
...
...
@@ -72,4 +73,5 @@ public interface WmsGoodsLogService {
*/
List
<
WmsGoodsLog
>
export
(
WmsGoodsLog
wmsGoodsLog
);
CyPersistModel
batchPersist
(
AddLogList
addLogList
);
}
src/main/java/org/rcisoft/bus/wmsgoodslog/service/impl/WmsGoodsLogServiceImpl.java
View file @
8b871ec3
...
...
@@ -5,6 +5,8 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.rcisoft.bus.wmsgoodsapply.service.WmsGoodsApplyService
;
import
org.rcisoft.bus.wmsgoodslog.dto.AddLogList
;
import
org.rcisoft.core.util.CyUserUtil
;
import
org.rcisoft.core.aop.CyPageUtilAsp
;
import
org.rcisoft.core.model.CyPersistModel
;
...
...
@@ -14,6 +16,7 @@ import org.rcisoft.bus.wmsgoodslog.entity.WmsGoodsLog;
import
org.rcisoft.bus.wmsgoodslog.service.WmsGoodsLogService
;
import
org.rcisoft.core.service.CyBaseService
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
...
...
@@ -21,110 +24,122 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
org.rcisoft.core.model.CyPageInfo
;
import
java.util.ArrayList
;
import
java.util.List
;
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
WmsGoodsLogServiceImpl
extends
ServiceImpl
<
WmsGoodsLogRepository
,
WmsGoodsLog
>
implements
WmsGoodsLogService
{
public
class
WmsGoodsLogServiceImpl
extends
ServiceImpl
<
WmsGoodsLogRepository
,
WmsGoodsLog
>
implements
WmsGoodsLogService
{
@Autowired
private
WmsGoodsApplyService
wmsGoodsApplyServiceImpl
;
/**
* 保存 商品记录表
*
* @param wmsGoodsLog
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
persist
(
WmsGoodsLog
wmsGoodsLog
){
public
CyPersistModel
persist
(
WmsGoodsLog
wmsGoodsLog
)
{
//增加操作
int
line
=
baseMapper
.
insert
(
wmsGoodsLog
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
wmsGoodsLog
.
getBusinessId
()+
"的商品记录表信息"
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"新增了ID为"
+
wmsGoodsLog
.
getBusinessId
()
+
"的商品记录表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 删除 商品记录表
*
* @param wmsGoodsLog
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
remove
(
WmsGoodsLog
wmsGoodsLog
){
public
CyPersistModel
remove
(
WmsGoodsLog
wmsGoodsLog
)
{
int
line
=
baseMapper
.
realDelete
(
wmsGoodsLog
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"删除了ID为"
+
wmsGoodsLog
.
getBusinessId
()+
"的商品记录表信息"
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"删除了ID为"
+
wmsGoodsLog
.
getBusinessId
()
+
"的商品记录表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 逻辑删除 商品记录表
*
* @param wmsGoodsLog
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
removeLogical
(
WmsGoodsLog
wmsGoodsLog
){
public
CyPersistModel
removeLogical
(
WmsGoodsLog
wmsGoodsLog
)
{
wmsGoodsLog
.
setDeleted
();
int
line
=
baseMapper
.
deleteById
(
wmsGoodsLog
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"逻辑删除了ID为"
+
wmsGoodsLog
.
getBusinessId
()
+
"的商品记录表信息"
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"逻辑删除了ID为"
+
wmsGoodsLog
.
getBusinessId
()
+
"的商品记录表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 修改 商品记录表
*
* @param wmsGoodsLog
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
merge
(
WmsGoodsLog
wmsGoodsLog
){
public
CyPersistModel
merge
(
WmsGoodsLog
wmsGoodsLog
)
{
int
line
=
baseMapper
.
updateById
(
wmsGoodsLog
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
wmsGoodsLog
.
getBusinessId
()+
"的商品记录表信息"
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()
+
"修改了ID为"
+
wmsGoodsLog
.
getBusinessId
()
+
"的商品记录表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 根据id查询 商品记录表
*
* @param id
* @return
*/
@Override
public
WmsGoodsLog
findById
(
int
id
){
public
WmsGoodsLog
findById
(
int
id
)
{
return
baseMapper
.
selectById
(
id
);
}
/**
* 分页查询 商品记录表
*
* @param wmsGoodsLog
* @return
*/
@Override
public
IPage
<
WmsGoodsLog
>
findAllByPagination
(
CyPageInfo
<
WmsGoodsLog
>
paginationUtility
,
WmsGoodsLog
wmsGoodsLog
)
{
return
baseMapper
.
queryWmsGoodsLogsPaged
(
paginationUtility
,
wmsGoodsLog
);
WmsGoodsLog
wmsGoodsLog
)
{
return
baseMapper
.
queryWmsGoodsLogsPaged
(
paginationUtility
,
wmsGoodsLog
);
}
/**
* 查询list 商品记录表
*
* @param wmsGoodsLog
* @return
*/
@Override
public
List
<
WmsGoodsLog
>
findAll
(
WmsGoodsLog
wmsGoodsLog
){
public
List
<
WmsGoodsLog
>
findAll
(
WmsGoodsLog
wmsGoodsLog
)
{
return
baseMapper
.
queryWmsGoodsLogs
(
wmsGoodsLog
);
}
/**
* 导出商品记录表
*
* @return
*/
@Override
...
...
@@ -133,4 +148,16 @@ public class WmsGoodsLogServiceImpl extends ServiceImpl<WmsGoodsLogRepository,Wm
return
wmsGoodsLogList
;
}
@Override
public
CyPersistModel
batchPersist
(
AddLogList
addLogList
)
{
List
<
WmsGoodsLog
>
wmsGoodsLogs
=
new
ArrayList
<>();
for
(
WmsGoodsLog
log
:
addLogList
.
getBoxList
())
{
WmsGoodsLog
wmsGoodsLog
=
new
WmsGoodsLog
();
BeanUtils
.
copyProperties
(
log
,
wmsGoodsLog
);
wmsGoodsLog
.
setApplyId
(
log
.
getBusinessId
());
wmsGoodsLogs
.
add
(
wmsGoodsLog
);
}
baseMapper
.
batchPersist
(
wmsGoodsLogs
);
return
new
CyPersistModel
(
1
);
}
}
src/main/java/org/rcisoft/bus/wmsgoodsstock/controller/WmsGoodsStockController.java
View file @
8b871ec3
...
...
@@ -92,7 +92,18 @@ public class WmsGoodsStockController extends CyPaginationController<WmsGoodsStoc
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsStock
);
}
@CyOpeLogAnno
(
title
=
"system-库存管理表管理-修改库存管理表"
,
businessType
=
CyLogTypeEnum
.
UPDATE
)
@ApiOperation
(
value
=
"修改库存管理表"
,
notes
=
"修改库存管理表"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
false
,
dataType
=
"varchar"
)})
@PutMapping
(
"/updateCpunts/{businessId:\\w+}"
)
public
CyResult
updateInCounts
(
@PathVariable
int
businessId
,
@Valid
WmsGoodsStock
wmsGoodsStock
,
BindingResult
bindingResult
)
{
wmsGoodsStock
.
setBusinessId
(
businessId
);
CyPersistModel
data
=
wmsGoodsStockServiceImpl
.
updateInCounts
(
wmsGoodsStock
);
return
CyResultGenUtil
.
builder
(
data
,
CyMessCons
.
MESSAGE_ALERT_SUCCESS
,
CyMessCons
.
MESSAGE_ALERT_ERROR
,
wmsGoodsStock
);
}
//@PreAuthorize("@cyPerm.hasPerm('sys:goodsStock:query')")
@CyOpeLogAnno
(
title
=
"system-库存管理表管理-查询库存管理表"
,
businessType
=
CyLogTypeEnum
.
QUERY
)
@ApiOperation
(
value
=
"查询单一库存管理表"
,
notes
=
"查询单一库存管理表"
)
...
...
src/main/java/org/rcisoft/bus/wmsgoodsstock/service/WmsGoodsStockService.java
View file @
8b871ec3
...
...
@@ -42,6 +42,7 @@ public interface WmsGoodsStockService {
* @return
*/
CyPersistModel
merge
(
WmsGoodsStock
wmsGoodsStock
);
CyPersistModel
updateInCounts
(
WmsGoodsStock
wmsGoodsStock
);
/**
* 根据id查询 库存管理表
...
...
src/main/java/org/rcisoft/bus/wmsgoodsstock/service/impl/WmsGoodsStockServiceImpl.java
View file @
8b871ec3
...
...
@@ -90,6 +90,14 @@ public class WmsGoodsStockServiceImpl extends ServiceImpl<WmsGoodsStockRepositor
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"修改了ID为"
+
wmsGoodsStock
.
getBusinessId
()+
"的库存管理表信息"
);
return
new
CyPersistModel
(
line
);
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
CyPersistModel
updateInCounts
(
WmsGoodsStock
wmsGoodsStock
)
{
wmsGoodsStock
.
setGoodsCounts
(
wmsGoodsStock
.
getGoodsCounts
()
+
1
);
int
line
=
baseMapper
.
updateById
(
wmsGoodsStock
);
log
.
debug
(
CyUserUtil
.
getAuthenUsername
()+
"修改了ID为"
+
wmsGoodsStock
.
getBusinessId
()+
"的库存管理表信息"
);
return
new
CyPersistModel
(
line
);
}
/**
* 根据id查询 库存管理表
...
...
src/main/resources/mapper/bus/wmsGoodsApply/WmsGoodsApplyMapper.xml
View file @
8b871ec3
...
...
@@ -11,16 +11,8 @@
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"goods_code"
jdbcType=
"VARCHAR"
property=
"goodsCode"
/>
<result
column=
"goods_type"
jdbcType=
"VARCHAR"
property=
"goodsType"
/>
<result
column=
"goods_article_number"
jdbcType=
"VARCHAR"
property=
"goodsArticleNumber"
/>
<result
column=
"goods_subclass"
jdbcType=
"VARCHAR"
property=
"goodsSubclass"
/>
<result
column=
"goods_colour"
jdbcType=
"VARCHAR"
property=
"goodsColour"
/>
<result
column=
"goods_norms"
jdbcType=
"VARCHAR"
property=
"goodsNorms"
/>
<result
column=
"goods_size"
jdbcType=
"VARCHAR"
property=
"goodsSize"
/>
<result
column=
"io_type"
jdbcType=
"CHAR"
property=
"ioType"
/>
<result
column=
"deal_status"
jdbcType=
"CHAR"
property=
"dealStatus"
/>
<result
column=
"sure_status"
jdbcType=
"CHAR"
property=
"sureStatus"
/>
<result
column=
"goods_counts"
jdbcType=
"INTEGER"
property=
"goodsCounts"
/>
<result
column=
"app_code"
jdbcType=
"VARCHAR"
property=
"appCode"
/>
<result
column=
"shipper"
jdbcType=
"VARCHAR"
property=
"shipper"
/>
...
...
@@ -32,12 +24,11 @@
<result
column=
"in_goods"
jdbcType=
"VARCHAR"
property=
"inGoods"
/>
<result
column=
"out_goods"
jdbcType=
"VARCHAR"
property=
"outGoods"
/>
</resultMap>
<insert
id=
"batchAdd"
>
insert into wms_goods_apply(flag,del_flag,create_by,create_date,update_by,update_date,remarks,
goods_code,goods_type,goods_article_number,goods_subclass,
goods_colour,goods_norms,goods_size,io_type,deal_status,sure_status,goods_counts,shipper,shipper_address,shipper_phone,goods_check,salesman,maker
) values
<insert
id=
"batchAdd"
>
insert into wms_goods_apply(flag,del_flag,create_by,create_date,update_by,update_date,remarks,
io_type,deal_status,goods_counts,shipper,shipper_address,shipper_phone,goods_check,salesman,maker,in_goods,out_goods,app_code
) values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.flag},#{item.delFlag},#{item.createBy},#{item.createDate},#{item.updateBy},#{item.updateDate},#{item.remarks},#{item.goods_code},#{item.goods_type},#{item.goods_article_number},#{item.goods_subclass},
#{item.goods_colour},#{item.goods_norms},#{item.goods_size},#{item.io_type},#{item.},#{item.deal_status},#{item.goods_counts},#{item.shipper},#{item.shipper_address},#{item.shipper_phone},
#{item.goods_check},#{item.salesman},#{item.maker})
(#{item.flag},#{item.delFlag},#{item.createBy},#{item.createDate},#{item.updateBy},#{item.updateDate},#{item.remarks},#{item.io_type},#{item.deal_status},#{item.goods_counts},#{item.shipper},#{item.shipper_address},#{item.shipper_phone},
#{item.goods_check},#{item.salesman},#{item.maker},#{item.inGoods},#{item.outGoods},#{item.appCode})
</foreach></insert>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
...
...
@@ -48,36 +39,12 @@
<if
test=
"entity.flag !=null and entity.flag != '' "
>
and flag = #{entity.flag}
</if>
<if
test=
"entity.goodsCode !=null and entity.goodsCode != '' "
>
and goods_code like concat('%',#{entity.goodsCode},'%')
</if>
<if
test=
"entity.goodsType !=null and entity.goodsType != '' "
>
and goods_type like concat('%',#{entity.goodsType},'%')
</if>
<if
test=
"entity.goodsArticleNumber !=null and entity.goodsArticleNumber != '' "
>
and goods_article_number like concat('%',#{entity.goodsArticleNumber},'%')
</if>
<if
test=
"entity.goodsSubclass !=null and entity.goodsSubclass != '' "
>
and goods_subclass like concat('%',#{entity.goodsSubclass},'%')
</if>
<if
test=
"entity.goodsColour !=null and entity.goodsColour != '' "
>
and goods_colour like concat('%',#{entity.goodsColour},'%')
</if>
<if
test=
"entity.goodsNorms !=null and entity.goodsNorms != '' "
>
and goods_norms like concat('%',#{entity.goodsNorms},'%')
</if>
<if
test=
"entity.goodsSize !=null and entity.goodsSize != '' "
>
and goods_size like concat('%',#{entity.goodsSize},'%')
</if>
<if
test=
"entity.ioType !=null and entity.ioType != '' "
>
and io_type = #{entity.ioType}
</if>
<if
test=
"entity.dealStatus !=null and entity.dealStatus != '' "
>
and deal_status = #{entity.dealStatus}
</if>
<if
test=
"entity.sureStatus !=null and entity.sureStatus != '' "
>
and sure_status = #{entity.sureStatus}
</if>
<if
test=
"entity.goodsCounts !=null and entity.goodsCounts != '' "
>
and goods_counts = #{entity.goodsCounts}
</if>
...
...
@@ -112,36 +79,12 @@
<if
test=
"entity.flag !=null and entity.flag != '' "
>
and flag = #{entity.flag}
</if>
<if
test=
"entity.goodsCode !=null and entity.goodsCode != '' "
>
and goods_code like concat('%',#{entity.goodsCode},'%')
</if>
<if
test=
"entity.goodsType !=null and entity.goodsType != '' "
>
and goods_type like concat('%',#{entity.goodsType},'%')
</if>
<if
test=
"entity.goodsArticleNumber !=null and entity.goodsArticleNumber != '' "
>
and goods_article_number like concat('%',#{entity.goodsArticleNumber},'%')
</if>
<if
test=
"entity.goodsSubclass !=null and entity.goodsSubclass != '' "
>
and goods_subclass like concat('%',#{entity.goodsSubclass},'%')
</if>
<if
test=
"entity.goodsColour !=null and entity.goodsColour != '' "
>
and goods_colour like concat('%',#{entity.goodsColour},'%')
</if>
<if
test=
"entity.goodsNorms !=null and entity.goodsNorms != '' "
>
and goods_norms like concat('%',#{entity.goodsNorms},'%')
</if>
<if
test=
"entity.goodsSize !=null and entity.goodsSize != '' "
>
and goods_size like concat('%',#{entity.goodsSize},'%')
</if>
<if
test=
"entity.ioType !=null and entity.ioType != '' "
>
and io_type = #{entity.ioType}
</if>
<if
test=
"entity.dealStatus !=null and entity.dealStatus != '' "
>
and deal_status = #{entity.dealStatus}
</if>
<if
test=
"entity.sureStatus !=null and entity.sureStatus != '' "
>
and sure_status = #{entity.sureStatus}
</if>
<if
test=
"entity.goodsCounts !=null and entity.goodsCounts != '' "
>
and goods_counts = #{entity.goodsCounts}
</if>
...
...
@@ -168,4 +111,10 @@
</if>
ORDER BY business_id DESC
</select>
<select
id=
"getOrderCodeCount"
resultType=
"java.lang.Integer"
>
SELECT COALESCE(
(SELECT MAX(RIGHT(app_code, 3)) FROM wms_goods_apply WHERE app_code LIKE CONCAT(#{data}, '%')),
'000'
)
</select>
</mapper>
src/main/resources/mapper/bus/wmsGoodsLog/WmsGoodsLogMapper.xml
View file @
8b871ec3
...
...
@@ -15,8 +15,18 @@
<result
column=
"goods_id"
jdbcType=
"INTEGER"
property=
"goodsId"
/>
<result
column=
"goods_name"
jdbcType=
"VARCHAR"
property=
"goodsName"
/>
<result
column=
"goods_code"
jdbcType=
"VARCHAR"
property=
"goodsCode"
/>
<result
column=
"apply_id"
jdbcType=
"INTEGER"
property=
"applyId"
/>
<result
column=
"goods_counts"
jdbcType=
"INTEGER"
property=
"goodsCounts"
/>
<result
column=
"update_counts"
jdbcType=
"INTEGER"
property=
"updateCounts"
/>
</resultMap>
<insert
id=
"batchPersist"
parameterType=
"java.util.List"
>
insert into
wms_goods_log(flag,del_flag,create_by,create_date,update_by,update_date,io_type,goods_name,goods_code,apply_id,goods_counts,update_counts)
values
<foreach
collection=
"list"
item=
"item"
separator=
","
>
(#{item.flag},#{item.delFlag},#{item.createBy},#{item.createDate},#{item.updateBy},#{item.updateDate},#{item.ioType},#{item.goodsName},#{item.goodsCode},#{item.applyId},#{item.goodsCounts},#{item.updateCounts}
</foreach>
</insert>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
<select
id=
"queryWmsGoodsLogs"
resultMap=
"BaseResultMap"
>
select * from wms_goods_log
...
...
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