Commit 9ae60499 by 丁伟峰

统一 LabelValue

1 parent fe8b97be
......@@ -5,7 +5,7 @@ import lombok.experimental.Accessors;
@Data
@Accessors(chain = true)
public class KeyValueDTO {
public class LabelValueDTO {
private String value;
private String label;
}
......@@ -8,6 +8,6 @@ import java.util.List;
@Data
@Accessors(chain = true)
public class ParameterRespDTO {
private List<KeyValueDTO> priorities;
private List<KeyValueDTO> standardTags;
private List<LabelValueDTO> priorities;
private List<LabelValueDTO> standardTags;
}
......@@ -78,11 +78,4 @@ public class WorkbenchEngineersGanttRespDTO {
*/
private List<?> tips;
}
@lombok.Data
@Accessors(chain = true)
public static class Tip {
private String desc;
private String title;
}
}
......@@ -21,7 +21,7 @@ import com.alibaba.cloud.integration.order.dao.OrderRequestDao;
import com.alibaba.cloud.integration.order.dao.OrderTagStrategyDao;
import com.alibaba.cloud.integration.order.dao.OrgTeamDao;
import com.alibaba.cloud.integration.order.dao.ProductCategoryDao;
import com.alibaba.cloud.integration.order.dto.KeyValueDTO;
import com.alibaba.cloud.integration.order.dto.LabelValueDTO;
import com.alibaba.cloud.integration.order.dto.LocationDTO;
import com.alibaba.cloud.integration.order.dto.OrderCreateReqDTO;
import com.alibaba.cloud.integration.order.dto.ParameterRespDTO;
......@@ -59,20 +59,20 @@ public class OrderCreateServiceImpl implements OrderCreateService {
@Autowired
private CommonService commonService;
private List<KeyValueDTO> getPriorities() {
private List<LabelValueDTO> getPriorities() {
String[] priorities = {"紧急", "正常"};
List<KeyValueDTO> listPriorities = new ArrayList<>();
List<LabelValueDTO> listPriorities = new ArrayList<>();
for (String s : priorities) {
listPriorities.add(new KeyValueDTO().setLabel(s).setValue(s));
listPriorities.add(new LabelValueDTO().setLabel(s).setValue(s));
}
return listPriorities;
}
private List<KeyValueDTO> getStandardTags() {
private List<LabelValueDTO> getStandardTags() {
String[] tags = {"远距离", "多人上门"};
List<KeyValueDTO> tagList = new ArrayList<>();
List<LabelValueDTO> tagList = new ArrayList<>();
for (String s : tags) {
tagList.add(new KeyValueDTO().setLabel(s).setValue(s));
tagList.add(new LabelValueDTO().setLabel(s).setValue(s));
}
return tagList;
}
......
......@@ -2,10 +2,7 @@ package com.alibaba.cloud.integration.order.service.impl;
import com.alibaba.cloud.integration.common.Result;
import com.alibaba.cloud.integration.order.dao.*;
import com.alibaba.cloud.integration.order.dto.WorkbenchEngineersGanttReqDTO;
import com.alibaba.cloud.integration.order.dto.WorkbenchEngineersGanttRespDTO;
import com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListReqDTO;
import com.alibaba.cloud.integration.order.dto.WorkbenchOrderChangeListRespDTO;
import com.alibaba.cloud.integration.order.dto.*;
import com.alibaba.cloud.integration.order.entity.*;
import com.alibaba.cloud.integration.order.service.WorkbenchService;
import lombok.extern.slf4j.Slf4j;
......@@ -125,13 +122,13 @@ public class WorkbenchServiceImpl implements WorkbenchService {
private List<?> getOrderTips(String orderId) {
log.info("==> getOrdertips: orderId[{}]", orderId);
OrderRequestEntity order = orderRequestDao.getByOrderId(orderId);
List<WorkbenchEngineersGanttRespDTO.Tip> tips = new ArrayList<>();
tips.add(new WorkbenchEngineersGanttRespDTO.Tip().setTitle("类型/品牌").setDesc(String.format("%s %s", order.getBrand(), order.getType())));
tips.add(new WorkbenchEngineersGanttRespDTO.Tip().setTitle("电话/地址").setDesc(String.format("%s %s\n %s", order.getName(), order.getPhone(), order.getAddress())));
List<LabelValueDTO> tips = new ArrayList<>();
tips.add(new LabelValueDTO().setLabel("类型/品牌").setValue(String.format("%s %s", order.getBrand(), order.getType())));
tips.add(new LabelValueDTO().setLabel("电话/地址").setValue(String.format("%s %s\n %s", order.getName(), order.getPhone(), order.getAddress())));
if (!order.getApplyNote().isBlank()) {
tips.add(new WorkbenchEngineersGanttRespDTO.Tip().setTitle("备注").setDesc(order.getApplyNote()));
tips.add(new LabelValueDTO().setLabel("备注").setValue(order.getApplyNote()));
}
tips.add(new WorkbenchEngineersGanttRespDTO.Tip().setTitle("标签").setDesc(order.getTags()));
tips.add(new LabelValueDTO().setLabel("标签").setValue(order.getTags()));
return tips;
}
}
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!