Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
b3a071d13c
|
@ -1,7 +1,6 @@
|
|||
package com.chint.domain.aggregates.order.order_record;
|
||||
|
||||
import com.chint.domain.aggregates.order.OrderDetail;
|
||||
import com.chint.domain.aggregates.order.OrderEvent;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
@ -9,11 +8,6 @@ import lombok.experimental.Accessors;
|
|||
import org.springframework.data.annotation.Id;
|
||||
import org.springframework.data.relational.core.mapping.Table;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
|
||||
import static com.chint.infrastructure.constant.OrderConstant.ORDER_EVENT_ETA;
|
||||
|
||||
@Data
|
||||
@Table("order_car_record")
|
||||
@NoArgsConstructor
|
||||
|
@ -71,13 +65,13 @@ public class OrderCarRecord extends OrderBaseRecord {
|
|||
private String orderSource; // 预订来源:线上/线下
|
||||
private String payAmount;//支付总金额
|
||||
private String receiptsNumOrigin;//支付总金额
|
||||
private String belongDeport; //归属部门
|
||||
private String belongDepart; //归属部门
|
||||
|
||||
|
||||
public OrderCarRecord loadBelongDeport(String belongDeport
|
||||
) {
|
||||
// 行程信息
|
||||
this.setBelongDeport(belongDeport);
|
||||
this.setBelongDepart(belongDeport);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -80,12 +80,12 @@ public class OrderFlightRecord extends OrderBaseRecord {
|
|||
private String createTime;
|
||||
private String receiptsNumOrigin;//原差旅申请单单号
|
||||
private String payAmount;
|
||||
private String belongDeport; //归属部门
|
||||
private String belongDepart; //归属部门
|
||||
|
||||
public OrderFlightRecord loadBelongDeport(String belongDeport
|
||||
) {
|
||||
// 行程信息
|
||||
this.setBelongDeport(belongDeport);
|
||||
this.setBelongDepart(belongDeport);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -79,12 +79,12 @@ public class OrderHotelRecord extends OrderBaseRecord {
|
|||
private String orderStatus;
|
||||
private String createTime;
|
||||
private String receiptsNumOrigin;//支付总金额
|
||||
private String belongDeport; //归属部门
|
||||
private String belongDepart; //归属部门
|
||||
|
||||
public OrderHotelRecord loadBelongDeport(String belongDeport
|
||||
) {
|
||||
// 行程信息
|
||||
this.setBelongDeport(belongDeport);
|
||||
this.setBelongDepart(belongDeport);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,12 +73,12 @@ public class OrderTrainRecord extends OrderBaseRecord{
|
|||
private String trainTime; // 发车时间 yyyy-MM-dd HH:mm:ss
|
||||
private String yxId; // 影像比对ID
|
||||
private String receiptsNumOrigin;//原差旅申请单单号
|
||||
private String belongDeport; //归属部门
|
||||
private String belongDepart; //归属部门
|
||||
|
||||
public OrderTrainRecord loadBelongDeport(String belongDeport
|
||||
) {
|
||||
// 行程信息
|
||||
this.setBelongDeport(belongDeport);
|
||||
this.setBelongDepart(belongDeport);
|
||||
return this;
|
||||
}
|
||||
// 加载基础订单信息
|
||||
|
|
|
@ -591,7 +591,7 @@ public class CTripOrderRecordExtensionFactory implements OrderRecordExtensionFac
|
|||
private String belongDeport(String employeeNo, String accountCompanyName) {
|
||||
User user = userRepository.findByUserEmployeeNo(employeeNo);
|
||||
if (user == null) {
|
||||
user = userHttpRequest.loadUserInfo(User.withEmployeeNo(employeeNo));
|
||||
user = userHttpRequest.loadUserBaseInfo(User.withEmployeeNo(employeeNo));
|
||||
if (user == null) {
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -5,5 +5,7 @@ import com.chint.domain.aggregates.user.User;
|
|||
public interface UserHttpRequest {
|
||||
User loadUserInfo(User user);
|
||||
|
||||
User loadUserBaseInfo(User user);
|
||||
|
||||
User loadUserDeptInfo(User user);
|
||||
}
|
|
@ -182,6 +182,30 @@ public class UserHttpRequestImpl implements UserHttpRequest {
|
|||
return user;
|
||||
}
|
||||
|
||||
//这个方法只保存从sf取来的信息
|
||||
public User loadUserBaseInfo(User user) {
|
||||
List<UserDataDTO> userDataDTOList = userSFRequest
|
||||
.getUserSFDataFromOpenApi(user);
|
||||
|
||||
if (userDataDTOList == null || userDataDTOList.isEmpty()) {
|
||||
return null;
|
||||
}
|
||||
userDataDTOList
|
||||
.stream()
|
||||
.filter(it -> it.getPersonIdExternal().equals(it.getLoginUsername()))
|
||||
.findFirst()
|
||||
.ifPresent(it -> {
|
||||
User byUserEmployeeNo = userRepository.findByUserEmployeeNo(user.getEmployeeNo());
|
||||
if(byUserEmployeeNo == null){
|
||||
userRepository.save(
|
||||
getDataFromUserSFData(user, it)
|
||||
);
|
||||
}
|
||||
});
|
||||
return user;
|
||||
}
|
||||
|
||||
|
||||
private User addDeptInfo(UserDataDTO userData, User user, Boolean ifPrimary) {
|
||||
UserDepartmentInfo.Builder builder = user.addDeptInfo()
|
||||
.companyInfo(userData.getCompany(), userData.getCompany_cn())
|
||||
|
|
Loading…
Reference in New Issue