Merge remote-tracking branch 'origin/master'

This commit is contained in:
HH 2022-07-27 19:42:18 +08:00
commit 05a4fa37fd
4 changed files with 26 additions and 15 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

@ -88,7 +88,7 @@ public class OrderMasterController extends BaseController {
@PostMapping("/app/list")
@ResponseBody
public TableDataInfo appList(@RequestBody OrderMaster orderMaster) {
TableDataInfo rspData = new TableDataInfo();
// TableDataInfo rspData = new TableDataInfo();
startPage();
List<OrderListResponse> orderListResponses = new ArrayList<>();
List<OrderMaster> list = orderMasterService.selectOrderMasterList(orderMaster);
@ -150,19 +150,19 @@ public class OrderMasterController extends BaseController {
});
PageDomain pageDomain = TableSupport.buildPageRequest();
if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize()) {
rspData.setRows(orderListResponses);
rspData.setTotal(orderListResponses.size());
return rspData;
}
Integer pageSize = pageDomain.getPageNum();
if (pageSize > orderListResponses.size()) {
pageSize = orderListResponses.size();
}
rspData.setRows(orderListResponses.subList(0, pageSize));
rspData.setTotal(orderListResponses.size());
return rspData;
// PageDomain pageDomain = TableSupport.buildPageRequest();
// if (null == pageDomain.getPageNum() || null == pageDomain.getPageSize()) {
// rspData.setRows(orderListResponses);
// rspData.setTotal(orderListResponses.size());
// return rspData;
// }
// Integer pageSize = pageDomain.getPageNum();
// if (pageSize > orderListResponses.size()) {
// pageSize = orderListResponses.size();
// }
// rspData.setRows(orderListResponses.subList(0, pageSize));
// rspData.setTotal(orderListResponses.size());
return voDataTable(orderListResponses, list);
}
@PostMapping("/app/detail")

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>