Compare commits
2 Commits
0d79babfac
...
08fa8e8084
| Author | SHA1 | Date |
|---|---|---|
|
|
08fa8e8084 | |
|
|
1316c2786c |
|
|
@ -171,6 +171,8 @@ public class Constant {
|
|||
public static final String DICTIONARY_TICKET_QUESTION = "Question";
|
||||
|
||||
public static final Integer TICKET_TYPE_MOBILE_BROKEN = 0;
|
||||
|
||||
public static final Integer TICKET_TYPE_GONGFU = 1;
|
||||
|
||||
public static final String COMPANY_NAME="福建南方路面机械股份有限公司";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,32 @@
|
|||
package com.nflg.mobilebroken.common.pojo.request;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class SubordinateQuotationSearchRequest extends PageRequest{
|
||||
|
||||
/**
|
||||
* 报价主体
|
||||
*/
|
||||
private Integer targetId;
|
||||
|
||||
/**
|
||||
* 创建人id
|
||||
*/
|
||||
private Integer createById;
|
||||
|
||||
/**
|
||||
* 用户类型,0:内部用户,1:代理商
|
||||
*/
|
||||
@JsonIgnore
|
||||
private Integer userType;
|
||||
|
||||
/**
|
||||
* 创建人id列表
|
||||
*/
|
||||
@JsonIgnore
|
||||
private List<Integer> createByIds;
|
||||
}
|
||||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
|
|||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.common.constant.Constant;
|
||||
import com.nflg.mobilebroken.common.pojo.ApiResult;
|
||||
import com.nflg.mobilebroken.common.pojo.PageData;
|
||||
import com.nflg.mobilebroken.common.pojo.dto.ModelConfigEffectiveDTO;
|
||||
|
|
@ -12,6 +13,7 @@ import com.nflg.mobilebroken.common.pojo.dto.QuotationDiscountDTO;
|
|||
import com.nflg.mobilebroken.common.pojo.dto.QuotationModelRatioDirectItemDTO;
|
||||
import com.nflg.mobilebroken.common.pojo.request.QuotationSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.ShoppingSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.SubordinateQuotationSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ModelPrice1VO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.ShoppingSearchVO;
|
||||
|
|
@ -132,6 +134,9 @@ public class ShoppingController extends ControllerBase {
|
|||
@Resource
|
||||
private RedisTemplate<String, Integer> redisTemplate;
|
||||
|
||||
@Resource
|
||||
private ITBaseDepartmentService departmentService;
|
||||
|
||||
/**
|
||||
* 购物车-获取报价主体
|
||||
*/
|
||||
|
|
@ -150,8 +155,8 @@ public class ShoppingController extends ControllerBase {
|
|||
} else {
|
||||
return ApiResult.success(List.of(
|
||||
new SimpleUserVO()
|
||||
.setUserId(AppUserUtil.getUserId())
|
||||
.setUserName("福建南方路面机械股份有限公司")
|
||||
.setUserId(0)
|
||||
.setUserName(Constant.COMPANY_NAME)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
|
@ -523,23 +528,19 @@ public class ShoppingController extends ControllerBase {
|
|||
*/
|
||||
@Transactional
|
||||
@PostMapping("/quotation/generate")
|
||||
public ApiResult<Long> generateQuotation(@RequestBody @NotEmpty List<Long> cartIds) {
|
||||
public ApiResult<Long> generateQuotation(@Valid @RequestBody QuotationGenerateRequest request) {
|
||||
List<QuotationShoppingCart> carts = shoppingCartService.lambdaQuery()
|
||||
.eq(QuotationShoppingCart::getStatus, 0)
|
||||
.eq(QuotationShoppingCart::getCreateByType, AppUserUtil.isAgent() ? 1 : 0)
|
||||
.eq(QuotationShoppingCart::getCreateById, AppUserUtil.getUserId())
|
||||
.in(QuotationShoppingCart::getId, cartIds)
|
||||
.in(QuotationShoppingCart::getId, request.getCartIds())
|
||||
.list();
|
||||
VUtils.trueThrowBusinessError(CollectionUtil.isEmpty(carts)).throwMessage("未找到购物车信息");
|
||||
VUtils.trueThrowBusinessError(cartIds.size() != carts.size()).throwMessage("数据无效");
|
||||
VUtils.trueThrowBusinessError(request.getCartIds().size() != carts.size()).throwMessage("数据无效");
|
||||
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getCustomerName).collect(Collectors.toSet()).size() > 1)
|
||||
.throwMessage("客户名称不一致");
|
||||
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getTargetId).collect(Collectors.toSet()).size() > 1)
|
||||
.throwMessage("报价主体不一致");
|
||||
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getCurrency).collect(Collectors.toSet()).size() > 1)
|
||||
.throwMessage("币种不一致");
|
||||
VUtils.trueThrowBusinessError(carts.stream().map(QuotationShoppingCart::getExchangeRate).collect(Collectors.toSet()).size() > 1)
|
||||
.throwMessage("汇率不一致");
|
||||
QuotationShoppingOrder order = new QuotationShoppingOrder()
|
||||
.setCreateByType(AppUserUtil.isAgent() ? 1 : 0)
|
||||
.setCreateBy(AppUserUtil.getUserName())
|
||||
|
|
@ -553,7 +554,7 @@ public class ShoppingController extends ControllerBase {
|
|||
.setTargetId(carts.get(0).getTargetId())
|
||||
.setTotalFee(carts.stream().map(QuotationShoppingCart::getActualFee).reduce(BigDecimal::add).get());
|
||||
order.setActualFee(order.getTotalFee());
|
||||
order.setExchangeFee(NumberUtil.multiply(order.getActualFee(), carts.get(0).getExchangeRate()));
|
||||
order.setExchangeFee(NumberUtil.multiply(order.getActualFee(), request.getExchangeRate()));
|
||||
shoppingOrderItemService.saveBatch(
|
||||
carts.stream()
|
||||
.map(cart -> new QuotationShoppingOrderItem()
|
||||
|
|
@ -566,7 +567,7 @@ public class ShoppingController extends ControllerBase {
|
|||
shoppingCartService.lambdaUpdate()
|
||||
.set(QuotationShoppingCart::getStatus, 1)
|
||||
.eq(QuotationShoppingCart::getStatus, 0)
|
||||
.in(QuotationShoppingCart::getId, cartIds)
|
||||
.in(QuotationShoppingCart::getId, request.getCartIds())
|
||||
.update();
|
||||
return ApiResult.success(order.getId());
|
||||
}
|
||||
|
|
@ -619,14 +620,11 @@ public class ShoppingController extends ControllerBase {
|
|||
}
|
||||
boolean isAgent = AppUserUtil.isAgent();
|
||||
List<TBaseCustomer> customers;
|
||||
List<AppUser> endUsers;
|
||||
if (isAgent) {
|
||||
customers = customerService.lambdaQuery()
|
||||
.in(TBaseCustomer::getId, datas.getRecords().stream().map(QuotationSearchVO::getTargetId).collect(Collectors.toList()))
|
||||
.list();
|
||||
endUsers = null;
|
||||
} else {
|
||||
endUsers = appUserService.getEndUsers();
|
||||
customers = null;
|
||||
}
|
||||
return ApiResult.success(datas, data -> {
|
||||
|
|
@ -639,14 +637,8 @@ public class ShoppingController extends ControllerBase {
|
|||
.orElse("")
|
||||
);
|
||||
} else {
|
||||
data.setTargetName(endUsers.stream()
|
||||
.filter(item -> item.getId().equals(data.getTargetId()))
|
||||
.map(AppUser::getName)
|
||||
.findFirst()
|
||||
.orElse("")
|
||||
);
|
||||
data.setTargetName(Constant.COMPANY_NAME);
|
||||
}
|
||||
//TODO 设置汇率价格
|
||||
return data;
|
||||
});
|
||||
}
|
||||
|
|
@ -998,4 +990,57 @@ public class ShoppingController extends ControllerBase {
|
|||
return adminUserService.getById(AppUserUtil.getUserId()).getQuotationCode();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下属列表
|
||||
*/
|
||||
@GetMapping("/getSubordinate")
|
||||
public ApiResult<List<SimpleUserVO>> getSubordinate() {
|
||||
if (AppUserUtil.isAgent()) {
|
||||
return ApiResult.success(
|
||||
appUserService.getChildren(appUserService.getById(AppUserUtil.getUserId()))
|
||||
.stream()
|
||||
.map(user -> new SimpleUserVO()
|
||||
.setUserId(user.getId())
|
||||
.setUserName(user.getName())
|
||||
)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
} else {
|
||||
AdminUser adminUser = adminUserService.getById(AppUserUtil.getUserId());
|
||||
Set<Long> deptIds = departmentService.getAllChildrenIds(adminUser.getDepartmentId());
|
||||
return ApiResult.success(
|
||||
adminUserService.getByDepartmentIds(deptIds)
|
||||
.stream()
|
||||
.map(user -> new SimpleUserVO()
|
||||
.setUserId(user.getId())
|
||||
.setUserName(user.getUserName())
|
||||
)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取下属报价单
|
||||
*/
|
||||
@PostMapping("/getQuotationOfSubordinate")
|
||||
public ApiResult<PageData<QuotationSearchVO>> getQuotationOfSubordinate(@Valid @RequestBody SubordinateQuotationSearchRequest request){
|
||||
VUtils.trueThrowBusinessError(AppUserUtil.isAgent() && !AppUserUtil.isPrimary())
|
||||
.throwMessage("你不是代理商主账号无权查看");
|
||||
if (Objects.isNull(request.getCreateById())){
|
||||
request.setCreateByIds(
|
||||
appUserService.getChildren(appUserService.getById(AppUserUtil.getUserId()))
|
||||
.stream()
|
||||
.map(AppUser::getId)
|
||||
.collect(Collectors.toList())
|
||||
);
|
||||
}else {
|
||||
request.setCreateByIds(List.of(request.getCreateById()));
|
||||
}
|
||||
if (!AppUserUtil.isAgent()){
|
||||
request.setTargetId(null);
|
||||
}
|
||||
return ApiResult.success(shoppingOrderService.getQuotationOfSubordinate(request));
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,60 @@
|
|||
package com.nflg.mobilebroken.quotation.pojo.request;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotEmpty;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.List;
|
||||
|
||||
@Data
|
||||
public class QuotationGenerateRequest {
|
||||
|
||||
/**
|
||||
* 购物车id列表
|
||||
*/
|
||||
@NotEmpty
|
||||
private List<Long> cartIds;
|
||||
|
||||
/**
|
||||
* 交货方式列表
|
||||
*/
|
||||
@Valid
|
||||
@NotEmpty
|
||||
private List<QuotationShoppingOrderDeliveryMethodRequest> deliveryMethods;
|
||||
|
||||
/**
|
||||
* 付款方式
|
||||
*/
|
||||
@NotBlank(message = "付款方式不能为空")
|
||||
private String paymentMethod;
|
||||
|
||||
/**
|
||||
* 付款方式产生的费用
|
||||
*/
|
||||
@NotBlank(message = "付款方式产生的费用不能为空")
|
||||
private BigDecimal paymentFee;
|
||||
|
||||
/**
|
||||
* 币种,字典id
|
||||
*/
|
||||
@NotBlank(message = "币种不能为空")
|
||||
private Long currency;
|
||||
|
||||
/**
|
||||
* 汇率
|
||||
*/
|
||||
@NotBlank(message = "汇率不能为空")
|
||||
private BigDecimal exchangeRate;
|
||||
|
||||
/**
|
||||
* 补充说明
|
||||
*/
|
||||
private String additionalNotes;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
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 QuotationShoppingOrderDeliveryMethodRequest {
|
||||
|
||||
/**
|
||||
* 交货方式,字典id
|
||||
*/
|
||||
@NotNull(message = "交货方式不能为空")
|
||||
private Long deliveryMethod;
|
||||
|
||||
/**
|
||||
* 交货时间
|
||||
*/
|
||||
@NotBlank(message = "交货时间不能为空")
|
||||
private String deliveryDate;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
@NotBlank(message = "交货地点不能为空")
|
||||
private String deliveryAddress;
|
||||
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
@NotNull(message = "运费不能为空")
|
||||
private BigDecimal deliveryFee;
|
||||
}
|
||||
|
|
@ -19,19 +19,19 @@ public class ShoppingSaveRequest {
|
|||
/**
|
||||
* 机型batch_number
|
||||
*/
|
||||
@NotNull
|
||||
@NotNull(message = "机型不能为空")
|
||||
private Long modelId;
|
||||
|
||||
/**
|
||||
* 价格id
|
||||
*/
|
||||
@NotNull
|
||||
@NotNull(message = "价格id不能为空")
|
||||
private Long priceId;
|
||||
|
||||
/**
|
||||
* 配置id
|
||||
*/
|
||||
@NotNull
|
||||
@NotNull(message = "配置id不能为空")
|
||||
private Long configId;
|
||||
|
||||
/**
|
||||
|
|
@ -52,52 +52,43 @@ public class ShoppingSaveRequest {
|
|||
/**
|
||||
* 客户名称
|
||||
*/
|
||||
@NotBlank
|
||||
@NotBlank(message = "客户名称不能为空")
|
||||
private String customerName;
|
||||
|
||||
/**
|
||||
* 报价主体,代理商时为公司id,内部用户时为其用户id
|
||||
*/
|
||||
@NotNull
|
||||
@NotNull(message = "报价主体不能为空")
|
||||
private Integer targetId;
|
||||
|
||||
/**
|
||||
* 油漆要求
|
||||
* 其他要求总费用
|
||||
*/
|
||||
private String paintRequirements;
|
||||
|
||||
/**
|
||||
* 其他要求
|
||||
*/
|
||||
private String otherRequirements;
|
||||
|
||||
/**
|
||||
* 其他要求费用
|
||||
*/
|
||||
private BigDecimal otherFee;
|
||||
@NotNull(message = "其他要求总费用不能为空")
|
||||
private BigDecimal otherRequirementsFee;
|
||||
|
||||
/**
|
||||
* 标配价格
|
||||
*/
|
||||
@NotNull
|
||||
@NotNull(message = "标配价格不能为空")
|
||||
private BigDecimal standardFee;
|
||||
|
||||
/**
|
||||
* 选配价格
|
||||
*/
|
||||
@NotNull
|
||||
@NotNull(message = "选配价格不能为空")
|
||||
private BigDecimal optionalFee;
|
||||
|
||||
/**
|
||||
* 总价
|
||||
*/
|
||||
@NotNull
|
||||
@NotNull(message = "总价不能为空")
|
||||
private BigDecimal totalFee;
|
||||
|
||||
/**
|
||||
* 实际总价
|
||||
*/
|
||||
@NotNull
|
||||
@NotNull(message = "实际总价不能为空")
|
||||
private BigDecimal actualFee;
|
||||
|
||||
/**
|
||||
|
|
@ -110,57 +101,35 @@ public class ShoppingSaveRequest {
|
|||
*/
|
||||
private BigDecimal serviceFee = BigDecimal.ZERO;
|
||||
|
||||
/**
|
||||
* 交货方式,字典id
|
||||
*/
|
||||
@NotNull
|
||||
private Long deliveryMethod;
|
||||
|
||||
/**
|
||||
* 交货时间
|
||||
*/
|
||||
@NotBlank
|
||||
private String deliveryDate;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
@NotBlank
|
||||
private String deliveryAddress;
|
||||
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
@NotNull
|
||||
private BigDecimal deliveryFee;
|
||||
|
||||
/**
|
||||
* 付款方式
|
||||
*/
|
||||
@NotBlank
|
||||
private String paymentMethod;
|
||||
|
||||
/**
|
||||
* 付款方式产生的费用
|
||||
*/
|
||||
private BigDecimal paymentFee;
|
||||
|
||||
/**
|
||||
* 币种,字典id
|
||||
*/
|
||||
@NotNull
|
||||
private Long currency;
|
||||
|
||||
/**
|
||||
* 汇率
|
||||
*/
|
||||
private BigDecimal exchangeRate;
|
||||
|
||||
/**
|
||||
* 优惠金额
|
||||
*/
|
||||
private BigDecimal discount;
|
||||
|
||||
/**
|
||||
* 质保服务描述
|
||||
*/
|
||||
@NotBlank(message = "质保服务描述不能为空")
|
||||
private String warrantyServiceDesc;
|
||||
|
||||
/**
|
||||
* 质保服务费用
|
||||
*/
|
||||
@NotNull(message = "质保服务费用不能为空")
|
||||
private BigDecimal warrantyServiceFee;
|
||||
|
||||
/**
|
||||
* 随机配件包装费
|
||||
*/
|
||||
@NotNull(message = "随机配件包装费不能为空")
|
||||
private BigDecimal accessoryPackagingFee;
|
||||
|
||||
/**
|
||||
* 随机配件运费
|
||||
*/
|
||||
@NotNull(message = "随机配件运费不能为空")
|
||||
private BigDecimal accessoryShippingFee;
|
||||
|
||||
/**
|
||||
* 部件列表
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -31,4 +31,14 @@ public class ShoppingSaveServiceRequest {
|
|||
*/
|
||||
@NotNull
|
||||
private BigDecimal totalFee;
|
||||
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,19 +67,9 @@ public class QuotationShoppingCart implements Serializable {
|
|||
private Integer targetId;
|
||||
|
||||
/**
|
||||
* 油漆要求
|
||||
* 其他要求总费用
|
||||
*/
|
||||
private String paintRequirements;
|
||||
|
||||
/**
|
||||
* 其他要求
|
||||
*/
|
||||
private String otherRequirements;
|
||||
|
||||
/**
|
||||
* 其他要求费用
|
||||
*/
|
||||
private BigDecimal otherFee;
|
||||
private BigDecimal otherRequirementsFee;
|
||||
|
||||
/**
|
||||
* 标配价格
|
||||
|
|
@ -111,46 +101,6 @@ public class QuotationShoppingCart implements Serializable {
|
|||
*/
|
||||
private BigDecimal serviceFee;
|
||||
|
||||
/**
|
||||
* 交货方式,字典id
|
||||
*/
|
||||
private Long deliveryMethod;
|
||||
|
||||
/**
|
||||
* 交货时间
|
||||
*/
|
||||
private String deliveryDate;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
private String deliveryAddress;
|
||||
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
private BigDecimal deliveryFee;
|
||||
|
||||
/**
|
||||
* 付款方式
|
||||
*/
|
||||
private String paymentMethod;
|
||||
|
||||
/**
|
||||
* 付款方式产生的费用
|
||||
*/
|
||||
private BigDecimal paymentFee;
|
||||
|
||||
/**
|
||||
* 币种,字典id
|
||||
*/
|
||||
private Long currency;
|
||||
|
||||
/**
|
||||
* 汇率
|
||||
*/
|
||||
private BigDecimal exchangeRate;
|
||||
|
||||
/**
|
||||
* 创建人类型,0:内部人员;1:代理商
|
||||
*/
|
||||
|
|
@ -185,4 +135,24 @@ public class QuotationShoppingCart implements Serializable {
|
|||
* 状态,0:未生成报价单;1:已生成报价单;
|
||||
*/
|
||||
private Integer status;
|
||||
|
||||
/**
|
||||
* 质保服务描述
|
||||
*/
|
||||
private String warrantyServiceDesc;
|
||||
|
||||
/**
|
||||
* 质保服务费用
|
||||
*/
|
||||
private BigDecimal warrantyServiceFee;
|
||||
|
||||
/**
|
||||
* 随机配件包装费
|
||||
*/
|
||||
private BigDecimal accessoryPackagingFee;
|
||||
|
||||
/**
|
||||
* 随机配件运费
|
||||
*/
|
||||
private BigDecimal accessoryShippingFee;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,4 +54,14 @@ public class QuotationShoppingCartService implements Serializable {
|
|||
* 服务总费用
|
||||
*/
|
||||
private BigDecimal totalFee;
|
||||
|
||||
/**
|
||||
* 地点
|
||||
*/
|
||||
private String address;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -105,4 +105,34 @@ public class QuotationShoppingOrder implements Serializable {
|
|||
* 最后修改时间
|
||||
*/
|
||||
private LocalDateTime updateTime;
|
||||
|
||||
/**
|
||||
* 付款方式
|
||||
*/
|
||||
private String paymentMethod;
|
||||
|
||||
/**
|
||||
* 付款方式产生的费用
|
||||
*/
|
||||
private BigDecimal paymentFee;
|
||||
|
||||
/**
|
||||
* 币种,字典id
|
||||
*/
|
||||
private Long currency;
|
||||
|
||||
/**
|
||||
* 汇率
|
||||
*/
|
||||
private BigDecimal exchangeRate;
|
||||
|
||||
/**
|
||||
* 补充说明
|
||||
*/
|
||||
private String additionalNotes;
|
||||
|
||||
/**
|
||||
* 备注
|
||||
*/
|
||||
private String remark;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,54 @@
|
|||
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_order_delivery_method")
|
||||
public class QuotationShoppingOrderDeliveryMethod implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 报价单id
|
||||
*/
|
||||
private Long orderId;
|
||||
|
||||
/**
|
||||
* 交货方式,字典id
|
||||
*/
|
||||
private Long deliveryMethod;
|
||||
|
||||
/**
|
||||
* 交货时间
|
||||
*/
|
||||
private String deliveryDate;
|
||||
|
||||
/**
|
||||
* 交货地点
|
||||
*/
|
||||
private String deliveryAddress;
|
||||
|
||||
/**
|
||||
* 运费
|
||||
*/
|
||||
private BigDecimal deliveryFee;
|
||||
}
|
||||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.mobilebroken.repository.mapper;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-报价单-交货方式 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface QuotationShoppingOrderDeliveryMethodMapper extends BaseMapper<QuotationShoppingOrderDeliveryMethod> {
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.common.pojo.request.QuotationAdminSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.QuotationSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.SubordinateQuotationSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrder;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
|
@ -21,4 +22,6 @@ public interface QuotationShoppingOrderMapper extends BaseMapper<QuotationShoppi
|
|||
IPage<QuotationSearchVO> search(QuotationSearchRequest request, Page<?> page);
|
||||
|
||||
IPage<QuotationSearchVO> searchFromAdmin(QuotationAdminSearchRequest request, Page<?> page);
|
||||
|
||||
IPage<QuotationSearchVO> getQuotationOfSubordinate(SubordinateQuotationSearchRequest request, Page<?> page);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import com.nflg.mobilebroken.common.pojo.vo.AdminUserSimpleVO;
|
|||
import com.nflg.mobilebroken.common.pojo.vo.AdminUserVO;
|
||||
import com.nflg.mobilebroken.repository.entity.AdminUser;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -63,5 +64,5 @@ public interface IAdminUserService extends IService<AdminUser> {
|
|||
|
||||
List<AdminUserVO> searchNew(SearchAccountRequest request);
|
||||
|
||||
List<AdminUser> getByDepartmentIds(List<Long> departmentIds);
|
||||
List<AdminUser> getByDepartmentIds(Collection<Long> departmentIds);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,16 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-报价单-交货方式 服务类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
public interface IQuotationShoppingOrderDeliveryMethodService extends IService<QuotationShoppingOrderDeliveryMethod> {
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,10 @@
|
|||
package com.nflg.mobilebroken.repository.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.nflg.mobilebroken.common.pojo.PageData;
|
||||
import com.nflg.mobilebroken.common.pojo.request.QuotationAdminSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.QuotationSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.SubordinateQuotationSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrder;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
|
@ -22,4 +24,6 @@ public interface IQuotationShoppingOrderService extends IService<QuotationShoppi
|
|||
IPage<QuotationSearchVO> search(QuotationSearchRequest request);
|
||||
|
||||
IPage<QuotationSearchVO> searchFromAdmin(QuotationAdminSearchRequest request);
|
||||
|
||||
IPage<QuotationSearchVO> getQuotationOfSubordinate(SubordinateQuotationSearchRequest request);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -527,7 +527,7 @@ public class AdminUserServiceImpl extends ServiceImpl<AdminUserMapper, AdminUser
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<AdminUser> getByDepartmentIds(List<Long> departmentIds) {
|
||||
public List<AdminUser> getByDepartmentIds(Collection<Long> departmentIds) {
|
||||
return lambdaQuery()
|
||||
.eq(AdminUser::getIsDel, false)
|
||||
.eq(AdminUser::getState, 1)
|
||||
|
|
|
|||
|
|
@ -0,0 +1,20 @@
|
|||
package com.nflg.mobilebroken.repository.service.impl;
|
||||
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrderDeliveryMethod;
|
||||
import com.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderDeliveryMethodMapper;
|
||||
import com.nflg.mobilebroken.repository.service.IQuotationShoppingOrderDeliveryMethodService;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 报价-报价单-交货方式 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author 代码生成器生成
|
||||
* @since 2026
|
||||
*/
|
||||
@Service
|
||||
public class QuotationShoppingOrderDeliveryMethodServiceImpl extends ServiceImpl<QuotationShoppingOrderDeliveryMethodMapper, QuotationShoppingOrderDeliveryMethod> implements IQuotationShoppingOrderDeliveryMethodService {
|
||||
|
||||
}
|
||||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.nflg.mobilebroken.common.pojo.request.QuotationAdminSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.QuotationSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.request.SubordinateQuotationSearchRequest;
|
||||
import com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO;
|
||||
import com.nflg.mobilebroken.repository.entity.QuotationShoppingOrder;
|
||||
import com.nflg.mobilebroken.repository.mapper.QuotationShoppingOrderMapper;
|
||||
|
|
@ -31,4 +32,9 @@ public class QuotationShoppingOrderServiceImpl extends ServiceImpl<QuotationShop
|
|||
public IPage<QuotationSearchVO> searchFromAdmin(QuotationAdminSearchRequest request) {
|
||||
return baseMapper.searchFromAdmin(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<QuotationSearchVO> getQuotationOfSubordinate(SubordinateQuotationSearchRequest request) {
|
||||
return baseMapper.getQuotationOfSubordinate(request, new Page<>(request.getPage(), request.getPageSize()));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@
|
|||
</select>
|
||||
|
||||
<select id="searchFromAdmin" resultType="com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO">
|
||||
SELECT qso.*,if(qso.create_by_type=0,au.user_name,bc.agency_company_name) as target_name
|
||||
SELECT qso.*,if(qso.create_by_type=0,'${@com.nflg.mobilebroken.common.constant.Constant@COMPANY_NAME}',bc.agency_company_name) as target_name
|
||||
FROM quotation_shopping_order qso
|
||||
INNER JOIN
|
||||
(
|
||||
|
|
@ -63,7 +63,6 @@
|
|||
</where>
|
||||
) AS t ON t.id=qso.id
|
||||
left join t_base_customer bc on qso.target_id=bc.id
|
||||
left join admin_user au on qso.target_id=au.id
|
||||
<where>
|
||||
<if test="request.targetId!=null">
|
||||
AND qso.target_id=#{request.targetId}
|
||||
|
|
@ -83,4 +82,24 @@
|
|||
</where>
|
||||
order by qso.id desc
|
||||
</select>
|
||||
|
||||
<select id="getQuotationOfSubordinate" resultType="com.nflg.mobilebroken.common.pojo.vo.QuotationSearchVO">
|
||||
SELECT qso.*,if(qso.create_by_type=0,'${@com.nflg.mobilebroken.common.constant.Constant@COMPANY_NAME}',bc.agency_company_name) as targetName
|
||||
FROM quotation_shopping_order qso
|
||||
LEFT JOIN t_base_customer bc ON qso.target_id=bc.id
|
||||
where qso.create_by_type=#{request.userType} and qso.create_by_id in
|
||||
<foreach item="item" collection="request.createByIds" separator="," open="(" close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
<if test="request.targetId!=null">
|
||||
and qso.target_id = #{request.targetId}
|
||||
</if>
|
||||
<if test="request.createTimeStart!=null and request.createTimeStart!=''">
|
||||
and qso.create_time>=#{request.createTimeStart}
|
||||
</if>
|
||||
<if test="request.createTimeEnd!=null and request.createTimeEnd!=''">
|
||||
and qso.create_time <= #{request.createTimeEnd}
|
||||
</if>
|
||||
order by qso.id desc
|
||||
</select>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue