Commit 3bafa010 by 王力

Merge branch 'feature_OrderServiceList_wangl' into 'develop'

数据库表字段变更

See merge request !19
2 parents 98883a6c a004ec31
...@@ -3,11 +3,7 @@ package com.alibaba.cloud.integration.order.service.impl; ...@@ -3,11 +3,7 @@ package com.alibaba.cloud.integration.order.service.impl;
import com.alibaba.cloud.integration.common.Result; import com.alibaba.cloud.integration.common.Result;
import com.alibaba.cloud.integration.order.dao.*; import com.alibaba.cloud.integration.order.dao.*;
import com.alibaba.cloud.integration.order.dto.EnginnerTimelineResp; import com.alibaba.cloud.integration.order.dto.EnginnerTimelineResp;
import com.alibaba.cloud.integration.order.entity.EngineerInfo; import com.alibaba.cloud.integration.order.entity.*;
import com.alibaba.cloud.integration.order.entity.EngineerTimeline;
import com.alibaba.cloud.integration.order.entity.OrderRequest;
import com.alibaba.cloud.integration.order.entity.WarehouseInfo;
import com.alibaba.cloud.integration.order.entity.OrderAppointment;
import com.alibaba.cloud.integration.order.service.EnginnerTimelineService; import com.alibaba.cloud.integration.order.service.EnginnerTimelineService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -39,6 +35,9 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService { ...@@ -39,6 +35,9 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
@Autowired @Autowired
private WarehouseInfoDao warehouseInfoDao; private WarehouseInfoDao warehouseInfoDao;
@Autowired
private OrgGroupDao orgGroupDao;
@Transactional @Transactional
@Override @Override
public Result<?> GetEnginnerTimelines(String engineerCode, String date){ public Result<?> GetEnginnerTimelines(String engineerCode, String date){
...@@ -58,8 +57,8 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService { ...@@ -58,8 +57,8 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
HashMap<String, String> orderLocations = this.OrderRequestsLocation(orderIds); HashMap<String, String> orderLocations = this.OrderRequestsLocation(orderIds);
// 获取配送站地址 // 获取配送站地址
String branchId = this.EngineerBranchId(engineerCode); String branchId = this.getEngineerBranchId(engineerCode);
String warehouseLocation = this.WarehouseLocation(branchId); String warehouseLocation = this.getWarehouseLocation(branchId);
List<EnginnerTimelineResp.DynamicItem> dynamics = this.PackItems(timelines, orders, orderLocations, warehouseLocation); List<EnginnerTimelineResp.DynamicItem> dynamics = this.PackItems(timelines, orders, orderLocations, warehouseLocation);
...@@ -110,7 +109,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService { ...@@ -110,7 +109,7 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
return map; return map;
} }
private String WarehouseLocation(String branchId) { private String getWarehouseLocation(String branchId) {
// 获取配送站location // 获取配送站location
LambdaQueryWrapper<WarehouseInfo> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<WarehouseInfo> lqw = new LambdaQueryWrapper<>();
lqw.eq(WarehouseInfo::getBranchId, branchId); lqw.eq(WarehouseInfo::getBranchId, branchId);
...@@ -118,12 +117,23 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService { ...@@ -118,12 +117,23 @@ public class EnginnerTimelineServiceImpl implements EnginnerTimelineService {
return String.format("%s,%s", w.getX(), w.getY()); return String.format("%s,%s", w.getX(), w.getY());
} }
private String EngineerBranchId(String engineerCode) { private String getEngineerBranchId(String engineerCode) {
LambdaQueryWrapper<EngineerInfo> lqw = new LambdaQueryWrapper<>(); LambdaQueryWrapper<EngineerInfo> lqw = new LambdaQueryWrapper<>();
lqw.select(EngineerInfo::getGroupId);
lqw.eq(EngineerInfo::getEngineerCode, engineerCode); lqw.eq(EngineerInfo::getEngineerCode, engineerCode);
return engineerInfoDao.selectOne(lqw).getBranchId(); EngineerInfo e = engineerInfoDao.selectOne(lqw);
if (e == null) {
return "";
} }
LambdaQueryWrapper<OrgGroup> lqw2 = new LambdaQueryWrapper<>();
lqw2.select(OrgGroup::getBranchId);
lqw2.eq(OrgGroup::getGroupId, e.getGroupId());
OrgGroup g = orgGroupDao.selectOne(lqw2);
return (g==null)? "": g.getBranchId();
}
private List<EnginnerTimelineResp.DynamicItem> PackItems(List<EngineerTimeline> timelines, List<OrderAppointment> orders, HashMap<String, String> locations, String warehouseLocation) { private List<EnginnerTimelineResp.DynamicItem> PackItems(List<EngineerTimeline> timelines, List<OrderAppointment> orders, HashMap<String, String> locations, String warehouseLocation) {
Integer index = 1; Integer index = 1;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!