Commit f686f859 by 丁伟峰

Merge branch 'feat-dingwf' into develop

2 parents 5355a61e 6bbbd1d4
package com.alibaba.cloud.integration.order.dao;
import com.alibaba.cloud.integration.order.entity.OrderTagStrategyEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import java.util.List;
public interface OrderTagStrategyDao extends JpaRepository<OrderTagStrategyEntity, Long> {
@Query("select distinct s.tagName from OrderTagStrategyEntity s where s.disabled=0")
List<String> getAllTags();
}
package com.alibaba.cloud.integration.order.entity;
import lombok.Data;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.util.Date;
@Entity
@Data
public class OrderTagStrategyEntity {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Integer id;
private String tagName;
private String processWay;
private int attention;
private int priority;
private int disabled;
private String memo;
private Date createTime;
private Date updateTime;
}
package com.alibaba.cloud.integration.order.service.impl;
import com.alibaba.cloud.integration.common.Result;
import com.alibaba.cloud.integration.order.dao.OrderTagStrategyDao;
import com.alibaba.cloud.integration.order.dao.ProductCategoryDao;
import com.alibaba.cloud.integration.order.dto.BrandDTO;
import com.alibaba.cloud.integration.order.dto.KeyValueDTO;
......@@ -23,12 +24,33 @@ public class ProductServiceImpl implements ProductService {
@Autowired
private ProductCategoryDao productCategoryDao;
@Autowired
private OrderTagStrategyDao orderTagStrategyDao;
private List<KeyValueDTO> getPriorities() {
return null;
List<KeyValueDTO> listPriorities = new ArrayList<>();
int prioritiesLevels = 10;
for (int i = 0; i <= prioritiesLevels; i++) {
String label;
if (i == 0) {
label = "最低";
} else if (i == prioritiesLevels) {
label = "最高";
} else {
label = String.format("优先级%d", i);
}
listPriorities.add(new KeyValueDTO().setLabel(label).setValue(String.valueOf(i)));
}
return listPriorities;
}
private List<KeyValueDTO> getStandardTags() {
return null;
List<KeyValueDTO> tagList = new ArrayList<>();
for (String tag : orderTagStrategyDao.getAllTags()) {
tagList.add(new KeyValueDTO().setLabel(tag).setValue(tag));
}
return tagList;
}
private List<BrandDTO> getBrands() {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!