Compare commits
2 Commits
5eb48c2c09
...
0e2b46713f
| Author | SHA1 | Date |
|---|---|---|
|
|
0e2b46713f | |
|
|
9e90022fed |
|
|
@ -2,6 +2,8 @@ package com.nflg.mobilebroken.common.pojo.vo;
|
||||||
|
|
||||||
import com.nflg.mobilebroken.common.util.NumberUtil;
|
import com.nflg.mobilebroken.common.util.NumberUtil;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
import org.springframework.data.annotation.AccessType;
|
||||||
|
|
||||||
import javax.validation.constraints.NotBlank;
|
import javax.validation.constraints.NotBlank;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
@ -9,6 +11,7 @@ import java.math.BigDecimal;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
public class PlanSearchItemVO {
|
public class PlanSearchItemVO {
|
||||||
|
|
||||||
private Long id;
|
private Long id;
|
||||||
|
|
|
||||||
|
|
@ -137,7 +137,7 @@ public class PlanController extends ControllerBase {
|
||||||
boolean multiRegionQuotations = isMultiRegionQuotationsUser();
|
boolean multiRegionQuotations = isMultiRegionQuotationsUser();
|
||||||
List<Long> categoryIds = new ArrayList<>();
|
List<Long> categoryIds = new ArrayList<>();
|
||||||
if (multiRegionQuotations) {
|
if (multiRegionQuotations) {
|
||||||
categoryIds = dictionaryItemService.getListByDictionaryCode("MultiRegionQuotationsSupplier")
|
categoryIds = dictionaryItemService.getListByDictionaryCode("DirectSalesCategory")
|
||||||
.stream()
|
.stream()
|
||||||
.map(DictionaryItem::getId)
|
.map(DictionaryItem::getId)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
@ -146,6 +146,7 @@ public class PlanController extends ControllerBase {
|
||||||
}
|
}
|
||||||
List<ModelPriceVO> prices = priceService.getAllModelPrice();
|
List<ModelPriceVO> prices = priceService.getAllModelPrice();
|
||||||
Map<Long, List<PlanSearchItemVO>> fgroup = items.stream().collect(Collectors.groupingBy(PlanSearchItemVO::getModelId));
|
Map<Long, List<PlanSearchItemVO>> fgroup = items.stream().collect(Collectors.groupingBy(PlanSearchItemVO::getModelId));
|
||||||
|
pageData.setTotal(fgroup.size());
|
||||||
for (Map.Entry<Long, List<PlanSearchItemVO>> entry : fgroup.entrySet()) {
|
for (Map.Entry<Long, List<PlanSearchItemVO>> entry : fgroup.entrySet()) {
|
||||||
if (index >= startIndex && index < endIndex) {
|
if (index >= startIndex && index < endIndex) {
|
||||||
categoryIds.forEach(categoryId -> {
|
categoryIds.forEach(categoryId -> {
|
||||||
|
|
@ -156,14 +157,30 @@ public class PlanController extends ControllerBase {
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
if (CollectionUtil.isEmpty(vos)) {
|
if (CollectionUtil.isEmpty(vos)) {
|
||||||
entry.getValue().forEach(item -> {
|
entry.getValue().forEach(item -> {
|
||||||
item.setStandardPrice(salePrice);
|
datas.add(new PlanSearchItemVO()
|
||||||
item.setAreaId(categoryId);
|
.setPlanId(item.getPlanId())
|
||||||
datas.add(item);
|
.setIsDefault(item.getIsDefault())
|
||||||
|
.setModelId(item.getModelId())
|
||||||
|
.setModelNo(item.getModelNo())
|
||||||
|
.setName(item.getName())
|
||||||
|
.setRatio(item.getRatio())
|
||||||
|
.setAreaId(categoryId)
|
||||||
|
.setStandardPrice(salePrice)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
vos.forEach(item -> {
|
vos.forEach(item -> {
|
||||||
item.setStandardPrice(salePrice);
|
datas.add(new PlanSearchItemVO()
|
||||||
datas.add(item);
|
.setId(item.getId())
|
||||||
|
.setPlanId(item.getPlanId())
|
||||||
|
.setIsDefault(item.getIsDefault())
|
||||||
|
.setModelId(item.getModelId())
|
||||||
|
.setModelNo(item.getModelNo())
|
||||||
|
.setName(item.getName())
|
||||||
|
.setRatio(item.getRatio())
|
||||||
|
.setAreaId(categoryId)
|
||||||
|
.setStandardPrice(salePrice)
|
||||||
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,9 @@ public class ShoppingController extends ControllerBase {
|
||||||
@Resource
|
@Resource
|
||||||
private IQuotationShoppingCartServiceService shoppingCartServiceService;
|
private IQuotationShoppingCartServiceService shoppingCartServiceService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private IQuotationShoppingCartOtherService shoppingCartOtherService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private IQuotationShoppingOrderService shoppingOrderService;
|
private IQuotationShoppingOrderService shoppingOrderService;
|
||||||
|
|
||||||
|
|
@ -357,6 +360,16 @@ public class ShoppingController extends ControllerBase {
|
||||||
).collect(Collectors.toList())
|
).collect(Collectors.toList())
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
if (CollectionUtil.isNotEmpty(request.getOthers())) {
|
||||||
|
shoppingCartOtherService.saveBatch(
|
||||||
|
request.getOthers().stream().map(as -> {
|
||||||
|
QuotationShoppingCartOther ci = Convert.convert(QuotationShoppingCartOther.class, as);
|
||||||
|
ci.setCartId(cartId);
|
||||||
|
return ci;
|
||||||
|
}
|
||||||
|
).collect(Collectors.toList())
|
||||||
|
);
|
||||||
|
}
|
||||||
shoppingCartService.save(cart);
|
shoppingCartService.save(cart);
|
||||||
return ApiResult.success(cartId);
|
return ApiResult.success(cartId);
|
||||||
}
|
}
|
||||||
|
|
@ -1025,20 +1038,20 @@ public class ShoppingController extends ControllerBase {
|
||||||
* 获取下属报价单
|
* 获取下属报价单
|
||||||
*/
|
*/
|
||||||
@PostMapping("/getQuotationOfSubordinate")
|
@PostMapping("/getQuotationOfSubordinate")
|
||||||
public ApiResult<PageData<QuotationSearchVO>> getQuotationOfSubordinate(@Valid @RequestBody SubordinateQuotationSearchRequest request){
|
public ApiResult<PageData<QuotationSearchVO>> getQuotationOfSubordinate(@Valid @RequestBody SubordinateQuotationSearchRequest request) {
|
||||||
VUtils.trueThrowBusinessError(AppUserUtil.isAgent() && !AppUserUtil.isPrimary())
|
VUtils.trueThrowBusinessError(AppUserUtil.isAgent() && !AppUserUtil.isPrimary())
|
||||||
.throwMessage("你不是代理商主账号无权查看");
|
.throwMessage("你不是代理商主账号无权查看");
|
||||||
if (Objects.isNull(request.getCreateById())){
|
if (Objects.isNull(request.getCreateById())) {
|
||||||
request.setCreateByIds(
|
request.setCreateByIds(
|
||||||
appUserService.getChildren(appUserService.getById(AppUserUtil.getUserId()))
|
appUserService.getChildren(appUserService.getById(AppUserUtil.getUserId()))
|
||||||
.stream()
|
.stream()
|
||||||
.map(AppUser::getId)
|
.map(AppUser::getId)
|
||||||
.collect(Collectors.toList())
|
.collect(Collectors.toList())
|
||||||
);
|
);
|
||||||
}else {
|
} else {
|
||||||
request.setCreateByIds(List.of(request.getCreateById()));
|
request.setCreateByIds(List.of(request.getCreateById()));
|
||||||
}
|
}
|
||||||
if (!AppUserUtil.isAgent()){
|
if (!AppUserUtil.isAgent()) {
|
||||||
request.setTargetId(null);
|
request.setTargetId(null);
|
||||||
}
|
}
|
||||||
return ApiResult.success(shoppingOrderService.getQuotationOfSubordinate(request));
|
return ApiResult.success(shoppingOrderService.getQuotationOfSubordinate(request));
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,23 @@
|
||||||
|
package com.nflg.mobilebroken.quotation.pojo.request;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
|
||||||
|
import javax.validation.constraints.NotBlank;
|
||||||
|
import javax.validation.constraints.NotNull;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
@Data
|
||||||
|
public class ShoppingCartOtherRequest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 要求说明
|
||||||
|
*/
|
||||||
|
@NotBlank(message = "要求说明不能为空")
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 费用
|
||||||
|
*/
|
||||||
|
@NotNull(message = "费用不能为空")
|
||||||
|
private BigDecimal fee;
|
||||||
|
}
|
||||||
|
|
@ -148,4 +148,10 @@ public class ShoppingSaveRequest {
|
||||||
*/
|
*/
|
||||||
@Valid
|
@Valid
|
||||||
private List<ShoppingSaveServiceRequest> services;
|
private List<ShoppingSaveServiceRequest> services;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 其他要求
|
||||||
|
*/
|
||||||
|
@Valid
|
||||||
|
private List<ShoppingCartOtherRequest> others;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
package com.nflg.mobilebroken.repository.entity;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.Setter;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
import java.io.Serializable;
|
||||||
|
import java.math.BigDecimal;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 报价-购物车-其他要求
|
||||||
|
* </p>
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@Accessors(chain = true)
|
||||||
|
@TableName("quotation_shopping_cart_other")
|
||||||
|
public class QuotationShoppingCartOther implements Serializable {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
private Long id;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 购物车id
|
||||||
|
*/
|
||||||
|
private Long cartId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 要求说明
|
||||||
|
*/
|
||||||
|
private String desc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 费用
|
||||||
|
*/
|
||||||
|
private BigDecimal fee;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.nflg.mobilebroken.repository.mapper;
|
||||||
|
|
||||||
|
import com.nflg.mobilebroken.repository.entity.QuotationShoppingCartOther;
|
||||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 报价-购物车-其他要求 Mapper 接口
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
public interface QuotationShoppingCartOtherMapper extends BaseMapper<QuotationShoppingCartOther> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
package com.nflg.mobilebroken.repository.service;
|
||||||
|
|
||||||
|
import com.nflg.mobilebroken.repository.entity.QuotationShoppingCartOther;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 报价-购物车-其他要求 服务类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
public interface IQuotationShoppingCartOtherService extends IService<QuotationShoppingCartOther> {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,20 @@
|
||||||
|
package com.nflg.mobilebroken.repository.service.impl;
|
||||||
|
|
||||||
|
import com.nflg.mobilebroken.repository.entity.QuotationShoppingCartOther;
|
||||||
|
import com.nflg.mobilebroken.repository.mapper.QuotationShoppingCartOtherMapper;
|
||||||
|
import com.nflg.mobilebroken.repository.service.IQuotationShoppingCartOtherService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* 报价-购物车-其他要求 服务实现类
|
||||||
|
* </p>
|
||||||
|
*
|
||||||
|
* @author 代码生成器生成
|
||||||
|
* @since 2026
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class QuotationShoppingCartOtherServiceImpl extends ServiceImpl<QuotationShoppingCartOtherMapper, QuotationShoppingCartOther> implements IQuotationShoppingCartOtherService {
|
||||||
|
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue