Skip to content
项目
群组
代码片段
帮助
正在加载...
帮助
为 GitLab 提交贡献
登录/注册
切换导航
C
chinafrica
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
计划
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
zhengfg
chinafrica
Commits
e0cc9a85
提交
e0cc9a85
authored
8月 01, 2020
作者:
吴德鹏
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
运费管理
上级
1984b7c3
隐藏空白字符变更
内嵌
并排
正在显示
7 个修改的文件
包含
87 行增加
和
19 行删除
+87
-19
TbCfExpressTemplateController.java
...om/platform/controller/TbCfExpressTemplateController.java
+12
-0
TbCfExpressTemplateDao.java
...rc/main/java/com/platform/dao/TbCfExpressTemplateDao.java
+1
-0
TbCfExpressTemplateService.java
...java/com/platform/service/TbCfExpressTemplateService.java
+3
-0
TbCfExpressTemplateServiceImpl.java
...platform/service/impl/TbCfExpressTemplateServiceImpl.java
+31
-1
TbCfExpressTemplateDao.xml
...ain/resources/com/platform/dao/TbCfExpressTemplateDao.xml
+6
-4
tbcfexpresstemplate.html
...src/main/webapp/WEB-INF/page/sys/tbcfexpresstemplate.html
+6
-5
tbcfexpresstemplate.js
platform-admin/src/main/webapp/js/sys/tbcfexpresstemplate.js
+28
-9
没有找到文件。
platform-admin/src/main/java/com/platform/controller/TbCfExpressTemplateController.java
浏览文件 @
e0cc9a85
...
...
@@ -106,4 +106,16 @@ public class TbCfExpressTemplateController {
return
R
.
ok
().
put
(
"list"
,
list
);
}
@RequestMapping
(
"/placedTop/{id}"
)
@ResponseBody
public
R
placedTop
(
@PathVariable
(
"id"
)
String
id
)
{
int
i
=
tbCfExpressTemplateService
.
placedTop
(
id
);
if
(
i
>
0
)
{
return
R
.
ok
();
}
else
if
(
i
==
-
1
)
{
return
R
.
error
(
"最多只有一个默认模板"
);
}
return
R
.
error
(
"操作失败"
);
}
}
platform-admin/src/main/java/com/platform/dao/TbCfExpressTemplateDao.java
浏览文件 @
e0cc9a85
...
...
@@ -10,4 +10,5 @@ import com.platform.entity.TbCfExpressTemplateEntity;
*/
public
interface
TbCfExpressTemplateDao
extends
BaseDao
<
TbCfExpressTemplateEntity
>
{
int
getDefaultCount
();
}
platform-admin/src/main/java/com/platform/service/TbCfExpressTemplateService.java
浏览文件 @
e0cc9a85
package
com
.
platform
.
service
;
import
com.platform.entity.TbCfExpressTemplateEntity
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -68,4 +69,6 @@ public interface TbCfExpressTemplateService {
* @return 删除条数
*/
int
deleteBatch
(
String
[]
templateIds
);
int
placedTop
(
String
id
);
}
platform-admin/src/main/java/com/platform/service/impl/TbCfExpressTemplateServiceImpl.java
浏览文件 @
e0cc9a85
...
...
@@ -4,9 +4,12 @@ import com.platform.dao.TbCfExpressTemplateDao;
import
com.platform.entity.TbCfExpressTemplateEntity
;
import
com.platform.service.TbCfExpressTemplateService
;
import
com.platform.utils.IdUtil
;
import
com.platform.utils.util.StringUtil
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -38,12 +41,17 @@ public class TbCfExpressTemplateServiceImpl implements TbCfExpressTemplateServic
@Override
public
int
save
(
TbCfExpressTemplateEntity
tbCfExpressTemplate
)
{
tbCfExpressTemplate
.
setTemplateId
(
tbCfExpressTemplate
.
getTemplateId
());
tbCfExpressTemplate
.
setTemplateId
(
IdUtil
.
createIdbyUUID
());
tbCfExpressTemplate
.
setIsDefault
(
0
);
tbCfExpressTemplate
.
setStatus
(
1
);
tbCfExpressTemplate
.
setCreateTime
(
new
Date
());
tbCfExpressTemplate
.
setUpdateTime
(
new
Date
());
return
tbCfExpressTemplateDao
.
save
(
tbCfExpressTemplate
);
}
@Override
public
int
update
(
TbCfExpressTemplateEntity
tbCfExpressTemplate
)
{
tbCfExpressTemplate
.
setUpdateTime
(
new
Date
());
return
tbCfExpressTemplateDao
.
update
(
tbCfExpressTemplate
);
}
...
...
@@ -56,4 +64,26 @@ public class TbCfExpressTemplateServiceImpl implements TbCfExpressTemplateServic
public
int
deleteBatch
(
String
[]
templateIds
)
{
return
tbCfExpressTemplateDao
.
deleteBatch
(
templateIds
);
}
@Override
public
int
placedTop
(
String
id
)
{
int
res
=
0
;
if
(
StringUtils
.
isBlank
(
id
))
{
return
res
;
}
TbCfExpressTemplateEntity
express
=
tbCfExpressTemplateDao
.
queryObject
(
id
);
System
.
err
.
println
(
express
.
getIsDefault
().
toString
());
if
(
"0"
.
equals
(
express
.
getIsDefault
().
toString
()))
{
int
count
=
tbCfExpressTemplateDao
.
getDefaultCount
();
if
(
count
>=
1
)
{
res
=
-
1
;
return
res
;
}
express
.
setIsDefault
(
1
);
}
else
{
express
.
setIsDefault
(
0
);
}
res
=
tbCfExpressTemplateDao
.
update
(
express
);
return
res
;
}
}
platform-admin/src/main/resources/com/platform/dao/TbCfExpressTemplateDao.xml
浏览文件 @
e0cc9a85
...
...
@@ -41,7 +41,9 @@
from tb_cf_express_template
where template_id = #{id}
</select>
<select
id=
"getDefaultCount"
resultType=
"int"
>
select count(*) from tb_cf_express_template where is_default=1 and status=1
</select>
<select
id=
"queryList"
resultType=
"com.platform.entity.TbCfExpressTemplateEntity"
>
select
`template_id`,
...
...
@@ -62,14 +64,14 @@
from tb_cf_express_template
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND
nam
e LIKE concat('%',#{name},'%')
AND
template_titl
e LIKE concat('%',#{name},'%')
</if>
<choose>
<when
test=
"sidx != null and sidx.trim() != ''"
>
order by ${sidx} ${order}
</when>
<otherwise>
order by is_default
order by is_default
desc
</otherwise>
</choose>
<if
test=
"offset != null and limit != null"
>
...
...
@@ -81,7 +83,7 @@
select count(*) from tb_cf_express_template
WHERE 1=1
<if
test=
"name != null and name.trim() != ''"
>
AND
nam
e LIKE concat('%',#{name},'%')
AND
template_titl
e LIKE concat('%',#{name},'%')
</if>
</select>
...
...
platform-admin/src/main/webapp/WEB-INF/page/sys/tbcfexpresstemplate.html
浏览文件 @
e0cc9a85
...
...
@@ -36,11 +36,12 @@
<Form-item
label=
"模板标题"
prop=
"templateTitle"
>
<i-input
v-model=
"tbCfExpressTemplate.templateTitle"
placeholder=
"模板标题"
style=
"width:300px"
/>
</Form-item>
<Form-item
label=
"计费方式"
prop=
"tbCfExpressTemplate.type"
>
<!--<i-input v-model="tbCfExpressTemplate.type" placeholder="计费方式" style="width:300px"/>-->
<Radio-group
v-model=
"type"
>
<Radio
v-for=
"e in typeList"
:label=
"e.label"
:value=
"e.value"
></Radio>
</Radio-group>
<Form-item
label=
"计费方式"
prop=
"type"
>
<i-select
placeholder=
"请选择"
v-model=
"tbCfExpressTemplate.type"
style=
"width:300px"
>
<i-option
v-for=
" e in typeList"
:value=
"e.value"
>
{{e.label}}
</i-option>
</i-select>
</Form-item>
<Form-item
label=
"起始数量"
prop=
"startNum"
>
<i-input
v-model=
"tbCfExpressTemplate.startNum"
placeholder=
"起始数量"
style=
"width:300px"
/>
...
...
platform-admin/src/main/webapp/js/sys/tbcfexpresstemplate.js
浏览文件 @
e0cc9a85
...
...
@@ -44,13 +44,14 @@ $(function () {
{
label
:
'续件运费(美金)'
,
name
:
'continuationFee'
,
index
:
'continuation_fee'
,
width
:
80
},
{
label
:
'免邮价格'
,
name
:
'postageFreePrice'
,
index
:
'postage_free_price'
,
width
:
80
},
{
label
:
'创建日期'
,
name
:
'createTime'
,
index
:
'create_time'
,
width
:
80
},
{
label
:
'最后编辑时间'
,
name
:
'updateTime'
,
index
:
'update_time'
,
width
:
80
},
//
{label: '最后编辑时间', name: 'updateTime', index: 'update_time', width: 80},
{
label
:
'操作'
,
index
:
'operate'
,
width
:
80
,
formatter
:
function
(
value
,
grid
,
rows
)
{
if
(
rows
.
type
===
0
)
{
return
'<span class="label label-danger pointer" ">默认</span> '
;
if
(
rows
.
isDefault
===
1
)
{
return
'<span class="label label-danger pointer" ">默认</span> '
+
'<span class="label label-primary pointer" onclick="vm.placedTop(
\'
'
+
rows
.
templateId
+
'
\'
)">取消默认</span>'
;
}
return
'<span class="label label-info pointer" ">设置默认</span> '
;
return
'<span class="label label-info pointer"
onclick="vm.placedTop(
\'
'
+
rows
.
templateId
+
'
\'
)
">设置默认</span> '
;
}
}]
});
...
...
@@ -59,14 +60,14 @@ $(function () {
let
vm
=
new
Vue
({
el
:
'#rrapp'
,
data
:
{
type
:
null
,
type
:
''
,
typeList
:
[{
label
:
'计件
'
,
value
:
'0
'
value
:
'0
'
,
label
:
'计件
'
},
{
label
:
'计重
'
,
value
:
'1
'
value
:
'1
'
,
label
:
'计重
'
}],
showList
:
true
,
title
:
null
,
...
...
@@ -81,6 +82,19 @@ let vm = new Vue({
}
},
methods
:
{
placedTop
:
function
(
id
)
{
let
url
=
'../tbcfexpresstemplate/placedTop/'
+
id
;
Ajax
.
request
({
url
:
url
,
type
:
"GET"
,
contentType
:
"application/json"
,
successCallback
:
function
()
{
alert
(
'操作成功'
,
function
(
index
)
{
vm
.
reload
();
});
}
})
},
query
:
function
()
{
vm
.
reload
();
},
...
...
@@ -146,6 +160,11 @@ let vm = new Vue({
async
:
true
,
successCallback
:
function
(
r
)
{
vm
.
tbCfExpressTemplate
=
r
.
tbCfExpressTemplate
;
// let type = vm.tbCfExpressTemplate.type;
// this.typeList.map(res=>{
// res.value
// })
}
});
},
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论