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
e8e43675
Commit
e8e43675
authored
Jun 05, 2020
by
季圣华
Browse files
优化报表的查询
parent
c46ab523
Changes
14
Hide whitespace changes
Inline
Side-by-side
erp_web/pages/reports/buy_in_report.html
View file @
e8e43675
...
@@ -29,6 +29,18 @@
...
@@ -29,6 +29,18 @@
class=
"txt Wdate width-160"
style=
"height: 30px;border: 1px solid #95B8E7;border-radius:5px;"
/>
class=
"txt Wdate width-160"
style=
"height: 30px;border: 1px solid #95B8E7;border-radius:5px;"
/>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label"
>
名称:
</label>
<div
class=
"control-inline"
>
<input
name=
"mName"
id=
"mName"
style=
"width:100px;"
></input>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label"
>
型号:
</label>
<div
class=
"control-inline"
>
<input
type=
"text"
name=
"mModel"
id=
"mModel"
class=
"easyui-textbox"
style=
"width:100px;"
></input>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-print"
id=
"printBtn"
>
打印
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-print"
id=
"printBtn"
>
打印
</a>
...
@@ -43,6 +55,7 @@
...
@@ -43,6 +55,7 @@
$
(
function
()
{
$
(
function
()
{
var
thisDate
=
getNowFormatMonth
();
//当前月份
var
thisDate
=
getNowFormatMonth
();
//当前月份
$
(
"
#searchMonth
"
).
val
(
thisDate
);
$
(
"
#searchMonth
"
).
val
(
thisDate
);
initMaterialNameList
();
initMProperty
();
//初始化商品属性
initMProperty
();
//初始化商品属性
initTableData
();
initTableData
();
ininPager
();
ininPager
();
...
@@ -50,6 +63,21 @@
...
@@ -50,6 +63,21 @@
print
();
print
();
});
});
//初始化商品名称模糊匹配
function
initMaterialNameList
()
{
$
(
'
#mName
'
).
combobox
({
method
:
"
get
"
,
url
:
"
/material/getMaterialNameList
"
,
valueField
:
'
value
'
,
textField
:
'
text
'
,
hasDownArrow
:
false
,
filter
:
function
(
q
,
row
){
var
opts
=
$
(
this
).
combobox
(
'
options
'
);
return
row
[
opts
.
textField
].
indexOf
(
q
)
>-
1
;
}
});
}
//初始化商品属性
//初始化商品属性
function
initMProperty
()
{
function
initMProperty
()
{
$
.
ajax
({
$
.
ajax
({
...
@@ -184,64 +212,20 @@
...
@@ -184,64 +212,20 @@
function
showDetails
(
pageNo
,
pageSize
)
{
function
showDetails
(
pageNo
,
pageSize
)
{
$
.
ajax
({
$
.
ajax
({
type
:
"
ge
t
"
,
type
:
"
pos
t
"
,
url
:
"
/depot
Head/findByMonth
"
,
url
:
"
/depot
Item/buyIn
"
,
dataType
:
"
json
"
,
dataType
:
"
json
"
,
data
:
({
data
:
({
monthTime
:
$
(
"
#searchMonth
"
).
val
()
currentPage
:
pageNo
,
pageSize
:
pageSize
,
monthTime
:
$
(
"
#searchMonth
"
).
val
(),
name
:
$
(
"
#mName
"
).
combobox
(
"
getValue
"
),
model
:
$
(
"
#mModel
"
).
textbox
(
"
getValue
"
),
mpList
:
mPropertyList
}),
}),
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
var
HeadIds
=
res
.
data
.
HeadIds
;
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
if
(
HeadIds
)
{
//获取排序后的产品ID
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/material/findByOrder
"
,
dataType
:
"
json
"
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
var
mIds
=
res
.
data
.
mIds
;
if
(
mIds
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/depotItem/buyIn
"
,
dataType
:
"
json
"
,
data
:
({
currentPage
:
pageNo
,
pageSize
:
pageSize
,
monthTime
:
$
(
"
#searchMonth
"
).
val
(),
headIds
:
HeadIds
,
materialIds
:
mIds
,
mpList
:
mPropertyList
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
else
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
本月无数据!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
else
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
本月无数据!
'
,
'
error
'
);
}
}
}
},
},
//此处添加错误处理
//此处添加错误处理
...
...
erp_web/pages/reports/in_out_stock_report.html
View file @
e8e43675
...
@@ -316,112 +316,69 @@
...
@@ -316,112 +316,69 @@
});
});
function
showEachDetails
(
pageNo
,
pageSize
)
{
function
showEachDetails
(
pageNo
,
pageSize
)
{
$
.
ajax
({
if
(
pageSize
===
3000
)
{
type
:
"
get
"
,
window
.
location
.
href
=
"
/depotItem/exportExcel?browserType=
"
+
getOs
()
url
:
"
/depotHead/findByMonth
"
,
+
"
¤tPage=
"
+
pageNo
+
"
&pageSize=
"
+
pageSize
dataType
:
"
json
"
,
+
"
&depotId=
"
+
$
.
trim
(
$
(
"
#searchProjectId
"
).
val
())
data
:
({
+
"
&monthTime=
"
+
$
(
"
#searchMonth
"
).
val
()
monthTime
:
$
(
"
#searchMonth
"
).
val
()
+
"
&name=
"
+
$
(
"
#mName
"
).
combobox
(
"
getValue
"
)
}),
+
"
&model=
"
+
$
(
"
#mModel
"
).
textbox
(
"
getValue
"
);
success
:
function
(
res
)
{
}
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
else
{
var
HeadIds
=
res
.
data
.
HeadIds
;
$
.
ajax
({
if
(
HeadIds
)
{
type
:
"
post
"
,
//获取排序后的产品ID
url
:
"
/depotItem/findByAll
"
,
$
.
ajax
({
dataType
:
"
json
"
,
type
:
"
get
"
,
data
:
({
url
:
"
/material/findByOrder
"
,
currentPage
:
pageNo
,
dataType
:
"
json
"
,
pageSize
:
pageSize
,
data
:
({
depotId
:
$
.
trim
(
$
(
"
#searchProjectId
"
).
val
()),
name
:
$
(
"
#mName
"
).
combobox
(
"
getValue
"
),
monthTime
:
$
(
"
#searchMonth
"
).
val
(),
model
:
$
(
"
#mModel
"
).
textbox
(
"
getValue
"
)
name
:
$
(
"
#mName
"
).
combobox
(
"
getValue
"
),
}),
model
:
$
(
"
#mModel
"
).
textbox
(
"
getValue
"
),
success
:
function
(
res
)
{
mpList
:
mPropertyList
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
}),
var
mIds
=
res
.
data
.
mIds
;
success
:
function
(
res
)
{
if
(
mIds
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
pageSize
===
3000
)
{
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
window
.
location
.
href
=
"
/depotItem/exportExcel?browserType=
"
+
getOs
()
+
"
¤tPage=
"
+
pageNo
+
"
&pageSize=
"
+
pageSize
+
"
&depotId=
"
+
$
.
trim
(
$
(
"
#searchProjectId
"
).
val
())
+
"
&monthTime=
"
+
$
(
"
#searchMonth
"
).
val
()
+
"
&headIds=
"
+
HeadIds
+
"
&materialIds=
"
+
mIds
;
}
}
},
else
{
//此处添加错误处理
$
.
ajax
({
error
:
function
()
{
type
:
"
post
"
,
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
url
:
"
/depotItem/findByAll
"
,
return
;
dataType
:
"
json
"
,
}
data
:
({
});
currentPage
:
pageNo
,
pageSize
:
pageSize
,
depotId
:
$
.
trim
(
$
(
"
#searchProjectId
"
).
val
()),
monthTime
:
$
(
"
#searchMonth
"
).
val
(),
headIds
:
HeadIds
,
materialIds
:
mIds
,
mpList
:
mPropertyList
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
//总金额
//总金额
$
.
ajax
({
$
.
ajax
({
type
:
"
post
"
,
type
:
"
post
"
,
url
:
"
/depotItem/totalCountMoney
"
,
url
:
"
/depotItem/totalCountMoney
"
,
dataType
:
"
json
"
,
dataType
:
"
json
"
,
data
:
({
data
:
({
depotId
:
$
.
trim
(
$
(
"
#searchProjectId
"
).
val
()),
depotId
:
$
.
trim
(
$
(
"
#searchProjectId
"
).
val
()),
monthTime
:
$
(
"
#searchMonth
"
).
val
(),
monthTime
:
$
(
"
#searchMonth
"
).
val
(),
headIds
:
HeadIds
,
name
:
$
(
"
#mName
"
).
combobox
(
"
getValue
"
),
materialIds
:
mIds
model
:
$
(
"
#mModel
"
).
textbox
(
"
getValue
"
)
}),
}),
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
&&
res
.
code
===
200
)
{
if
(
res
.
data
&&
res
.
data
.
totalCount
)
{
if
(
res
.
data
&&
res
.
data
.
totalCount
)
{
var
count
=
res
.
data
.
totalCount
.
toString
();
var
count
=
res
.
data
.
totalCount
.
toString
();
if
(
count
.
lastIndexOf
(
'
.
'
)
>
-
1
)
{
if
(
count
.
lastIndexOf
(
'
.
'
)
>
-
1
)
{
count
=
count
.
substring
(
0
,
count
.
lastIndexOf
(
'
.
'
)
+
3
);
count
=
count
.
substring
(
0
,
count
.
lastIndexOf
(
'
.
'
)
+
3
);
}
$
(
"
#tablePanel .total-count
"
).
text
(
"
本月合计金额:
"
+
count
+
"
元
"
);
//本月合计金额
}
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
}
else
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
本月无数据!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
}
});
$
(
"
#tablePanel .total-count
"
).
text
(
"
本月合计金额:
"
+
count
+
"
元
"
);
//本月合计金额
}
}
else
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
本月无数据!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
}
},
});
//此处添加错误处理
}
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
}
//报表打印
//报表打印
...
...
erp_web/pages/reports/sale_out_report.html
View file @
e8e43675
...
@@ -29,6 +29,18 @@
...
@@ -29,6 +29,18 @@
class=
"txt Wdate width-160"
style=
"height: 30px;border: 1px solid #95B8E7;border-radius:5px;"
/>
class=
"txt Wdate width-160"
style=
"height: 30px;border: 1px solid #95B8E7;border-radius:5px;"
/>
</div>
</div>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label"
>
名称:
</label>
<div
class=
"control-inline"
>
<input
name=
"mName"
id=
"mName"
style=
"width:100px;"
></input>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label"
>
型号:
</label>
<div
class=
"control-inline"
>
<input
type=
"text"
name=
"mModel"
id=
"mModel"
class=
"easyui-textbox"
style=
"width:100px;"
></input>
</div>
</div>
<div
class=
"form-group"
>
<div
class=
"form-group"
>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-search"
id=
"searchBtn"
>
查询
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-print"
id=
"printBtn"
>
打印
</a>
<a
href=
"javascript:void(0)"
class=
"easyui-linkbutton"
iconCls=
"icon-print"
id=
"printBtn"
>
打印
</a>
...
@@ -47,6 +59,7 @@
...
@@ -47,6 +59,7 @@
$
(
"
#searchTable .tip
"
).
css
(
"
padding-left
"
,
"
15px
"
).
css
(
"
color
"
,
"
red
"
);
$
(
"
#searchTable .tip
"
).
css
(
"
padding-left
"
,
"
15px
"
).
css
(
"
color
"
,
"
red
"
);
var
thisDate
=
getNowFormatMonth
();
//当前月份
var
thisDate
=
getNowFormatMonth
();
//当前月份
$
(
"
#searchMonth
"
).
val
(
thisDate
);
$
(
"
#searchMonth
"
).
val
(
thisDate
);
initMaterialNameList
();
initMProperty
();
//初始化商品属性
initMProperty
();
//初始化商品属性
initTableData
();
initTableData
();
ininPager
();
ininPager
();
...
@@ -54,6 +67,21 @@
...
@@ -54,6 +67,21 @@
print
();
print
();
});
});
//初始化商品名称模糊匹配
function
initMaterialNameList
()
{
$
(
'
#mName
'
).
combobox
({
method
:
"
get
"
,
url
:
"
/material/getMaterialNameList
"
,
valueField
:
'
value
'
,
textField
:
'
text
'
,
hasDownArrow
:
false
,
filter
:
function
(
q
,
row
){
var
opts
=
$
(
this
).
combobox
(
'
options
'
);
return
row
[
opts
.
textField
].
indexOf
(
q
)
>-
1
;
}
});
}
//初始化商品属性
//初始化商品属性
function
initMProperty
()
{
function
initMProperty
()
{
$
.
ajax
({
$
.
ajax
({
...
@@ -191,72 +219,28 @@
...
@@ -191,72 +219,28 @@
function
showDetails
(
pageNo
,
pageSize
)
{
function
showDetails
(
pageNo
,
pageSize
)
{
$
.
ajax
({
$
.
ajax
({
type
:
"
ge
t
"
,
type
:
"
pos
t
"
,
url
:
"
/depot
Head/findByMonth
"
,
url
:
"
/depot
Item/saleOut
"
,
dataType
:
"
json
"
,
dataType
:
"
json
"
,
data
:
({
data
:
({
monthTime
:
$
(
"
#searchMonth
"
).
val
()
currentPage
:
pageNo
,
pageSize
:
pageSize
,
monthTime
:
$
(
"
#searchMonth
"
).
val
(),
name
:
$
(
"
#mName
"
).
combobox
(
"
getValue
"
),
model
:
$
(
"
#mModel
"
).
textbox
(
"
getValue
"
),
mpList
:
mPropertyList
}),
}),
success
:
function
(
res
)
{
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
if
(
res
&&
res
.
code
===
200
)
{
var
HeadIds
=
res
.
data
.
HeadIds
;
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
if
(
HeadIds
)
{
//获取排序后的产品ID
$
.
ajax
({
type
:
"
get
"
,
url
:
"
/material/findByOrder
"
,
dataType
:
"
json
"
,
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
&&
res
.
data
)
{
var
mIds
=
res
.
data
.
mIds
;
if
(
mIds
)
{
$
.
ajax
({
type
:
"
post
"
,
url
:
"
/depotItem/saleOut
"
,
dataType
:
"
json
"
,
data
:
({
currentPage
:
pageNo
,
pageSize
:
pageSize
,
monthTime
:
$
(
"
#searchMonth
"
).
val
(),
headIds
:
HeadIds
,
materialIds
:
mIds
,
mpList
:
mPropertyList
}),
success
:
function
(
res
)
{
if
(
res
&&
res
.
code
===
200
)
{
$
(
"
#tableData
"
).
datagrid
(
'
loadData
'
,
res
.
data
);
}
var
total
=
0
;
res
.
data
.
rows
.
forEach
(
function
(
value
,
index
,
array
){
//执行某些操作
total
+=
value
.
OutInSumPrice
;
})
$
(
"
.first-total
"
).
text
(
total
);
//当前总余额
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
else
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
本月无数据!
'
,
'
error
'
);
}
}
},
//此处添加错误处理
error
:
function
()
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
查询数据后台异常,请稍后再试!
'
,
'
error
'
);
return
;
}
});
}
else
{
$
.
messager
.
alert
(
'
查询提示
'
,
'
本月无数据!
'
,
'
error
'
);
}
}
}
var
total
=
0
;
res
.
data
.
rows
.
forEach
(
function
(
value
,
index
,
array
){
//执行某些操作
total
+=
value
.
OutInSumPrice
;
})
$
(
"
.first-total
"
).
text
(
total
);
//当前总余额
},
},
//此处添加错误处理
//此处添加错误处理
error
:
function
()
{
error
:
function
()
{
...
...
src/main/java/com/jsh/erp/controller/DepotHeadController.java
View file @
e8e43675
...
@@ -109,39 +109,6 @@ public class DepotHeadController {
...
@@ -109,39 +109,6 @@ public class DepotHeadController {
return
res
;
return
res
;
}
}
/**
* 查找单据_根据月份(报表)
* @param monthTime
* @param request
* @return
*/
@GetMapping
(
value
=
"/findByMonth"
)
public
BaseResponseInfo
findByMonth
(
@RequestParam
(
"monthTime"
)
String
monthTime
,
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
List
<
DepotHead
>
dataList
=
depotHeadService
.
findByMonth
(
monthTime
);
String
headId
=
""
;
if
(
null
!=
dataList
)
{
for
(
DepotHead
depotHead
:
dataList
)
{
headId
=
headId
+
depotHead
.
getId
()
+
","
;
}
}
if
(
headId
!=
""
)
{
headId
=
headId
.
substring
(
0
,
headId
.
lastIndexOf
(
","
));
}
map
.
put
(
"HeadIds"
,
headId
);
res
.
code
=
200
;
res
.
data
=
map
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
res
.
code
=
500
;
res
.
data
=
"获取数据失败"
;
}
return
res
;
}
/**
/**
* 入库出库明细接口
* 入库出库明细接口
* @param currentPage
* @param currentPage
...
...
src/main/java/com/jsh/erp/controller/DepotItemController.java
View file @
e8e43675
...
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
...
@@ -22,6 +22,7 @@ import javax.servlet.http.HttpServletResponse;
import
java.io.File
;
import
java.io.File
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.text.DecimalFormat
;
import
java.text.DecimalFormat
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
...
@@ -258,17 +259,20 @@ public class DepotItemController {
...
@@ -258,17 +259,20 @@ public class DepotItemController {
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"depotId"
)
Long
depotId
,
@RequestParam
(
"depotId"
)
Long
depotId
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"
headIds
"
)
String
headIds
,
@RequestParam
(
"
name
"
)
String
name
,
@RequestParam
(
"m
aterialIds
"
)
String
m
aterialIds
,
@RequestParam
(
"m
odel
"
)
String
m
odel
,
@RequestParam
(
"mpList"
)
String
mpList
,
@RequestParam
(
"mpList"
)
String
mpList
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Long
tenantId
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"tenantId"
).
toString
());
Long
tenantId
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"tenantId"
).
toString
());
String
timeA
=
monthTime
+
"-01 00:00:00"
;
String
timeB
=
Tools
.
lastDayOfMonth
(
monthTime
)+
" 23:59:59"
;
try
{
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
headIds
,
materialIds
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
name
),
StringUtil
.
toNull
(
model
),
timeB
,(
currentPage
-
1
)*
pageSize
,
pageSize
);
String
[]
mpArr
=
mpList
.
split
(
","
);
String
[]
mpArr
=
mpList
.
split
(
","
);
int
total
=
depotItemService
.
findByAllCount
(
headIds
,
materialIds
);
int
total
=
depotItemService
.
findByAllCount
(
StringUtil
.
toNull
(
name
),
timeB
,
StringUtil
.
toNull
(
model
)
);
map
.
put
(
"total"
,
total
);
map
.
put
(
"total"
,
total
);
//存放数据json数组
//存放数据json数组
JSONArray
dataArray
=
new
JSONArray
();
JSONArray
dataArray
=
new
JSONArray
();
...
@@ -281,8 +285,6 @@ public class DepotItemController {
...
@@ -281,8 +285,6 @@ public class DepotItemController {
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
JSONObject
item
=
new
JSONObject
();
JSONObject
item
=
new
JSONObject
();
Long
mId
=
diEx
.
getMId
();
Long
mId
=
diEx
.
getMId
();
String
timeA
=
monthTime
+
"-01 00:00:00"
;
String
timeB
=
monthTime
+
"-31 23:59:59"
;
item
.
put
(
"MaterialName"
,
diEx
.
getMName
());
item
.
put
(
"MaterialName"
,
diEx
.
getMName
());
item
.
put
(
"MaterialModel"
,
diEx
.
getMModel
());
item
.
put
(
"MaterialModel"
,
diEx
.
getMModel
());
//扩展信息
//扩展信息
...
@@ -294,7 +296,7 @@ public class DepotItemController {
...
@@ -294,7 +296,7 @@ public class DepotItemController {
item
.
put
(
"prevSum"
,
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
timeA
,
tenantId
));
item
.
put
(
"prevSum"
,
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
timeA
,
tenantId
));
item
.
put
(
"InSum"
,
depotItemService
.
getInNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
));
item
.
put
(
"InSum"
,
depotItemService
.
getInNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
));
item
.
put
(
"OutSum"
,
depotItemService
.
getOutNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
));
item
.
put
(
"OutSum"
,
depotItemService
.
getOutNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
));
BigDecimal
thisSum
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
null
,
tenantId
);
BigDecimal
thisSum
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
timeB
,
tenantId
);
item
.
put
(
"thisSum"
,
thisSum
);
item
.
put
(
"thisSum"
,
thisSum
);
for
(
MaterialExtend
me:
meList
)
{
for
(
MaterialExtend
me:
meList
)
{
if
(
me
.
getMaterialId
().
longValue
()
==
diEx
.
getMId
().
longValue
())
{
if
(
me
.
getMaterialId
().
longValue
()
==
diEx
.
getMId
().
longValue
())
{
...
@@ -336,12 +338,15 @@ public class DepotItemController {
...
@@ -336,12 +338,15 @@ public class DepotItemController {
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"depotId"
)
Long
depotId
,
@RequestParam
(
"depotId"
)
Long
depotId
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"
headIds
"
)
String
headIds
,
@RequestParam
(
"
name
"
)
String
name
,
@RequestParam
(
"m
aterialIds
"
)
String
m
aterialIds
,
@RequestParam
(
"m
odel
"
)
String
m
odel
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
HttpServletRequest
request
,
HttpServletResponse
response
)
throws
Exception
{
Long
tenantId
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"tenantId"
).
toString
());
Long
tenantId
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"tenantId"
).
toString
());
String
timeA
=
monthTime
+
"-01 00:00:00"
;
String
timeB
=
Tools
.
lastDayOfMonth
(
monthTime
)+
" 23:59:59"
;
try
{
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
headIds
,
materialIds
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
name
),
StringUtil
.
toNull
(
model
),
timeB
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
//存放数据json数组
//存放数据json数组
String
[]
names
=
{
"名称"
,
"型号"
,
"单位"
,
"单价"
,
"上月结存数量"
,
"入库数量"
,
"出库数量"
,
"本月结存数量"
,
"结存金额"
};
String
[]
names
=
{
"名称"
,
"型号"
,
"单位"
,
"单价"
,
"上月结存数量"
,
"入库数量"
,
"出库数量"
,
"本月结存数量"
,
"结存金额"
};
String
title
=
"库存报表"
;
String
title
=
"库存报表"
;
...
@@ -349,8 +354,6 @@ public class DepotItemController {
...
@@ -349,8 +354,6 @@ public class DepotItemController {
if
(
null
!=
dataList
)
{
if
(
null
!=
dataList
)
{
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
Long
mId
=
diEx
.
getMId
();
Long
mId
=
diEx
.
getMId
();
String
timeA
=
monthTime
+
"-01 00:00:00"
;
String
timeB
=
monthTime
+
"-31 23:59:59"
;
String
[]
objs
=
new
String
[
9
];
String
[]
objs
=
new
String
[
9
];
objs
[
0
]
=
diEx
.
getMName
().
toString
();
objs
[
0
]
=
diEx
.
getMName
().
toString
();
objs
[
1
]
=
diEx
.
getMModel
().
toString
();
objs
[
1
]
=
diEx
.
getMModel
().
toString
();
...
@@ -359,7 +362,7 @@ public class DepotItemController {
...
@@ -359,7 +362,7 @@ public class DepotItemController {
objs
[
4
]
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
timeA
,
tenantId
).
toString
();
objs
[
4
]
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
timeA
,
tenantId
).
toString
();
objs
[
5
]
=
depotItemService
.
getInNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
).
toString
();
objs
[
5
]
=
depotItemService
.
getInNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
).
toString
();
objs
[
6
]
=
depotItemService
.
getOutNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
).
toString
();
objs
[
6
]
=
depotItemService
.
getOutNumByParam
(
depotId
,
mId
,
timeA
,
timeB
,
tenantId
).
toString
();
BigDecimal
thisSum
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
null
,
tenantId
);
BigDecimal
thisSum
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
timeB
,
tenantId
);
objs
[
7
]
=
thisSum
.
toString
();
objs
[
7
]
=
thisSum
.
toString
();
objs
[
8
]
=
thisSum
.
multiply
(
getUnitPrice
(
diEx
.
getPresetPriceOne
(),
diEx
.
getPriceStrategy
())).
toString
();
objs
[
8
]
=
thisSum
.
multiply
(
getUnitPrice
(
diEx
.
getPresetPriceOne
(),
diEx
.
getPriceStrategy
())).
toString
();
objects
.
add
(
objs
);
objects
.
add
(
objs
);
...
@@ -384,20 +387,22 @@ public class DepotItemController {
...
@@ -384,20 +387,22 @@ public class DepotItemController {
@PostMapping
(
value
=
"/totalCountMoney"
)
@PostMapping
(
value
=
"/totalCountMoney"
)
public
BaseResponseInfo
totalCountMoney
(
@RequestParam
(
"depotId"
)
Long
depotId
,
public
BaseResponseInfo
totalCountMoney
(
@RequestParam
(
"depotId"
)
Long
depotId
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"
headIds
"
)
String
headIds
,
@RequestParam
(
"
name
"
)
String
name
,
@RequestParam
(
"m
aterialIds
"
)
String
m
aterialIds
,
@RequestParam
(
"m
odel
"
)
String
m
odel
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Long
tenantId
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"tenantId"
).
toString
());
Long
tenantId
=
Long
.
parseLong
(
request
.
getSession
().
getAttribute
(
"tenantId"
).
toString
());
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)+
" 23:59:59"
;
try
{
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
headIds
,
materialIds
,
null
,
null
);
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
name
),
StringUtil
.
toNull
(
model
),
endTime
,
null
,
null
);
BigDecimal
thisAllPrice
=
BigDecimal
.
ZERO
;
BigDecimal
thisAllPrice
=
BigDecimal
.
ZERO
;
if
(
null
!=
dataList
)
{
if
(
null
!=
dataList
)
{
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
for
(
DepotItemVo4WithInfoEx
diEx
:
dataList
)
{
Long
mId
=
diEx
.
getMId
();
Long
mId
=
diEx
.
getMId
();
BigDecimal
thisSum
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
null
,
tenantId
);
BigDecimal
thisSum
=
depotItemService
.
getStockByParam
(
depotId
,
mId
,
null
,
endTime
,
tenantId
);
BigDecimal
unitPrice
=
getUnitPrice
(
diEx
.
getPresetPriceOne
(),
diEx
.
getPriceStrategy
()
);
BigDecimal
unitPrice
=
diEx
.
getPurchaseDecimal
(
);
thisAllPrice
=
thisAllPrice
.
add
(
thisSum
.
multiply
(
unitPrice
));
thisAllPrice
=
thisAllPrice
.
add
(
thisSum
.
multiply
(
unitPrice
));
}
}
}
}
...
@@ -427,16 +432,18 @@ public class DepotItemController {
...
@@ -427,16 +432,18 @@ public class DepotItemController {
public
BaseResponseInfo
buyIn
(
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
public
BaseResponseInfo
buyIn
(
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"
headIds
"
)
String
headIds
,
@RequestParam
(
"
name
"
)
String
name
,
@RequestParam
(
"m
aterialIds
"
)
String
m
aterialIds
,
@RequestParam
(
"m
odel
"
)
String
m
odel
,
@RequestParam
(
"mpList"
)
String
mpList
,
@RequestParam
(
"mpList"
)
String
mpList
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)+
" 23:59:59"
;
try
{
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
headIds
,
materialIds
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
name
),
StringUtil
.
toNull
(
model
),
endTime
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
String
[]
mpArr
=
mpList
.
split
(
","
);
String
[]
mpArr
=
mpList
.
split
(
","
);
int
total
=
depotItemService
.
findByAllCount
(
headIds
,
materialIds
);
int
total
=
depotItemService
.
findByAllCount
(
StringUtil
.
toNull
(
name
),
StringUtil
.
toNull
(
model
),
endTime
);
map
.
put
(
"total"
,
total
);
map
.
put
(
"total"
,
total
);
//存放数据json数组
//存放数据json数组
JSONArray
dataArray
=
new
JSONArray
();
JSONArray
dataArray
=
new
JSONArray
();
...
@@ -488,16 +495,18 @@ public class DepotItemController {
...
@@ -488,16 +495,18 @@ public class DepotItemController {
public
BaseResponseInfo
saleOut
(
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
public
BaseResponseInfo
saleOut
(
@RequestParam
(
"currentPage"
)
Integer
currentPage
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"monthTime"
)
String
monthTime
,
@RequestParam
(
"
headIds
"
)
String
headIds
,
@RequestParam
(
"
name
"
)
String
name
,
@RequestParam
(
"m
aterialIds
"
)
String
m
aterialIds
,
@RequestParam
(
"m
odel
"
)
String
m
odel
,
@RequestParam
(
"mpList"
)
String
mpList
,
@RequestParam
(
"mpList"
)
String
mpList
,
HttpServletRequest
request
)
throws
Exception
{
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
String
endTime
=
Tools
.
lastDayOfMonth
(
monthTime
)+
" 23:59:59"
;
try
{
try
{
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
headIds
,
materialIds
,
(
currentPage
-
1
)*
pageSize
,
pageSize
);
List
<
DepotItemVo4WithInfoEx
>
dataList
=
depotItemService
.
findByAll
(
StringUtil
.
toNull
(
name
),
StringUtil
.
toNull
(
model
),
endTime
,(
currentPage
-
1
)*
pageSize
,
pageSize
);
String
[]
mpArr
=
mpList
.
split
(
","
);
String
[]
mpArr
=
mpList
.
split
(
","
);
int
total
=
depotItemService
.
findByAllCount
(
headIds
,
materialIds
);
int
total
=
depotItemService
.
findByAllCount
(
StringUtil
.
toNull
(
name
),
StringUtil
.
toNull
(
model
),
endTime
);
map
.
put
(
"total"
,
total
);
map
.
put
(
"total"
,
total
);
//存放数据json数组
//存放数据json数组
JSONArray
dataArray
=
new
JSONArray
();
JSONArray
dataArray
=
new
JSONArray
();
...
...
src/main/java/com/jsh/erp/controller/MaterialController.java
View file @
e8e43675
...
@@ -208,40 +208,6 @@ public class MaterialController {
...
@@ -208,40 +208,6 @@ public class MaterialController {
return
object
;
return
object
;
}
}
/**
* 查找商品信息-统计排序
* @param request
* @return
*/
@GetMapping
(
value
=
"/findByOrder"
)
public
BaseResponseInfo
findByOrder
(
@RequestParam
(
"name"
)
String
name
,
@RequestParam
(
"model"
)
String
model
,
HttpServletRequest
request
)
throws
Exception
{
BaseResponseInfo
res
=
new
BaseResponseInfo
();
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
try
{
List
<
Material
>
dataList
=
materialService
.
findByOrder
(
StringUtil
.
toNull
(
name
),
StringUtil
.
toNull
(
model
));
String
mId
=
""
;
if
(
null
!=
dataList
)
{
for
(
Material
material
:
dataList
)
{
mId
=
mId
+
material
.
getId
()
+
","
;
}
}
if
(
mId
!=
""
)
{
mId
=
mId
.
substring
(
0
,
mId
.
lastIndexOf
(
","
));
}
map
.
put
(
"mIds"
,
mId
);
res
.
code
=
200
;
res
.
data
=
map
;
}
catch
(
Exception
e
){
e
.
printStackTrace
();
res
.
code
=
500
;
res
.
data
=
"获取数据失败"
;
}
return
res
;
}
/**
/**
* 根据商品id查找商品信息
* 根据商品id查找商品信息
* @param meId
* @param meId
...
...
src/main/java/com/jsh/erp/datasource/mappers/DepotItemMapperEx.java
View file @
e8e43675
...
@@ -40,14 +40,16 @@ public interface DepotItemMapperEx {
...
@@ -40,14 +40,16 @@ public interface DepotItemMapperEx {
@Param
(
"headerId"
)
Long
headerId
);
@Param
(
"headerId"
)
Long
headerId
);
List
<
DepotItemVo4WithInfoEx
>
findByAll
(
List
<
DepotItemVo4WithInfoEx
>
findByAll
(
@Param
(
"headIds"
)
String
headIds
,
@Param
(
"name"
)
String
name
,
@Param
(
"materialIds"
)
String
materialIds
,
@Param
(
"model"
)
String
model
,
@Param
(
"endTime"
)
String
endTime
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"rows"
)
Integer
rows
);
@Param
(
"rows"
)
Integer
rows
);
int
findByAllCount
(
int
findByAllCount
(
@Param
(
"headIds"
)
String
headIds
,
@Param
(
"name"
)
String
name
,
@Param
(
"materialIds"
)
String
materialIds
);
@Param
(
"model"
)
String
model
,
@Param
(
"endTime"
)
String
endTime
);
BigDecimal
buyOrSaleNumber
(
BigDecimal
buyOrSaleNumber
(
@Param
(
"type"
)
String
type
,
@Param
(
"type"
)
String
type
,
...
...
src/main/java/com/jsh/erp/datasource/mappers/MaterialMapperEx.java
View file @
e8e43675
...
@@ -41,8 +41,6 @@ public interface MaterialMapperEx {
...
@@ -41,8 +41,6 @@ public interface MaterialMapperEx {
List
<
MaterialVo4Unit
>
findByIdWithBarCode
(
@Param
(
"meId"
)
Long
meId
);
List
<
MaterialVo4Unit
>
findByIdWithBarCode
(
@Param
(
"meId"
)
Long
meId
);
List
<
MaterialVo4Unit
>
findBySelect
();
List
<
MaterialVo4Unit
>
findBySelectWithBarCode
(
@Param
(
"q"
)
String
q
,
List
<
MaterialVo4Unit
>
findBySelectWithBarCode
(
@Param
(
"q"
)
String
q
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"offset"
)
Integer
offset
,
@Param
(
"rows"
)
Integer
rows
);
@Param
(
"rows"
)
Integer
rows
);
...
@@ -76,7 +74,4 @@ public interface MaterialMapperEx {
...
@@ -76,7 +74,4 @@ public interface MaterialMapperEx {
@Param
(
"meId"
)
Long
meId
);
@Param
(
"meId"
)
Long
meId
);
List
<
String
>
getMaterialNameList
();
List
<
String
>
getMaterialNameList
();
List
<
Material
>
findByOrder
(
@Param
(
"name"
)
String
name
,
@Param
(
"model"
)
String
model
);
}
}
src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
e8e43675
...
@@ -285,20 +285,6 @@ public class DepotHeadService {
...
@@ -285,20 +285,6 @@ public class DepotHeadService {
return
result
;
return
result
;
}
}
public
List
<
DepotHead
>
findByMonth
(
String
monthTime
)
throws
Exception
{
DepotHeadExample
example
=
new
DepotHeadExample
();
monthTime
=
monthTime
+
"-31 23:59:59"
;
Date
month
=
StringUtil
.
getDateByString
(
monthTime
,
null
);
example
.
createCriteria
().
andOpertimeLessThanOrEqualTo
(
month
).
andDeleteFlagNotEqualTo
(
BusinessConstants
.
DELETE_FLAG_DELETED
);
List
<
DepotHead
>
list
=
null
;
try
{
list
=
depotHeadMapper
.
selectByExample
(
example
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
return
list
;
}
public
List
<
DepotHeadVo4InDetail
>
findByAll
(
String
beginTime
,
String
endTime
,
String
type
,
Integer
pid
,
String
dids
,
Integer
oId
,
Integer
offset
,
Integer
rows
)
throws
Exception
{
public
List
<
DepotHeadVo4InDetail
>
findByAll
(
String
beginTime
,
String
endTime
,
String
type
,
Integer
pid
,
String
dids
,
Integer
oId
,
Integer
offset
,
Integer
rows
)
throws
Exception
{
List
<
DepotHeadVo4InDetail
>
list
=
null
;
List
<
DepotHeadVo4InDetail
>
list
=
null
;
try
{
try
{
...
...
src/main/java/com/jsh/erp/service/depotItem/DepotItemService.java
View file @
e8e43675
...
@@ -234,20 +234,20 @@ public class DepotItemService {
...
@@ -234,20 +234,20 @@ public class DepotItemService {
return
list
;
return
list
;
}
}
public
List
<
DepotItemVo4WithInfoEx
>
findByAll
(
String
headIds
,
String
m
aterialIds
,
Integer
offset
,
Integer
rows
)
throws
Exception
{
public
List
<
DepotItemVo4WithInfoEx
>
findByAll
(
String
name
,
String
m
odel
,
String
endTime
,
Integer
offset
,
Integer
rows
)
throws
Exception
{
List
<
DepotItemVo4WithInfoEx
>
list
=
null
;
List
<
DepotItemVo4WithInfoEx
>
list
=
null
;
try
{
try
{
list
=
depotItemMapperEx
.
findByAll
(
headIds
,
materialIds
,
offset
,
rows
);
list
=
depotItemMapperEx
.
findByAll
(
name
,
model
,
endTime
,
offset
,
rows
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
}
}
return
list
;
return
list
;
}
}
public
int
findByAllCount
(
String
headIds
,
String
m
aterialIds
)
throws
Exception
{
public
int
findByAllCount
(
String
name
,
String
m
odel
,
String
endTime
)
throws
Exception
{
int
result
=
0
;
int
result
=
0
;
try
{
try
{
result
=
depotItemMapperEx
.
findByAllCount
(
headIds
,
materialIds
);
result
=
depotItemMapperEx
.
findByAllCount
(
name
,
model
,
endTime
);
}
catch
(
Exception
e
){
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
JshException
.
readFail
(
logger
,
e
);
}
}
...
...
src/main/java/com/jsh/erp/service/material/MaterialService.java
View file @
e8e43675
...
@@ -317,26 +317,6 @@ public class MaterialService {
...
@@ -317,26 +317,6 @@ public class MaterialService {
return
list
;
return
list
;
}
}
public
List
<
MaterialVo4Unit
>
findBySelect
()
throws
Exception
{
List
<
MaterialVo4Unit
>
list
=
null
;
try
{
list
=
materialMapperEx
.
findBySelect
();
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
return
list
;
}
public
List
<
Material
>
findByOrder
(
String
name
,
String
model
)
throws
Exception
{
List
<
Material
>
list
=
null
;
try
{
list
=
materialMapperEx
.
findByOrder
(
name
,
model
);
}
catch
(
Exception
e
){
JshException
.
readFail
(
logger
,
e
);
}
return
list
;
}
public
List
<
MaterialVo4Unit
>
findBySelectWithBarCode
(
String
q
,
Integer
offset
,
Integer
rows
)
throws
Exception
{
public
List
<
MaterialVo4Unit
>
findBySelectWithBarCode
(
String
q
,
Integer
offset
,
Integer
rows
)
throws
Exception
{
List
<
MaterialVo4Unit
>
list
=
null
;
List
<
MaterialVo4Unit
>
list
=
null
;
try
{
try
{
...
...
src/main/java/com/jsh/erp/utils/Tools.java
View file @
e8e43675
...
@@ -459,6 +459,20 @@ public class Tools {
...
@@ -459,6 +459,20 @@ public class Tools {
return
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
c
.
getTime
());
return
new
SimpleDateFormat
(
"yyyy-MM"
).
format
(
c
.
getTime
());
}
}
/**
* 根据月份获取当月最后一天
* @param monthTime
* @return
* @throws ParseException
*/
public
static
String
lastDayOfMonth
(
String
monthTime
)
throws
ParseException
{
Date
date
=
new
SimpleDateFormat
(
"yyyy-MM"
).
parse
(
monthTime
);
Calendar
cal
=
Calendar
.
getInstance
();
cal
.
setTime
(
date
);
cal
.
set
(
Calendar
.
DAY_OF_MONTH
,
1
);
cal
.
roll
(
Calendar
.
DAY_OF_MONTH
,
-
1
);
return
new
SimpleDateFormat
(
"yyyy-MM-dd"
).
format
(
cal
.
getTime
());
}
/**
/**
* 获取email用户姓名
* 获取email用户姓名
...
...
src/main/resources/mapper_xml/DepotItemMapperEx.xml
View file @
e8e43675
...
@@ -149,20 +149,25 @@
...
@@ -149,20 +149,25 @@
<select
id=
"findByAll"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"ResultByMaterial"
>
<select
id=
"findByAll"
parameterType=
"com.jsh.erp.datasource.entities.DepotItemExample"
resultMap=
"ResultByMaterial"
>
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor,
select m.id MId, m.Name MName, m.Model MModel, m.Unit MaterialUnit, m.Color MColor,
me.purchase_decimal, u.UName UName
me.purchase_decimal, u.UName UName
from jsh_depotitem di
from jsh_material m
inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depotitem di on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depothead dh on di.HeaderId=dh.id and ifnull(dh.delete_Flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_material_extend me on me.id=di.material_extend_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where 1=1
where 1=1
and me.default_flag=1
and me.default_flag=1
<if
test=
"headIds != null"
>
<if
test=
"name != null"
>
and di.HeaderId in (${headIds})
and m.name like '%${name}%'
</if>
<if
test=
"model != null"
>
and m.model like '%${model}%'
</if>
</if>
<if
test=
"
materialIds
!= null"
>
<if
test=
"
endTime
!= null"
>
and d
i.MaterialId in (${materialIds})
and d
h.OperTime
<
= '${endTime}'
</if>
</if>
and ifnull(di.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
group by m.id,m.Name, m.Model, m.Unit, m.Color, me.purchase_decimal, u.UName
group by m.id,m.Name, m.Model, m.Unit, m.Color, me.purchase_decimal, u.UName
order by m.Name, m.Model asc
<if
test=
"offset != null and rows != null"
>
<if
test=
"offset != null and rows != null"
>
limit #{offset},#{rows}
limit #{offset},#{rows}
</if>
</if>
...
@@ -170,14 +175,18 @@
...
@@ -170,14 +175,18 @@
<select
id=
"findByAllCount"
resultType=
"java.lang.Integer"
>
<select
id=
"findByAllCount"
resultType=
"java.lang.Integer"
>
select count(1) from (select m.id
select count(1) from (select m.id
from jsh_depotitem di
from jsh_material m
inner join jsh_material m on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depotitem di on di.MaterialId=m.id and ifnull(m.delete_Flag,'0') !='1'
left join jsh_depothead dh on di.HeaderId=dh.id and ifnull(dh.delete_Flag,'0') !='1'
where 1=1
where 1=1
<if
test=
"headIds != null"
>
<if
test=
"name != null"
>
and di.HeaderId in (${headIds})
and m.name like '%${name}%'
</if>
<if
test=
"model != null"
>
and m.model like '%${model}%'
</if>
</if>
<if
test=
"
materialIds
!= null"
>
<if
test=
"
endTime
!= null"
>
and d
i.MaterialId in (${materialIds})
and d
h.OperTime
<
= '${endTime}'
</if>
</if>
and ifnull(di.delete_Flag,'0') !='1'
and ifnull(di.delete_Flag,'0') !='1'
group by m.id) cc
group by m.id) cc
...
...
src/main/resources/mapper_xml/MaterialMapperEx.xml
View file @
e8e43675
...
@@ -97,14 +97,6 @@
...
@@ -97,14 +97,6 @@
and ifnull(m.delete_Flag,'0') !='1'
and ifnull(m.delete_Flag,'0') !='1'
</select>
</select>
<select
id=
"findBySelect"
parameterType=
"com.jsh.erp.datasource.entities.MaterialExample"
resultMap=
"ResultAndUnitMap"
>
select m.*,u.UName from jsh_material m
left join jsh_unit u on m.UnitId=u.id and ifnull(u.delete_Flag,'0') !='1'
where m.enabled=1
and ifnull(m.delete_Flag,'0') !='1'
ORDER BY Id desc
</select>
<select
id=
"findBySelectWithBarCode"
parameterType=
"com.jsh.erp.datasource.entities.MaterialExample"
resultMap=
"ResultAndUnitMap"
>
<select
id=
"findBySelectWithBarCode"
parameterType=
"com.jsh.erp.datasource.entities.MaterialExample"
resultMap=
"ResultAndUnitMap"
>
select m.*,u.UName,me.bar_code m_bar_code,me.id meId,me.commodity_unit from jsh_material m
select m.*,u.UName,me.bar_code m_bar_code,me.id meId,me.commodity_unit from jsh_material m
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
left join jsh_material_extend me on m.id=me.material_id and ifnull(me.delete_Flag,'0') !='1'
...
@@ -258,18 +250,4 @@
...
@@ -258,18 +250,4 @@
group by m.name
group by m.name
order by m.name asc
order by m.name asc
</select>
</select>
<select
id=
"findByOrder"
resultType=
"com.jsh.erp.datasource.entities.Material"
>
select m.*
FROM jsh_material m
where 1=1
<if
test=
"name != null"
>
and m.name like '%${name}%'
</if>
<if
test=
"model != null"
>
and m.model like '%${model}%'
</if>
and ifnull(m.delete_Flag,'0') !='1'
order by m.name,m.model asc
</select>
</mapper>
</mapper>
\ No newline at end of file
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