公司类目增加排序功能

This commit is contained in:
HH 2023-03-22 23:35:19 +08:00
parent 9bd5811918
commit c72916b45a
3 changed files with 68 additions and 51 deletions

View File

@ -105,6 +105,14 @@
</div> </div>
<div class="row"> <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="col-sm-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-6 control-label">是否热门类目:</label> <label class="col-sm-6 control-label">是否热门类目:</label>
@ -116,26 +124,27 @@
</div> </div>
</div> </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>
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">热门名称:</label> <label class="col-sm-6 control-label">热门名称:</label>
<div class="col-sm-9"> <div class="col-sm-6">
<input name="hotName" placeholder="请输入热门名称" class="form-control" type="text" maxlength="12" <input name="hotName" placeholder="请输入热门名称" class="form-control" type="text" maxlength="12"
th:field="*{hotName}"> th:field="*{hotName}">
</div> </div>
</div> </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>
<div class="row"> <div class="row">
<div class="col-sm-6"> <div class="col-sm-6">
@ -161,20 +170,28 @@
</div> </div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-sm-12">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">热门类目图标:</label> <label class="col-sm-3 control-label">热门类目图标:</label>
<div class="col-sm-8"> <div class="col-sm-9">
<input type="text" name="cover" value="" hidden> <input type="text" name="cover" value="" hidden>
<input type="file" name="coverImg" id="coverImg" multiple class="file"/> <input type="file" name="coverImg" id="coverImg" multiple class="file"/>
</div> </div>
</div> </div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">热门类目图片:</label> <label class="col-sm-3 control-label">热门类目图片:</label>
<div class="col-sm-8"> <div class="col-sm-9">
<input type="text" name="categoryUrl" value="" hidden> <input type="text" name="categoryUrl" value="" hidden>
<input type="file" name="categoryUrlImg" id="categoryUrlImg" multiple class="file"/> <input type="file" name="categoryUrlImg" id="categoryUrlImg" multiple class="file"/>
</div> </div>
</div> </div>
</div>
</div>
</form> </form>
</div> </div>

View File

@ -21,8 +21,9 @@ public class DeptGoodsCategory extends GoodsCategory {
@Excel(name = "分公司id", cellType = Excel.ColumnType.NUMERIC) @Excel(name = "分公司id", cellType = Excel.ColumnType.NUMERIC)
private Long deptId; 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) @Excel(name = "是否热门类目 0.不是,1.是", cellType = Excel.ColumnType.NUMERIC)
private Integer isHot; private Integer isHot;
@ -67,6 +68,7 @@ public class DeptGoodsCategory extends GoodsCategory {
private List<String> hotCategoryImgs; private List<String> hotCategoryImgs;
// 热门类目图片
private String categoryUrl; private String categoryUrl;
private String hotCategoryName; private String hotCategoryName;

View File

@ -9,7 +9,6 @@
<result property="cover" column="cover"/> <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="goodsCategoryName" column="goods_category_name"/>
<result property="deptCategoryName" column="dept_category_name" />
<result property="parentCategoryId" column="parent_category_id" /> <result property="parentCategoryId" column="parent_category_id" />
<result property="level" column="level" /> <result property="level" column="level" />
<result property="status" column="status" /> <result property="status" column="status" />
@ -34,17 +33,18 @@
</resultMap> </resultMap>
<sql id="selectDeptGoodsCategory"> <sql id="selectDeptGoodsCategory">
SELECT dept_goods_category_id, dept_id, goods_category_id, category_sort, is_hot, cover, hot_name, is_sure, is_cert, SELECT dept_goods_category_id, dept_id, goods_category_id, category_sort, is_hot, cover, hot_name,
one_rate, two_rate, three_rate, dept_rate, dept_money, retain_rate, retain_money, create_by, create_time, remark 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 FROM dept_goods_category
</sql> </sql>
<sql id="selectJoin"> <sql id="selectJoin">
SELECT dgc.dept_goods_category_id, dgc.dept_id, dgc.goods_category_id, dgc.category_sort, 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.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.is_hot, dgc.cover, dgc.hot_name, dgc.is_sure, dgc.is_cert, dgc.dept_rate, dgc.dept_money,
dgc.dept_category_name, gc.goods_category_name, gc.level, gc.parent_category_id, gc.type, gc.status, dgc.retain_rate, dgc.retain_money, dgc.simple_goods_category_name,
gc.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 FROM dept_goods_category dgc LEFT JOIN goods_category gc ON dgc.goods_category_id = gc.goods_category_id
</sql> </sql>
@ -65,16 +65,16 @@
and dgc.dept_goods_category_id = #{deptGoodsCategoryId} and dgc.dept_goods_category_id = #{deptGoodsCategoryId}
</if> </if>
</where> </where>
ORDER BY gc.category_sort ORDER BY dgc.category_sort
</select> </select>
<update id="updateDeptGoodsCategory" parameterType="com.ghy.goods.domain.DeptGoodsCategory"> <update id="updateDeptGoodsCategory" parameterType="com.ghy.goods.domain.DeptGoodsCategory">
UPDATE dept_goods_category UPDATE dept_goods_category
<set> <set>
<if test="deptCategoryName != null and deptCategoryName != ''">dept_category_name = #{deptCategoryName},</if>
<if test="isHot != null">is_hot = #{isHot},</if> <if test="isHot != null">is_hot = #{isHot},</if>
<if test="cover != null and cover != ''">cover = #{cover},</if> <if test="cover != null and cover != ''">cover = #{cover},</if>
<if test="hotName != null">hot_name = #{hotName},</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="isSure != null">is_sure = #{isSure},</if>
<if test="isCert != null">is_cert = #{isCert},</if> <if test="isCert != null">is_cert = #{isCert},</if>
<if test="deptRate != null and deptRate != ''">dept_rate = #{deptRate},</if> <if test="deptRate != null and deptRate != ''">dept_rate = #{deptRate},</if>
@ -107,7 +107,6 @@
keyProperty="goodsCategoryId"> keyProperty="goodsCategoryId">
insert into dept_goods_category( insert into dept_goods_category(
<if test="isHot != null and isHot != ''">is_hot,</if> <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="deptRate != null and deptRate != ''">dept_rate,</if>
<if test="deptMoney != null and deptMoney != ''">dept_money,</if> <if test="deptMoney != null and deptMoney != ''">dept_money,</if>
<if test="retainRate != null and retainRate != ''">retain_rate,</if> <if test="retainRate != null and retainRate != ''">retain_rate,</if>
@ -122,7 +121,6 @@
create_time create_time
)values( )values(
<if test="isHot != null and isHot != ''">#{isHot},</if> <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="deptRate != null and deptRate != ''">#{deptRate},</if>
<if test="deptMoney != null and deptMoney != ''">#{deptMoney},</if> <if test="deptMoney != null and deptMoney != ''">#{deptMoney},</if>
<if test="retainRate != null and retainRate != ''">#{retainRate},</if> <if test="retainRate != null and retainRate != ''">#{retainRate},</if>
@ -160,7 +158,7 @@
AND gc.type = #{type} AND gc.type = #{type}
</if> </if>
</where> </where>
ORDER BY gc.category_sort ORDER BY dgc.category_sort
</select> </select>
<select id="selectById" parameterType="long" resultMap="DeptGoodsCategoryResult"> <select id="selectById" parameterType="long" resultMap="DeptGoodsCategoryResult">