Commit 8c47b6ec by huangjinxin

fix:指派工程师返回名称

1 parent a64f3bc9
...@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude; ...@@ -4,6 +4,7 @@ import com.fasterxml.jackson.annotation.JsonInclude;
import lombok.Data; import lombok.Data;
import java.util.List; import java.util.List;
import java.util.Map;
@Data @Data
public class OrderServiceDetailResp { public class OrderServiceDetailResp {
...@@ -33,7 +34,13 @@ public class OrderServiceDetailResp { ...@@ -33,7 +34,13 @@ public class OrderServiceDetailResp {
/** /**
* 指定某个工程师/排除某个工程师 codes 多个,分割 * 指定某个工程师/排除某个工程师 codes 多个,分割
*/ */
private String appointEngineerCodes; // private String appointEngineerCodes;
/**
* 指定某个工程师/排除某个工程师 codes 多个,分割 key code,value 名称
*/
private Map<String, String> appointEngineerCodes;
/** /**
...@@ -76,7 +83,7 @@ public class OrderServiceDetailResp { ...@@ -76,7 +83,7 @@ public class OrderServiceDetailResp {
/** /**
* 是否是cutoff,0否 1是 默认0 * 是否是cutoff,0否 1是 默认0
*/ */
private Integer isCutoff ; private Integer isCutoff;
/** /**
...@@ -86,7 +93,7 @@ public class OrderServiceDetailResp { ...@@ -86,7 +93,7 @@ public class OrderServiceDetailResp {
@Data @Data
@JsonInclude(JsonInclude.Include.NON_NULL) @JsonInclude(JsonInclude.Include.NON_NULL)
public static class OrderDetail{ public static class OrderDetail {
private String location; private String location;
private String address; private String address;
private String brand; private String brand;
......
...@@ -8,6 +8,8 @@ import com.dituhui.pea.order.dto.*; ...@@ -8,6 +8,8 @@ import com.dituhui.pea.order.dto.*;
import com.dituhui.pea.order.entity.*; import com.dituhui.pea.order.entity.*;
import com.dituhui.pea.order.service.OrderServiceDetail; import com.dituhui.pea.order.service.OrderServiceDetail;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
...@@ -70,7 +72,11 @@ public class OrderServiceDetailImpl implements OrderServiceDetail { ...@@ -70,7 +72,11 @@ public class OrderServiceDetailImpl implements OrderServiceDetail {
res.setIsMultiple(order.getIsMultiple()); res.setIsMultiple(order.getIsMultiple());
res.setIsAppointEngineer(order.getIsAppointEngineer()); res.setIsAppointEngineer(order.getIsAppointEngineer());
res.setAppointEngineerCodes(order.getAppointEngineerCodes()); if (StringUtils.isNotBlank(order.getAppointEngineerCodes())) {
String[] strings = order.getAppointEngineerCodes().split(",");
List<EngineerInfoEntity> engineerCodeIn = engineerInfoDao.findByEngineerCodeIn(Arrays.asList(strings));
res.setAppointEngineerCodes(CollectionUtils.isEmpty(engineerCodeIn) ? null : engineerCodeIn.stream().collect(Collectors.toMap(EngineerInfoEntity::getEngineerCode, EngineerInfoEntity::getName)));
}
res.setBeanPriority(order.getBeanPriority()); res.setBeanPriority(order.getBeanPriority());
res.setName(order.getName()); res.setName(order.getName());
res.setPhone(order.getPhone()); res.setPhone(order.getPhone());
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!