Compare commits
No commits in common. "f3306d713e1fb2458367387df92293292b21bd73" and "0e2b46713fca3d7e05631181ad6d82a300e32c6e" have entirely different histories.
f3306d713e
...
0e2b46713f
|
|
@ -140,9 +140,6 @@ public class ShoppingController extends ControllerBase {
|
||||||
@Resource
|
@Resource
|
||||||
private ITBaseDepartmentService departmentService;
|
private ITBaseDepartmentService departmentService;
|
||||||
|
|
||||||
@Resource
|
|
||||||
private IQuotationShoppingOrderDeliveryMethodService shoppingOrderDeliveryMethodService;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 购物车-获取报价主体
|
* 购物车-获取报价主体
|
||||||
*/
|
*/
|
||||||
|
|
@ -501,10 +498,6 @@ public class ShoppingController extends ControllerBase {
|
||||||
.eq(QuotationShoppingCartService::getCartId, cart.getId())
|
.eq(QuotationShoppingCartService::getCartId, cart.getId())
|
||||||
.list()
|
.list()
|
||||||
);
|
);
|
||||||
vo.setOthers(shoppingCartOtherService.lambdaQuery()
|
|
||||||
.eq(QuotationShoppingCartOther::getCartId, cart.getId())
|
|
||||||
.list()
|
|
||||||
);
|
|
||||||
return ApiResult.success(vo);
|
return ApiResult.success(vo);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -561,19 +554,18 @@ public class ShoppingController extends ControllerBase {
|
||||||
.throwMessage("客户名称不一致");
|
.throwMessage("客户名称不一致");
|
||||||
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getTargetId).collect(Collectors.toSet()).size() > 1)
|
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getTargetId).collect(Collectors.toSet()).size() > 1)
|
||||||
.throwMessage("报价主体不一致");
|
.throwMessage("报价主体不一致");
|
||||||
QuotationShoppingOrder order = Convert.convert(QuotationShoppingOrder.class, request);
|
QuotationShoppingOrder order = new QuotationShoppingOrder()
|
||||||
order.setId(IdUtil.getId());
|
.setCreateByType(AppUserUtil.isAgent() ? 1 : 0)
|
||||||
order.setNo(genOrderNo());
|
.setCreateBy(AppUserUtil.getUserName())
|
||||||
order.setCreateByType(AppUserUtil.isAgent() ? 1 : 0);
|
.setCreateById(AppUserUtil.getUserId())
|
||||||
order.setCreateBy(AppUserUtil.getUserName());
|
.setCreateTime(LocalDateTime.now())
|
||||||
order.setCreateById(AppUserUtil.getUserId());
|
.setId(IdUtil.getId())
|
||||||
order.setCreateTime(LocalDateTime.now());
|
.setCustomerName(carts.get(0).getCustomerName())
|
||||||
order.setCustomerName(carts.get(0).getCustomerName());
|
.setEffectiveStartTime(DateTimeUtil.format(LocalDate.now(), "yyyy-MM-dd"))
|
||||||
order.setEffectiveStartTime(DateTimeUtil.format(LocalDate.now(), "yyyy-MM-dd"));
|
.setEffectiveEndTime(DateTimeUtil.format(LocalDate.now().plusMonths(1), "yyyy-MM-dd"))
|
||||||
order.setEffectiveEndTime(DateTimeUtil.format(LocalDate.now().plusMonths(1), "yyyy-MM-dd"));
|
.setQuotationCode(getQuotationCode())
|
||||||
order.setQuotationCode(getQuotationCode());
|
.setTargetId(carts.get(0).getTargetId())
|
||||||
order.setTargetId(carts.get(0).getTargetId());
|
.setTotalFee(carts.stream().map(QuotationShoppingCart::getActualFee).reduce(BigDecimal::add).get());
|
||||||
order.setTotalFee(carts.stream().map(QuotationShoppingCart::getActualFee).reduce(BigDecimal::add).orElse(BigDecimal.ZERO));
|
|
||||||
order.setActualFee(order.getTotalFee());
|
order.setActualFee(order.getTotalFee());
|
||||||
order.setExchangeFee(NumberUtil.multiply(order.getActualFee(), request.getExchangeRate()));
|
order.setExchangeFee(NumberUtil.multiply(order.getActualFee(), request.getExchangeRate()));
|
||||||
shoppingOrderItemService.saveBatch(
|
shoppingOrderItemService.saveBatch(
|
||||||
|
|
@ -583,17 +575,7 @@ public class ShoppingController extends ControllerBase {
|
||||||
.setCartId(cart.getId()))
|
.setCartId(cart.getId()))
|
||||||
.collect(Collectors.toList())
|
.collect(Collectors.toList())
|
||||||
);
|
);
|
||||||
if (CollectionUtil.isNotEmpty(request.getDeliveryMethods())) {
|
order.setNo(genOrderNo());
|
||||||
shoppingOrderDeliveryMethodService.saveBatch(
|
|
||||||
request.getDeliveryMethods().stream()
|
|
||||||
.map(deliveryMethod -> {
|
|
||||||
QuotationShoppingOrderDeliveryMethod dm = Convert.convert(QuotationShoppingOrderDeliveryMethod.class, deliveryMethod);
|
|
||||||
dm.setOrderId(order.getId());
|
|
||||||
return dm;
|
|
||||||
})
|
|
||||||
.collect(Collectors.toList())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
shoppingOrderService.save(order);
|
shoppingOrderService.save(order);
|
||||||
shoppingCartService.lambdaUpdate()
|
shoppingCartService.lambdaUpdate()
|
||||||
.set(QuotationShoppingCart::getStatus, 1)
|
.set(QuotationShoppingCart::getStatus, 1)
|
||||||
|
|
|
||||||
|
|
@ -57,24 +57,4 @@ public class QuotationGenerateRequest {
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人
|
|
||||||
*/
|
|
||||||
private String contactPerson;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系方式
|
|
||||||
*/
|
|
||||||
private String contactInformation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系邮箱
|
|
||||||
*/
|
|
||||||
private String contactEmail;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国家/地区
|
|
||||||
*/
|
|
||||||
private String contactCountry;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
package com.nflg.mobilebroken.quotation.pojo.vo;
|
package com.nflg.mobilebroken.quotation.pojo.vo;
|
||||||
|
|
||||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingCartAccessory;
|
import com.nflg.mobilebroken.repository.entity.QuotationShoppingCartAccessory;
|
||||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingCartOther;
|
|
||||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingCartService;
|
import com.nflg.mobilebroken.repository.entity.QuotationShoppingCartService;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
@ -210,9 +209,4 @@ public class ShoppingCartVO {
|
||||||
* 交机服务
|
* 交机服务
|
||||||
*/
|
*/
|
||||||
private List<QuotationShoppingCartService> services;
|
private List<QuotationShoppingCartService> services;
|
||||||
|
|
||||||
/**
|
|
||||||
* 其他要求
|
|
||||||
*/
|
|
||||||
private List<QuotationShoppingCartOther> others;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -135,24 +135,4 @@ public class QuotationShoppingOrder implements Serializable {
|
||||||
* 备注
|
* 备注
|
||||||
*/
|
*/
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系人
|
|
||||||
*/
|
|
||||||
private String contactPerson;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系方式
|
|
||||||
*/
|
|
||||||
private String contactInformation;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 联系邮箱
|
|
||||||
*/
|
|
||||||
private String contactEmail;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 国家/地区
|
|
||||||
*/
|
|
||||||
private String contactCountry;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue