公司类目增加排序功能
This commit is contained in:
parent
9bd5811918
commit
c72916b45a
|
|
@ -105,6 +105,14 @@
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-6 control-label is-required">显示排序:</label>
|
||||
<div class="col-sm-6">
|
||||
<input class="form-control" type="text" name="categorySort" th:field="*{categorySort}" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-6 control-label">是否热门类目:</label>
|
||||
|
|
@ -116,26 +124,27 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">别名:</label>
|
||||
<div class="col-sm-9">
|
||||
<input name="deptCategoryName" placeholder="请输入别名" class="form-control" type="text" maxlength="12"
|
||||
th:field="*{deptCategoryName}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">热门名称:</label>
|
||||
<div class="col-sm-9">
|
||||
<label class="col-sm-6 control-label">热门名称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="hotName" placeholder="请输入热门名称" class="form-control" type="text" maxlength="12"
|
||||
th:field="*{hotName}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-6">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-6 control-label">简称:</label>
|
||||
<div class="col-sm-6">
|
||||
<input name="simpleGoodsCategoryName" placeholder="请输入简称" class="form-control" type="text"
|
||||
maxlength="12"
|
||||
th:field="*{simpleGoodsCategoryName}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6">
|
||||
|
|
@ -161,18 +170,26 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">热门类目图标:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="cover" value="" hidden>
|
||||
<input type="file" name="coverImg" id="coverImg" multiple class="file" />
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">热门类目图标:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" name="cover" value="" hidden>
|
||||
<input type="file" name="coverImg" id="coverImg" multiple class="file"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">热门类目图片:</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="categoryUrl" value="" hidden>
|
||||
<input type="file" name="categoryUrlImg" id="categoryUrlImg" multiple class="file" />
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label">热门类目图片:</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" name="categoryUrl" value="" hidden>
|
||||
<input type="file" name="categoryUrlImg" id="categoryUrlImg" multiple class="file"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
@ -181,7 +198,7 @@
|
|||
<th:block th:include="include :: footer"/>
|
||||
<th:block th:include="include :: select2-js"/>
|
||||
<th:block th:include="include :: bootstrap-fileinput-js"/>
|
||||
<th:block th:include="include :: datetimepicker-js" />
|
||||
<th:block th:include="include :: datetimepicker-js"/>
|
||||
|
||||
<script type="text/javascript">
|
||||
var prefix = ctx + "goods/deptcategory";
|
||||
|
|
@ -216,15 +233,15 @@
|
|||
maxFileSize: 12048, //上传文件最大值,单位kb
|
||||
uploadAsync: true, //异步上传
|
||||
maxFileCount: 3 //上传文件最大个数。
|
||||
}).on("fileuploaded", function(event,data) { //异步上传成功后回调
|
||||
if(data.response.code === 0){
|
||||
}).on("fileuploaded", function (event, data) { //异步上传成功后回调
|
||||
if (data.response.code === 0) {
|
||||
var imgUrl = $("input[name='categoryUrl']").val();
|
||||
if(imgUrl){
|
||||
$("input[name='categoryUrl']").val( imgUrl + "," + data.response.url)
|
||||
}else {
|
||||
if (imgUrl) {
|
||||
$("input[name='categoryUrl']").val(imgUrl + "," + data.response.url)
|
||||
} else {
|
||||
$("input[name='categoryUrl']").val(data.response.url)
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
alert("上传失败!");
|
||||
}
|
||||
});
|
||||
|
|
@ -244,15 +261,15 @@
|
|||
maxFileSize: 12048, //上传文件最大值,单位kb
|
||||
uploadAsync: true, //异步上传
|
||||
maxFileCount: 1 //上传文件最大个数。
|
||||
}).on("fileuploaded", function(event,data) { //异步上传成功后回调
|
||||
if(data.response.code === 0){
|
||||
}).on("fileuploaded", function (event, data) { //异步上传成功后回调
|
||||
if (data.response.code === 0) {
|
||||
var imgUrl = $("input[name='cover']").val();
|
||||
if(imgUrl){
|
||||
$("input[name='cover']").val( imgUrl + "," + data.response.url)
|
||||
}else {
|
||||
if (imgUrl) {
|
||||
$("input[name='cover']").val(imgUrl + "," + data.response.url)
|
||||
} else {
|
||||
$("input[name='cover']").val(data.response.url)
|
||||
}
|
||||
}else {
|
||||
} else {
|
||||
alert("上传失败!");
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -21,8 +21,9 @@ public class DeptGoodsCategory extends GoodsCategory {
|
|||
@Excel(name = "分公司id", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Long deptId;
|
||||
|
||||
@Excel(name = "分公司备注类目名称", cellType = Excel.ColumnType.STRING)
|
||||
private String deptCategoryName;
|
||||
// 这个字段实际上没用到 注释掉避免混淆
|
||||
// @Excel(name = "分公司备注类目名称", cellType = Excel.ColumnType.STRING)
|
||||
// private String deptCategoryName;
|
||||
|
||||
@Excel(name = "是否热门类目 0.不是,1.是", cellType = Excel.ColumnType.NUMERIC)
|
||||
private Integer isHot;
|
||||
|
|
@ -67,6 +68,7 @@ public class DeptGoodsCategory extends GoodsCategory {
|
|||
|
||||
private List<String> hotCategoryImgs;
|
||||
|
||||
// 热门类目图片
|
||||
private String categoryUrl;
|
||||
|
||||
private String hotCategoryName;
|
||||
|
|
|
|||
|
|
@ -7,16 +7,15 @@
|
|||
<result property="deptId" column="dept_id"/>
|
||||
<result property="goodsCategoryId" column="goods_category_id"/>
|
||||
<result property="cover" column="cover"/>
|
||||
<result property="simpleGoodsCategoryName" column="simple_goods_category_name"/>
|
||||
<result property="simpleGoodsCategoryName" column="simple_goods_category_name"/>
|
||||
<result property="goodsCategoryName" column="goods_category_name"/>
|
||||
<result property="deptCategoryName" column="dept_category_name" />
|
||||
<result property="parentCategoryId" column="parent_category_id" />
|
||||
<result property="level" column="level" />
|
||||
<result property="status" column="status" />
|
||||
<result property="type" column="type" />
|
||||
<result property="categorySort" column="category_sort"/>
|
||||
<result property="isHot" column="is_hot"/>
|
||||
<result property="hotName" column="hot_name"/>
|
||||
<result property="hotName" column="hot_name"/>
|
||||
<result property="oneRate" column="one_rate"/>
|
||||
<result property="twoRate" column="two_rate"/>
|
||||
<result property="threeRate" column="three_rate"/>
|
||||
|
|
@ -24,8 +23,8 @@
|
|||
<result property="deptMoney" column="dept_money"/>
|
||||
<result property="retainRate" column="retain_rate"/>
|
||||
<result property="retainMoney" column="retain_money"/>
|
||||
<result property="isSure" column="is_sure"/>
|
||||
<result property="isCert" column="is_cert"/>
|
||||
<result property="isSure" column="is_sure"/>
|
||||
<result property="isCert" column="is_cert"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="createTime" column="create_time"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
|
|
@ -34,17 +33,18 @@
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectDeptGoodsCategory">
|
||||
SELECT dept_goods_category_id, dept_id, goods_category_id, category_sort, is_hot, cover, hot_name, is_sure, is_cert,
|
||||
one_rate, two_rate, three_rate, dept_rate, dept_money, retain_rate, retain_money, create_by, create_time, remark
|
||||
SELECT dept_goods_category_id, dept_id, goods_category_id, category_sort, is_hot, cover, hot_name,
|
||||
simple_goods_category_name, is_sure, is_cert, one_rate, two_rate, three_rate, dept_rate,
|
||||
dept_money, retain_rate, retain_money, create_by, create_time, remark
|
||||
FROM dept_goods_category
|
||||
</sql>
|
||||
|
||||
<sql id="selectJoin">
|
||||
SELECT dgc.dept_goods_category_id, dgc.dept_id, dgc.goods_category_id, dgc.category_sort,
|
||||
dgc.one_rate, dgc.two_rate, dgc.three_rate, dgc.create_by, dgc.create_time, dgc.remark,
|
||||
dgc.is_hot, dgc.cover, dgc.hot_name, dgc.is_sure, dgc.is_cert, dgc.dept_rate, dgc.dept_money, dgc.retain_rate, dgc.retain_money,
|
||||
dgc.dept_category_name, gc.goods_category_name, gc.level, gc.parent_category_id, gc.type, gc.status,
|
||||
gc.simple_goods_category_name
|
||||
dgc.is_hot, dgc.cover, dgc.hot_name, dgc.is_sure, dgc.is_cert, dgc.dept_rate, dgc.dept_money,
|
||||
dgc.retain_rate, dgc.retain_money, dgc.simple_goods_category_name,
|
||||
gc.goods_category_name, gc.level, gc.parent_category_id, gc.type, gc.status
|
||||
FROM dept_goods_category dgc LEFT JOIN goods_category gc ON dgc.goods_category_id = gc.goods_category_id
|
||||
</sql>
|
||||
|
||||
|
|
@ -65,16 +65,16 @@
|
|||
and dgc.dept_goods_category_id = #{deptGoodsCategoryId}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY gc.category_sort
|
||||
ORDER BY dgc.category_sort
|
||||
</select>
|
||||
|
||||
<update id="updateDeptGoodsCategory" parameterType="com.ghy.goods.domain.DeptGoodsCategory">
|
||||
UPDATE dept_goods_category
|
||||
<set>
|
||||
<if test="deptCategoryName != null and deptCategoryName != ''">dept_category_name = #{deptCategoryName},</if>
|
||||
<if test="isHot != null">is_hot = #{isHot},</if>
|
||||
<if test="cover != null and cover != ''">cover = #{cover},</if>
|
||||
<if test="hotName != null">hot_name = #{hotName},</if>
|
||||
<if test="simpleGoodsCategoryName != null">simple_goods_category_name = #{simpleGoodsCategoryName},</if>
|
||||
<if test="isSure != null">is_sure = #{isSure},</if>
|
||||
<if test="isCert != null">is_cert = #{isCert},</if>
|
||||
<if test="deptRate != null and deptRate != ''">dept_rate = #{deptRate},</if>
|
||||
|
|
@ -107,7 +107,6 @@
|
|||
keyProperty="goodsCategoryId">
|
||||
insert into dept_goods_category(
|
||||
<if test="isHot != null and isHot != ''">is_hot,</if>
|
||||
<if test="deptCategoryName != null and deptCategoryName != ''">dept_category_name,</if>
|
||||
<if test="deptRate != null and deptRate != ''">dept_rate,</if>
|
||||
<if test="deptMoney != null and deptMoney != ''">dept_money,</if>
|
||||
<if test="retainRate != null and retainRate != ''">retain_rate,</if>
|
||||
|
|
@ -122,7 +121,6 @@
|
|||
create_time
|
||||
)values(
|
||||
<if test="isHot != null and isHot != ''">#{isHot},</if>
|
||||
<if test="deptCategoryName != null and deptCategoryName != ''">#{deptCategoryName},</if>
|
||||
<if test="deptRate != null and deptRate != ''">#{deptRate},</if>
|
||||
<if test="deptMoney != null and deptMoney != ''">#{deptMoney},</if>
|
||||
<if test="retainRate != null and retainRate != ''">#{retainRate},</if>
|
||||
|
|
@ -160,7 +158,7 @@
|
|||
AND gc.type = #{type}
|
||||
</if>
|
||||
</where>
|
||||
ORDER BY gc.category_sort
|
||||
ORDER BY dgc.category_sort
|
||||
</select>
|
||||
|
||||
<select id="selectById" parameterType="long" resultMap="DeptGoodsCategoryResult">
|
||||
|
|
|
|||
Loading…
Reference in New Issue