Commit d0bd9db8 authored by yanghao's avatar yanghao

fix: 客户报价调整使用报价分页接口。

parent 9a400c7a
...@@ -92,27 +92,63 @@ public interface OfferMapper extends BaseMapperX<OfferDO> { ...@@ -92,27 +92,63 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
@ResultType(OfferRespVO.class) @ResultType(OfferRespVO.class)
@Select({ @Select({
"<script>", "<script>",
"select o.offer_id, ", "select o.*, ",
"o.number, ", // "o.number, ",
"o.order_no, ", // "o.order_no, ",
"o.order_id, ", // "o.order_id, ",
"if(#{lang} = 0, o.departure ->> '$.titleZh', o.departure ->> '$.titleEn') as departure_name, ", "if(#{lang} = 0, o.departure ->> '$.titleZh', o.departure ->> '$.titleEn') as departure_name, ",
"if(#{lang} = 0, o.objective ->> '$.titleZh', o.objective ->> '$.titleEn') as objective_name, ", "if(#{lang} = 0, o.objective ->> '$.titleZh', o.objective ->> '$.titleEn') as objective_name, ",
"o.start_time, ", // "o.start_time, ",
"o.end_time, ", // "o.end_time, ",
"o.stop_time, ", // "o.stop_time, ",
"o.status, ", // "o.status, ",
"o.transport_id, ", // "o.transport_id, ",
"o.est_cost, ", // "o.est_cost, ",
"o.create_time, ", // "o.create_time, ",
"o.update_time, ", // "o.update_time, ",
"(select count(1) from ecw_customer_follow l where l.biz_id = o.offer_id and l.follow_type = 4) as log_count, ", "(select count(1) from ecw_customer_followup l where l.offer_id = o.offer_id) as log_count, ",
"u.nickname as creator_name, ", "u.nickname as creator_name, ",
"(SELECT cc.`name` FROM ecw_customer_contacts cc WHERE ( o.relation = 1 AND cc.id = o.consignor_id ) OR ( o.relation = 2 AND cc.id = o.consignee_id)) AS relation_name ", "u.nickname as business_manager_name, ",
// "(SELECT cc.`name` FROM ecw_customer_contacts cc WHERE ( o.relation = 1 AND cc.id = o.consignor_id ) OR ( o.relation = 2 AND cc.id = o.consignee_id)) AS relation_name ",
"cc.name as relation_name, ",
"cc.area_code as relation_area_code, ",
"cc.phone_new as relation_phone, ",
"line.start_warehouse_id, ",
"line.dest_warehouse_id, ",
"line.transport_type ",
"from ecw_offer o ", "from ecw_offer o ",
// "left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ", "left join ecw_customer_contacts cc on (o.relation = 1 and cc.id = o.consignor_id) or (o.relation = 2 and cc.id = o.consignee_id) ",
"left join system_user u on u.id = o.follow_up_salesman_id ", "left join system_user u on u.id = o.follow_up_salesman_id ",
"left join ecw_region s on o.objective_id = s.id ",
"left join ecw_warehouse_line line on o.line_id = line.id ",
"left join ecw_warehouse dst on line.dest_warehouse_id = dst.id ",
"where o.deleted = 0", "where o.deleted = 0",
//destCountryIds
"<when test = 'pageVO.destCountryIds != null and pageVO.destCountryIds.size() > 0'>",
"AND dst.guojia IN",
"<foreach item='destCountryId' collection='pageVO.destCountryIds' open='(' close=')' separator=','> #{destCountryId} </foreach>",
"</when>",
//objectiveIds
"<when test = 'pageVO.objectiveIds != null and pageVO.objectiveIds.size() > 0'>",
"AND dst.objective_id IN",
"<foreach item='objectiveId' collection='pageVO.objectiveIds' open='(' close=')' separator=','> #{objectiveId} </foreach>",
"</when>",
//destWarehouseIds
"<when test = 'pageVO.destWarehouseIds != null and pageVO.destWarehouseIds.size() > 0'>",
"AND dst.id IN",
"<foreach item='destWarehouseId' collection='pageVO.destWarehouseIds' open='(' close=')' separator=','> #{destWarehouseId} </foreach>",
"</when>",
//customerId
"<when test = 'pageVO.customerId != null'>",
"AND o.relation_id = #{pageVO.customerId} ",
"</when>",
"<when test = 'pageVO.deptId != null'>", "<when test = 'pageVO.deptId != null'>",
"AND o.dept_id = #{pageVO.deptId} ", "AND o.dept_id = #{pageVO.deptId} ",
"</when>", "</when>",
...@@ -192,7 +228,32 @@ public interface OfferMapper extends BaseMapperX<OfferDO> { ...@@ -192,7 +228,32 @@ public interface OfferMapper extends BaseMapperX<OfferDO> {
"select count(1)", "select count(1)",
"from ecw_offer o ", "from ecw_offer o ",
"left join ecw_customer c on c.id = o.relation_id ", "left join ecw_customer c on c.id = o.relation_id ",
"left join ecw_region s on o.objective_id = s.id ",
"left join ecw_warehouse_line line on o.line_id = line.id ",
"left join ecw_warehouse dst on line.dest_warehouse_id = dst.id ",
"where o.deleted = 0", "where o.deleted = 0",
//destCountryIds
"<when test = 'pageVO.destCountryIds != null and pageVO.destCountryIds.size() > 0'>",
"AND dst.guojia IN",
"<foreach item='destCountryId' collection='pageVO.destCountryIds' open='(' close=')' separator=','> #{destCountryId} </foreach>",
"</when>",
//objectiveIds
"<when test = 'pageVO.objectiveIds != null and pageVO.objectiveIds.size() > 0'>",
"AND dst.objective_id IN",
"<foreach item='objectiveId' collection='pageVO.objectiveIds' open='(' close=')' separator=','> #{objectiveId} </foreach>",
"</when>",
//destWarehouseIds
"<when test = 'pageVO.destWarehouseIds != null and pageVO.destWarehouseIds.size() > 0'>",
"AND dst.id IN",
"<foreach item='destWarehouseId' collection='pageVO.destWarehouseIds' open='(' close=')' separator=','> #{destWarehouseId} </foreach>",
"</when>",
//customerId
"<when test = 'pageVO.customerId != null'>",
"AND o.relation_id = #{pageVO.customerId} ",
"</when>",
"<when test = 'pageVO.deptId != null'>", "<when test = 'pageVO.deptId != null'>",
"AND o.dept_id = #{pageVO.deptId} ", "AND o.dept_id = #{pageVO.deptId} ",
"</when>", "</when>",
......
...@@ -161,4 +161,18 @@ public class OfferPageReqVO extends PageParam { ...@@ -161,4 +161,18 @@ public class OfferPageReqVO extends PageParam {
@ApiModelProperty(value = "创建者或业务员") @ApiModelProperty(value = "创建者或业务员")
private String creator; private String creator;
@ApiModelProperty(value = "客户id")
private Long customerId;
@ApiModelProperty(value = "目的国id集合")
private List<Long> destCountryIds;
@ApiModelProperty(value = "目的地id集合")
private List<Long> objectiveIds;
@ApiModelProperty(value = "目的仓ID集合")
private List<Long> destWarehouseIds;
} }
...@@ -40,13 +40,35 @@ public class OfferRespVO extends OfferBaseVO { ...@@ -40,13 +40,35 @@ public class OfferRespVO extends OfferBaseVO {
@ApiModelProperty(value = "目的地名称") @ApiModelProperty(value = "目的地名称")
private String objectiveName; private String objectiveName;
@ApiModelProperty(value = "关联客户名称")
private String relationName;
@ApiModelProperty(value = "业务员名称") @ApiModelProperty(value = "业务员名称")
private String creatorName; private String creatorName;
@ApiModelProperty(value = "跟进业务员") @ApiModelProperty(value = "跟进业务员")
private String followUpSalesmanId; private String followUpSalesmanId;
@ApiModelProperty(value = "关联客户名称")
private String relationName;
@ApiModelProperty(value = "联系人区号")
private String relationAreaCode;
@ApiModelProperty(value = "联系人手机号")
private String relationPhone;
// 线路相关
@ExcelProperty("始发仓库id")
private Long startWarehouseId;
@ExcelProperty("目的仓库id")
private Long destWarehouseId;
@ExcelProperty("运输方式")
private String transportType;
@ApiModelProperty(value = "业务员名称-客户经理")
private String businessManagerName;
} }
...@@ -10,4 +10,10 @@ Content-Type: application/json ...@@ -10,4 +10,10 @@ Content-Type: application/json
"result": 1, "result": 1,
"reason": "no reason", "reason": "no reason",
"warehousingType": 1 "warehousingType": 1
} }
\ No newline at end of file
### page
GET {{baseUrl}}/ecw/offer/page?pageNo=1&pageSize=10&transportId=1&customerId=51966&destCountryIds%5B0%5D=4174
Authorization: Bearer {{token}}
tenant-id: {{adminTenentId}}
\ No newline at end of file
...@@ -46,16 +46,16 @@ spring: ...@@ -46,16 +46,16 @@ spring:
datasource: datasource:
master: master:
name: jiedao name: jiedao
url: jdbc:mysql://110.41.143.128:3306/${spring.datasource.dynamic.datasource.master.name}?useUnicode=true&useSSL=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&rewriteBatchedStatements=TRUE&connectTimeout=60000 url: jdbc:mysql://159.75.224.138:2297/${spring.datasource.dynamic.datasource.master.name}?useUnicode=true&useSSL=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&rewriteBatchedStatements=TRUE&connectTimeout=60000
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
username: root username: root
password: mysql@2024 password: mysql@2022
slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改 slave: # 模拟从库,可根据自己需要修改 # 模拟从库,可根据自己需要修改
name: jiedao name: jiedao
url: jdbc:mysql://110.41.143.128:3306/${spring.datasource.dynamic.datasource.slave.name}?useUnicode=true&useSSL=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&rewriteBatchedStatements=TRUE&connectTimeout=60000 url: jdbc:mysql://159.75.224.138:2297/${spring.datasource.dynamic.datasource.slave.name}?useUnicode=true&useSSL=true&characterEncoding=utf8&characterSetResults=utf8&allowMultiQueries=true&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&autoReconnect=true&rewriteBatchedStatements=TRUE&connectTimeout=60000
driver-class-name: com.mysql.cj.jdbc.Driver driver-class-name: com.mysql.cj.jdbc.Driver
username: root username: root
password: mysql@2024 password: mysql@2022
# Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优 # Redis 配置。Redisson 默认的配置足够使用,一般不需要进行调优
redis: redis:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment