Commit 3ac2e062 by 王力

Merge branch 'dev_rescheduling20230711' into 'develop'

修改

See merge request !194
2 parents 686f10b0 9315d2c2
...@@ -11,7 +11,6 @@ import com.dituhui.pea.order.entity.SkillInfo; ...@@ -11,7 +11,6 @@ import com.dituhui.pea.order.entity.SkillInfo;
import lombok.Data; import lombok.Data;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import java.sql.Timestamp; import java.sql.Timestamp;
...@@ -24,11 +23,9 @@ import java.util.List; ...@@ -24,11 +23,9 @@ import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Component
@Slf4j @Slf4j
public class OrderAssignCheck { public class OrderAssignCheck {
private String orderId;
private String engineerCode;
@Autowired @Autowired
OrderRequestMPDao orderRequestMPDao; OrderRequestMPDao orderRequestMPDao;
...@@ -41,10 +38,6 @@ public class OrderAssignCheck { ...@@ -41,10 +38,6 @@ public class OrderAssignCheck {
@Autowired @Autowired
EngineerBusinessMPDao engineerBusinessMPDao; EngineerBusinessMPDao engineerBusinessMPDao;
public OrderAssignCheck(String orderId, String engineerCode) {
this.orderId = orderId;
this.engineerCode = engineerCode;
}
@Data @Data
public class Result { public class Result {
...@@ -65,10 +58,10 @@ public class OrderAssignCheck { ...@@ -65,10 +58,10 @@ public class OrderAssignCheck {
} }
} }
public Result orderAssignCheck() { public Result orderAssignCheck(String orderId, String engineerCode) {
log.info("begin orderAssignCheck:orderId={}, engineerCode={}", this.orderId, this.engineerCode); log.info("begin orderAssignCheck:orderId={}, engineerCode={}", orderId, engineerCode);
OrderRequest order = orderRequestMPDao.getByOrderId(this.orderId); OrderRequest order = orderRequestMPDao.getByOrderId(orderId);
double curX = Double.parseDouble(order.getX()); double curX = Double.parseDouble(order.getX());
double curY = Double.parseDouble(order.getY()); double curY = Double.parseDouble(order.getY());
......
...@@ -131,8 +131,8 @@ public class OrderAssignImpl implements OrderAssign { ...@@ -131,8 +131,8 @@ public class OrderAssignImpl implements OrderAssign {
throw new BusinessException(String.format("订单已指派个技术员[%s], 不必重复指派给同一个技术员", engineer.getName())); throw new BusinessException(String.format("订单已指派个技术员[%s], 不必重复指派给同一个技术员", engineer.getName()));
} }
OrderAssignCheck ck = new OrderAssignCheck(orderId, engineerCode); OrderAssignCheck ck = new OrderAssignCheck();
OrderAssignCheck.Result result = ck.orderAssignCheck(); OrderAssignCheck.Result result = ck.orderAssignCheck(orderId, engineerCode);
log.info("指派检查结果:{}", result); log.info("指派检查结果:{}", result);
if(!result.getCanAssign()){ if(!result.getCanAssign()){
throw new BusinessException("指派失败, 未能找到合适的时间段, 请选择其他技术员"); throw new BusinessException("指派失败, 未能找到合适的时间段, 请选择其他技术员");
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!