Commit adbb94e0 authored by unset's avatar unset

添加订单商品信息

parent 261d8381
......@@ -138,13 +138,16 @@ public class ImageImgStorageBiz extends BaseBiz<ImageImgStorageMapper,ImageImgSt
return ObjectRestResponse.succ(imageImgStorage);
}
public ObjectRestResponse getAll(Integer type) {
public ObjectRestResponse<List<ImageImgStorage>> getAll(Integer type, String name) {
Example example = new Example(ImageImgStorage.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("isDel", 0).andEqualTo("status", 1);
if (type != null) {
criteria.andEqualTo("type", type);
}
if (StringUtils.isNotBlank(name)) {
criteria.andLike("name", "%" + name + "%");
}
example.orderBy("updTime").desc();
List<ImageImgStorage> list = mapper.selectByExample(example);
if (list != null && list.size() > 0) {
......
......@@ -12,6 +12,7 @@ import com.upyuns.platform.rs.website.entity.IndustryApplicationInfo;
import com.upyuns.platform.rs.website.entity.IndustryApplicationType;
import com.upyuns.platform.rs.website.mapper.IndustryApplicationInfoMapper;
import com.upyuns.platform.rs.website.vo.IndustryTypeVo;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -126,9 +127,13 @@ public class IndustryApplicationInfoBiz extends BaseBiz<IndustryApplicationInfoM
* 获取所有行业应用
* @return
*/
public List<IndustryApplicationInfo> getAllData() {
public List<IndustryApplicationInfo> getAllData(String name) {
Example example = new Example(IndustryApplicationInfo.class);
example.createCriteria().andEqualTo("isDel", 0).andEqualTo("status", 1);
Example.Criteria criteria = example.createCriteria();
if (StringUtils.isNotBlank(name)) {
criteria.andLike("title", "%" + name + "");
}
criteria.andEqualTo("isDel", 0).andEqualTo("status", 1);
return mapper.selectByExample(example);
}
......
......@@ -875,20 +875,54 @@ public class OrderInfoBiz extends BaseBiz<OrderInfoMapper, OrderInfo> {
}
public ObjectRestResponse getItemByType(Integer type) {
/**
* 根据类型查询商品信息
* @param type
* @param name
* @return
*/
public ObjectRestResponse getItemByType(Integer type, String name) {
if (type == null) {
return ObjectRestResponse.paramIsEmpty();
}
List<ItemInfoVo> itemInfoVoList = new ArrayList<>();
switch (ItemTypeEnum.getByCode(type)) {
case IMAGE_STORAGE:
return imageImgStorageBiz.getAll(null);
List<ImageImgStorage> imageImgStorageList = imageImgStorageBiz.getAll(null, name).getData();
if (imageImgStorageList != null && imageImgStorageList.size() > 0) {
imageImgStorageList.parallelStream().forEach(imageImgStorage -> {
List<ImageInfoRelation> imageInfoRelationList = imageImgStorage.getImageInfoRelationList();
if (imageInfoRelationList != null && imageInfoRelationList.size() > 0) {
imageInfoRelationList.parallelStream().forEach(imageInfoRelation -> {
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setName(imageImgStorage.getName() + imageInfoRelation.getFileWidth());
itemInfoVo.setId(Long.parseLong(String.valueOf(imageInfoRelation.getId())));
itemInfoVoList.add(itemInfoVo);
});
} else {
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setName(imageImgStorage.getName());
itemInfoVo.setId(Long.parseLong(String.valueOf(imageImgStorage.getId())));
itemInfoVoList.add(itemInfoVo);
}
});
}
break;
case INDUSTRY_INFO:
return ObjectRestResponse.succ(industryApplicationInfoBiz.getAllData());
List<IndustryApplicationInfo> industryApplicationInfoList = industryApplicationInfoBiz.getAllData(name);
if (industryApplicationInfoList != null && industryApplicationInfoList.size() > 0) {
industryApplicationInfoList.parallelStream().forEach(industryApplicationInfo -> {
ItemInfoVo itemInfoVo = new ItemInfoVo();
itemInfoVo.setName(industryApplicationInfo.getTitle());
itemInfoVo.setId(Long.parseLong(String.valueOf(industryApplicationInfo.getId())));
itemInfoVoList.add(itemInfoVo);
});
}
case STANDARD_DATA:
break;
}
return ObjectRestResponse.succ();
return ObjectRestResponse.succ(itemInfoVoList);
}
}
\ No newline at end of file
......@@ -53,8 +53,8 @@ public class OrderInfoController extends BaseController<OrderInfoBiz,OrderInfo>
}
@GetMapping(value = "getItemByType")
public ObjectRestResponse getItemByType(Integer type) {
return baseBiz.getItemByType(type);
public ObjectRestResponse getItemByType(Integer type, String name) {
return baseBiz.getItemByType(type, name);
}
}
\ No newline at end of file
......@@ -21,7 +21,7 @@ public class ImageImgStorageWebController extends BaseController<ImageImgStorage
@GetMapping(value = "/app/unauth/getAll")
@IgnoreUserToken
public ObjectRestResponse getAll(Integer type) {
return baseBiz.getAll(type);
return baseBiz.getAll(type, "");
}
@GetMapping(value = "/app/unauth/getList")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment