Commit 0e1263d8 by 丁伟峰

返回字段信息补充

1 parent 8269ab8a
......@@ -29,7 +29,7 @@ public class BusinessOrgWarehousesDTO {
@lombok.Data
@Accessors(chain = true)
public static class Content {
private String warehouserName;
private String warehouseName;
private String warehouseId;
private String groupName;
private String address;
......
package com.dituhui.pea.order.service.impl;
import com.dituhui.pea.common.Result;
import com.dituhui.pea.order.common.DateUtils;
import com.dituhui.pea.order.dao.*;
import com.dituhui.pea.order.dto.BusinessOrgWarehousesDTO;
import com.dituhui.pea.order.dto.BusinessSkillListDTO;
......@@ -22,6 +23,8 @@ import java.util.stream.Collectors;
@Service
@Slf4j
public class BusinessBaseServiceImpl implements BusinessBaseService {
@Autowired
private OrgGroupDao orgGroupDao;
@Autowired
private SkillInfoDao skillInfoDao;
......@@ -77,17 +80,18 @@ public class BusinessBaseServiceImpl implements BusinessBaseService {
List<BusinessOrgWarehousesDTO.Content> contents = page.getContent().stream().map(e -> {
BusinessOrgWarehousesDTO.Content content = new BusinessOrgWarehousesDTO.Content();
content.setWarehouseId(e.getWarehouseId());
content.setWarehouserName(e.getWarehouseName());
content.setWarehouseName(e.getWarehouseName());
content.setAddress(e.getAddress());
content.setLocation(String.format("%s,%s", e.getX(), e.getY()));
content.setGroupName(getGroupName(e.getGroupId()));
content.setManagerName(e.getManagerName());
content.setManagerPhone(e.getManagerPhone());
if (e.getGroupId() != null && !e.getGroupId().equals("0")) {
content.setType("");
if (e.getKind() == 1) {
content.setType("分部仓-可分发");
} else {
content.setType("分部仓 - 可分发");
content.setType("小组仓-快递柜");
}
content.setUpdateTime(DateUtils.formatDateTime(e.getUpdateTime()));
return content;
}).collect(Collectors.toList());
BusinessOrgWarehousesDTO.Result rs = new BusinessOrgWarehousesDTO.Result();
......@@ -100,6 +104,14 @@ public class BusinessBaseServiceImpl implements BusinessBaseService {
}
private String getGroupName(String groupId) {
if ("0".equals(groupId)) {
return "直属分部";
}
OrgGroupEntity groupEntity = orgGroupDao.getByGroupId(groupId);
if (groupEntity != null) {
return groupEntity.getGroupName();
}
log.error("未找到匹配的 直属分站信息");
return null;
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!