订单状态查询条件

This commit is contained in:
HH 2023-02-18 15:21:55 +08:00
parent da9fca3675
commit eaef0920cc
2 changed files with 13 additions and 5 deletions

View File

@ -20,7 +20,7 @@
订单号:<input type="text" name="code"/> 订单号:<input type="text" name="code"/>
</li> </li>
<li> <li>
订单状态:<select name="status" th:with="type=${@dict.getType('order_status')}"> 订单状态:<select name="orderStatus" th:with="type=${@dict.getType('order_status')}">
<option value="">所有</option> <option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" <option th:each="dict : ${type}" th:text="${dict.dictLabel}"
th:value="${dict.dictValue}"></option> th:value="${dict.dictValue}"></option>

View File

@ -5,7 +5,6 @@ import com.ghy.common.core.text.Convert;
import com.ghy.common.exception.ServiceException; import com.ghy.common.exception.ServiceException;
import com.ghy.common.utils.StringUtils; import com.ghy.common.utils.StringUtils;
import com.ghy.goods.domain.Goods; import com.ghy.goods.domain.Goods;
import com.ghy.goods.domain.GoodsArea;
import com.ghy.goods.domain.GoodsStandard; import com.ghy.goods.domain.GoodsStandard;
import com.ghy.goods.mapper.GoodsMapper; import com.ghy.goods.mapper.GoodsMapper;
import com.ghy.goods.request.AppGoodsRequest; import com.ghy.goods.request.AppGoodsRequest;
@ -16,9 +15,11 @@ import com.ghy.goods.service.GoodsStandardService;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.Assert; import org.springframework.util.Assert;
import org.springframework.util.CollectionUtils;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collection; import java.util.Collection;
import java.util.List; import java.util.List;
@ -47,11 +48,15 @@ public class GoodsServiceImpl implements GoodsService {
int result = goodsMapper.insertGoods(goods); int result = goodsMapper.insertGoods(goods);
// 给各组件插入商品主体id // 给各组件插入商品主体id
goods.getGoodsAreaList().forEach(goodsArea -> {goodsArea.setGoodsId(goods.getGoodsId());}); goods.getGoodsAreaList().forEach(goodsArea -> {
goods.getGoodsImgsList().forEach(goodsImg -> {goodsImg.setGoodsId(goods.getGoodsId());}); goodsArea.setGoodsId(goods.getGoodsId());
});
goods.getGoodsImgsList().forEach(goodsImg -> {
goodsImg.setGoodsId(goods.getGoodsId());
});
goods.getGoodsStandardList().forEach(goodsStandard -> { goods.getGoodsStandardList().forEach(goodsStandard -> {
goodsStandard.setGoodsId(goods.getGoodsId()); goodsStandard.setGoodsId(goods.getGoodsId());
if(goodsStandard.getExtMoney() == null){ if (goodsStandard.getExtMoney() == null) {
goodsStandard.setExtMoney(BigDecimal.ZERO); goodsStandard.setExtMoney(BigDecimal.ZERO);
} }
}); });
@ -146,6 +151,9 @@ public class GoodsServiceImpl implements GoodsService {
@Override @Override
public List<Goods> selectByIds(Collection<Long> ids) { public List<Goods> selectByIds(Collection<Long> ids) {
if (CollectionUtils.isEmpty(ids)) {
return new ArrayList<>(0);
}
return goodsMapper.selectByIds(ids); return goodsMapper.selectByIds(ids);
} }