Commit 0e1263d8 by 丁伟峰

返回字段信息补充

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