Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
d28e558e
提交
d28e558e
authored
1月 07, 2020
作者:
zgy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
完成商品导入导出功能
上级
2dfc748d
隐藏空白字符变更
内嵌
并排
正在显示
18 个修改的文件
包含
856 行增加
和
77 行删除
+856
-77
TbCategoryTemplateController.java
...com/platform/controller/TbCategoryTemplateController.java
+111
-0
TbCfStationItemController.java
...va/com/platform/controller/TbCfStationItemController.java
+27
-3
TbCategoryTemplateDao.java
...src/main/java/com/platform/dao/TbCategoryTemplateDao.java
+13
-0
TbCfCategoryDao.java
...admin/src/main/java/com/platform/dao/TbCfCategoryDao.java
+1
-0
TbCategoryTemplateEntity.java
...in/java/com/platform/entity/TbCategoryTemplateEntity.java
+119
-0
TbCategoryTemplateService.java
.../java/com/platform/service/TbCategoryTemplateService.java
+71
-0
TbCfStationItemService.java
...ain/java/com/platform/service/TbCfStationItemService.java
+9
-3
TbCategoryTemplateServiceImpl.java
.../platform/service/impl/TbCategoryTemplateServiceImpl.java
+64
-0
TbCfStationItemServiceImpl.java
...com/platform/service/impl/TbCfStationItemServiceImpl.java
+81
-32
TbCategoryTemplateDao.xml
...main/resources/com/platform/dao/TbCategoryTemplateDao.xml
+101
-0
TbCfCategoryDao.xml
...n/src/main/resources/com/platform/dao/TbCfCategoryDao.xml
+3
-1
TbCfStationItemDao.xml
...rc/main/resources/com/platform/dao/TbCfStationItemDao.xml
+21
-13
tbcategorytemplate.html
.../src/main/webapp/WEB-INF/page/sys/tbcategorytemplate.html
+53
-0
tbcfstationitem.html
...min/src/main/webapp/WEB-INF/page/sys/tbcfstationitem.html
+25
-15
common.js
platform-admin/src/main/webapp/js/common.js
+9
-4
tbcategorytemplate.js
platform-admin/src/main/webapp/js/sys/tbcategorytemplate.js
+115
-0
tbcfstationitem.js
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
+32
-6
pom.xml
platform-common/pom.xml
+1
-0
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCategoryTemplateController.java
0 → 100644
浏览文件 @
d28e558e
package
com
.
platform
.
controller
;
import
com.platform.entity.TbCategoryTemplateEntity
;
import
com.platform.service.TbCategoryTemplateService
;
import
com.platform.utils.PageUtils
;
import
com.platform.utils.Query
;
import
com.platform.utils.R
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
java.util.List
;
import
java.util.Map
;
/**
* Controller
*
* @author lipengjun
* @date 2020-01-07 12:23:04
*/
@Controller
@RequestMapping
(
"tbcategorytemplate"
)
public
class
TbCategoryTemplateController
{
@Autowired
private
TbCategoryTemplateService
tbCategoryTemplateService
;
/**
* 查看列表
*/
@RequestMapping
(
"/list"
)
@RequiresPermissions
(
"tbcategorytemplate:list"
)
@ResponseBody
public
R
list
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
//查询列表数据
Query
query
=
new
Query
(
params
);
List
<
TbCategoryTemplateEntity
>
tbCategoryTemplateList
=
tbCategoryTemplateService
.
queryList
(
query
);
int
total
=
tbCategoryTemplateService
.
queryTotal
(
query
);
PageUtils
pageUtil
=
new
PageUtils
(
tbCategoryTemplateList
,
total
,
query
.
getLimit
(),
query
.
getPage
());
return
R
.
ok
().
put
(
"page"
,
pageUtil
);
}
/**
* 查看信息
*/
@RequestMapping
(
"/info/{id}"
)
@RequiresPermissions
(
"tbcategorytemplate:info"
)
@ResponseBody
public
R
info
(
@PathVariable
(
"id"
)
String
id
)
{
TbCategoryTemplateEntity
tbCategoryTemplate
=
tbCategoryTemplateService
.
queryObject
(
id
);
return
R
.
ok
().
put
(
"tbCategoryTemplate"
,
tbCategoryTemplate
);
}
/**
* 保存
*/
@RequestMapping
(
"/save"
)
@RequiresPermissions
(
"tbcategorytemplate:save"
)
@ResponseBody
public
R
save
(
@RequestBody
TbCategoryTemplateEntity
tbCategoryTemplate
)
{
tbCategoryTemplateService
.
save
(
tbCategoryTemplate
);
return
R
.
ok
();
}
/**
* 修改
*/
@RequestMapping
(
"/update"
)
@RequiresPermissions
(
"tbcategorytemplate:update"
)
@ResponseBody
public
R
update
(
@RequestBody
TbCategoryTemplateEntity
tbCategoryTemplate
)
{
tbCategoryTemplateService
.
update
(
tbCategoryTemplate
);
return
R
.
ok
();
}
/**
* 删除
*/
@RequestMapping
(
"/delete"
)
@RequiresPermissions
(
"tbcategorytemplate:delete"
)
@ResponseBody
public
R
delete
(
@RequestBody
String
[]
ids
)
{
tbCategoryTemplateService
.
deleteBatch
(
ids
);
return
R
.
ok
();
}
/**
* 查看所有列表
*/
@RequestMapping
(
"/queryAll"
)
@ResponseBody
public
R
queryAll
(
@RequestParam
Map
<
String
,
Object
>
params
)
{
List
<
TbCategoryTemplateEntity
>
list
=
tbCategoryTemplateService
.
queryList
(
params
);
return
R
.
ok
().
put
(
"list"
,
list
);
}
}
platform-admin/src/main/java/com/platform/controller/TbCfStationItemController.java
浏览文件 @
d28e558e
...
@@ -7,6 +7,7 @@ import com.platform.service.TbCfGoodstwotypeService;
...
@@ -7,6 +7,7 @@ import com.platform.service.TbCfGoodstwotypeService;
import
com.platform.service.TbCfStationItemService
;
import
com.platform.service.TbCfStationItemService
;
import
com.platform.util.ApiBaseAction
;
import
com.platform.util.ApiBaseAction
;
import
com.platform.utils.*
;
import
com.platform.utils.*
;
import
com.platform.utils.excel.ExcelImport
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
import
org.apache.shiro.authz.annotation.RequiresPermissions
;
...
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Controller;
...
@@ -15,6 +16,7 @@ import org.springframework.stereotype.Controller;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -176,8 +178,30 @@ public class TbCfStationItemController extends ApiBaseAction {
...
@@ -176,8 +178,30 @@ public class TbCfStationItemController extends ApiBaseAction {
*/
*/
@RequestMapping
(
"/exportExcel"
)
@RequestMapping
(
"/exportExcel"
)
@ResponseBody
@ResponseBody
public
R
exportExcel
()
{
public
R
exportExcel
()
throws
IOException
{
tbCfStationItemService
.
exportExcel
();
try
{
return
R
.
ok
();
tbCfStationItemService
.
exportExcel
();
return
R
.
ok
();
}
catch
(
Exception
e
)
{
return
R
.
error
();
}
}
/**
* 从excel导入
*
* @param multipartFile
* @return
*/
@RequestMapping
(
"/importExcel"
)
@ResponseBody
public
R
importExcel
(
@RequestParam
(
"file"
)
MultipartFile
multipartFile
)
{
try
{
tbCfStationItemService
.
importExcel
(
multipartFile
);
return
R
.
ok
();
}
catch
(
Exception
e
)
{
return
R
.
error
();
}
}
}
}
}
platform-admin/src/main/java/com/platform/dao/TbCategoryTemplateDao.java
0 → 100644
浏览文件 @
d28e558e
package
com
.
platform
.
dao
;
import
com.platform.entity.TbCategoryTemplateEntity
;
/**
* Dao
*
* @author lipengjun
* @date 2020-01-07 12:23:04
*/
public
interface
TbCategoryTemplateDao
extends
BaseDao
<
TbCategoryTemplateEntity
>
{
}
platform-admin/src/main/java/com/platform/dao/TbCfCategoryDao.java
浏览文件 @
d28e558e
...
@@ -20,4 +20,5 @@ public interface TbCfCategoryDao extends BaseDao<TbCfCategoryEntity> {
...
@@ -20,4 +20,5 @@ public interface TbCfCategoryDao extends BaseDao<TbCfCategoryEntity> {
int
changStatusBatch
(
String
[]
itemId
);
int
changStatusBatch
(
String
[]
itemId
);
TbCfCategoryEntity
queryByOrderNum
(
@Param
(
"orderNum"
)
Integer
orderNum
,
@Param
(
"itemId"
)
String
itemId
);
TbCfCategoryEntity
queryByOrderNum
(
@Param
(
"orderNum"
)
Integer
orderNum
,
@Param
(
"itemId"
)
String
itemId
);
int
deleteByItemId
(
String
itemId
);
}
}
platform-admin/src/main/java/com/platform/entity/TbCategoryTemplateEntity.java
0 → 100644
浏览文件 @
d28e558e
package
com
.
platform
.
entity
;
import
java.io.Serializable
;
import
java.util.Date
;
/**
* 实体
* 表名 tb_category_template
*
* @author lipengjun
* @date 2020-01-07 12:23:04
*/
public
class
TbCategoryTemplateEntity
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 规格Id
*/
private
String
id
;
/**
* 规格名称
*/
private
String
categoryName
;
/**
* 规格描述(规格名称英文)
*/
private
String
categoryDesc
;
/**
* 删除标志
*/
private
Integer
delFlag
;
/**
* 创建时间
*/
private
Date
createTime
;
/**
* 更新时间
*/
private
Date
updateTime
;
/**
* 设置:规格Id
*/
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
}
/**
* 获取:规格Id
*/
public
String
getId
()
{
return
id
;
}
/**
* 设置:规格名称
*/
public
void
setCategoryName
(
String
categoryName
)
{
this
.
categoryName
=
categoryName
;
}
/**
* 获取:规格名称
*/
public
String
getCategoryName
()
{
return
categoryName
;
}
/**
* 设置:规格描述(规格名称英文)
*/
public
void
setCategoryDesc
(
String
categoryDesc
)
{
this
.
categoryDesc
=
categoryDesc
;
}
/**
* 获取:规格描述(规格名称英文)
*/
public
String
getCategoryDesc
()
{
return
categoryDesc
;
}
/**
* 设置:删除标志
*/
public
void
setDelFlag
(
Integer
delFlag
)
{
this
.
delFlag
=
delFlag
;
}
/**
* 获取:删除标志
*/
public
Integer
getDelFlag
()
{
return
delFlag
;
}
/**
* 设置:创建时间
*/
public
void
setCreateTime
(
Date
createTime
)
{
this
.
createTime
=
createTime
;
}
/**
* 获取:创建时间
*/
public
Date
getCreateTime
()
{
return
createTime
;
}
/**
* 设置:更新时间
*/
public
void
setUpdateTime
(
Date
updateTime
)
{
this
.
updateTime
=
updateTime
;
}
/**
* 获取:更新时间
*/
public
Date
getUpdateTime
()
{
return
updateTime
;
}
}
platform-admin/src/main/java/com/platform/service/TbCategoryTemplateService.java
0 → 100644
浏览文件 @
d28e558e
package
com
.
platform
.
service
;
import
com.platform.entity.TbCategoryTemplateEntity
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service接口
*
* @author lipengjun
* @date 2020-01-07 12:23:04
*/
public
interface
TbCategoryTemplateService
{
/**
* 根据主键查询实体
*
* @param id 主键
* @return 实体
*/
TbCategoryTemplateEntity
queryObject
(
String
id
);
/**
* 分页查询
*
* @param map 参数
* @return list
*/
List
<
TbCategoryTemplateEntity
>
queryList
(
Map
<
String
,
Object
>
map
);
/**
* 分页统计总数
*
* @param map 参数
* @return 总数
*/
int
queryTotal
(
Map
<
String
,
Object
>
map
);
/**
* 保存实体
*
* @param tbCategoryTemplate 实体
* @return 保存条数
*/
int
save
(
TbCategoryTemplateEntity
tbCategoryTemplate
);
/**
* 根据主键更新实体
*
* @param tbCategoryTemplate 实体
* @return 更新条数
*/
int
update
(
TbCategoryTemplateEntity
tbCategoryTemplate
);
/**
* 根据主键删除
*
* @param id
* @return 删除条数
*/
int
delete
(
String
id
);
/**
* 根据主键批量删除
*
* @param ids
* @return 删除条数
*/
int
deleteBatch
(
String
[]
ids
);
}
platform-admin/src/main/java/com/platform/service/TbCfStationItemService.java
浏览文件 @
d28e558e
...
@@ -5,7 +5,10 @@ import com.platform.entity.ItemInfo;
...
@@ -5,7 +5,10 @@ import com.platform.entity.ItemInfo;
import
com.platform.entity.TbCfStationItemEntity
;
import
com.platform.entity.TbCfStationItemEntity
;
import
com.platform.utils.R
;
import
com.platform.utils.R
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.IOException
;
import
java.io.UnsupportedEncodingException
;
import
java.io.UnsupportedEncodingException
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -21,7 +24,6 @@ public interface TbCfStationItemService {
...
@@ -21,7 +24,6 @@ public interface TbCfStationItemService {
/**
/**
* 根据主键查询实体
* 根据主键查询实体
*
*
*
* @return 实体
* @return 实体
*/
*/
ItemInfo
queryItemInfoById
(
String
itemId
);
ItemInfo
queryItemInfoById
(
String
itemId
);
...
@@ -76,16 +78,20 @@ public interface TbCfStationItemService {
...
@@ -76,16 +78,20 @@ public interface TbCfStationItemService {
/**
/**
* 修改商品状态
* 修改商品状态
*
* @param status
* @param status
* @param itemIds
* @param itemIds
* @return
* @return
*/
*/
void
changeItemStatus
(
Integer
status
,
String
[]
itemIds
);
void
changeItemStatus
(
Integer
status
,
String
[]
itemIds
);
/**
/**
* 导出到Excel
* 导出到Excel
*
* @param
* @param
*/
*/
void
exportExcel
();
void
exportExcel
()
throws
IOException
;
void
importExcel
(
MultipartFile
multipartFile
);
}
}
platform-admin/src/main/java/com/platform/service/impl/TbCategoryTemplateServiceImpl.java
0 → 100644
浏览文件 @
d28e558e
package
com
.
platform
.
service
.
impl
;
import
com.platform.dao.TbCategoryTemplateDao
;
import
com.platform.entity.TbCategoryTemplateEntity
;
import
com.platform.service.TbCategoryTemplateService
;
import
com.platform.utils.IdUtil
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
/**
* Service实现类
*
* @author lipengjun
* @date 2020-01-07 12:23:04
*/
@Service
(
"tbCategoryTemplateService"
)
public
class
TbCategoryTemplateServiceImpl
implements
TbCategoryTemplateService
{
@Autowired
private
TbCategoryTemplateDao
tbCategoryTemplateDao
;
@Override
public
TbCategoryTemplateEntity
queryObject
(
String
id
)
{
return
tbCategoryTemplateDao
.
queryObject
(
id
);
}
@Override
public
List
<
TbCategoryTemplateEntity
>
queryList
(
Map
<
String
,
Object
>
map
)
{
return
tbCategoryTemplateDao
.
queryList
(
map
);
}
@Override
public
int
queryTotal
(
Map
<
String
,
Object
>
map
)
{
return
tbCategoryTemplateDao
.
queryTotal
(
map
);
}
@Override
public
int
save
(
TbCategoryTemplateEntity
tbCategoryTemplate
)
{
tbCategoryTemplate
.
setId
(
IdUtil
.
createIdbyUUID
());
tbCategoryTemplate
.
setCreateTime
(
new
Date
());
tbCategoryTemplate
.
setUpdateTime
(
new
Date
());
tbCategoryTemplate
.
setDelFlag
(
1
);
return
tbCategoryTemplateDao
.
save
(
tbCategoryTemplate
);
}
@Override
public
int
update
(
TbCategoryTemplateEntity
tbCategoryTemplate
)
{
tbCategoryTemplate
.
setUpdateTime
(
new
Date
());
return
tbCategoryTemplateDao
.
update
(
tbCategoryTemplate
);
}
@Override
public
int
delete
(
String
id
)
{
return
tbCategoryTemplateDao
.
delete
(
id
);
}
@Override
public
int
deleteBatch
(
String
[]
ids
)
{
return
tbCategoryTemplateDao
.
deleteBatch
(
ids
);
}
}
platform-admin/src/main/java/com/platform/service/impl/TbCfStationItemServiceImpl.java
浏览文件 @
d28e558e
...
@@ -4,17 +4,21 @@ import com.platform.dao.*;
...
@@ -4,17 +4,21 @@ import com.platform.dao.*;
import
com.platform.entity.*
;
import
com.platform.entity.*
;
import
com.platform.service.TbCfStationItemService
;
import
com.platform.service.TbCfStationItemService
;
import
com.platform.utils.IdUtil
;
import
com.platform.utils.IdUtil
;
import
com.platform.utils.UuidUtil
;
import
com.platform.utils.excel.ExcelExport
;
import
com.platform.utils.excel.ExcelExport
;
import
com.platform.utils.excel.ExcelImport
;
import
com.platform.utils.util.StringUtil
;
import
com.platform.utils.util.StringUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.io.*
;
import
java.io.*
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.net.URLDecoder
;
import
java.net.URLDecoder
;
import
java.net.URLEncoder
;
import
java.net.URLEncoder
;
import
java.sql.Timestamp
;
import
java.sql.Timestamp
;
import
java.text.SimpleDateFormat
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -163,7 +167,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
...
@@ -163,7 +167,7 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
}
}
@Override
@Override
public
void
update
(
ItemDescSkus
itemSkus
,
String
itemDesc
)
throws
UnsupportedEncodingException
{
public
void
update
(
ItemDescSkus
itemSkus
,
String
itemDesc
)
throws
UnsupportedEncodingException
{
String
itemId
=
itemSkus
.
getItemId
();
String
itemId
=
itemSkus
.
getItemId
();
Date
updateTime
=
new
Date
();
Date
updateTime
=
new
Date
();
//商品sku
//商品sku
...
@@ -245,23 +249,32 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
...
@@ -245,23 +249,32 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
tbCfItemDescDao
.
update
(
itemDescEntity
);
tbCfItemDescDao
.
update
(
itemDescEntity
);
}
}
//先删除之前的属性模板
//先删除之前的属性模板
tbCfCategoryDao
.
deleteByItemId
(
itemId
);
tbCfOptionDao
.
deleteByItemId
(
itemId
);
tbCfOptionDao
.
deleteByItemId
(
itemId
);
//商品规格
//商品规格
//商品规格
List
<
TbCfCategoryEntity
>
tree
=
itemSkus
.
getTree
();
List
<
TbCfCategoryEntity
>
tree
=
itemSkus
.
getTree
();
for
(
int
i
=
0
;
i
<
tree
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
tree
.
size
();
i
++)
{
String
cid
=
IdUtil
.
createIdbyUUID
();
String
categoryDesc
=
tree
.
get
(
i
).
getCategoryDesc
();
String
categoryDesc
=
tree
.
get
(
i
).
getCategoryDesc
();
TbCfCategoryEntity
categoryEntity
=
tbCfCategoryDao
.
queryByOrderNum
(
i
+
1
,
itemId
);
TbCfCategoryEntity
categoryEntity
=
new
TbCfCategoryEntity
();
categoryEntity
.
setUpdateTime
(
updateTime
);
categoryEntity
.
setCategoryId
(
cid
);
categoryEntity
.
setCreateTime
(
new
Date
());
categoryEntity
.
setUpdateTime
(
new
Date
());
categoryEntity
.
setDelFlag
(
1
);
categoryEntity
.
setItemId
(
itemId
);
categoryEntity
.
setCategoryName
(
tree
.
get
(
i
).
getCategoryName
());
categoryEntity
.
setCategoryName
(
tree
.
get
(
i
).
getCategoryName
());
categoryEntity
.
setCategoryDesc
(
categoryDesc
);
categoryEntity
.
setCategoryDesc
(
categoryDesc
);
tbCfCategoryDao
.
update
(
categoryEntity
);
int
num
=
i
+
1
;
int
num
=
i
+
1
;
categoryEntity
.
setOrderNum
(
num
);
categoryEntity
.
setOption
(
"option"
+
num
);
tbCfCategoryDao
.
save
(
categoryEntity
);
String
[]
desc
=
categoryDesc
.
split
(
","
);
String
[]
desc
=
categoryDesc
.
split
(
","
);
for
(
int
j
=
0
;
j
<
desc
.
length
;
j
++)
{
for
(
int
j
=
0
;
j
<
desc
.
length
;
j
++)
{
//
保存新的商品属性模板
//
商品属性
TbCfOptionEntity
optionEntity
=
new
TbCfOptionEntity
();
TbCfOptionEntity
optionEntity
=
new
TbCfOptionEntity
();
optionEntity
.
setOptionId
(
IdUtil
.
createIdbyUUID
());
optionEntity
.
setOptionId
(
IdUtil
.
createIdbyUUID
());
optionEntity
.
setCid
(
c
ategoryEntity
.
getCategoryId
()
);
optionEntity
.
setCid
(
c
id
);
optionEntity
.
setItemId
(
itemId
);
optionEntity
.
setItemId
(
itemId
);
optionEntity
.
setOptiionSpecies
(
desc
[
j
]);
optionEntity
.
setOptiionSpecies
(
desc
[
j
]);
optionEntity
.
setCreateTime
(
new
Date
());
optionEntity
.
setCreateTime
(
new
Date
());
...
@@ -301,51 +314,46 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
...
@@ -301,51 +314,46 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
}
}
@Override
@Override
public
void
exportExcel
()
{
public
void
exportExcel
()
throws
IOException
{
// if (itemIds != null) {
// itemList = tbCfStationItemDao.queryByItems(itemIds);
// } else {
List
<
TbCfStationItemEntityExtends
>
itemList
=
tbCfStationItemDao
.
queryByItems
();
List
<
TbCfStationItemEntityExtends
>
itemList
=
tbCfStationItemDao
.
queryByItems
();
// }
ExcelExport
excelExport
=
new
ExcelExport
();
ExcelExport
excelExport
=
new
ExcelExport
();
List
<
Object
[]>
list
=
new
ArrayList
<
Object
[]>();
List
<
Object
[]>
list
=
new
ArrayList
<
Object
[]>();
String
status
=
null
;
for
(
int
i
=
0
;
i
<
itemList
.
size
();
i
++)
{
for
(
int
i
=
0
;
i
<
itemList
.
size
();
i
++)
{
List
<
Object
>
obj
=
new
ArrayList
<
Object
>();
List
<
Object
>
obj
=
new
ArrayList
<
Object
>();
status
=
itemList
.
get
(
i
).
getEnableFlag
().
toString
();
if
(
"1"
.
equals
(
status
))
{
status
=
"在线销售"
;
}
else
{
status
=
"已下架"
;
}
obj
.
add
(
itemList
.
get
(
i
).
getItemId
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemId
());
obj
.
add
(
itemList
.
get
(
i
).
getItemImg
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemImg
());
obj
.
add
(
itemList
.
get
(
i
).
getItemCode
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemCode
());
obj
.
add
(
itemList
.
get
(
i
).
getItemCode
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemCode
());
obj
.
add
(
itemList
.
get
(
i
).
getItemName
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemName
());
obj
.
add
(
itemList
.
get
(
i
).
getItemName
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemName
());
obj
.
add
(
itemList
.
get
(
i
).
getItemBrief
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemBrief
());
obj
.
add
(
itemList
.
get
(
i
).
getItemTags
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemTags
());
obj
.
add
(
itemList
.
get
(
i
).
getItemPrice
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemPrice
());
obj
.
add
(
itemList
.
get
(
i
).
getItemPrice
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemPrice
());
obj
.
add
(
itemList
.
get
(
i
).
getDiscountPrice
()
==
null
?
null
:
itemList
.
get
(
i
).
getDiscountPrice
());
obj
.
add
(
itemList
.
get
(
i
).
getItemImg
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemImg
());
obj
.
add
(
itemList
.
get
(
i
).
getItemCount
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemCount
());
obj
.
add
(
itemList
.
get
(
i
).
getItemCount
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemCount
());
obj
.
add
(
itemList
.
get
(
i
).
getItemNum
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemNum
());
obj
.
add
(
itemList
.
get
(
i
).
getItemCategory
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemCategory
());
obj
.
add
(
itemList
.
get
(
i
).
getItemCategory
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemCategory
());
obj
.
add
(
itemList
.
get
(
i
).
getItemCategorytwo
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemCategorytwo
());
obj
.
add
(
itemList
.
get
(
i
).
getItemCategorytwo
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemCategorytwo
());
obj
.
add
(
itemList
.
get
(
i
).
getItemDescritionId
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemDescritionId
());
obj
.
add
(
itemList
.
get
(
i
).
getItemDescritionId
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemDescritionId
());
obj
.
add
(
itemList
.
get
(
i
).
getEnableFlag
()
==
null
?
null
:
status
);
obj
.
add
(
itemList
.
get
(
i
).
getEnableFlag
()
==
null
?
null
:
itemList
.
get
(
i
).
getEnableFlag
()
);
obj
.
add
(
itemList
.
get
(
i
).
getCreateTime
()
==
null
?
null
:
itemList
.
get
(
i
).
getCreateTime
());
obj
.
add
(
itemList
.
get
(
i
).
getCreateTime
()
==
null
?
null
:
itemList
.
get
(
i
).
getCreateTime
());
obj
.
add
(
itemList
.
get
(
i
).
getItemDesc
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemDesc
());
obj
.
add
(
itemList
.
get
(
i
).
getItemDesc
()
==
null
?
null
:
itemList
.
get
(
i
).
getItemDesc
());
list
.
add
(
obj
.
toArray
());
list
.
add
(
obj
.
toArray
());
}
}
String
[]
header
=
new
String
[]{
"商品编号"
,
"商品名称"
,
"商品标题"
,
"商品标签"
,
"商品价格"
,
"折扣价格"
,
"商品图片"
,
"库存"
,
"一级分类"
,
"二级分类"
,
"商品品名"
,
"状态"
,
"创建时间"
,
"商品详情"
};
String
[]
header
=
new
String
[]{
"商品ID"
,
"商品图片"
,
"商品编号"
,
"商品名称"
,
"商品价格"
,
"商品库存"
,
"点击量"
,
"一级分类"
,
"二级分类"
,
"商品品名"
,
"状态"
,
"创建时间"
,
"商品详情"
};
excelExport
.
addSheetByArray
(
"商品信息"
,
list
,
header
);
excelExport
.
addSheetByArray
(
"商品信息"
,
list
,
header
);
Date
date
=
new
Date
();
SimpleDateFormat
format
=
new
SimpleDateFormat
(
"yyyy-MM-dd"
);
String
time
=
format
.
format
(
date
);
File
file
=
new
File
(
"D:\\Afrishop\\"
+
time
);
if
(!
file
.
exists
())
{
file
.
mkdirs
();
}
File
excel
=
new
File
(
file
,
"product.xlsx"
);
if
(
excel
.
exists
())
{
excel
.
delete
();
}
excel
.
createNewFile
();
OutputStream
fis
;
OutputStream
fis
;
try
{
try
{
fis
=
new
FileOutputStream
(
"D:\\product.xlsx"
);
fis
=
new
FileOutputStream
(
excel
);
excelExport
.
getWorkbook
().
write
(
fis
);
excelExport
.
getWorkbook
().
write
(
fis
);
...
@@ -356,5 +364,46 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
...
@@ -356,5 +364,46 @@ public class TbCfStationItemServiceImpl implements TbCfStationItemService {
}
}
}
}
@Override
public
void
importExcel
(
MultipartFile
multipartFile
)
{
List
<
String
[]>
list
=
ExcelImport
.
getExcelData
(
multipartFile
);
list
.
remove
(
0
);
for
(
int
i
=
0
;
i
<
list
.
size
();
i
++)
{
String
[]
values
=
list
.
get
(
i
);
//处理excel数据
handleExcel
(
values
);
}
}
//"商品编号", "商品名称", "商品标题", "商品标签", "商品价格", "折扣价格", "库存","商品图片", "一级分类", "二级分类", "商品品名", "状态", "创建时间", "商品详情"
public
void
handleExcel
(
String
[]
values
)
{
//商品信息
TbCfStationItemEntity
item
=
new
TbCfStationItemEntity
();
String
itemId
=
IdUtil
.
createIdbyUUID
();
item
.
setItemId
(
itemId
);
item
.
setItemCode
(
values
[
0
]);
item
.
setItemName
(
values
[
1
]);
item
.
setItemBrief
(
values
[
2
]);
item
.
setItemTags
(
values
[
3
]);
item
.
setItemPrice
(
new
BigDecimal
(
values
[
4
]));
item
.
setDiscountPrice
(
new
BigDecimal
(
values
[
5
]));
item
.
setItemImg
(
values
[
6
]);
item
.
setItemCount
(
Long
.
parseLong
(
values
[
7
]));
item
.
setItemCategory
(
values
[
8
]);
item
.
setItemCategorytwo
(
values
[
9
]);
item
.
setItemDescritionId
(
values
[
10
]);
item
.
setEnableFlag
(
Integer
.
parseInt
(
values
[
11
]));
item
.
setCreateTime
(
new
Date
());
item
.
setItemNum
(
0L
);
tbCfStationItemDao
.
save
(
item
);
//商品详情
TbCfItemDescEntity
desc
=
new
TbCfItemDescEntity
();
desc
.
setItemId
(
itemId
);
desc
.
setItemDesc
(
values
[
13
]);
desc
.
setCreateTime
(
new
Date
());
desc
.
setUpdateTime
(
new
Date
());
desc
.
setDelFlag
(
1
);
tbCfItemDescDao
.
save
(
desc
);
}
}
}
platform-admin/src/main/resources/com/platform/dao/TbCategoryTemplateDao.xml
0 → 100644
浏览文件 @
d28e558e
<?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.platform.dao.TbCategoryTemplateDao"
>
<resultMap
type=
"com.platform.entity.TbCategoryTemplateEntity"
id=
"tbCategoryTemplateMap"
>
<result
property=
"id"
column=
"id"
/>
<result
property=
"categoryName"
column=
"category_name"
/>
<result
property=
"categoryDesc"
column=
"category_desc"
/>
<result
property=
"delFlag"
column=
"del_flag"
/>
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"updateTime"
column=
"update_time"
/>
</resultMap>
<select
id=
"queryObject"
resultType=
"com.platform.entity.TbCategoryTemplateEntity"
>
select
`id`,
`category_name`,
`category_desc`,
`del_flag`,
`create_time`,
`update_time`
from tb_category_template
where id = #{id}
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCategoryTemplateEntity"
>
select
`id`,
`category_name`,
`category_desc`,
`del_flag`,
`create_time`,
`update_time`
from tb_category_template
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
limit #{offset}, #{limit}
</if>
</select>
<select
id=
"queryTotal"
resultType=
"int"
>
select count(*) from tb_category_template
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND name LIKE concat('%',#{name},'%')
</if>
</select>
<insert
id=
"save"
parameterType=
"com.platform.entity.TbCategoryTemplateEntity"
>
insert into tb_category_template(
`id`,
`category_name`,
`category_desc`,
`del_flag`,
`create_time`,
`update_time`)
values(
#{id},
#{categoryName},
#{categoryDesc},
#{delFlag},
#{createTime},
#{updateTime})
</insert>
<update
id=
"update"
parameterType=
"com.platform.entity.TbCategoryTemplateEntity"
>
update tb_category_template
<set>
<if
test=
"categoryName != null"
>
`category_name` = #{categoryName},
</if>
<if
test=
"categoryDesc != null"
>
`category_desc` = #{categoryDesc},
</if>
<if
test=
"delFlag != null"
>
`del_flag` = #{delFlag},
</if>
<if
test=
"createTime != null"
>
`create_time` = #{createTime},
</if>
<if
test=
"updateTime != null"
>
`update_time` = #{updateTime}
</if>
</set>
where id = #{id}
</update>
<delete
id=
"delete"
>
delete from tb_category_template where id = #{value}
</delete>
<delete
id=
"deleteBatch"
>
delete from tb_category_template where id in
<foreach
item=
"id"
collection=
"array"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
platform-admin/src/main/resources/com/platform/dao/TbCfCategoryDao.xml
浏览文件 @
d28e558e
...
@@ -128,5 +128,7 @@
...
@@ -128,5 +128,7 @@
#{categoryId}
#{categoryId}
</foreach>
</foreach>
</delete>
</delete>
<delete
id=
"deleteByItemId"
>
delete from tb_cf_category where item_id =#{itemId}
</delete>
</mapper>
</mapper>
\ No newline at end of file
platform-admin/src/main/resources/com/platform/dao/TbCfStationItemDao.xml
浏览文件 @
d28e558e
...
@@ -54,19 +54,27 @@
...
@@ -54,19 +54,27 @@
</select>
</select>
<select
id=
"queryByItems"
resultType=
"com.platform.entity.TbCfStationItemEntityExtends"
>
<select
id=
"queryByItems"
resultType=
"com.platform.entity.TbCfStationItemEntityExtends"
>
select
select
i.item_id,
i.item_id,
`item_img`,
`item_code`,
`item_code`,
`item_name`,
`item_name`,
`item_brief`,
`item_price`,
`item_category`,
`item_count`,
`item_price`,
`item_num`,
`discount_price`,
`item_category`,
`item_url`,
`item_categorytwo`,
`item_img`,
`item_descrition_id`,
`item_tags`,
`enable_flag`,
`item_num`,
i.create_time,
`item_count`,
item_desc itemDesc
`item_sku`,
`item_top`,
`platform_code`,
`platform_name`,
`enable_flag`,
i.create_time,
`item_categorytwo`,
`item_descrition_id`,
item_desc itemDesc
from tb_cf_station_item i left join tb_cf_item_desc d on i.item_id=d.item_id
from tb_cf_station_item i left join tb_cf_item_desc d on i.item_id=d.item_id
where
where
i.enable_flag!=0
i.enable_flag!=0
...
...
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcategorytemplate.html
0 → 100644
浏览文件 @
d28e558e
<!DOCTYPE html>
<html>
<head>
<title></title>
#parse("sys/header.html")
</head>
<body>
<div
id=
"rrapp"
v-cloak
style=
"height: calc(100% - 15px);"
>
<div
v-show=
"showList"
style=
"height: 100%;"
>
<Row
:gutter=
"16"
>
<div
class=
"search-group"
>
<i-col
span=
"4"
>
<i-input
v-model=
"q.name"
@
on-enter=
"query"
placeholder=
"名称"
/>
</i-col>
<i-button
@
click=
"query"
>
查询
</i-button>
<i-button
@
click=
"reloadSearch"
>
重置
</i-button>
</div>
<div
class=
"buttons-group"
>
#if($shiro.hasPermission("tbcategorytemplate:save"))
<i-button
type=
"info"
@
click=
"add"
><i
class=
"fa fa-plus"
></i>
新增
</i-button>
#end
#if($shiro.hasPermission("tbcategorytemplate:update"))
<i-button
type=
"warning"
@
click=
"update"
><i
class=
"fa fa-pencil-square-o"
></i>
修改
</i-button>
#end
#if($shiro.hasPermission("tbcategorytemplate:delete"))
<i-button
type=
"error"
@
click=
"del"
><i
class=
"fa fa-trash-o"
></i>
删除
</i-button>
#end
</div>
</Row>
<table
id=
"jqGrid"
></table>
</div>
<Card
v-show=
"!showList"
>
<p
slot=
"title"
>
{{title}}
</p>
<i-form
ref=
"formValidate"
:model=
"tbCategoryTemplate"
:rules=
"ruleValidate"
:label-width=
"80"
>
<Form-item
label=
"规格名称"
prop=
"categoryName"
>
<i-input
v-model=
"tbCategoryTemplate.categoryName"
placeholder=
"规格名称"
/>
</Form-item>
<Form-item
label=
"规格描述"
prop=
"categoryDesc"
>
<i-input
v-model=
"tbCategoryTemplate.categoryDesc"
placeholder=
"规格描述(规格名称的英文)"
/>
</Form-item>
<Form-item>
<i-button
type=
"primary"
@
click=
"handleSubmit('formValidate')"
>
提交
</i-button>
<i-button
type=
"warning"
@
click=
"reload"
style=
"margin-left: 8px"
/>
返回
</i-button>
<i-button
type=
"ghost"
@
click=
"handleReset('formValidate')"
style=
"margin-left: 8px"
>
重置
</i-button>
</Form-item>
</i-form>
</Card>
</div>
<script
src=
"${rc.contextPath}/js/sys/tbcategorytemplate.js?_${date.systemTime}"
></script>
</body>
</html>
\ No newline at end of file
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcfstationitem.html
浏览文件 @
d28e558e
...
@@ -203,7 +203,18 @@
...
@@ -203,7 +203,18 @@
</i-button>
</i-button>
#end
#end
#if($shiro.hasPermission("tbcfstationitem:import"))
#if($shiro.hasPermission("tbcfstationitem:import"))
<i-button
type=
"primary"
@
click=
"importExcel()"
><i
class=
"fa fa-chevron-up"
></i>
导入
<i-button
type=
"primary"
@
click=
"modal = true"
><i
class=
"fa fa-chevron-up"
></i>
导入
<Modal
v-model=
"modal"
title=
"商品导入"
@
on-ok=
"ok"
@
on-cancel=
"cancel"
>
<template>
<Upload
action=
"../tbcfstationitem/importExcel/"
>
<i-Button
icon=
"ios-cloud-upload-outline"
>
请选择
</i-Button>
</Upload>
</template>
</Modal>
</i-button>
</i-button>
#end
#end
#if($shiro.hasPermission("tbcfstationitem:export"))
#if($shiro.hasPermission("tbcfstationitem:export"))
...
@@ -396,19 +407,18 @@
...
@@ -396,19 +407,18 @@
</i-form>
</i-form>
</Card>
</Card>
</div>
<script
src=
"${rc.contextPath}/statics/libs/iview.js"
></script>
<script
src=
"${rc.contextPath}/statics/libs/iview.js"
></script>
<script
src=
"${rc.contextPath}/js/sys/tbcfstationitem.js?_${date.systemTime}"
></script>
<script
src=
"${rc.contextPath}/js/sys/tbcfstationitem.js?_${date.systemTime}"
></script>
<script
type=
"text/javascript"
>
<script
type=
"text/javascript"
>
var
content
=
UE
.
getEditor
(
'itemDesc'
);
var
content
=
UE
.
getEditor
(
'itemDesc'
);
UE
.
Editor
.
prototype
.
_bkGetActionUrl
=
UE
.
Editor
.
prototype
.
getActionUrl
;
UE
.
Editor
.
prototype
.
_bkGetActionUrl
=
UE
.
Editor
.
prototype
.
getActionUrl
;
UE
.
Editor
.
prototype
.
getActionUrl
=
function
(
action
)
{
UE
.
Editor
.
prototype
.
getActionUrl
=
function
(
action
)
{
if
(
action
==
'uploadimage'
||
action
==
'uploadscrawl'
||
action
==
'uploadimage'
)
{
if
(
action
==
'uploadimage'
||
action
==
'uploadscrawl'
||
action
==
'uploadimage'
)
{
return
'${rc.contextPath}/api/osstest/uploaditemimage'
;
return
'${rc.contextPath}/api/osstest/uploaditemimage'
;
}
else
{
}
else
{
return
this
.
_bkGetActionUrl
.
call
(
this
,
action
);
return
this
.
_bkGetActionUrl
.
call
(
this
,
action
);
}
}
};
};
</script>
</script>
</body>
</body>
</html>
</html>
\ No newline at end of file
platform-admin/src/main/webapp/js/common.js
浏览文件 @
d28e558e
...
@@ -139,9 +139,9 @@ function eyeImages(data) {
...
@@ -139,9 +139,9 @@ function eyeImages(data) {
* @param name
* @param name
*/
*/
function
handleResetForm
(
vue
,
name
)
{
function
handleResetForm
(
vue
,
name
)
{
if
(
vue
.
$refs
[
name
]
!==
undefined
)
{
if
(
vue
.
$refs
[
name
]
!==
undefined
)
{
vue
.
$refs
[
name
].
resetFields
();
vue
.
$refs
[
name
].
resetFields
();
}
}
};
};
...
@@ -617,6 +617,11 @@ useFormat = function (cellvalue) {
...
@@ -617,6 +617,11 @@ useFormat = function (cellvalue) {
return
cellvalue
==
0
?
'已使用'
:
'未使用'
;
return
cellvalue
==
0
?
'已使用'
:
'未使用'
;
};
};
categoryFormat
=
function
(
cellvalue
)
{
return
cellvalue
==
1
?
'正常'
:
'已删除'
;
};
/**
/**
* 订单状态翻译 (0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭)
* 订单状态翻译 (0取消,10未付款,20已付款,40已发货,50交易成功,60交易关闭)
* @param cellvalue
* @param cellvalue
...
@@ -691,7 +696,7 @@ userTypeFormat = function (cellvalue) {
...
@@ -691,7 +696,7 @@ userTypeFormat = function (cellvalue) {
returnStr
=
"facebook"
;
returnStr
=
"facebook"
;
}
else
if
(
cellvalue
==
'3'
)
{
}
else
if
(
cellvalue
==
'3'
)
{
returnStr
=
"twitter"
;
returnStr
=
"twitter"
;
}
else
if
(
cellvalue
==
'4'
)
{
}
else
if
(
cellvalue
==
'4'
)
{
returnStr
=
"手机"
;
returnStr
=
"手机"
;
}
}
}
}
...
...
platform-admin/src/main/webapp/js/sys/tbcategorytemplate.js
0 → 100644
浏览文件 @
d28e558e
$
(
function
()
{
$
(
"#jqGrid"
).
Grid
({
url
:
'../tbcategorytemplate/list'
,
colModel
:
[
{
label
:
'id'
,
name
:
'id'
,
index
:
'id'
,
key
:
true
,
hidden
:
true
},
{
label
:
'规格名称'
,
name
:
'categoryName'
,
index
:
'category_name'
,
width
:
80
},
{
label
:
'规格描述'
,
name
:
'categoryDesc'
,
index
:
'category_desc'
,
width
:
80
},
{
label
:
'状态'
,
name
:
'delFlag'
,
index
:
'del_flag'
,
width
:
80
,
formatter
:
categoryFormat
},
{
label
:
'创建时间'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
80
}
]
});
});
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
data
:
{
showList
:
true
,
title
:
null
,
tbCategoryTemplate
:
{},
ruleValidate
:
{
name
:
[
{
required
:
true
,
message
:
'名称不能为空'
,
trigger
:
'blur'
}
]
},
q
:
{
name
:
''
}
},
methods
:
{
query
:
function
()
{
vm
.
reload
();
},
add
:
function
()
{
vm
.
showList
=
false
;
vm
.
title
=
"新增"
;
vm
.
tbCategoryTemplate
=
{};
},
update
:
function
(
event
)
{
let
id
=
getSelectedRow
(
"#jqGrid"
);
if
(
id
==
null
)
{
return
;
}
vm
.
showList
=
false
;
vm
.
title
=
"修改"
;
vm
.
getInfo
(
id
);
},
saveOrUpdate
:
function
(
event
)
{
let
url
=
vm
.
tbCategoryTemplate
.
id
==
null
?
"../tbcategorytemplate/save"
:
"../tbcategorytemplate/update"
;
Ajax
.
request
({
url
:
url
,
params
:
JSON
.
stringify
(
vm
.
tbCategoryTemplate
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
(
r
)
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
},
del
:
function
(
event
)
{
let
ids
=
getSelectedRows
(
"#jqGrid"
);
if
(
ids
==
null
){
return
;
}
confirm
(
'确定要删除选中的记录?'
,
function
()
{
Ajax
.
request
({
url
:
"../tbcategorytemplate/delete"
,
params
:
JSON
.
stringify
(
ids
),
type
:
"POST"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
});
});
},
getInfo
:
function
(
id
){
Ajax
.
request
({
url
:
"../tbcategorytemplate/info/"
+
id
,
async
:
true
,
successCallback
:
function
(
r
)
{
vm
.
tbCategoryTemplate
=
r
.
tbCategoryTemplate
;
}
});
},
reload
:
function
(
event
)
{
vm
.
showList
=
true
;
let
page
=
$
(
"#jqGrid"
).
jqGrid
(
'getGridParam'
,
'page'
);
$
(
"#jqGrid"
).
jqGrid
(
'setGridParam'
,
{
postData
:
{
'name'
:
vm
.
q
.
name
},
page
:
page
}).
trigger
(
"reloadGrid"
);
vm
.
handleReset
(
'formValidate'
);
},
reloadSearch
:
function
()
{
vm
.
q
=
{
name
:
''
};
vm
.
reload
();
},
handleSubmit
:
function
(
name
)
{
handleSubmitValidate
(
this
,
name
,
function
()
{
vm
.
saveOrUpdate
()
});
},
handleReset
:
function
(
name
)
{
handleResetForm
(
this
,
name
);
}
}
});
\ No newline at end of file
platform-admin/src/main/webapp/js/sys/tbcfstationitem.js
浏览文件 @
d28e558e
...
@@ -26,6 +26,7 @@ $(function () {
...
@@ -26,6 +26,7 @@ $(function () {
let
vm
=
new
Vue
({
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
el
:
'#rrapp'
,
data
:
{
data
:
{
modal
:
false
,
showList
:
true
,
showList
:
true
,
title
:
null
,
title
:
null
,
tbCfStationItem
:
{},
tbCfStationItem
:
{},
...
@@ -47,9 +48,10 @@ let vm = new Vue({
...
@@ -47,9 +48,10 @@ let vm = new Vue({
alertShow
:
false
,
//警告弹窗
alertShow
:
false
,
//警告弹窗
serverSkuAttr
:[],
attrItem
:
[{
attrItem
:
[{
categoryName
:
'Size'
,
categoryName
:
'Size'
,
option
:
[
'Color'
,
'Size'
,
'Length'
],
option
:
[],
categoryDesc
:
''
categoryDesc
:
''
}],
//属性设置
}],
//属性设置
prevItem
:
[],
//组合数组
prevItem
:
[],
//组合数组
...
@@ -189,7 +191,7 @@ let vm = new Vue({
...
@@ -189,7 +191,7 @@ let vm = new Vue({
});
});
},
},
getInfo
:
function
(
itemId
)
{
getInfo
:
function
(
itemId
)
{
this
.
isDisabled
=
true
//
this.isDisabled = true
let
_this
=
this
let
_this
=
this
Ajax
.
request
({
Ajax
.
request
({
url
:
"../tbcfstationitem/info/"
+
itemId
,
url
:
"../tbcfstationitem/info/"
+
itemId
,
...
@@ -197,12 +199,12 @@ let vm = new Vue({
...
@@ -197,12 +199,12 @@ let vm = new Vue({
successCallback
:
function
(
r
)
{
successCallback
:
function
(
r
)
{
r
.
code
===
0
&&
(()
=>
{
r
.
code
===
0
&&
(()
=>
{
_this
.
attrItem
=
[]
_this
.
attrItem
=
[]
let
_option
=
JSON
.
parse
(
localStorage
.
getItem
(
'option'
))
//
let _option = JSON.parse(localStorage.getItem('option'))
//回显属性
//回显属性
r
.
tbCfStationItem
.
categoryList
.
map
(
item
=>
{
r
.
tbCfStationItem
.
categoryList
.
map
(
item
=>
{
_this
.
attrItem
.
push
({
_this
.
attrItem
.
push
({
categoryName
:
item
.
categoryName
,
categoryName
:
item
.
categoryName
,
option
:
_
option
,
option
:
_
this
.
serverSkuAttr
,
categoryDesc
:
item
.
categoryDesc
categoryDesc
:
item
.
categoryDesc
})
})
})
})
...
@@ -218,6 +220,7 @@ let vm = new Vue({
...
@@ -218,6 +220,7 @@ let vm = new Vue({
})
})
console
.
log
(
r
)
console
.
log
(
r
)
})()
})()
console
.
log
(
123321
,
_this
.
attrItem
)
vm
.
tbCfStationItem
=
r
.
tbCfStationItem
.
item
;
vm
.
tbCfStationItem
=
r
.
tbCfStationItem
.
item
;
vm
.
uploadList
[
0
]
=
vm
.
tbCfStationItem
.
itemImg
;
vm
.
uploadList
[
0
]
=
vm
.
tbCfStationItem
.
itemImg
;
let
itemDesc
=
vm
.
tbCfStationItem
.
itemDesc
;
let
itemDesc
=
vm
.
tbCfStationItem
.
itemDesc
;
...
@@ -227,10 +230,19 @@ let vm = new Vue({
...
@@ -227,10 +230,19 @@ let vm = new Vue({
vm
.
tbCfStationItem
.
enableFlag
===
1
&&
(()
=>
{
vm
.
tbCfStationItem
.
enableFlag
===
1
&&
(()
=>
{
_this
.
putaway
=
true
;
_this
.
putaway
=
true
;
})()
})()
UE
.
getEditor
(
'itemDesc'
).
setContent
(
itemDesc
);
try
{
UE
.
getEditor
(
'itemDesc'
).
setContent
(
itemDesc
);
}
catch
(
e
)
{
}
setTimeout
(()
=>
{
UE
.
getEditor
(
'itemDesc'
).
setContent
(
itemDesc
);
},
500
)
if
(
itemDesc
==
null
||
itemDesc
==
''
)
{
if
(
itemDesc
==
null
||
itemDesc
==
''
)
{
UE
.
getEditor
(
'itemDesc'
).
setContent
(
""
);
UE
.
getEditor
(
'itemDesc'
).
setContent
(
""
);
}
}
}
}
});
});
...
@@ -389,7 +401,8 @@ let vm = new Vue({
...
@@ -389,7 +401,8 @@ let vm = new Vue({
}
else
{
}
else
{
this
.
attrItem
.
push
({
this
.
attrItem
.
push
({
categoryName
:
'Color'
,
categoryName
:
'Color'
,
option
:
JSON
.
parse
(
localStorage
.
getItem
(
'option'
)),
// option: JSON.parse(localStorage.getItem('option')),
option
:
this
.
serverSkuAttr
,
categoryDesc
:
''
categoryDesc
:
''
})
})
}
}
...
@@ -478,6 +491,10 @@ let vm = new Vue({
...
@@ -478,6 +491,10 @@ let vm = new Vue({
})
})
}
}
},
},
ok
(){
this
.
reloadSearch
();
},
cancel
(){},
handleCreateSelect
(
val
)
{
handleCreateSelect
(
val
)
{
let
option
=
JSON
.
parse
(
localStorage
.
getItem
(
'option'
))
let
option
=
JSON
.
parse
(
localStorage
.
getItem
(
'option'
))
option
.
push
(
val
)
option
.
push
(
val
)
...
@@ -504,5 +521,14 @@ let vm = new Vue({
...
@@ -504,5 +521,14 @@ let vm = new Vue({
this
.
Goodstype
=
res
.
list
;
this
.
Goodstype
=
res
.
list
;
console
.
log
(
'一级分类'
,
this
.
Goodstype
)
console
.
log
(
'一级分类'
,
this
.
Goodstype
)
})
})
//获取默认规格
$
.
get
(
'../tbcategorytemplate/queryAll'
,
res
=>
{
let
_res
=
JSON
.
parse
(
res
)
_res
.
list
.
forEach
(
item
=>
{
this
.
attrItem
[
0
].
option
.
push
(
item
.
categoryDesc
)
this
.
serverSkuAttr
.
push
(
item
.
categoryDesc
)
})
})
}
}
});
});
\ No newline at end of file
platform-common/pom.xml
浏览文件 @
d28e558e
...
@@ -25,6 +25,7 @@
...
@@ -25,6 +25,7 @@
</properties>
</properties>
<dependencies>
<dependencies>
<!-- excel工具 -->
<!-- excel工具 -->
<dependency>
<dependency>
<groupId>
javax.servlet
</groupId>
<groupId>
javax.servlet
</groupId>
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论