Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
baf116d4
Commit
baf116d4
authored
Dec 15, 2022
by
季圣华
Browse files
给商品查询接口增加扩展信息的查询
parent
b00aa14c
Changes
4
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
View file @
baf116d4
...
@@ -19,6 +19,7 @@ public interface MaterialMapperEx {
...
@@ -19,6 +19,7 @@ public interface MaterialMapperEx {
List
<
MaterialVo4Unit
>
selectByConditionMaterial
(
List
<
MaterialVo4Unit
>
selectByConditionMaterial
(
@Param
(
"materialParam"
)
String
materialParam
,
@Param
(
"materialParam"
)
String
materialParam
,
@Param
(
"color"
)
String
color
,
@Param
(
"color"
)
String
color
,
@Param
(
"materialOther"
)
String
materialOther
,
@Param
(
"weight"
)
String
weight
,
@Param
(
"weight"
)
String
weight
,
@Param
(
"expiryNum"
)
String
expiryNum
,
@Param
(
"expiryNum"
)
String
expiryNum
,
@Param
(
"enableSerialNumber"
)
String
enableSerialNumber
,
@Param
(
"enableSerialNumber"
)
String
enableSerialNumber
,
...
@@ -33,6 +34,7 @@ public interface MaterialMapperEx {
...
@@ -33,6 +34,7 @@ public interface MaterialMapperEx {
Long
countsByMaterial
(
Long
countsByMaterial
(
@Param
(
"materialParam"
)
String
materialParam
,
@Param
(
"materialParam"
)
String
materialParam
,
@Param
(
"color"
)
String
color
,
@Param
(
"color"
)
String
color
,
@Param
(
"materialOther"
)
String
materialOther
,
@Param
(
"weight"
)
String
weight
,
@Param
(
"weight"
)
String
weight
,
@Param
(
"expiryNum"
)
String
expiryNum
,
@Param
(
"expiryNum"
)
String
expiryNum
,
@Param
(
"enableSerialNumber"
)
String
enableSerialNumber
,
@Param
(
"enableSerialNumber"
)
String
enableSerialNumber
,
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialComponent.java
View file @
baf116d4
...
@@ -36,6 +36,7 @@ public class MaterialComponent implements ICommonQuery {
...
@@ -36,6 +36,7 @@ public class MaterialComponent implements ICommonQuery {
String
categoryId
=
StringUtil
.
getInfo
(
search
,
"categoryId"
);
String
categoryId
=
StringUtil
.
getInfo
(
search
,
"categoryId"
);
String
materialParam
=
StringUtil
.
getInfo
(
search
,
"materialParam"
);
String
materialParam
=
StringUtil
.
getInfo
(
search
,
"materialParam"
);
String
color
=
StringUtil
.
getInfo
(
search
,
"color"
);
String
color
=
StringUtil
.
getInfo
(
search
,
"color"
);
String
materialOther
=
StringUtil
.
getInfo
(
search
,
"materialOther"
);
String
weight
=
StringUtil
.
getInfo
(
search
,
"weight"
);
String
weight
=
StringUtil
.
getInfo
(
search
,
"weight"
);
String
expiryNum
=
StringUtil
.
getInfo
(
search
,
"expiryNum"
);
String
expiryNum
=
StringUtil
.
getInfo
(
search
,
"expiryNum"
);
String
enableSerialNumber
=
StringUtil
.
getInfo
(
search
,
"enableSerialNumber"
);
String
enableSerialNumber
=
StringUtil
.
getInfo
(
search
,
"enableSerialNumber"
);
...
@@ -43,7 +44,7 @@ public class MaterialComponent implements ICommonQuery {
...
@@ -43,7 +44,7 @@ public class MaterialComponent implements ICommonQuery {
String
enabled
=
StringUtil
.
getInfo
(
search
,
"enabled"
);
String
enabled
=
StringUtil
.
getInfo
(
search
,
"enabled"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
mpList
=
StringUtil
.
getInfo
(
search
,
"mpList"
);
String
mpList
=
StringUtil
.
getInfo
(
search
,
"mpList"
);
return
materialService
.
select
(
materialParam
,
color
,
weight
,
expiryNum
,
return
materialService
.
select
(
materialParam
,
color
,
materialOther
,
weight
,
expiryNum
,
enableSerialNumber
,
enableBatchNumber
,
enabled
,
remark
,
categoryId
,
mpList
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
enableSerialNumber
,
enableBatchNumber
,
enabled
,
remark
,
categoryId
,
mpList
,
QueryUtils
.
offset
(
map
),
QueryUtils
.
rows
(
map
));
}
}
...
@@ -53,6 +54,7 @@ public class MaterialComponent implements ICommonQuery {
...
@@ -53,6 +54,7 @@ public class MaterialComponent implements ICommonQuery {
String
categoryId
=
StringUtil
.
getInfo
(
search
,
"categoryId"
);
String
categoryId
=
StringUtil
.
getInfo
(
search
,
"categoryId"
);
String
materialParam
=
StringUtil
.
getInfo
(
search
,
"materialParam"
);
String
materialParam
=
StringUtil
.
getInfo
(
search
,
"materialParam"
);
String
color
=
StringUtil
.
getInfo
(
search
,
"color"
);
String
color
=
StringUtil
.
getInfo
(
search
,
"color"
);
String
materialOther
=
StringUtil
.
getInfo
(
search
,
"materialOther"
);
String
weight
=
StringUtil
.
getInfo
(
search
,
"weight"
);
String
weight
=
StringUtil
.
getInfo
(
search
,
"weight"
);
String
expiryNum
=
StringUtil
.
getInfo
(
search
,
"expiryNum"
);
String
expiryNum
=
StringUtil
.
getInfo
(
search
,
"expiryNum"
);
String
enableSerialNumber
=
StringUtil
.
getInfo
(
search
,
"enableSerialNumber"
);
String
enableSerialNumber
=
StringUtil
.
getInfo
(
search
,
"enableSerialNumber"
);
...
@@ -60,7 +62,7 @@ public class MaterialComponent implements ICommonQuery {
...
@@ -60,7 +62,7 @@ public class MaterialComponent implements ICommonQuery {
String
enabled
=
StringUtil
.
getInfo
(
search
,
"enabled"
);
String
enabled
=
StringUtil
.
getInfo
(
search
,
"enabled"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
remark
=
StringUtil
.
getInfo
(
search
,
"remark"
);
String
mpList
=
StringUtil
.
getInfo
(
search
,
"mpList"
);
String
mpList
=
StringUtil
.
getInfo
(
search
,
"mpList"
);
return
materialService
.
countMaterial
(
materialParam
,
color
,
weight
,
expiryNum
,
return
materialService
.
countMaterial
(
materialParam
,
color
,
materialOther
,
weight
,
expiryNum
,
enableSerialNumber
,
enableBatchNumber
,
enabled
,
remark
,
categoryId
,
mpList
);
enableSerialNumber
,
enableBatchNumber
,
enabled
,
remark
,
categoryId
,
mpList
);
}
}
...
...
jshERP-boot/src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
baf116d4
...
@@ -111,7 +111,7 @@ public class MaterialService {
...
@@ -111,7 +111,7 @@ public class MaterialService {
return
list
;
return
list
;
}
}
public
List
<
MaterialVo4Unit
>
select
(
String
materialParam
,
String
color
,
String
weight
,
String
expiryNum
,
public
List
<
MaterialVo4Unit
>
select
(
String
materialParam
,
String
color
,
String
materialOther
,
String
weight
,
String
expiryNum
,
String
enableSerialNumber
,
String
enableBatchNumber
,
String
enabled
,
String
enableSerialNumber
,
String
enableBatchNumber
,
String
enabled
,
String
remark
,
String
categoryId
,
String
mpList
,
int
offset
,
int
rows
)
String
remark
,
String
categoryId
,
String
mpList
,
int
offset
,
int
rows
)
throws
Exception
{
throws
Exception
{
...
@@ -126,7 +126,7 @@ public class MaterialService {
...
@@ -126,7 +126,7 @@ public class MaterialService {
if
(
StringUtil
.
isNotEmpty
(
categoryId
)){
if
(
StringUtil
.
isNotEmpty
(
categoryId
)){
idList
=
getListByParentId
(
Long
.
parseLong
(
categoryId
));
idList
=
getListByParentId
(
Long
.
parseLong
(
categoryId
));
}
}
list
=
materialMapperEx
.
selectByConditionMaterial
(
materialParam
,
color
,
weight
,
expiryNum
,
list
=
materialMapperEx
.
selectByConditionMaterial
(
materialParam
,
color
,
materialOther
,
weight
,
expiryNum
,
enableSerialNumber
,
enableBatchNumber
,
enabled
,
remark
,
idList
,
mpList
,
offset
,
rows
);
enableSerialNumber
,
enableBatchNumber
,
enabled
,
remark
,
idList
,
mpList
,
offset
,
rows
);
if
(
null
!=
list
&&
list
.
size
()>
0
)
{
if
(
null
!=
list
&&
list
.
size
()>
0
)
{
Map
<
Long
,
BigDecimal
>
currentStockMap
=
getCurrentStockMapByMaterialList
(
list
);
Map
<
Long
,
BigDecimal
>
currentStockMap
=
getCurrentStockMapByMaterialList
(
list
);
...
@@ -143,7 +143,7 @@ public class MaterialService {
...
@@ -143,7 +143,7 @@ public class MaterialService {
return
resList
;
return
resList
;
}
}
public
Long
countMaterial
(
String
materialParam
,
String
color
,
String
weight
,
String
expiryNum
,
public
Long
countMaterial
(
String
materialParam
,
String
color
,
String
materialOther
,
String
weight
,
String
expiryNum
,
String
enableSerialNumber
,
String
enableBatchNumber
,
String
enabled
,
String
enableSerialNumber
,
String
enableBatchNumber
,
String
enabled
,
String
remark
,
String
categoryId
,
String
mpList
)
throws
Exception
{
String
remark
,
String
categoryId
,
String
mpList
)
throws
Exception
{
Long
result
=
null
;
Long
result
=
null
;
...
@@ -152,7 +152,7 @@ public class MaterialService {
...
@@ -152,7 +152,7 @@ public class MaterialService {
if
(
StringUtil
.
isNotEmpty
(
categoryId
)){
if
(
StringUtil
.
isNotEmpty
(
categoryId
)){
idList
=
getListByParentId
(
Long
.
parseLong
(
categoryId
));
idList
=
getListByParentId
(
Long
.
parseLong
(
categoryId
));
}
}
result
=
materialMapperEx
.
countsByMaterial
(
materialParam
,
color
,
weight
,
expiryNum
,
result
=
materialMapperEx
.
countsByMaterial
(
materialParam
,
color
,
materialOther
,
weight
,
expiryNum
,
enableSerialNumber
,
enableBatchNumber
,
enabled
,
remark
,
idList
,
mpList
);
enableSerialNumber
,
enableBatchNumber
,
enabled
,
remark
,
idList
,
mpList
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
...
...
jshERP-boot/src/main/resources/mapper_xml/MaterialMapperEx.xml
View file @
baf116d4
...
@@ -51,6 +51,11 @@
...
@@ -51,6 +51,11 @@
<bind
name=
"bindColor"
value=
"'%'+color+'%'"
/>
<bind
name=
"bindColor"
value=
"'%'+color+'%'"
/>
and m.color like #{bindColor}
and m.color like #{bindColor}
</if>
</if>
<if
test=
"materialOther != null and materialOther !=''"
>
<bind
name=
"bindOther"
value=
"'%'+materialOther+'%'"
/>
and (m.mfrs like #{bindOther} or m.other_field1 like #{bindOther}
or m.other_field2 like #{bindOther} or m.other_field3 like #{bindOther})
</if>
<if
test=
"weight != null and weight !=''"
>
<if
test=
"weight != null and weight !=''"
>
and m.weight = #{weight}
and m.weight = #{weight}
</if>
</if>
...
@@ -101,6 +106,11 @@
...
@@ -101,6 +106,11 @@
<bind
name=
"bindColor"
value=
"'%'+color+'%'"
/>
<bind
name=
"bindColor"
value=
"'%'+color+'%'"
/>
and m.color like #{bindColor}
and m.color like #{bindColor}
</if>
</if>
<if
test=
"materialOther != null and materialOther !=''"
>
<bind
name=
"bindOther"
value=
"'%'+materialOther+'%'"
/>
and (m.mfrs like #{bindOther} or m.other_field1 like #{bindOther}
or m.other_field2 like #{bindOther} or m.other_field3 like #{bindOther})
</if>
<if
test=
"weight != null and weight !=''"
>
<if
test=
"weight != null and weight !=''"
>
and m.weight = #{weight}
and m.weight = #{weight}
</if>
</if>
...
...
Write
Preview
Supports
Markdown
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