增加商品规格

This commit is contained in:
donqi 2022-07-26 21:14:25 +08:00
parent 7cc761d7d5
commit dbf512677c
3 changed files with 12 additions and 1 deletions

View File

@ -7,6 +7,7 @@ import com.ghy.common.core.page.TableDataInfo;
import com.ghy.common.enums.BusinessType;
import com.ghy.common.utils.ExceptionUtil;
import com.ghy.common.utils.ShiroUtils;
import com.ghy.common.utils.StringUtils;
import com.ghy.common.utils.poi.ExcelUtil;
import com.ghy.goods.domain.*;
import com.ghy.goods.service.*;
@ -164,6 +165,11 @@ public class GoodsController extends BaseController {
// 补全商品类别
List<GoodsStandard> goodsStandards = goodsStandardService.selectByGoodsId(result.getGoodsId());
goodsStandards.stream().forEach(goodsStandard -> {
if (StringUtils.isEmpty(goodsStandard.getGoodsUnit())) {
goodsStandard.setGoodsUnit(result.getGoodsUnit());
}
});
result.setGoodsStandardList(goodsStandards);
return AjaxResult.success(result);

View File

@ -32,6 +32,8 @@ public class Goods extends BaseEntity {
private String goodsDesc;
private String goodsUnit;
@Excel(name = "商品排序", cellType = Excel.ColumnType.NUMERIC)
private Integer goodsSort;

View File

@ -9,6 +9,7 @@
<result property="deptId" column="dept_id" />
<result property="goodsName" column="goods_name" />
<result property="goodsDesc" column="goods_desc" />
<result property="goodsUnit" column="goods_unit" />
<result property="goodsSort" column="goods_sort"/>
<result property="workerId" column="worker_id"/>
<result property="deptGoodsCategoryId" column="dept_goods_category_id"/>
@ -23,7 +24,7 @@
</resultMap>
<sql id="selectGoods">
SELECT goods_id, goods_code, dept_id, goods_name, goods_desc, goods_sort, worker_id,
SELECT goods_id, goods_code, dept_id, goods_name, goods_desc, goods_unit, goods_sort, worker_id,
dept_goods_category_id, goods_img_url, goods_video_url, status, create_by, create_time, remark
FROM goods
</sql>
@ -62,6 +63,7 @@
<if test="deptId != null and deptId != ''">dept_id,</if>
<if test="goodsName != null and goodsName != ''">goods_name,</if>
<if test="goodsDesc != null and goodsDesc != ''">goods_desc,</if>
<if test="goodsUnit != null and goodsUnit != ''">goods_unit,</if>
<if test="goodsSort != null and goodsSort != ''">goods_sort,</if>
<if test="workerId != null and workerId != ''">worker_id,</if>
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">dept_goods_category_id,</if>
@ -76,6 +78,7 @@
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
<if test="goodsDesc != null and goodsDesc != ''">#{goodsDesc},</if>
<if test="goodsUnit != null and goodsUnit != ''">#{goodsUnit},</if>
<if test="goodsSort != null and goodsSort != ''">#{goodsSort},</if>
<if test="workerId != null and workerId != ''">#{workerId},</if>
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">#{deptGoodsCategoryId},</if>