增加商品规格
This commit is contained in:
parent
7cc761d7d5
commit
dbf512677c
|
|
@ -7,6 +7,7 @@ import com.ghy.common.core.page.TableDataInfo;
|
||||||
import com.ghy.common.enums.BusinessType;
|
import com.ghy.common.enums.BusinessType;
|
||||||
import com.ghy.common.utils.ExceptionUtil;
|
import com.ghy.common.utils.ExceptionUtil;
|
||||||
import com.ghy.common.utils.ShiroUtils;
|
import com.ghy.common.utils.ShiroUtils;
|
||||||
|
import com.ghy.common.utils.StringUtils;
|
||||||
import com.ghy.common.utils.poi.ExcelUtil;
|
import com.ghy.common.utils.poi.ExcelUtil;
|
||||||
import com.ghy.goods.domain.*;
|
import com.ghy.goods.domain.*;
|
||||||
import com.ghy.goods.service.*;
|
import com.ghy.goods.service.*;
|
||||||
|
|
@ -164,6 +165,11 @@ public class GoodsController extends BaseController {
|
||||||
|
|
||||||
// 补全商品类别
|
// 补全商品类别
|
||||||
List<GoodsStandard> goodsStandards = goodsStandardService.selectByGoodsId(result.getGoodsId());
|
List<GoodsStandard> goodsStandards = goodsStandardService.selectByGoodsId(result.getGoodsId());
|
||||||
|
goodsStandards.stream().forEach(goodsStandard -> {
|
||||||
|
if (StringUtils.isEmpty(goodsStandard.getGoodsUnit())) {
|
||||||
|
goodsStandard.setGoodsUnit(result.getGoodsUnit());
|
||||||
|
}
|
||||||
|
});
|
||||||
result.setGoodsStandardList(goodsStandards);
|
result.setGoodsStandardList(goodsStandards);
|
||||||
|
|
||||||
return AjaxResult.success(result);
|
return AjaxResult.success(result);
|
||||||
|
|
|
||||||
|
|
@ -32,6 +32,8 @@ public class Goods extends BaseEntity {
|
||||||
|
|
||||||
private String goodsDesc;
|
private String goodsDesc;
|
||||||
|
|
||||||
|
private String goodsUnit;
|
||||||
|
|
||||||
@Excel(name = "商品排序", cellType = Excel.ColumnType.NUMERIC)
|
@Excel(name = "商品排序", cellType = Excel.ColumnType.NUMERIC)
|
||||||
private Integer goodsSort;
|
private Integer goodsSort;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,6 +9,7 @@
|
||||||
<result property="deptId" column="dept_id" />
|
<result property="deptId" column="dept_id" />
|
||||||
<result property="goodsName" column="goods_name" />
|
<result property="goodsName" column="goods_name" />
|
||||||
<result property="goodsDesc" column="goods_desc" />
|
<result property="goodsDesc" column="goods_desc" />
|
||||||
|
<result property="goodsUnit" column="goods_unit" />
|
||||||
<result property="goodsSort" column="goods_sort"/>
|
<result property="goodsSort" column="goods_sort"/>
|
||||||
<result property="workerId" column="worker_id"/>
|
<result property="workerId" column="worker_id"/>
|
||||||
<result property="deptGoodsCategoryId" column="dept_goods_category_id"/>
|
<result property="deptGoodsCategoryId" column="dept_goods_category_id"/>
|
||||||
|
|
@ -23,7 +24,7 @@
|
||||||
</resultMap>
|
</resultMap>
|
||||||
|
|
||||||
<sql id="selectGoods">
|
<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
|
dept_goods_category_id, goods_img_url, goods_video_url, status, create_by, create_time, remark
|
||||||
FROM goods
|
FROM goods
|
||||||
</sql>
|
</sql>
|
||||||
|
|
@ -62,6 +63,7 @@
|
||||||
<if test="deptId != null and deptId != ''">dept_id,</if>
|
<if test="deptId != null and deptId != ''">dept_id,</if>
|
||||||
<if test="goodsName != null and goodsName != ''">goods_name,</if>
|
<if test="goodsName != null and goodsName != ''">goods_name,</if>
|
||||||
<if test="goodsDesc != null and goodsDesc != ''">goods_desc,</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="goodsSort != null and goodsSort != ''">goods_sort,</if>
|
||||||
<if test="workerId != null and workerId != ''">worker_id,</if>
|
<if test="workerId != null and workerId != ''">worker_id,</if>
|
||||||
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">dept_goods_category_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="deptId != null and deptId != ''">#{deptId},</if>
|
||||||
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
|
<if test="goodsName != null and goodsName != ''">#{goodsName},</if>
|
||||||
<if test="goodsDesc != null and goodsDesc != ''">#{goodsDesc},</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="goodsSort != null and goodsSort != ''">#{goodsSort},</if>
|
||||||
<if test="workerId != null and workerId != ''">#{workerId},</if>
|
<if test="workerId != null and workerId != ''">#{workerId},</if>
|
||||||
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">#{deptGoodsCategoryId},</if>
|
<if test="deptGoodsCategoryId != null and deptGoodsCategoryId != 0">#{deptGoodsCategoryId},</if>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue