Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
T
topsun-bpm
Project
Project
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
鲁鑫
topsun-bpm
Commits
c56a75de
Commit
c56a75de
authored
Dec 13, 2023
by
赵汉亭
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
尺码组完成
parent
2ce04f71
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
749 additions
and
36 deletions
+749
-36
sizeGroup.js
topsun-xt/src/main/webapp/biz/topsun/product/sizeGroup.js
+100
-1
sizeGroup.jsp
topsun-xt/src/main/webapp/biz/topsun/product/sizeGroup.jsp
+6
-6
sizeGroupDetail.js
...-xt/src/main/webapp/biz/topsun/product/sizeGroupDetail.js
+175
-0
sizeGroupDetail.jsp
...xt/src/main/webapp/biz/topsun/product/sizeGroupDetail.jsp
+34
-0
SizeGroupApplication.java
...igou/topsun/product/application/SizeGroupApplication.java
+17
-1
SizeGroupApplicationImpl.java
...un/product/application/impl/SizeGroupApplicationImpl.java
+139
-0
SizeGroupController.java
...huigou/topsun/product/controller/SizeGroupController.java
+75
-26
SizeGroup.java
...main/java/com/huigou/topsun/product/domain/SizeGroup.java
+61
-2
SizeGroupItemVo.java
.../com/huigou/topsun/product/domain/vo/SizeGroupItemVo.java
+51
-0
SizeGroupVo.java
...java/com/huigou/topsun/product/domain/vo/SizeGroupVo.java
+76
-0
SizeGroupItemRepository.java
...ou/topsun/product/repository/SizeGroupItemRepository.java
+3
-0
sizeGroup.xml
...un/src/main/resources/config/topsun/product/sizeGroup.xml
+12
-0
No files found.
topsun-xt/src/main/webapp/biz/topsun/product/sizeGroup.js
View file @
c56a75de
...
...
@@ -36,9 +36,12 @@ function loadSizeGroupListGrid() {
type
:
"string"
,
align
:
"left"
},
{
display
:
"创建时间"
,
name
:
"sizeGroupName"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"修改人"
,
name
:
"sizeGroupName"
,
width
:
100
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
{
display
:
"修改时间"
,
name
:
"sizeGroupName"
,
width
:
120
,
minWidth
:
60
,
type
:
"string"
,
align
:
"left"
},
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/
technology/slicedTechnology
List.ajax'
,
url
:
web_app
.
name
+
'/
sizeGroup/findSizeGroup
List.ajax'
,
pageSize
:
20
,
usePager
:
true
,
toolbar
:
toolbarOptions
,
...
...
@@ -53,4 +56,100 @@ function loadSizeGroupListGrid() {
}
});
UICtrl
.
setSearchAreaToggle
(
gridManager
);
}
function
query
(
obj
)
{
var
param
=
$
(
obj
).
formToJSON
();
UICtrl
.
gridSearch
(
gridManager
,
param
);
}
function
reloadGrid
()
{
gridManager
.
loadData
();
}
function
resetForm
(
obj
)
{
$
(
obj
).
formClean
();
}
function
addHandler
()
{
/*UICtrl.showAjaxDialog({
url: web_app.name + '/technology/addTechnologyDetail.load',
title: "新增工艺设置",
width: 1000,
ok: function (div) {
var _self = this;
$('#submitForm', div).ajaxSubmit({
url: web_app.name + '/technology/saveTechnology.ajax',
param: {
processList: getProcessList(),
},
success: function () {
_self.close();
reloadGrid();
}
});
}
});*/
UICtrl
.
addTabItem
({
tabid
:
'sizeGroupDetail'
,
text
:
"新增尺码组"
,
url
:
web_app
.
name
+
'/sizeGroup/addSizeGroupDetail.do'
})
}
function
updateHandler
(
row
)
{
if
(
!
row
)
{
row
=
DataUtil
.
getUpdateRow
(
gridManager
);
if
(
!
row
)
{
return
;
}
}
/*UICtrl.showAjaxDialog({
url: web_app.name + '/technology/showTechnologyDetail.load',
title: "修改工艺设置",
width: 1000,
param: {technologyId: row.technologyId},
ok: function (div) {
var _self = this;
$('#submitForm', div).ajaxSubmit({
url: web_app.name + '/technology/updateTechnology.ajax',
param: {
processList: getProcessList(),
},
success: function () {
_self.close();
reloadGrid();
}
});
}
});*/
UICtrl
.
addTabItem
({
tabid
:
'sizeGroupDetail'
,
text
:
"修改尺码组"
,
url
:
web_app
.
name
+
'/sizeGroup/showSizeGroupDetail.do?sizeGroupId='
+
row
.
sizeGroupId
})
}
//删除按钮
function
deleteHandler
()
{
DataUtil
.
del
({
action
:
'sizeGroup/deleteSizeGroupById.ajax'
,
gridManager
:
gridManager
,
idFieldName
:
'sizeGroupId'
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
}
function
getProcessList
()
{
var
processList
=
null
;
var
processManager
=
UICtrl
.
getGridManager
(
'#sizeGroupItemListGrid'
);
if
(
processManager
)
{
processList
=
DataUtil
.
getGridData
({
gridManager
:
processManager
,
isAllData
:
true
});
processList
=
Public
.
encodeJSONURI
(
processList
);
}
return
processList
;
}
\ No newline at end of file
topsun-xt/src/main/webapp/biz/topsun/product/sizeGroup.jsp
View file @
c56a75de
...
...
@@ -15,19 +15,19 @@
</head>
<body>
<div
class=
"container-fluid"
>
<div
class=
"ui-hide"
>
<x:select
name=
"processType"
dictionary=
"processType"
/
>
<x:select
name=
"yesorno"
dictionary=
"yesorno"
/
>
</div
>
<%-- <div class="ui-hide">--%
>
<%-- <x:select name="processType" dictionary="processType" />--%
>
<%-- <x:select name="yesorno" dictionary="yesorno" />--%
>
<%-- </div>--%
>
<div
id=
"layout"
>
<div
posinset=
"center"
title=
"尺码组
信息
"
>
<div
posinset=
"center"
title=
"尺码组
管理
"
>
<x:title
title=
"common.button.search"
hideTable=
"queryMainForm"
isHide=
"true"
/>
<form
class=
"hg-form ui-hide"
method=
"post"
action=
""
id=
"queryMainForm"
>
<x:inputC
name=
"ruleKind"
required=
"false"
label=
"尺码组名称"
labelCol=
"1"
/>
<x:searchButtons />
</form>
<div
class=
"blank_div clearfix"
></div>
<div
id=
"
technology
ListGrid"
style=
"margin: 2px;"
></div>
<div
id=
"
sizeGroup
ListGrid"
style=
"margin: 2px;"
></div>
</div>
</div>
</div>
...
...
topsun-xt/src/main/webapp/biz/topsun/product/sizeGroupDetail.js
0 → 100644
View file @
c56a75de
var
sizeGroupGridManager
=
null
;
$
(
document
).
ready
(
function
()
{
initializateUI
();
loadSizeGroupListGrid
();
//bindQueryEvent();
bindEvent
();
});
function
initializateUI
()
{
UICtrl
.
layout
(
"#layout"
,
{
leftWidth
:
3
});
}
// 加载页码表格
function
loadSizeGroupListGrid
()
{
var
toolbarOptions
=
UICtrl
.
getDefaultToolbarOptions
({
// 添加一行表格
addHandler
:
function
()
{
UICtrl
.
addGridRow
(
sizeGroupGridManager
);
},
// 删除选中的尺码信息
deleteHandler
:
function
()
{
var
_grid
=
UICtrl
.
getGridManager
(
'#sizeGroupItemListGrid'
);
DataUtil
.
delSelectedRows
({
action
:
'sizeGroup/deleteSizeGroupItemById.ajax'
,
param
:
{},
gridManager
:
_grid
,
idFieldName
:
'sizeGroupItemId'
,
onSuccess
:
function
()
{
reloadGrid
();
}
});
}
});
// 表格
sizeGroupGridManager
=
UICtrl
.
grid
(
"#sizeGroupItemListGrid"
,
{
gridManager
:
null
,
columns
:
[
{
display
:
"尺码名称"
,
name
:
"sizeGroupItemName"
,
width
:
100
,
minWidth
:
60
,
type
:
"String"
,
align
:
"left"
,
editor
:
{
type
:
'text'
,
required
:
true
}
},
{
display
:
"显示顺序"
,
name
:
"sizeGroupItemSequence"
,
width
:
100
,
minWidth
:
60
,
type
:
"String"
,
align
:
"left"
,
editor
:
{
type
:
'text'
,
mask
:
'nnn'
,
required
:
true
}
},
{
display
:
"备注"
,
name
:
"sizeGroupItemRemark"
,
width
:
100
,
minWidth
:
60
,
type
:
"String"
,
align
:
"left"
,
editor
:
{
type
:
'text'
,
required
:
true
}
},
],
dataAction
:
"server"
,
url
:
web_app
.
name
+
'/sizeGroup/slicedSizeGroupItemList.ajax'
,
parms
:
{
sizeGroupId
:
getId
},
pageSize
:
20
,
usePager
:
true
,
toolbar
:
toolbarOptions
,
enabledEdit
:
true
,
width
:
"98%"
,
height
:
"100%"
,
heightDiff
:
-
8
,
checkbox
:
true
,
fixedCellHeight
:
true
,
selectRowButtonOnly
:
true
,
});
UICtrl
.
setSearchAreaToggle
(
sizeGroupGridManager
);
}
function
bindQueryEvent
()
{
$
(
'#sizeGroupItemName'
).
searchbox
({
type
:
"sizeGroupItem"
,
name
:
"sizeGroupItemCode"
,
onChange
:
function
(
value
,
data
)
{
$
(
'#sizeGroupItemId'
).
val
(
data
.
sizeGroupItemId
);
$
(
'#sizeGroupItemName'
).
val
(
data
.
sizeGroupItemName
);
}
});
}
// 定义点击事件
function
bindEvent
()
{
$
(
"#save"
).
click
(
function
()
{
saveData
(
"save"
);
})
$
(
"#submit"
).
click
(
function
()
{
saveData
(
"submit"
);
})
$
(
"#close"
).
click
(
function
()
{
//关闭
closeDispatchTabItem
();
})
}
function
getSizeGroupItemDetail
(
sizeGroupAction
)
{
//采购订单保存时数据不进行必填验证,提交时数据才进行必填验证
var
op
=
{};
var
check
=
true
;
var
sizeGroupItemList
=
[];
if
(
sizeGroupAction
==
"save"
)
{
check
=
false
;
}
op
=
{
check
:
check
};
var
sizeGroup
=
$
(
'#submitForm'
).
formToJSON
(
op
);
if
(
!
sizeGroup
)
{
return
false
;
}
sizeGroupItemList
=
DataUtil
.
getGridData
({
gridManager
:
sizeGroupGridManager
,
isAllData
:
true
,
onCheck
:
check
})
if
(
!
sizeGroupItemList
)
{
return
false
;
}
sizeGroup
.
sizeGroupItemList
=
$
.
toJSON
(
sizeGroupItemList
);
return
sizeGroup
;
}
// 保存数据
function
saveData
(
action
)
{
var
sizeGroupItemDetail
=
getSizeGroupItemDetail
(
"submit"
);
if
(
!
sizeGroupItemDetail
)
{
return
;
}
Public
.
ajax
(
web_app
.
name
+
'/sizeGroup/saveSizeGroup.ajax?code='
+
action
,
sizeGroupItemDetail
,
function
(
data
)
{
setId
(
data
.
sizeGroupId
);
Public
.
successTip
(
"数据保存成功"
);
sizeGroupGridManager
.
setParm
(
'sizeGroupId'
,
data
.
sizeGroupId
);
sizeGroupGridManager
.
loadData
();
}
);
}
// 关闭
function
closeDispatchTabItem
()
{
UICtrl
.
closeCurrentTab
();
}
function
setId
(
value
)
{
$
(
'#sizeGroupId'
).
val
(
value
);
}
function
getId
()
{
return
$
(
"#sizeGroupId"
).
val
();
}
/**
* 刷新表格
*/
function
reloadGrid
(
obj
)
{
sizeGroupGridManager
.
loadData
();
}
topsun-xt/src/main/webapp/biz/topsun/product/sizeGroupDetail.jsp
0 → 100644
View file @
c56a75de
<%--
Created by IntelliJ IDEA.
User: lenovo
Date: 2023/12/11
Time: 14:36
To change this template use File | Settings | File Templates.
--%>
<%@ page
contentType=
"text/html;charset=UTF-8"
language=
"java"
%>
<%@taglib
uri=
"/WEB-INF/taglib.tld"
prefix=
"x"
%>
<%@ taglib
uri=
"http://java.sun.com/jsp/jstl/core"
prefix=
"c"
%>
<html>
<head>
<x:base
include=
"layout,dialog,grid,tree,combox,commonTree"
/>
<x:script
src=
'/biz/topsun/product/sizeGroupDetail.js'
/></head>
<body>
<x:billTitle
title=
"尺码组详情"
needStatus=
"false"
needPerson=
"true"
/>
<div
class=
"blank_div clearfix"
></div>
<button
class=
"btn btn-default"
type=
"button"
id=
"close"
style=
"left: 200px;float:right;bottom: 10px;"
>
关闭
</button>
<button
class=
"btn btn-warning"
type=
"button"
id=
"submit"
style=
"left: 200px;float:right;bottom: 10px;"
>
提交
</button>
<button
class=
"btn btn-success"
type=
"button"
id=
"save"
style=
"left: 200px;float:right;bottom: 10px;"
>
保存
</button>
<form
class=
"hg-form"
method=
"post"
action=
""
id=
"submitForm"
>
<x:hidden
name=
"sizeGroupId"
/>
<x:hidden
name=
"sizeGroupItemId"
/>
<div
class=
"hg-form-row"
>
<x:inputC
name=
"sizeGroupCode"
required=
"true"
label=
"尺码组编码"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:inputC
name=
"sizeGroupName"
required=
"true"
label=
"尺码组名称"
labelCol=
"2"
maxLength=
"64"
fieldCol=
"4"
/>
<x:selectC
name=
"sizeGroupType"
label=
"SIZE类型"
labelCol=
"2"
dictionary=
"sizeGroupType"
fieldCol=
"4"
/>
</div>
<div
class=
"blank_div clearfix"
></div>
<x:title
title=
"尺码设置"
name=
"group"
hideTable=
"#info"
/>
<div
id=
"sizeGroupItemListGrid"
style=
"margin: 2px;"
></div>
</form>
</body>
</html>
topsun/src/main/java/com/huigou/topsun/product/application/SizeGroupApplication.java
View file @
c56a75de
package
com
.
huigou
.
topsun
.
product
.
application
;
import
com.huigou.topsun.product.domain.SizeGroup
;
import
com.huigou.topsun.product.domain.query.SizeGroupQueryRequest
;
import
com.huigou.topsun.product.domain.vo.SizeGroupItemVo
;
import
com.huigou.topsun.product.domain.vo.SizeGroupVo
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -20,4 +22,18 @@ public interface SizeGroupApplication {
* 获取页码组列表
*/
Map
<
String
,
Object
>
getSizeGroupList
(
SizeGroupQueryRequest
queryRequest
);
SizeGroupVo
saveSizeGroup
(
SizeGroupVo
sizeGroupVo
,
List
<
SizeGroupItemVo
>
sizeGroupItemList
);
void
updateSizeGroup
(
SizeGroupVo
sizeGroupVo
,
List
<
SizeGroupItemVo
>
sizeGroupItemList
);
SizeGroupVo
findSIzeGroupBySizeGroupId
(
String
sizeGroupId
);
void
deleteSizeGroup
(
List
<
String
>
ids
);
// Object slicedSizeGroupItemList(String sizeGroupId);
Object
findBySizeGroupId
(
String
sizeGroupId
);
void
deleteSizeGroupItemById
(
List
<
String
>
ids
);
}
topsun/src/main/java/com/huigou/topsun/product/application/impl/SizeGroupApplicationImpl.java
View file @
c56a75de
...
...
@@ -4,14 +4,21 @@ import com.huigou.cache.DictUtil;
import
com.huigou.data.query.model.QueryDescriptor
;
import
com.huigou.data.query.model.QueryModel
;
import
com.huigou.topsun.product.application.SizeGroupApplication
;
import
com.huigou.topsun.product.domain.SizeGroup
;
import
com.huigou.topsun.product.domain.SizeGroupItem
;
import
com.huigou.topsun.product.domain.query.SizeGroupQueryRequest
;
import
com.huigou.topsun.product.domain.vo.SizeGroupItemVo
;
import
com.huigou.topsun.product.domain.vo.SizeGroupVo
;
import
com.huigou.topsun.product.repository.SizeGroupItemRepository
;
import
com.huigou.topsun.product.repository.SizeGroupRepository
;
import
com.huigou.uasp.bmp.common.application.BaseApplication
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* title:
...
...
@@ -37,4 +44,136 @@ public class SizeGroupApplicationImpl extends BaseApplication implements SizeGro
model
.
putDictionary
(
"sizeGroupType"
,
DictUtil
.
getDictionary
(
"sizeGroupType"
));
return
this
.
sqlExecutorDao
.
executeSlicedQuery
(
model
);
}
/**
* 保存尺码组信息及尺码信息
*
* @param sizeGroupVo 尺码组信息
* @param sizeGroupItemList 尺码列表
* @return
*/
@Override
public
SizeGroupVo
saveSizeGroup
(
SizeGroupVo
sizeGroupVo
,
List
<
SizeGroupItemVo
>
sizeGroupItemList
)
{
// 获取尺码组对象
SizeGroup
sizeGroup
=
SizeGroupVo
.
getSizeGroup
(
sizeGroupVo
);
// 封装时间信息
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long
timestamp
=
System
.
currentTimeMillis
();
sizeGroup
.
setCreatedDate
(
new
Date
(
timestamp
));
sizeGroup
=
save
(
sizeGroupItemList
,
sizeGroup
);
sizeGroupVo
.
setSizeGroupId
(
sizeGroup
.
getSizeGroupId
());
return
sizeGroupVo
;
}
/**
* 修改尺码组信息
*
* @param sizeGroupVo
* @param sizeGroupItemList
*/
@Override
public
void
updateSizeGroup
(
SizeGroupVo
sizeGroupVo
,
List
<
SizeGroupItemVo
>
sizeGroupItemList
)
{
// 获取尺码组对象
SizeGroup
sizeGroup
=
SizeGroupVo
.
getSizeGroup
(
sizeGroupVo
);
// 封装时间信息
// SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
long
timestamp
=
System
.
currentTimeMillis
();
sizeGroup
.
setLastModifiedDate
(
new
Date
(
timestamp
));
// 获取原有信息
SizeGroup
old
=
sizeGroupRepository
.
findOne
(
sizeGroup
.
getSizeGroupId
());
// 封装原有创建人信息到VO对象中
sizeGroup
.
setCreatedById
(
old
.
getCreatedById
());
sizeGroup
.
setCreatedByName
(
old
.
getCreatedByName
());
sizeGroup
.
setCreatedDate
(
old
.
getCreatedDate
());
// 保存修改的信息
save
(
sizeGroupItemList
,
sizeGroup
);
}
/**
* 根据sizeGroupId获取尺码组信息
* @param sizeGroupId
* @return
*/
@Override
public
SizeGroupVo
findSIzeGroupBySizeGroupId
(
String
sizeGroupId
)
{
SizeGroup
sizeGroup
=
sizeGroupRepository
.
findOne
(
sizeGroupId
);
return
SizeGroupVo
.
getSizeGroupVo
(
sizeGroup
);
}
/**
* 删除尺码组信息及相关尺码
* @param ids
*/
@Override
public
void
deleteSizeGroup
(
List
<
String
>
ids
)
{
ids
.
forEach
(
sizeGroupId
->{
List
<
SizeGroupItem
>
sizeGroupItemList
=
findBySizeGroupId
(
sizeGroupId
);
List
<
String
>
sizeGroupItemIds
=
sizeGroupItemList
.
stream
()
.
map
(
SizeGroupItem:
:
getSizeGroupItemId
)
.
collect
(
Collectors
.
toList
());
//删除尺码组相关的尺码信息
deleteBySizeGroupItemIds
(
sizeGroupItemIds
);
//删除尺码组
sizeGroupRepository
.
delete
(
sizeGroupId
);
});
}
// @Override
// public Object slicedSizeGroupItemList(String sizeGroupId) {
// QueryDescriptor queryDescriptor = this.sqlExecutorDao.getQuery(QUERY_XML_FILE_PATH, "slicedTechnologyProcessList");
// String sql = queryDescriptor.getSql();
// return this.sqlExecutorDao.queryToListMap(sql,sizeGroupId);
// return findBySizeGroupId(sizeGroupId);
// }
/**
* 提取方法--保存尺码组信息、尺码列表信息到数据库
*/
private
SizeGroup
save
(
List
<
SizeGroupItemVo
>
sizeGroupItemList
,
SizeGroup
sizeGroup
)
{
// 保存
sizeGroup
=
sizeGroupRepository
.
saveAndFlush
(
sizeGroup
);
// 保存尺码信息
if
(!
sizeGroupItemList
.
isEmpty
())
{
// 尺码信息不为空,保存尺码列表
String
sizeGroupId
=
sizeGroup
.
getSizeGroupId
();
for
(
SizeGroupItemVo
sizeGroupItemVo
:
sizeGroupItemList
)
{
SizeGroupItem
sizeGroupItem
=
SizeGroupItemVo
.
getSizeGroupItem
(
sizeGroupItemVo
);
sizeGroupItem
.
setSizeGroupId
(
sizeGroupId
);
sizeGroupItemRepository
.
saveAndFlush
(
sizeGroupItem
);
}
}
return
sizeGroup
;
}
/**
* 删除尺码列表
*/
public
void
deleteBySizeGroupItemIds
(
List
<
String
>
sizeGroupItemIds
)
{
List
<
SizeGroupItem
>
sizeGroupItemList
=
sizeGroupItemRepository
.
findAll
(
sizeGroupItemIds
);
sizeGroupItemRepository
.
delete
(
sizeGroupItemList
);
}
/**
* 查找尺码组下的尺码列表
*/
@Override
public
List
<
SizeGroupItem
>
findBySizeGroupId
(
String
sizeGroupId
)
{
QueryDescriptor
queryDescriptor
=
this
.
sqlExecutorDao
.
getQuery
(
QUERY_XML_FILE_PATH
,
"findBySizeGroupId"
);
String
sql
=
queryDescriptor
.
getSql
();
return
this
.
sqlExecutorDao
.
queryToList
(
sql
,
SizeGroupItem
.
class
,
sizeGroupId
);
// return sizeGroupItemRepository.findBySizeGroupId(sizeGroupId);
}
@Override
public
void
deleteSizeGroupItemById
(
List
<
String
>
ids
)
{
for
(
String
id
:
ids
)
{
sizeGroupItemRepository
.
delete
(
id
);
}
}
}
topsun/src/main/java/com/huigou/topsun/product/controller/SizeGroupController.java
View file @
c56a75de
package
com
.
huigou
.
topsun
.
product
.
controller
;
import
com.huigou.cache.DictUtil
;
import
com.huigou.topsun.product.application.SizeGroupApplication
;
import
com.huigou.topsun.product.domain.SizeGroup
;
import
com.huigou.topsun.product.domain.query.SizeGroupQueryRequest
;
import
com.huigou.topsun.product.domain.vo.SizeGroupItemVo
;
import
com.huigou.topsun.product.domain.vo.SizeGroupVo
;
import
com.huigou.uasp.annotation.ControllerMapping
;
import
com.huigou.uasp.client.CommonController
;
import
com.huigou.util.SDO
;
import
com.huigou.util.StringUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
...
...
@@ -28,15 +30,29 @@ public class SizeGroupController extends CommonController {
@Override
protected
String
getPagePath
()
{
return
"/biz/topsun/
sizeGroup
/"
;
return
"/biz/topsun/
product
/"
;
}
/**
* 跳转到尺码组页面
*/
public
String
forwardSizeGroupList
()
{
Map
<
String
,
String
>
processType
=
DictUtil
.
getDictionary
(
"processType"
);
this
.
putAttribute
(
"processType"
,
processType
);
return
forward
(
"sizeGroup"
);
}
/**
* 跳转到尺码组添加/修改/明细页面
*/
public
String
addSizeGroupDetail
(){
return
forward
(
"sizeGroupDetail"
);
}
/**
* 获取尺码组列表(分页)
*/
public
String
findSizeGroupList
(){
// TODO
public
String
findSizeGroupList
()
{
SDO
sdo
=
this
.
getSDO
();
SizeGroupQueryRequest
sizeGroupQueryRequest
=
sdo
.
toQueryRequest
(
SizeGroupQueryRequest
.
class
);
...
...
@@ -46,59 +62,92 @@ public class SizeGroupController extends CommonController {
/**
* 添加新的尺码组信息
*/
public
String
addSizeGroup
(){
//TODO
return
""
;
public
String
saveSizeGroup
()
{
SDO
sdo
=
this
.
getSDO
();
SizeGroupVo
sizeGroupVo
=
sdo
.
toObject
(
SizeGroupVo
.
class
);
List
<
SizeGroupItemVo
>
sizeGroupItemList
=
sdo
.
getList
(
"sizeGroupItemList"
,
SizeGroupItemVo
.
class
);
// 获取操作人信息
String
personMemberId
=
sdo
.
getOperator
().
getPersonMemberId
();
String
personMemberName
=
sdo
.
getOperator
().
getPersonMemberName
();
if
(
StringUtil
.
isNotBlank
(
sizeGroupVo
.
getSizeGroupId
()))
{
// 封装修改人信息
sizeGroupVo
.
setLastModifiedById
(
personMemberId
);
sizeGroupVo
.
setLastModifiedByName
(
personMemberName
);
// 修改尺码组信息和尺码信息
sizeGroupApplication
.
updateSizeGroup
(
sizeGroupVo
,
sizeGroupItemList
);
}
else
{
// 封装创建人信息
sizeGroupVo
.
setCreatedById
(
personMemberId
);
sizeGroupVo
.
setCreatedByName
(
personMemberName
);
sizeGroupVo
=
sizeGroupApplication
.
saveSizeGroup
(
sizeGroupVo
,
sizeGroupItemList
);
}
return
success
(
sizeGroupVo
);
}
/**
* 编辑选中的尺码组信息
*/
public
String
updateSizeGroup
(){
//TODO
return
""
;
}
// public String updateSizeGroup() {
// return "";
// }
/**
* 删除选中的尺码组
*/
public
String
deleteSizeGroupById
(){
//TODO
return
""
;
public
String
deleteSizeGroupById
()
{
SDO
sdo
=
this
.
getSDO
();
List
<
String
>
ids
=
sdo
.
getIds
();
sizeGroupApplication
.
deleteSizeGroup
(
ids
);
return
success
();
}
/**
* 根据尺码组id获取尺码列表
*/
public
String
findSizeGroupItemByGroupId
(){
//TODO
public
String
findSizeGroupItemByGroupId
()
{
return
""
;
}
/**
* 添加尺码
*/
public
String
addSizeGroupItem
(){
//TODO
public
String
saveSizeGroupItem
()
{
return
""
;
}
/**
* 修改尺码
*/
public
String
updateSizeGroupItem
(){
//TODO
public
String
updateSizeGroupItem
()
{
return
""
;
}
/**
* 删除尺码
*/
public
String
deleteSizeGroupItemById
(){
//TODO
return
""
;
}
public
String
deleteSizeGroupItemById
()
{
SDO
sdo
=
this
.
getSDO
();
List
<
String
>
ids
=
sdo
.
getIds
();
sizeGroupApplication
.
deleteSizeGroupItemById
(
ids
);
return
success
();
}
/**
* 查看尺码组明细
*/
public
String
showSizeGroupDetail
()
{
SDO
sdo
=
this
.
getSDO
();
String
sizeGroupId
=
sdo
.
getString
(
"sizeGroupId"
);
// this.putAttribute("productName", "1");
SizeGroupVo
sizeGroupVo
=
sizeGroupApplication
.
findSIzeGroupBySizeGroupId
(
sizeGroupId
);
return
forward
(
"sizeGroupDetail"
,
sizeGroupVo
);
}
public
String
slicedSizeGroupItemList
(){
SDO
sdo
=
this
.
getSDO
();
String
sizeGroupId
=
sdo
.
getString
(
"sizeGroupId"
);
return
packGridDataAndResult
(
sizeGroupApplication
.
findBySizeGroupId
(
sizeGroupId
));
}
}
topsun/src/main/java/com/huigou/topsun/product/domain/SizeGroup.java
View file @
c56a75de
...
...
@@ -7,11 +7,16 @@ import javax.persistence.*;
import
lombok.Data
;
import
org.hibernate.annotations.GenericGenerator
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 尺码组主表
*
* @TableName size_group
*/
@Table
(
name
=
"size_group"
)
@Table
(
name
=
"size_group"
)
@Data
@Entity
public
class
SizeGroup
implements
Serializable
{
...
...
@@ -20,7 +25,7 @@ public class SizeGroup implements Serializable {
*/
@Id
@GeneratedValue
(
generator
=
"system-uuid"
)
@GenericGenerator
(
name
=
"system-uuid"
,
strategy
=
"guid"
)
@GenericGenerator
(
name
=
"system-uuid"
,
strategy
=
"guid"
)
@Column
(
name
=
"size_group_id"
)
private
String
sizeGroupId
;
...
...
@@ -79,4 +84,58 @@ public class SizeGroup implements Serializable {
private
Date
lastModifiedDate
;
private
static
final
long
serialVersionUID
=
1L
;
@Override
public
boolean
equals
(
Object
o
)
{
if
(
this
==
o
)
return
true
;
if
(
o
==
null
||
getClass
()
!=
o
.
getClass
())
return
false
;
SizeGroup
other
=
(
SizeGroup
)
o
;
return
(
this
.
getSizeGroupId
()
==
null
?
other
.
getSizeGroupId
()
==
null
:
this
.
getSizeGroupId
().
equals
(
other
.
getSizeGroupId
()))
&&
(
this
.
getSizeGroupName
()
==
null
?
other
.
getSizeGroupName
()
==
null
:
this
.
getSizeGroupName
().
equals
(
other
.
getSizeGroupName
()))
&&
(
this
.
getSizeGroupCode
()
==
null
?
other
.
getSizeGroupCode
()
==
null
:
this
.
getSizeGroupCode
().
equals
(
other
.
getSizeGroupCode
()))
&&
(
this
.
getSizeGroupType
()
==
null
?
other
.
getSizeGroupType
()
==
null
:
this
.
getSizeGroupType
().
equals
(
other
.
getSizeGroupType
()))
&&
(
this
.
getCreatedDate
()
==
null
?
other
.
getCreatedDate
()
==
null
:
this
.
getCreatedDate
().
equals
(
other
.
getCreatedDate
()))
&&
(
this
.
getCreatedByName
()
==
null
?
other
.
getCreatedByName
()
==
null
:
this
.
getCreatedByName
().
equals
(
other
.
getCreatedByName
()))
&&
(
this
.
getCreatedById
()
==
null
?
other
.
getCreatedById
()
==
null
:
this
.
getCreatedById
().
equals
(
other
.
getCreatedById
()))
&&
(
this
.
getLastModifiedDate
()
==
null
?
other
.
getLastModifiedDate
()
==
null
:
this
.
getLastModifiedDate
().
equals
(
other
.
getLastModifiedDate
()))
&&
(
this
.
getLastModifiedById
()
==
null
?
other
.
getLastModifiedById
()
==
null
:
this
.
getLastModifiedById
().
equals
(
other
.
getLastModifiedById
()))
&&
(
this
.
getLastModifiedByName
()
==
null
?
other
.
getLastModifiedByName
()
==
null
:
this
.
getLastModifiedByName
().
equals
(
other
.
getLastModifiedByName
()));
}
@Override
public
int
hashCode
()
{
final
int
prime
=
1
;
int
result
=
1
;
result
=
prime
*
result
+
((
getSizeGroupId
()
==
null
)
?
0
:
getSizeGroupId
().
hashCode
());
result
=
prime
*
result
+
((
getSizeGroupCode
()
==
null
)
?
0
:
getSizeGroupCode
().
hashCode
());
result
=
prime
*
result
+
((
getSizeGroupName
()
==
null
)
?
0
:
getSizeGroupName
().
hashCode
());
result
=
prime
*
result
+
((
getSizeGroupType
()
==
null
)
?
0
:
getSizeGroupType
().
hashCode
());
result
=
prime
*
result
+
((
getCreatedDate
()
==
null
)
?
0
:
getCreatedDate
().
hashCode
());
result
=
prime
*
result
+
((
getCreatedById
()
==
null
)
?
0
:
getCreatedById
().
hashCode
());
result
=
prime
*
result
+
((
getCreatedByName
()
==
null
)
?
0
:
getCreatedByName
().
hashCode
());
result
=
prime
*
result
+
((
getLastModifiedDate
()
==
null
)
?
0
:
getLastModifiedDate
().
hashCode
());
result
=
prime
*
result
+
((
getLastModifiedById
()
==
null
)
?
0
:
getLastModifiedById
().
hashCode
());
result
=
prime
*
result
+
((
getLastModifiedByName
()
==
null
)
?
0
:
getLastModifiedByName
().
hashCode
());
return
result
;
}
@Override
public
String
toString
()
{
StringBuilder
stringBuilder
=
new
StringBuilder
();
stringBuilder
.
append
(
getClass
().
getSimpleName
());
stringBuilder
.
append
(
" ["
);
stringBuilder
.
append
(
"Hash = "
).
append
(
hashCode
());
stringBuilder
.
append
(
"sizeGroupId="
).
append
(
sizeGroupId
);
stringBuilder
.
append
(
", sizeGroupName="
).
append
(
sizeGroupName
);
stringBuilder
.
append
(
", sizeGroupCode="
).
append
(
sizeGroupCode
);
stringBuilder
.
append
(
", sizeGroupType="
).
append
(
sizeGroupType
);
stringBuilder
.
append
(
", createdByName="
).
append
(
createdByName
);
stringBuilder
.
append
(
", createdById="
).
append
(
createdById
);
stringBuilder
.
append
(
", createdDate="
).
append
(
createdDate
);
stringBuilder
.
append
(
", lastModifiedById="
).
append
(
lastModifiedById
);
stringBuilder
.
append
(
", lastModifiedByName="
).
append
(
lastModifiedByName
);
stringBuilder
.
append
(
", lastModifiedDate="
).
append
(
lastModifiedDate
);
stringBuilder
.
append
(
"]"
);
return
stringBuilder
.
toString
();
}
}
\ No newline at end of file
topsun/src/main/java/com/huigou/topsun/product/domain/vo/SizeGroupItemVo.java
0 → 100644
View file @
c56a75de
package
com
.
huigou
.
topsun
.
product
.
domain
.
vo
;
import
com.alibaba.fastjson.JSON
;
import
com.huigou.topsun.product.domain.SizeGroupItem
;
import
com.huigou.topsun.technology.vo.TechnologyProcessVo
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* title:
* author:ZHT
* date:2023/12/12
* description:
*/
@Data
public
class
SizeGroupItemVo
implements
Serializable
{
/**
* 尺码id
*/
private
String
sizeGroupItemId
;
/**
* 尺码组id
*/
private
String
sizeGroupId
;
/**
* 尺码名称
*/
private
String
sizeGroupItemName
;
/**
* 显示顺序
*/
private
Integer
sizeGroupItemSequence
;
/**
* 备注
*/
private
String
sizeGroupItemRemark
;
public
static
SizeGroupItem
getSizeGroupItem
(
SizeGroupItemVo
sizeGroupItemVo
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
sizeGroupItemVo
),
SizeGroupItem
.
class
);
}
public
static
SizeGroupItemVo
getProcessVo
(
SizeGroupItem
process
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
process
),
SizeGroupItemVo
.
class
);
}
}
topsun/src/main/java/com/huigou/topsun/product/domain/vo/SizeGroupVo.java
0 → 100644
View file @
c56a75de
package
com
.
huigou
.
topsun
.
product
.
domain
.
vo
;
import
com.alibaba.fastjson.JSON
;
import
com.huigou.topsun.product.domain.SizeGroup
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* title:
* author:ZHT
* date:2023/12/11
* description:
*/
@Data
public
class
SizeGroupVo
implements
Serializable
{
/**
* 尺码组id
*/
private
String
sizeGroupId
;
/**
* 尺码组名称
*/
private
String
sizeGroupName
;
/**
* 尺码组编码
*/
private
String
sizeGroupCode
;
/**
* 尺码组类型
*/
private
String
sizeGroupType
;
/**
* 录入人
*/
private
String
createdByName
;
/**
* 录入人id
*/
private
String
createdById
;
/**
* 录入时间
*/
private
Date
createdDate
;
/**
* 修改人id
*/
private
String
lastModifiedById
;
/**
* 修改人
*/
private
String
lastModifiedByName
;
/**
* 修改日期
*/
private
Date
lastModifiedDate
;
public
static
SizeGroupVo
getSizeGroupVo
(
SizeGroup
sizeGroup
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
sizeGroup
),
SizeGroupVo
.
class
);
}
public
static
SizeGroup
getSizeGroup
(
SizeGroupVo
sizeGroupVo
){
return
JSON
.
parseObject
(
JSON
.
toJSONString
(
sizeGroupVo
),
SizeGroup
.
class
);
}
}
topsun/src/main/java/com/huigou/topsun/product/repository/SizeGroupItemRepository.java
View file @
c56a75de
...
...
@@ -3,6 +3,8 @@ package com.huigou.topsun.product.repository;
import
com.huigou.topsun.product.domain.SizeGroupItem
;
import
org.springframework.data.jpa.repository.JpaRepository
;
import
java.util.List
;
/**
* title:
* author:ZHT
...
...
@@ -10,4 +12,5 @@ import org.springframework.data.jpa.repository.JpaRepository;
* description:
*/
public
interface
SizeGroupItemRepository
extends
JpaRepository
<
SizeGroupItem
,
String
>
{
List
<
SizeGroupItem
>
findBySizeGroupId
(
String
sizeGroupId
);
}
topsun/src/main/resources/config/topsun/product/sizeGroup.xml
View file @
c56a75de
...
...
@@ -6,4 +6,16 @@
select t.* from size_group t
</sql-query>
</query>
<query
name=
"findBySizeGroupId"
label=
"页码表"
table=
"size_group_item"
>
<sql-query>
SELECT
t.*
FROM size_group_item t
WHERE
size_group_id = ?
ORDER BY size_group_item_sequence
</sql-query>
</query>
</query-mappings>
\ 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