Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
warehouse
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
胡懿
warehouse
Commits
dc1c0266
Commit
dc1c0266
authored
Jun 16, 2023
by
胡懿
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复获评模块生成和清除二维码会把入库的也清除
parent
a4aa24b7
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
11 deletions
+21
-11
GoodsService.java
...jeeplus/modules/warehouse/goods/service/GoodsService.java
+15
-8
QrCodeMapper.java
...jeeplus/modules/warehouse/qrcode/mapper/QrCodeMapper.java
+1
-1
QrCodeMapper.xml
...plus/modules/warehouse/qrcode/mapper/xml/QrCodeMapper.xml
+5
-2
No files found.
src/main/java/com/jeeplus/modules/warehouse/goods/service/GoodsService.java
View file @
dc1c0266
...
@@ -111,19 +111,24 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
...
@@ -111,19 +111,24 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
GoodsInfo
temGi
=
new
GoodsInfo
();
GoodsInfo
temGi
=
new
GoodsInfo
();
temGi
.
setId
(
infoId
);
temGi
.
setId
(
infoId
);
temQr
.
setGoodsInfo
(
temGi
);
temQr
.
setGoodsInfo
(
temGi
);
temQr
.
setState
(
"0"
);
List
<
QrCode
>
qrCodeListAll
=
qrCodeMapper
.
findByGoodsInfoId
(
temQr
);
List
<
QrCode
>
qrCodeList
=
qrCodeMapper
.
findByGoodsInfoId
(
temQr
);
if
(
null
!=
qrCodeListAll
&&
qrCodeListAll
.
size
()
>
0
&&
goodsInfo
.
getNum
()
==
qrCodeListAll
.
size
())
{
// 二维码已经生成过
if
(
null
!=
qrCodeList
&&
qrCodeList
.
size
()
>
0
)
{
// 二维码已经生成过
goodsInfo
.
setQrCodeList
(
qrCodeListAll
);
goodsInfo
.
setQrCodeList
(
qrCodeList
);
return
goodsInfo
;
return
goodsInfo
;
}
else
{
}
else
{
int
haveSize
=
0
;
List
<
QrCode
>
qrCodeList
=
new
ArrayList
<>();
if
(
null
!=
qrCodeListAll
)
{
haveSize
=
qrCodeListAll
.
size
();
}
// 查询物资编码
// 查询物资编码
Wzcode
wzcode
=
wzcodeService
.
findByCode
(
goodsInfo
.
getType
().
getCode
());
Wzcode
wzcode
=
wzcodeService
.
findByCode
(
goodsInfo
.
getType
().
getCode
());
int
wzNum
=
wzcode
.
getIntNum
();
int
wzNum
=
wzcode
.
getIntNum
();
qrCodeList
=
new
ArrayList
<>();
int
num
=
goodsInfo
.
getNum
();
int
num
=
goodsInfo
.
getNum
()
-
haveSize
;
String
beginNumSeq
=
""
;
String
beginNumSeq
=
""
;
for
(
int
i
=
0
;
i
<
num
;
i
++)
{
for
(
int
i
=
0
;
i
<
num
;
i
++)
{
wzNum
++;
wzNum
++;
...
@@ -154,7 +159,8 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
...
@@ -154,7 +159,8 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
goodsInfo
.
setQrInterval
(
qrInterval
);
// 设置编码区间
goodsInfo
.
setQrInterval
(
qrInterval
);
// 设置编码区间
// goodsInfo.preUpdate();
// goodsInfo.preUpdate();
goodsInfoMapper
.
update
(
goodsInfo
);
goodsInfoMapper
.
update
(
goodsInfo
);
goodsInfo
.
setQrCodeList
(
qrCodeList
);
qrCodeListAll
.
addAll
(
qrCodeList
);
goodsInfo
.
setQrCodeList
(
qrCodeListAll
);
// 更新物资编码表
// 更新物资编码表
wzcodeService
.
save
(
wzcode
);
wzcodeService
.
save
(
wzcode
);
...
@@ -173,6 +179,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
...
@@ -173,6 +179,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
GoodsInfo
temGi
=
new
GoodsInfo
();
GoodsInfo
temGi
=
new
GoodsInfo
();
temGi
.
setId
(
infoId
);
temGi
.
setId
(
infoId
);
temQr
.
setGoodsInfo
(
temGi
);
temQr
.
setGoodsInfo
(
temGi
);
temQr
.
setState
(
"0"
);
List
<
QrCode
>
qrCodeList
=
qrCodeMapper
.
findByGoodsInfoId
(
temQr
);
List
<
QrCode
>
qrCodeList
=
qrCodeMapper
.
findByGoodsInfoId
(
temQr
);
if
(
null
!=
qrCodeList
&&
qrCodeList
.
size
()
>
0
)
{
if
(
null
!=
qrCodeList
&&
qrCodeList
.
size
()
>
0
)
{
for
(
QrCode
qrCode
:
qrCodeList
)
{
for
(
QrCode
qrCode
:
qrCodeList
)
{
...
@@ -193,7 +200,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
...
@@ -193,7 +200,7 @@ public class GoodsService extends CrudService<GoodsMapper, Goods> {
}
}
}
}
}
}
qrCodeMapper
.
deleteByGoodInfoId
(
infoId
);
// 删除
二维码
qrCodeMapper
.
deleteByGoodInfoId
(
infoId
,
"0"
);
// 删除未入库的
二维码
goodsInfo
.
setQrInterval
(
""
);
goodsInfo
.
setQrInterval
(
""
);
goodsInfo
.
preUpdate
();
goodsInfo
.
preUpdate
();
goodsInfoMapper
.
update
(
goodsInfo
);
goodsInfoMapper
.
update
(
goodsInfo
);
...
...
src/main/java/com/jeeplus/modules/warehouse/qrcode/mapper/QrCodeMapper.java
View file @
dc1c0266
...
@@ -22,7 +22,7 @@ public interface QrCodeMapper extends BaseMapper<QrCode> {
...
@@ -22,7 +22,7 @@ public interface QrCodeMapper extends BaseMapper<QrCode> {
* @param infoId
* @param infoId
* @return
* @return
*/
*/
public
int
deleteByGoodInfoId
(
String
infoId
);
public
int
deleteByGoodInfoId
(
@Param
(
"infoId"
)
String
infoId
,
@Param
(
"state"
)
String
state
);
/**
/**
* 根据货品明细id查询二维码集合
* 根据货品明细id查询二维码集合
...
...
src/main/java/com/jeeplus/modules/warehouse/qrcode/mapper/xml/QrCodeMapper.xml
View file @
dc1c0266
...
@@ -184,9 +184,9 @@
...
@@ -184,9 +184,9 @@
</select>
</select>
<!--根据货品明细删除-->
<!--根据货品明细删除-->
<update
id=
"deleteByGoodInfoId"
>
<update
id=
"deleteByGoodInfoId"
parameterType=
"String"
>
DELETE FROM t_wh_qr
DELETE FROM t_wh_qr
WHERE goods_info_id = #{infoId}
WHERE goods_info_id = #{infoId}
and state = #{state}
</update>
</update>
<select
id=
"findByGoodsInfoId"
resultType=
"QrCode"
>
<select
id=
"findByGoodsInfoId"
resultType=
"QrCode"
>
...
@@ -199,6 +199,9 @@
...
@@ -199,6 +199,9 @@
<if
test=
"goodsInfo.id != null and goodsInfo.id != ''"
>
<if
test=
"goodsInfo.id != null and goodsInfo.id != ''"
>
AND a.goods_info_id = #{goodsInfo.id}
AND a.goods_info_id = #{goodsInfo.id}
</if>
</if>
<if
test=
"state != null and state != ''"
>
AND a.state = #{state}
</if>
</where>
</where>
</select>
</select>
...
...
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