Compare commits

..

2 Commits

Author SHA1 Message Date
曹鹏飞 08fa8e8084 feat(quotation): 新增下属报价单及下属列表接口功能
- 新增SubordinateQuotationSearchRequest请求类定义下属报价查询参数
- 在QuotationShoppingOrderMapper及xml中增加getQuotationOfSubordinate方法及对应SQL查询
- 在QuotationShoppingOrderService及实现类中添加获取下属报价单接口逻辑
- 修改ShoppingController,新增获取下属列表和下属报价单两个接口
- 调整购物车模块中目标名称展示,使用固定企业名称常量替代原有逻辑
- 修改AdminUserService接口中getByDepartmentIds方法参数为集合类型以支持多部门查询
- 在Constant中新增企业名称和工夫工单类型常量定义
- Optimized 部分查询中对代理商和内部用户的处理逻辑验证和权限控制
2026-05-14 15:14:08 +08:00
曹鹏飞 1316c2786c feat(quotation): 重构报价生成并支持多交货方式
- 新增QuotationGenerateRequest请求类,支持传入多个购物车id和交货方式信息
- 新增QuotationShoppingOrderDeliveryMethod实体及相关服务和Mapper,管理报价单交货方式
- 购物车实体QuotationShoppingCart去除单一交货方式与支付信息字段,新增额外费用字段
- 报价单实体QuotationShoppingOrder增加支付方式、币种、汇率、补充说明及备注字段
- 购物车服务实体QuotationShoppingCartService新增地址及备注字段
- 修改ShoppingController中报价生成接口,改为接收QuotationGenerateRequest参数,校验更严格
- 更新购物保存请求类,加强必填字段校验,新增质保服务及随机配件相关费用字段
- 购物保存服务请求类新增地址及备注字段支持
- 提升了报价单多交货方式的支持能力及数据结构的灵活性和完整性
2026-05-14 14:13:31 +08:00
20 changed files with 446 additions and 144 deletions

View File

@ -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="福建南方路面机械股份有限公司";
}

View File

@ -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;
}

View File

@ -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));
}
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;
/**
* 部件列表
*/

View File

@ -31,4 +31,14 @@ public class ShoppingSaveServiceRequest {
*/
@NotNull
private BigDecimal totalFee;
/**
* 地点
*/
private String address;
/**
* 备注
*/
private String remark;
}

View File

@ -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;
}

View File

@ -54,4 +54,14 @@ public class QuotationShoppingCartService implements Serializable {
* 服务总费用
*/
private BigDecimal totalFee;
/**
* 地点
*/
private String address;
/**
* 备注
*/
private String remark;
}

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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> {
}

View File

@ -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);
}

View File

@ -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);
}

View File

@ -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> {
}

View File

@ -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);
}

View File

@ -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)

View File

@ -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 {
}

View File

@ -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()));
}
}

View File

@ -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 &lt;= #{request.createTimeEnd}
</if>
order by qso.id desc
</select>
</mapper>