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
59244dad
Commit
59244dad
authored
Feb 13, 2023
by
zhanglt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
合并代码
parent
b9bab81f
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
1608 additions
and
0 deletions
+1608
-0
MaterialType.java
...s/modules/warehouse/materialtype/entity/MaterialType.java
+52
-0
MaterialTypeMapper.java
...les/warehouse/materialtype/mapper/MaterialTypeMapper.java
+19
-0
MaterialTypeMapper.xml
.../warehouse/materialtype/mapper/xml/MaterialTypeMapper.xml
+177
-0
MaterialTypeService.java
...s/warehouse/materialtype/service/MaterialTypeService.java
+47
-0
MaterialTypeController.java
...es/warehouse/materialtype/web/MaterialTypeController.java
+177
-0
Warehouse.java
...jeeplus/modules/warehouse/warehouse/entity/Warehouse.java
+48
-0
WarehouseMapper.java
...s/modules/warehouse/warehouse/mapper/WarehouseMapper.java
+19
-0
WarehouseMapper.xml
...odules/warehouse/warehouse/mapper/xml/WarehouseMapper.xml
+132
-0
WarehouseService.java
...modules/warehouse/warehouse/service/WarehouseService.java
+48
-0
WarehouseController.java
.../modules/warehouse/warehouse/web/WarehouseController.java
+226
-0
materialTypeForm.jsp
...bpage/modules/warehouse/materialtype/materialTypeForm.jsp
+85
-0
materialTypeList.js
...ebpage/modules/warehouse/materialtype/materialTypeList.js
+117
-0
materialTypeList.jsp
...bpage/modules/warehouse/materialtype/materialTypeList.jsp
+48
-0
warehouseForm.jsp
...app/webpage/modules/warehouse/warehouse/warehouseForm.jsp
+72
-0
warehouseList.js
...bapp/webpage/modules/warehouse/warehouse/warehouseList.js
+246
-0
warehouseList.jsp
...app/webpage/modules/warehouse/warehouse/warehouseList.jsp
+95
-0
No files found.
src/main/java/com/jeeplus/modules/warehouse/materialtype/entity/MaterialType.java
0 → 100644
View file @
59244dad
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialtype
.
entity
;
import
com.fasterxml.jackson.annotation.JsonBackReference
;
import
javax.validation.constraints.NotNull
;
import
com.jeeplus.core.persistence.TreeEntity
;
/**
* 物资类型Entity
* @author zhnaglt
* @version 2023-02-13
*/
public
class
MaterialType
extends
TreeEntity
<
MaterialType
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
code
;
// 物资类型编码
public
MaterialType
()
{
super
();
}
public
MaterialType
(
String
id
){
super
(
id
);
}
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
public
MaterialType
getParent
()
{
return
parent
;
}
@Override
public
void
setParent
(
MaterialType
parent
)
{
this
.
parent
=
parent
;
}
public
String
getParentId
()
{
return
parent
!=
null
&&
parent
.
getId
()
!=
null
?
parent
.
getId
()
:
"0"
;
}
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialtype/mapper/MaterialTypeMapper.java
0 → 100644
View file @
59244dad
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialtype
.
mapper
;
import
com.jeeplus.core.persistence.TreeMapper
;
import
com.jeeplus.core.persistence.annotation.MyBatisMapper
;
import
com.jeeplus.modules.warehouse.materialtype.entity.MaterialType
;
/**
* 物资类型MAPPER接口
* @author zhnaglt
* @version 2023-02-13
*/
@MyBatisMapper
public
interface
MaterialTypeMapper
extends
TreeMapper
<
MaterialType
>
{
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialtype/mapper/xml/MaterialTypeMapper.xml
0 → 100644
View file @
59244dad
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jeeplus.modules.warehouse.materialtype.mapper.MaterialTypeMapper"
>
<resultMap
id=
"materialTypeResult"
type=
"MaterialType"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"name"
column=
"name"
/>
<result
property=
"sort"
column=
"sort"
/>
<result
property=
"parentIds"
column=
"parentIds"
/>
<result
property=
"code"
column=
"code"
/>
<association
property=
"hasChildren"
column=
"id"
select=
"hasChildren"
/>
</resultMap>
<sql
id=
"materialTypeColumns"
>
a.id AS "id",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.del_flag AS "delFlag",
a.parent_id AS "parent.id",
a.parent_ids AS "parentIds",
a.name AS "name",
a.sort AS "sort",
a.code AS "code"
</sql>
<sql
id=
"materialTypeJoins"
>
</sql>
<select
id=
"get"
resultType=
"MaterialType"
>
SELECT
<include
refid=
"materialTypeColumns"
/>
FROM t_wh_material_type a
<include
refid=
"materialTypeJoins"
/>
WHERE a.id = #{id}
</select>
<select
id=
"findList"
resultType=
"MaterialType"
>
SELECT
<include
refid=
"materialTypeColumns"
/>
FROM t_wh_material_type a
<include
refid=
"materialTypeJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
<if
test=
"parent != null and parent.id != null and parent.id != ''"
>
AND a.parent_id = #{parent.id}
</if>
<if
test=
"parentIds != null and parentIds != ''"
>
AND a.parent_ids LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{parentIds}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{parentIds}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
concat('%',#{parentIds},'%')
</if>
</if>
<if
test=
"name != null and name != ''"
>
AND a.name LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{name}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{name}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
concat('%',#{name},'%')
</if>
</if>
</where>
ORDER BY a.sort ASC
</select>
<select
id=
"findAllList"
resultType=
"MaterialType"
>
SELECT
<include
refid=
"materialTypeColumns"
/>
FROM t_wh_material_type a
<include
refid=
"materialTypeJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
</where>
ORDER BY a.sort ASC
</select>
<select
id=
"getChildren"
parameterType=
"String"
resultMap=
"materialTypeResult"
>
select * from t_wh_material_type where parent_id = #{id} ORDER BY sort
</select>
<select
id=
"hasChildren"
parameterType=
"String"
resultType=
"Boolean"
>
select case when exists(select 1 from t_wh_material_type where parent_id = #{id}) then 1 else 0 end ${dual}
</select>
<select
id=
"findByParentIdsLike"
resultType=
"MaterialType"
>
SELECT
a.id,
a.parent_id AS "parent.id",
a.parent_ids
FROM t_wh_material_type a
<include
refid=
"materialTypeJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
AND a.parent_ids LIKE #{parentIds}
</where>
ORDER BY a.sort ASC
</select>
<insert
id=
"insert"
>
INSERT INTO t_wh_material_type(
id,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag,
parent_id,
parent_ids,
name,
sort,
code
) VALUES (
#{id},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{remarks},
#{delFlag},
#{parent.id},
#{parentIds},
#{name},
#{sort},
#{code}
)
</insert>
<update
id=
"update"
>
UPDATE t_wh_material_type SET
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks},
parent_id = #{parent.id},
parent_ids = #{parentIds},
name = #{name},
sort = #{sort},
code = #{code}
WHERE id = #{id}
</update>
<update
id=
"updateParentIds"
>
UPDATE t_wh_material_type SET
parent_id = #{parent.id},
parent_ids = #{parentIds}
WHERE id = #{id}
</update>
<!--物理删除-->
<update
id=
"delete"
>
DELETE FROM t_wh_material_type
WHERE id = #{id} OR parent_ids LIKE
<if
test=
"dbName == 'oracle'"
>
'%,'||#{id}||',%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%,'+#{id}+',%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%,', #{id}, ',%')
</if>
</update>
<!--逻辑删除-->
<update
id=
"deleteByLogic"
>
UPDATE t_wh_material_type SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id} OR parent_ids LIKE
<if
test=
"dbName == 'oracle'"
>
'%,'||#{id}||',%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%,'+#{id}+',%'
</if>
<if
test=
"dbName == 'mysql'"
>
CONCAT('%,', #{id}, ',%')
</if>
</update>
</mapper>
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialtype/service/MaterialTypeService.java
0 → 100644
View file @
59244dad
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialtype
.
service
;
import
java.util.List
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.jeeplus.core.service.TreeService
;
import
com.jeeplus.common.utils.StringUtils
;
import
com.jeeplus.modules.warehouse.materialtype.entity.MaterialType
;
import
com.jeeplus.modules.warehouse.materialtype.mapper.MaterialTypeMapper
;
/**
* 物资类型Service
* @author zhnaglt
* @version 2023-02-13
*/
@Service
@Transactional
(
readOnly
=
true
)
public
class
MaterialTypeService
extends
TreeService
<
MaterialTypeMapper
,
MaterialType
>
{
public
MaterialType
get
(
String
id
)
{
return
super
.
get
(
id
);
}
public
List
<
MaterialType
>
findList
(
MaterialType
materialType
)
{
if
(
StringUtils
.
isNotBlank
(
materialType
.
getParentIds
())){
materialType
.
setParentIds
(
","
+
materialType
.
getParentIds
()+
","
);
}
return
super
.
findList
(
materialType
);
}
@Transactional
(
readOnly
=
false
)
public
void
save
(
MaterialType
materialType
)
{
super
.
save
(
materialType
);
}
@Transactional
(
readOnly
=
false
)
public
void
delete
(
MaterialType
materialType
)
{
super
.
delete
(
materialType
);
}
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/materialtype/web/MaterialTypeController.java
0 → 100644
View file @
59244dad
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
materialtype
.
web
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
org.apache.shiro.authz.annotation.Logical
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.jeeplus.common.json.AjaxJson
;
import
com.jeeplus.common.config.Global
;
import
com.jeeplus.core.web.BaseController
;
import
com.jeeplus.common.utils.StringUtils
;
import
com.jeeplus.modules.warehouse.materialtype.entity.MaterialType
;
import
com.jeeplus.modules.warehouse.materialtype.service.MaterialTypeService
;
/**
* 物资类型Controller
* @author zhnaglt
* @version 2023-02-13
*/
@Controller
@RequestMapping
(
value
=
"${adminPath}/warehouse/materialtype/materialType"
)
public
class
MaterialTypeController
extends
BaseController
{
@Autowired
private
MaterialTypeService
materialTypeService
;
@ModelAttribute
public
MaterialType
get
(
@RequestParam
(
required
=
false
)
String
id
)
{
MaterialType
entity
=
null
;
if
(
StringUtils
.
isNotBlank
(
id
)){
entity
=
materialTypeService
.
get
(
id
);
}
if
(
entity
==
null
){
entity
=
new
MaterialType
();
}
return
entity
;
}
/**
* 物资类型列表页面
*/
@RequiresPermissions
(
"warehouse:materialtype:materialType:list"
)
@RequestMapping
(
value
=
{
"list"
,
""
})
public
String
list
(
MaterialType
materialType
,
@ModelAttribute
(
"parentIds"
)
String
parentIds
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
if
(
StringUtils
.
isNotBlank
(
parentIds
)){
model
.
addAttribute
(
"parentIds"
,
parentIds
);
}
model
.
addAttribute
(
"materialType"
,
materialType
);
return
"modules/warehouse/materialtype/materialTypeList"
;
}
/**
* 查看,增加,编辑物资类型表单页面
* params:
* mode: add, edit, view,addChild 代表四种种模式的页面
*/
@RequiresPermissions
(
value
={
"warehouse:materialtype:materialType:view"
,
"warehouse:materialtype:materialType:add"
,
"warehouse:materialtype:materialType:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"form/{mode}"
)
public
String
form
(
@PathVariable
String
mode
,
MaterialType
materialType
,
Model
model
)
{
if
(
materialType
.
getParent
()!=
null
&&
StringUtils
.
isNotBlank
(
materialType
.
getParent
().
getId
())){
materialType
.
setParent
(
materialTypeService
.
get
(
materialType
.
getParent
().
getId
()));
// 获取排序号,最末节点排序号+30
if
(
StringUtils
.
isBlank
(
materialType
.
getId
())){
MaterialType
materialTypeChild
=
new
MaterialType
();
materialTypeChild
.
setParent
(
new
MaterialType
(
materialType
.
getParent
().
getId
()));
List
<
MaterialType
>
list
=
materialTypeService
.
findList
(
materialType
);
if
(
list
.
size
()
>
0
){
materialType
.
setSort
(
list
.
get
(
list
.
size
()-
1
).
getSort
());
if
(
materialType
.
getSort
()
!=
null
){
materialType
.
setSort
(
materialType
.
getSort
()
+
30
);
}
}
}
}
if
(
materialType
.
getSort
()
==
null
){
materialType
.
setSort
(
30
);
}
model
.
addAttribute
(
"mode"
,
mode
);
model
.
addAttribute
(
"materialType"
,
materialType
);
return
"modules/warehouse/materialtype/materialTypeForm"
;
}
/**
* 保存物资类型
*/
@ResponseBody
@RequiresPermissions
(
value
={
"warehouse:materialtype:materialType:add"
,
"warehouse:materialtype:materialType:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"save"
)
public
AjaxJson
save
(
MaterialType
materialType
,
Model
model
)
throws
Exception
{
AjaxJson
j
=
new
AjaxJson
();
/**
* 后台hibernate-validation插件校验
*/
String
errMsg
=
beanValidator
(
materialType
);
if
(
StringUtils
.
isNotBlank
(
errMsg
)){
j
.
setSuccess
(
false
);
j
.
setMsg
(
errMsg
);
return
j
;
}
//新增或编辑表单保存
materialTypeService
.
save
(
materialType
);
//保存
j
.
setSuccess
(
true
);
j
.
put
(
"parentIds"
,
materialType
.
getParentIds
());
j
.
setMsg
(
"保存物资类型成功"
);
return
j
;
}
@ResponseBody
@RequestMapping
(
value
=
"getChildren"
)
public
List
<
MaterialType
>
getChildren
(
String
parentId
){
if
(
"-1"
.
equals
(
parentId
)){
//如果是-1,没指定任何父节点,就从根节点开始查找
parentId
=
"0"
;
}
return
materialTypeService
.
getChildren
(
parentId
);
}
/**
* 删除物资类型
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:materialtype:materialType:del"
)
@RequestMapping
(
value
=
"delete"
)
public
AjaxJson
delete
(
MaterialType
materialType
)
{
AjaxJson
j
=
new
AjaxJson
();
materialTypeService
.
delete
(
materialType
);
j
.
setSuccess
(
true
);
j
.
setMsg
(
"删除物资类型成功"
);
return
j
;
}
@RequiresPermissions
(
"user"
)
@ResponseBody
@RequestMapping
(
value
=
"treeData"
)
public
List
<
Map
<
String
,
Object
>>
treeData
(
@RequestParam
(
required
=
false
)
String
extId
,
HttpServletResponse
response
)
{
List
<
Map
<
String
,
Object
>>
mapList
=
Lists
.
newArrayList
();
List
<
MaterialType
>
list
=
materialTypeService
.
findList
(
new
MaterialType
());
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++){
MaterialType
e
=
list
.
get
(
i
);
if
(
StringUtils
.
isBlank
(
extId
)
||
(
extId
!=
null
&&
!
extId
.
equals
(
e
.
getId
())
&&
e
.
getParentIds
().
indexOf
(
","
+
extId
+
","
)==-
1
)){
Map
<
String
,
Object
>
map
=
Maps
.
newHashMap
();
map
.
put
(
"id"
,
e
.
getId
());
map
.
put
(
"text"
,
e
.
getName
());
if
(
StringUtils
.
isBlank
(
e
.
getParentId
())
||
"0"
.
equals
(
e
.
getParentId
())){
map
.
put
(
"parent"
,
"#"
);
Map
<
String
,
Object
>
state
=
Maps
.
newHashMap
();
state
.
put
(
"opened"
,
true
);
map
.
put
(
"state"
,
state
);
}
else
{
map
.
put
(
"parent"
,
e
.
getParentId
());
}
mapList
.
add
(
map
);
}
}
return
mapList
;
}
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/warehouse/entity/Warehouse.java
0 → 100644
View file @
59244dad
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
warehouse
.
entity
;
import
com.jeeplus.core.persistence.DataEntity
;
import
com.jeeplus.common.utils.excel.annotation.ExcelField
;
/**
* 仓库信息Entity
* @author zhanglt
* @version 2023-02-13
*/
public
class
Warehouse
extends
DataEntity
<
Warehouse
>
{
private
static
final
long
serialVersionUID
=
1L
;
private
String
name
;
// 仓库名称
private
String
code
;
// 仓库编号
public
Warehouse
()
{
super
();
}
public
Warehouse
(
String
id
){
super
(
id
);
}
@ExcelField
(
title
=
"仓库名称"
,
align
=
2
,
sort
=
7
)
public
String
getName
()
{
return
name
;
}
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
@ExcelField
(
title
=
"仓库编号"
,
align
=
2
,
sort
=
8
)
public
String
getCode
()
{
return
code
;
}
public
void
setCode
(
String
code
)
{
this
.
code
=
code
;
}
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/warehouse/mapper/WarehouseMapper.java
0 → 100644
View file @
59244dad
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
warehouse
.
mapper
;
import
com.jeeplus.core.persistence.BaseMapper
;
import
com.jeeplus.core.persistence.annotation.MyBatisMapper
;
import
com.jeeplus.modules.warehouse.warehouse.entity.Warehouse
;
/**
* 仓库信息MAPPER接口
* @author zhanglt
* @version 2023-02-13
*/
@MyBatisMapper
public
interface
WarehouseMapper
extends
BaseMapper
<
Warehouse
>
{
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/warehouse/mapper/xml/WarehouseMapper.xml
0 → 100644
View file @
59244dad
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.jeeplus.modules.warehouse.warehouse.mapper.WarehouseMapper"
>
<sql
id=
"warehouseColumns"
>
a.id AS "id",
a.create_by AS "createBy.id",
a.create_date AS "createDate",
a.update_by AS "updateBy.id",
a.update_date AS "updateDate",
a.remarks AS "remarks",
a.del_flag AS "delFlag",
a.name AS "name",
a.code AS "code"
</sql>
<sql
id=
"warehouseJoins"
>
</sql>
<select
id=
"get"
resultType=
"Warehouse"
>
SELECT
<include
refid=
"warehouseColumns"
/>
FROM t_wh_warehouse a
<include
refid=
"warehouseJoins"
/>
WHERE a.id = #{id}
</select>
<select
id=
"findList"
resultType=
"Warehouse"
>
SELECT
<include
refid=
"warehouseColumns"
/>
FROM t_wh_warehouse a
<include
refid=
"warehouseJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
<if
test=
"name != null and name != ''"
>
AND a.name LIKE
<if
test=
"dbName == 'oracle'"
>
'%'||#{name}||'%'
</if>
<if
test=
"dbName == 'mssql'"
>
'%'+#{name}+'%'
</if>
<if
test=
"dbName == 'mysql'"
>
concat('%',#{name},'%')
</if>
</if>
<if
test=
"code != null and code != ''"
>
AND a.code = #{code}
</if>
</where>
<choose>
<when
test=
"page !=null and page.orderBy != null and page.orderBy != ''"
>
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.update_date DESC
</otherwise>
</choose>
</select>
<select
id=
"findAllList"
resultType=
"Warehouse"
>
SELECT
<include
refid=
"warehouseColumns"
/>
FROM t_wh_warehouse a
<include
refid=
"warehouseJoins"
/>
<where>
a.del_flag = #{DEL_FLAG_NORMAL}
${dataScope}
</where>
<choose>
<when
test=
"page !=null and page.orderBy != null and page.orderBy != ''"
>
ORDER BY ${page.orderBy}
</when>
<otherwise>
ORDER BY a.update_date DESC
</otherwise>
</choose>
</select>
<insert
id=
"insert"
>
INSERT INTO t_wh_warehouse(
id,
create_by,
create_date,
update_by,
update_date,
remarks,
del_flag,
name,
code
) VALUES (
#{id},
#{createBy.id},
#{createDate},
#{updateBy.id},
#{updateDate},
#{remarks},
#{delFlag},
#{name},
#{code}
)
</insert>
<update
id=
"update"
>
UPDATE t_wh_warehouse SET
update_by = #{updateBy.id},
update_date = #{updateDate},
remarks = #{remarks},
name = #{name},
code = #{code}
WHERE id = #{id}
</update>
<!--物理删除-->
<update
id=
"delete"
>
DELETE FROM t_wh_warehouse
WHERE id = #{id}
</update>
<!--逻辑删除-->
<update
id=
"deleteByLogic"
>
UPDATE t_wh_warehouse SET
del_flag = #{DEL_FLAG_DELETE}
WHERE id = #{id}
</update>
<!-- 根据实体名称和字段名称和字段值获取唯一记录 -->
<select
id=
"findUniqueByProperty"
resultType=
"Warehouse"
statementType=
"STATEMENT"
>
select * FROM t_wh_warehouse where ${propertyName} = '${value}'
</select>
</mapper>
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/warehouse/service/WarehouseService.java
0 → 100644
View file @
59244dad
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
warehouse
.
service
;
import
java.util.List
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
com.jeeplus.core.persistence.Page
;
import
com.jeeplus.core.service.CrudService
;
import
com.jeeplus.modules.warehouse.warehouse.entity.Warehouse
;
import
com.jeeplus.modules.warehouse.warehouse.mapper.WarehouseMapper
;
/**
* 仓库信息Service
* @author zhanglt
* @version 2023-02-13
*/
@Service
@Transactional
(
readOnly
=
true
)
public
class
WarehouseService
extends
CrudService
<
WarehouseMapper
,
Warehouse
>
{
public
Warehouse
get
(
String
id
)
{
return
super
.
get
(
id
);
}
public
List
<
Warehouse
>
findList
(
Warehouse
warehouse
)
{
return
super
.
findList
(
warehouse
);
}
public
Page
<
Warehouse
>
findPage
(
Page
<
Warehouse
>
page
,
Warehouse
warehouse
)
{
return
super
.
findPage
(
page
,
warehouse
);
}
@Transactional
(
readOnly
=
false
)
public
void
save
(
Warehouse
warehouse
)
{
super
.
save
(
warehouse
);
}
@Transactional
(
readOnly
=
false
)
public
void
delete
(
Warehouse
warehouse
)
{
super
.
delete
(
warehouse
);
}
}
\ No newline at end of file
src/main/java/com/jeeplus/modules/warehouse/warehouse/web/WarehouseController.java
0 → 100644
View file @
59244dad
/**
* Copyright © 2015-2020 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
*/
package
com
.
jeeplus
.
modules
.
warehouse
.
warehouse
.
web
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.validation.ConstraintViolationException
;
import
org.apache.shiro.authz.annotation.Logical
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.ui.Model
;
import
org.springframework.web.bind.annotation.ModelAttribute
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMethod
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.multipart.MultipartFile
;
import
com.google.common.collect.Lists
;
import
com.jeeplus.common.utils.DateUtils
;
import
com.jeeplus.common.config.Global
;
import
com.jeeplus.common.json.AjaxJson
;
import
com.jeeplus.core.persistence.Page
;
import
com.jeeplus.core.web.BaseController
;
import
com.jeeplus.common.utils.StringUtils
;
import
com.jeeplus.common.utils.excel.ExportExcel
;
import
com.jeeplus.common.utils.excel.ImportExcel
;
import
com.jeeplus.modules.warehouse.warehouse.entity.Warehouse
;
import
com.jeeplus.modules.warehouse.warehouse.service.WarehouseService
;
/**
* 仓库信息Controller
* @author zhanglt
* @version 2023-02-13
*/
@Controller
@RequestMapping
(
value
=
"${adminPath}/warehouse/warehouse/warehouse"
)
public
class
WarehouseController
extends
BaseController
{
@Autowired
private
WarehouseService
warehouseService
;
@ModelAttribute
public
Warehouse
get
(
@RequestParam
(
required
=
false
)
String
id
)
{
Warehouse
entity
=
null
;
if
(
StringUtils
.
isNotBlank
(
id
)){
entity
=
warehouseService
.
get
(
id
);
}
if
(
entity
==
null
){
entity
=
new
Warehouse
();
}
return
entity
;
}
/**
* 仓库信息列表页面
*/
@RequiresPermissions
(
"warehouse:warehouse:warehouse:list"
)
@RequestMapping
(
value
=
{
"list"
,
""
})
public
String
list
(
Warehouse
warehouse
,
Model
model
)
{
model
.
addAttribute
(
"warehouse"
,
warehouse
);
return
"modules/warehouse/warehouse/warehouseList"
;
}
/**
* 仓库信息列表数据
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:warehouse:warehouse:list"
)
@RequestMapping
(
value
=
"data"
)
public
Map
<
String
,
Object
>
data
(
Warehouse
warehouse
,
HttpServletRequest
request
,
HttpServletResponse
response
,
Model
model
)
{
Page
<
Warehouse
>
page
=
warehouseService
.
findPage
(
new
Page
<
Warehouse
>(
request
,
response
),
warehouse
);
return
getBootstrapData
(
page
);
}
/**
* 查看,增加,编辑仓库信息表单页面
*/
@RequiresPermissions
(
value
={
"warehouse:warehouse:warehouse:view"
,
"warehouse:warehouse:warehouse:add"
,
"warehouse:warehouse:warehouse:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"form/{mode}"
)
public
String
form
(
@PathVariable
String
mode
,
Warehouse
warehouse
,
Model
model
)
{
model
.
addAttribute
(
"warehouse"
,
warehouse
);
model
.
addAttribute
(
"mode"
,
mode
);
return
"modules/warehouse/warehouse/warehouseForm"
;
}
/**
* 保存仓库信息
*/
@ResponseBody
@RequiresPermissions
(
value
={
"warehouse:warehouse:warehouse:add"
,
"warehouse:warehouse:warehouse:edit"
},
logical
=
Logical
.
OR
)
@RequestMapping
(
value
=
"save"
)
public
AjaxJson
save
(
Warehouse
warehouse
,
Model
model
)
throws
Exception
{
AjaxJson
j
=
new
AjaxJson
();
/**
* 后台hibernate-validation插件校验
*/
String
errMsg
=
beanValidator
(
warehouse
);
if
(
StringUtils
.
isNotBlank
(
errMsg
)){
j
.
setSuccess
(
false
);
j
.
setMsg
(
errMsg
);
return
j
;
}
//新增或编辑表单保存
warehouseService
.
save
(
warehouse
);
//保存
j
.
setSuccess
(
true
);
j
.
setMsg
(
"保存仓库信息成功"
);
return
j
;
}
/**
* 删除仓库信息
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:warehouse:warehouse:del"
)
@RequestMapping
(
value
=
"delete"
)
public
AjaxJson
delete
(
Warehouse
warehouse
)
{
AjaxJson
j
=
new
AjaxJson
();
warehouseService
.
delete
(
warehouse
);
j
.
setMsg
(
"删除仓库信息成功"
);
return
j
;
}
/**
* 批量删除仓库信息
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:warehouse:warehouse:del"
)
@RequestMapping
(
value
=
"deleteAll"
)
public
AjaxJson
deleteAll
(
String
ids
)
{
AjaxJson
j
=
new
AjaxJson
();
String
idArray
[]
=
ids
.
split
(
","
);
for
(
String
id
:
idArray
){
warehouseService
.
delete
(
warehouseService
.
get
(
id
));
}
j
.
setMsg
(
"删除仓库信息成功"
);
return
j
;
}
/**
* 导出excel文件
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:warehouse:warehouse:export"
)
@RequestMapping
(
value
=
"export"
)
public
AjaxJson
exportFile
(
Warehouse
warehouse
,
HttpServletRequest
request
,
HttpServletResponse
response
)
{
AjaxJson
j
=
new
AjaxJson
();
try
{
String
fileName
=
"仓库信息"
+
DateUtils
.
getDate
(
"yyyyMMddHHmmss"
)+
".xlsx"
;
Page
<
Warehouse
>
page
=
warehouseService
.
findPage
(
new
Page
<
Warehouse
>(
request
,
response
,
-
1
),
warehouse
);
new
ExportExcel
(
"仓库信息"
,
Warehouse
.
class
).
setDataList
(
page
.
getList
()).
write
(
response
,
fileName
).
dispose
();
j
.
setSuccess
(
true
);
j
.
setMsg
(
"导出成功!"
);
return
j
;
}
catch
(
Exception
e
)
{
j
.
setSuccess
(
false
);
j
.
setMsg
(
"导出仓库信息记录失败!失败信息:"
+
e
.
getMessage
());
}
return
j
;
}
/**
* 导入Excel数据
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:warehouse:warehouse:import"
)
@RequestMapping
(
value
=
"import"
)
public
AjaxJson
importFile
(
@RequestParam
(
"file"
)
MultipartFile
file
,
HttpServletResponse
response
,
HttpServletRequest
request
)
{
AjaxJson
j
=
new
AjaxJson
();
try
{
int
successNum
=
0
;
int
failureNum
=
0
;
StringBuilder
failureMsg
=
new
StringBuilder
();
ImportExcel
ei
=
new
ImportExcel
(
file
,
1
,
0
);
List
<
Warehouse
>
list
=
ei
.
getDataList
(
Warehouse
.
class
);
for
(
Warehouse
warehouse
:
list
){
try
{
warehouseService
.
save
(
warehouse
);
successNum
++;
}
catch
(
ConstraintViolationException
ex
){
failureNum
++;
}
catch
(
Exception
ex
)
{
failureNum
++;
}
}
if
(
failureNum
>
0
){
failureMsg
.
insert
(
0
,
",失败 "
+
failureNum
+
" 条仓库信息记录。"
);
}
j
.
setMsg
(
"已成功导入 "
+
successNum
+
" 条仓库信息记录"
+
failureMsg
);
}
catch
(
Exception
e
)
{
j
.
setSuccess
(
false
);
j
.
setMsg
(
"导入仓库信息失败!失败信息:"
+
e
.
getMessage
());
}
return
j
;
}
/**
* 下载导入仓库信息数据模板
*/
@ResponseBody
@RequiresPermissions
(
"warehouse:warehouse:warehouse:import"
)
@RequestMapping
(
value
=
"import/template"
)
public
AjaxJson
importFileTemplate
(
HttpServletResponse
response
)
{
AjaxJson
j
=
new
AjaxJson
();
try
{
String
fileName
=
"仓库信息数据导入模板.xlsx"
;
List
<
Warehouse
>
list
=
Lists
.
newArrayList
();
new
ExportExcel
(
"仓库信息数据"
,
Warehouse
.
class
,
1
).
setDataList
(
list
).
write
(
response
,
fileName
).
dispose
();
return
null
;
}
catch
(
Exception
e
)
{
j
.
setSuccess
(
false
);
j
.
setMsg
(
"导入模板下载失败!失败信息:"
+
e
.
getMessage
());
}
return
j
;
}
}
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/materialtype/materialTypeForm.jsp
0 → 100644
View file @
59244dad
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
物资类型管理
</title>
<meta
name=
"decorator"
content=
"ani"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
){
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
jp
.
go
(
"${ctx}/warehouse/materialtype/materialType?parentIds="
+
data
.
body
.
parentIds
);
}
else
{
jp
.
error
(
data
.
msg
);
$
(
"#inputForm"
).
find
(
"button:submit"
).
button
(
"reset"
);
}
});
});
</script>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
<a
class=
"panelButton"
href=
"${ctx}/warehouse/materialtype/materialType"
><i
class=
"ti-angle-left"
></i>
返回
</a>
</h3>
</div>
<div
class=
"panel-body"
>
<form:form
id=
"inputForm"
modelAttribute=
"materialType"
action=
"${ctx}/warehouse/materialtype/materialType/save"
method=
"post"
class=
"form-horizontal"
>
<form:hidden
path=
"id"
/>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
备注信息:
</label>
<div
class=
"col-sm-10"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
上级父级编号:
</label>
<div
class=
"col-sm-10"
>
<sys:treeselect
id=
"parent"
name=
"parent.id"
value=
"${materialType.parent.id}"
labelName=
"parent.name"
labelValue=
"${materialType.parent.name}"
title=
"父级编号"
url=
"/warehouse/materialtype/materialType/treeData"
extId=
"${materialType.id}"
cssClass=
"form-control "
allowClear=
"true"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><font
color=
"red"
>
*
</font>
名称:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"name"
htmlEscape=
"false"
class=
"form-control required"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
><font
color=
"red"
>
*
</font>
排序:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"sort"
htmlEscape=
"false"
class=
"form-control required"
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
物资类型编码:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"code"
htmlEscape=
"false"
class=
"form-control "
/>
</div>
</div>
<c:if
test=
"${mode == 'add' || mode=='edit'}"
>
<div
class=
"col-lg-3"
></div>
<div
class=
"col-lg-6"
>
<div
class=
"form-group text-center"
>
<div>
<button
class=
"btn btn-primary btn-block btn-lg btn-parsley"
data-loading-text=
"正在提交..."
>
提 交
</button>
</div>
</div>
</div>
</c:if>
</form:form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/materialtype/materialTypeList.js
0 → 100644
View file @
59244dad
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
var
$materialTypeTreeTable
=
null
;
$
(
document
).
ready
(
function
()
{
$materialTypeTreeTable
=
$
(
'#materialTypeTreeTable'
).
treeTable
({
theme
:
'vsStyle'
,
expandLevel
:
2
,
column
:
0
,
checkbox
:
false
,
url
:
'${ctx}/warehouse/materialtype/materialType/getChildren?parentId='
,
callback
:
function
(
item
)
{
var
treeTableTpl
=
$
(
"#materialTypeTreeTableTpl"
).
html
();
item
.
dict
=
{};
var
result
=
laytpl
(
treeTableTpl
).
render
({
row
:
item
});
return
result
;
},
beforeClick
:
function
(
$materialTypeTreeTable
,
id
)
{
//异步获取数据 这里模拟替换处理
$materialTypeTreeTable
.
refreshPoint
(
id
);
},
beforeExpand
:
function
(
$materialTypeTreeTable
,
id
)
{
},
afterExpand
:
function
(
$materialTypeTreeTable
,
id
)
{
},
beforeClose
:
function
(
$materialTypeTreeTable
,
id
)
{
}
});
$materialTypeTreeTable
.
initParents
(
'${parentIds}'
,
"0"
);
//在保存编辑时定位展开当前节点
});
function
del
(
con
,
id
){
jp
.
confirm
(
'确认要删除物资类型吗?'
,
function
(){
jp
.
loading
();
$
.
get
(
"${ctx}/warehouse/materialtype/materialType/delete?id="
+
id
,
function
(
data
){
if
(
data
.
success
){
$materialTypeTreeTable
.
del
(
id
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
});
}
function
add
(){
//新增
jp
.
go
(
'${ctx}/warehouse/materialtype/materialType/form/add'
);
}
function
edit
(
id
){
//编辑
jp
.
go
(
'${ctx}/warehouse/materialtype/materialType/form/edit?id='
+
id
);
}
function
view
(
id
){
//查看
jp
.
go
(
'${ctx}/warehouse/materialtype/materialType/form/view?id='
+
id
);
}
function
addChild
(
id
){
//添加下级机构
jp
.
go
(
'${ctx}/warehouse/materialtype/materialType/form/add?parent.id='
+
id
);
}
function
refresh
(){
//刷新
var
index
=
jp
.
loading
(
"正在加载,请稍等..."
);
$materialTypeTreeTable
.
refresh
();
jp
.
close
(
index
);
}
<
/script
>
<
script
type
=
"text/html"
id
=
"materialTypeTreeTableTpl"
>
<
td
>
<
c
:
choose
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:materialtype:materialType:edit')}"
>
<
a
href
=
"${ctx}/warehouse/materialtype/materialType/form/edit?id={{d.row.id}}"
>
{{
d
.
row
.
remarks
===
undefined
?
""
:
d
.
row
.
remarks
}}
<
/a>
<
/c:when
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:materialtype:materialType:view')}"
>
<
a
href
=
"${ctx}/warehouse/materialtype/materialType/form/view?id={{d.row.id}}"
>
{{
d
.
row
.
remarks
===
undefined
?
""
:
d
.
row
.
remarks
}}
<
/a>
<
/c:when
>
<
c
:
otherwise
>
{{
d
.
row
.
remarks
===
undefined
?
""
:
d
.
row
.
remarks
}}
<
/c:otherwise
>
<
/c:choose
>
<
/td
>
<
td
>
{{
d
.
row
.
name
===
undefined
?
""
:
d
.
row
.
name
}}
<
/td
>
<
td
>
{{
d
.
row
.
code
===
undefined
?
""
:
d
.
row
.
code
}}
<
/td
>
<
td
>
<
div
class
=
"btn-group"
>
<
button
type
=
"button"
class
=
"btn btn-primary btn-xs dropdown-toggle"
data
-
toggle
=
"dropdown"
>
<
i
class
=
"fa fa-cog"
><
/i
>
<
span
class
=
"fa fa-chevron-down"
><
/span
>
<
/button
>
<
ul
class
=
"dropdown-menu"
role
=
"menu"
>
<
shiro
:
hasPermission
name
=
"warehouse:materialtype:materialType:view"
>
<
li
><
a
href
=
"${ctx}/warehouse/materialtype/materialType/form/view?id={{d.row.id}}"
><
i
class
=
"fa fa-search-plus"
><
/i> 查看</
a
><
/li
>
<
/shiro:hasPermission
>
<
shiro
:
hasPermission
name
=
"warehouse:materialtype:materialType:edit"
>
<
li
><
a
href
=
"${ctx}/warehouse/materialtype/materialType/form/edit?id={{d.row.id}}"
><
i
class
=
"fa fa-edit"
><
/i> 修改</
a
><
/li
>
<
/shiro:hasPermission
>
<
shiro
:
hasPermission
name
=
"warehouse:materialtype:materialType:del"
>
<
li
><
a
onclick
=
"return del(this, '{{d.row.id}}')"
><
i
class
=
"fa fa-trash"
><
/i> 删除</
a
><
/li
>
<
/shiro:hasPermission
>
<
shiro
:
hasPermission
name
=
"warehouse:materialtype:materialType:add"
>
<
li
><
a
href
=
"${ctx}/warehouse/materialtype/materialType/form/add?parent.id={{d.row.id}}"
><
i
class
=
"fa fa-plus"
><
/i> 添加下级物资类型</
a
><
/li
>
<
/shiro:hasPermission
>
<
/ul
>
<
/div
>
<
/td
>
<
/script>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/materialtype/materialTypeList.jsp
0 → 100644
View file @
59244dad
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
物资类型管理
</title>
<meta
name=
"decorator"
content=
"ani"
/>
<
%@
include
file=
"materialTypeList.js"
%
>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
物资类型列表
</h3>
</div>
<div
class=
"panel-body"
>
<!-- 工具栏 -->
<div
class=
"row"
>
<div
class=
"col-sm-12"
>
<div
class=
"pull-left treetable-bar"
>
<shiro:hasPermission
name=
"warehouse:materialtype:materialType:add"
>
<a
id=
"add"
href=
"javascript: return false"
class=
"btn btn-primary"
onclick=
"add()"
><i
class=
"glyphicon glyphicon-plus"
></i>
新建
</a>
<!-- 增加按钮 -->
</shiro:hasPermission>
<button
class=
"btn btn-default"
data-toggle=
"tooltip"
data-placement=
"left"
onclick=
"refresh()"
title=
"刷新"
><i
class=
"glyphicon glyphicon-repeat"
></i>
刷新
</button>
</div>
</div>
</div>
<table
id=
"materialTypeTreeTable"
class=
"table table-hover"
>
<thead>
<tr>
<th>
备注信息
</th>
<th>
名称
</th>
<th>
物资类型编码
</th>
<th>
操作
</th>
</tr>
</thead>
<tbody
id=
"materialTypeTreeTableList"
></tbody>
</table>
<br/>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/warehouse/warehouseForm.jsp
0 → 100644
View file @
59244dad
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
仓库信息管理
</title>
<meta
name=
"decorator"
content=
"ani"
/>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
jp
.
ajaxForm
(
"#inputForm"
,
function
(
data
){
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
jp
.
go
(
"${ctx}/warehouse/warehouse/warehouse"
);
}
else
{
jp
.
error
(
data
.
msg
);
$
(
"#inputForm"
).
find
(
"button:submit"
).
button
(
"reset"
);
}
});
});
</script>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"row"
>
<div
class=
"col-md-12"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
<a
class=
"panelButton"
href=
"${ctx}/warehouse/warehouse/warehouse"
><i
class=
"ti-angle-left"
></i>
返回
</a>
</h3>
</div>
<div
class=
"panel-body"
>
<form:form
id=
"inputForm"
modelAttribute=
"warehouse"
action=
"${ctx}/warehouse/warehouse/warehouse/save"
method=
"post"
class=
"form-horizontal"
>
<form:hidden
path=
"id"
/>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
备注信息:
</label>
<div
class=
"col-sm-10"
>
<form:textarea
path=
"remarks"
htmlEscape=
"false"
rows=
"4"
class=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
仓库名称:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"name"
htmlEscape=
"false"
class=
"form-control "
/>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"col-sm-2 control-label"
>
仓库编号:
</label>
<div
class=
"col-sm-10"
>
<form:input
path=
"code"
htmlEscape=
"false"
class=
"form-control "
/>
</div>
</div>
<c:if
test=
"${mode == 'add' || mode=='edit'}"
>
<div
class=
"col-lg-3"
></div>
<div
class=
"col-lg-6"
>
<div
class=
"form-group text-center"
>
<div>
<button
class=
"btn btn-primary btn-block btn-lg btn-parsley"
data-loading-text=
"正在提交..."
>
提 交
</button>
</div>
</div>
</div>
</c:if>
</form:form>
</div>
</div>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/warehouse/warehouseList.js
0 → 100644
View file @
59244dad
<%
@
page
contentType
=
"text/html;charset=UTF-8"
%>
<
script
>
$
(
document
).
ready
(
function
()
{
$
(
'#warehouseTable'
).
bootstrapTable
({
//请求方法
method
:
'post'
,
//类型json
dataType
:
"json"
,
contentType
:
"application/x-www-form-urlencoded"
,
//显示检索按钮
showSearch
:
true
,
//显示刷新按钮
showRefresh
:
true
,
//显示切换手机试图按钮
showToggle
:
true
,
//显示 内容列下拉框
showColumns
:
true
,
//显示到处按钮
showExport
:
true
,
//显示切换分页按钮
showPaginationSwitch
:
true
,
//最低显示2行
minimumCountColumns
:
2
,
//是否显示行间隔色
striped
:
true
,
//是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
cache
:
false
,
//是否显示分页(*)
pagination
:
true
,
//排序方式
sortOrder
:
"asc"
,
//初始化加载第一页,默认第一页
pageNumber
:
1
,
//每页的记录行数(*)
pageSize
:
10
,
//可供选择的每页的行数(*)
pageList
:
[
10
,
25
,
50
,
100
],
//这个接口需要处理bootstrap table传递的固定参数,并返回特定格式的json数据
url
:
"${ctx}/warehouse/warehouse/warehouse/data"
,
//默认值为 'limit',传给服务端的参数为:limit, offset, search, sort, order Else
//queryParamsType:'',
////查询参数,每次调用是会带上这个参数,可自定义
queryParams
:
function
(
params
)
{
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
params
.
limit
===
undefined
?
"1"
:
params
.
offset
/
params
.
limit
+
1
;
searchParam
.
pageSize
=
params
.
limit
===
undefined
?
-
1
:
params
.
limit
;
searchParam
.
orderBy
=
params
.
sort
===
undefined
?
""
:
params
.
sort
+
" "
+
params
.
order
;
return
searchParam
;
},
//分页方式:client客户端分页,server服务端分页(*)
sidePagination
:
"server"
,
contextMenuTrigger
:
"right"
,
//pc端 按右键弹出菜单
contextMenuTriggerMobile
:
"press"
,
//手机端 弹出菜单,click:单击, press:长按。
contextMenu
:
'#context-menu'
,
onContextMenuItem
:
function
(
row
,
$el
){
if
(
$el
.
data
(
"item"
)
==
"edit"
){
edit
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"view"
){
view
(
row
.
id
);
}
else
if
(
$el
.
data
(
"item"
)
==
"delete"
){
jp
.
confirm
(
'确认要删除该仓库信息记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/warehouse/warehouse/delete?id="
+
row
.
id
,
function
(
data
){
if
(
data
.
success
){
$
(
'#warehouseTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
});
}
},
onClickRow
:
function
(
row
,
$el
){
},
onShowSearch
:
function
()
{
$
(
"#search-collapse"
).
slideToggle
();
},
columns
:
[{
checkbox
:
true
}
,{
field
:
'remarks'
,
title
:
'备注信息'
,
sortable
:
true
,
sortName
:
'remarks'
,
formatter
:
function
(
value
,
row
,
index
){
value
=
jp
.
unescapeHTML
(
value
);
<
c
:
choose
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:warehouse:warehouse:edit')}"
>
return
"<a href='javascript:edit(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
<
/c:when
>
<
c
:
when
test
=
"${fns:hasPermission('warehouse:warehouse:warehouse:view')}"
>
return
"<a href='javascript:view(
\"
"
+
row
.
id
+
"
\"
)'>"
+
value
+
"</a>"
;
<
/c:when
>
<
c
:
otherwise
>
return
value
;
<
/c:otherwise
>
<
/c:choose
>
}
}
,{
field
:
'name'
,
title
:
'仓库名称'
,
sortable
:
true
,
sortName
:
'name'
}
,{
field
:
'code'
,
title
:
'仓库编号'
,
sortable
:
true
,
sortName
:
'code'
}
]
});
if
(
navigator
.
userAgent
.
match
(
/
(
iPhone|iPod|Android|ios
)
/i
)){
//如果是移动端
$
(
'#warehouseTable'
).
bootstrapTable
(
"toggleView"
);
}
$
(
'#warehouseTable'
).
on
(
'check.bs.table uncheck.bs.table load-success.bs.table '
+
'check-all.bs.table uncheck-all.bs.table'
,
function
()
{
$
(
'#remove'
).
prop
(
'disabled'
,
!
$
(
'#warehouseTable'
).
bootstrapTable
(
'getSelections'
).
length
);
$
(
'#view,#edit'
).
prop
(
'disabled'
,
$
(
'#warehouseTable'
).
bootstrapTable
(
'getSelections'
).
length
!=
1
);
});
$
(
"#btnImport"
).
click
(
function
(){
jp
.
open
({
type
:
2
,
area
:
[
500
,
200
],
auto
:
true
,
title
:
"导入数据"
,
content
:
"${ctx}/tag/importExcel"
,
btn
:
[
'下载模板'
,
'确定'
,
'关闭'
],
btn1
:
function
(
index
,
layero
){
jp
.
downloadFile
(
'${ctx}/warehouse/warehouse/warehouse/import/template'
);
},
btn2
:
function
(
index
,
layero
){
var
iframeWin
=
layero
.
find
(
'iframe'
)[
0
];
//得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method();
iframeWin
.
contentWindow
.
importExcel
(
'${ctx}/warehouse/warehouse/warehouse/import'
,
function
(
data
)
{
if
(
data
.
success
){
jp
.
success
(
data
.
msg
);
refresh
();
}
else
{
jp
.
error
(
data
.
msg
);
}
jp
.
close
(
index
);
});
//调用保存事件
return
false
;
},
btn3
:
function
(
index
){
jp
.
close
(
index
);
}
});
});
$
(
"#export"
).
click
(
function
(){
//导出Excel文件
var
searchParam
=
$
(
"#searchForm"
).
serializeJSON
();
searchParam
.
pageNo
=
1
;
searchParam
.
pageSize
=
-
1
;
var
sortName
=
$
(
'#warehouseTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortName
;
var
sortOrder
=
$
(
'#warehouseTable'
).
bootstrapTable
(
"getOptions"
,
"none"
).
sortOrder
;
var
values
=
""
;
for
(
var
key
in
searchParam
){
values
=
values
+
key
+
"="
+
searchParam
[
key
]
+
"&"
;
}
if
(
sortName
!=
undefined
&&
sortOrder
!=
undefined
){
values
=
values
+
"orderBy="
+
sortName
+
" "
+
sortOrder
;
}
jp
.
downloadFile
(
'${ctx}/warehouse/warehouse/warehouse/export?'
+
values
);
})
$
(
"#search"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
'#warehouseTable'
).
bootstrapTable
(
'refresh'
);
});
$
(
"#reset"
).
click
(
"click"
,
function
()
{
// 绑定查询按扭
$
(
"#searchForm input"
).
val
(
""
);
$
(
"#searchForm select"
).
val
(
""
);
$
(
"#searchForm .select-item"
).
html
(
""
);
$
(
'#warehouseTable'
).
bootstrapTable
(
'refresh'
);
});
});
function
getIdSelections
()
{
return
$
.
map
(
$
(
"#warehouseTable"
).
bootstrapTable
(
'getSelections'
),
function
(
row
)
{
return
row
.
id
});
}
function
deleteAll
(){
jp
.
confirm
(
'确认要删除该仓库信息记录吗?'
,
function
(){
jp
.
loading
();
jp
.
get
(
"${ctx}/warehouse/warehouse/warehouse/deleteAll?ids="
+
getIdSelections
(),
function
(
data
){
if
(
data
.
success
){
$
(
'#warehouseTable'
).
bootstrapTable
(
'refresh'
);
jp
.
success
(
data
.
msg
);
}
else
{
jp
.
error
(
data
.
msg
);
}
})
})
}
function
refresh
(){
$
(
'#warehouseTable'
).
bootstrapTable
(
'refresh'
);
}
function
add
(){
jp
.
go
(
"${ctx}/warehouse/warehouse/warehouse/form/add"
);
}
function
edit
(
id
){
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
go
(
"${ctx}/warehouse/warehouse/warehouse/form/edit?id="
+
id
);
}
function
view
(
id
)
{
if
(
id
==
undefined
){
id
=
getIdSelections
();
}
jp
.
go
(
"${ctx}/warehouse/warehouse/warehouse/form/view?id="
+
id
);
}
<
/script>
\ No newline at end of file
src/main/webapp/webpage/modules/warehouse/warehouse/warehouseList.jsp
0 → 100644
View file @
59244dad
<
%@
page
contentType=
"text/html;charset=UTF-8"
%
>
<
%@
include
file=
"/webpage/include/taglib.jsp"
%
>
<html>
<head>
<title>
仓库信息管理
</title>
<meta
http-equiv=
"Content-type"
content=
"text/html; charset=utf-8"
>
<meta
name=
"decorator"
content=
"ani"
/>
<
%@
include
file=
"/webpage/include/bootstraptable.jsp"
%
>
<
%@
include
file=
"/webpage/include/treeview.jsp"
%
>
<
%@
include
file=
"warehouseList.js"
%
>
</head>
<body>
<div
class=
"wrapper wrapper-content"
>
<div
class=
"panel panel-primary"
>
<div
class=
"panel-heading"
>
<h3
class=
"panel-title"
>
仓库信息列表
</h3>
</div>
<div
class=
"panel-body"
>
<!-- 搜索 -->
<div
id=
"search-collapse"
class=
"collapse"
>
<div
class=
"accordion-inner"
>
<form:form
id=
"searchForm"
modelAttribute=
"warehouse"
class=
"form form-horizontal well clearfix"
>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"仓库名称:"
>
仓库名称:
</label>
<form:input
path=
"name"
htmlEscape=
"false"
maxlength=
"64"
class=
" form-control"
/>
</div>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<label
class=
"label-item single-overflow pull-left"
title=
"仓库编号:"
>
仓库编号:
</label>
<form:input
path=
"code"
htmlEscape=
"false"
maxlength=
"64"
class=
" form-control"
/>
</div>
<div
class=
"col-xs-12 col-sm-6 col-md-4"
>
<div
style=
"margin-top:26px"
>
<a
id=
"search"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-search"
></i>
查询
</a>
<a
id=
"reset"
class=
"btn btn-primary btn-rounded btn-bordered btn-sm"
><i
class=
"fa fa-refresh"
></i>
重置
</a>
</div>
</div>
</form:form>
</div>
</div>
<!-- 工具栏 -->
<div
id=
"toolbar"
>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:add"
>
<button
id=
"add"
class=
"btn btn-primary"
onclick=
"add()"
>
<i
class=
"glyphicon glyphicon-plus"
></i>
新建
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:edit"
>
<button
id=
"edit"
class=
"btn btn-success"
disabled
onclick=
"edit()"
>
<i
class=
"glyphicon glyphicon-edit"
></i>
修改
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:del"
>
<button
id=
"remove"
class=
"btn btn-danger"
disabled
onclick=
"deleteAll()"
>
<i
class=
"glyphicon glyphicon-remove"
></i>
删除
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:import"
>
<button
id=
"btnImport"
class=
"btn btn-info"
><i
class=
"fa fa-folder-open-o"
></i>
导入
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:export"
>
<button
id=
"export"
class=
"btn btn-warning"
>
<i
class=
"fa fa-file-excel-o"
></i>
导出
</button>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:view"
>
<button
id=
"view"
class=
"btn btn-default"
disabled
onclick=
"view()"
>
<i
class=
"fa fa-search-plus"
></i>
查看
</button>
</shiro:hasPermission>
</div>
<!-- 表格 -->
<table
id=
"warehouseTable"
data-toolbar=
"#toolbar"
></table>
<!-- context menu -->
<ul
id=
"context-menu"
class=
"dropdown-menu"
>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:view"
>
<li
data-item=
"view"
><a>
查看
</a></li>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:edit"
>
<li
data-item=
"edit"
><a>
编辑
</a></li>
</shiro:hasPermission>
<shiro:hasPermission
name=
"warehouse:warehouse:warehouse:del"
>
<li
data-item=
"delete"
><a>
删除
</a></li>
</shiro:hasPermission>
<li
data-item=
"action1"
><a>
取消
</a></li>
</ul>
</div>
</div>
</div>
</body>
</html>
\ No newline at end of file
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