Browse Source

Merge branch 'dev' into pre-production

pre-production
zhaoqiaobo 2 weeks ago
parent
commit
62c00fcd65
  1. 45
      blade-service/logpm-report/src/main/java/com/logpm/report/controller/TrunklinePickupController.java
  2. 49
      blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml

45
blade-service/logpm-report/src/main/java/com/logpm/report/controller/TrunklinePickupController.java

@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletResponse;
import java.time.Duration;
/**
* 干线提货时效
@ -40,8 +41,17 @@ public class TrunklinePickupController {
@ApiOperationSupport(order = 1)
@ApiOperation(value = "干线提货时效", notes = "干线提货时效")
public R<IPage<TrunklinePickupEfficiencyVO>> efficiencyPage(TrunklinePickupEfficiencyQuery query) {
if(ObjectUtil.isEmpty(query.getStartCreateTime()) || ObjectUtil.isEmpty(query.getEndCreateTime())){
if (ObjectUtil.isEmpty(query.getStartCreateTime()) || ObjectUtil.isEmpty(query.getEndCreateTime())) {
throw new ServiceException("创建时间必须选择");
} else {
// 时间跨度不能大于31天
Duration duration = Duration.between(
query.getStartCreateTime().toInstant(),
query.getEndCreateTime().toInstant()
);
if (duration.toDays() > 31) {
throw new ServiceException("时间跨度不能大于31天");
}
}
IPage<TrunklinePickupEfficiencyVO> pages = trunklinePickupService.efficiencyPage(query);
return R.data(pages);
@ -51,8 +61,17 @@ public class TrunklinePickupController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "导出干线提货时效", notes = "导出干线提货时效")
public void exportEfficiency(HttpServletResponse response, TrunklinePickupEfficiencyQuery query) {
if(ObjectUtil.isEmpty(query.getStartCreateTime()) || ObjectUtil.isEmpty(query.getEndCreateTime())){
if (ObjectUtil.isEmpty(query.getStartCreateTime()) || ObjectUtil.isEmpty(query.getEndCreateTime())) {
throw new ServiceException("创建时间必须选择");
} else {
// 时间跨度不能大于31天
Duration duration = Duration.between(
query.getStartCreateTime().toInstant(),
query.getEndCreateTime().toInstant()
);
if (duration.toDays() > 31) {
throw new ServiceException("时间跨度不能大于31天");
}
}
trunklinePickupService.exportEfficiency(response, query);
}
@ -91,8 +110,17 @@ public class TrunklinePickupController {
@ApiOperationSupport(order = 1)
@ApiOperation(value = "2B业务配送时效表", notes = "2B业务配送时效表")
public R<IPage<B2BDeliverTimelinessVO>> b2BDeliveryTimelinessPage(B2BDeliveryTimelinessQuery query) {
if(ObjectUtil.isEmpty(query.getStartCreateTime()) || ObjectUtil.isEmpty(query.getEndCreateTime())){
if (ObjectUtil.isEmpty(query.getStartCreateTime()) || ObjectUtil.isEmpty(query.getEndCreateTime())) {
throw new ServiceException("入库时间必须选择");
} else {
// 时间跨度不能大于31天
Duration duration = Duration.between(
query.getStartCreateTime().toInstant(),
query.getEndCreateTime().toInstant()
);
if (duration.toDays() > 31) {
throw new ServiceException("时间跨度不能大于31天");
}
}
IPage<B2BDeliverTimelinessVO> pages = trunklinePickupService.b2BDeliveryTimelinessPage(query);
return R.data(pages);
@ -102,8 +130,17 @@ public class TrunklinePickupController {
@ApiOperationSupport(order = 2)
@ApiOperation(value = "导出2B业务配送时效表", notes = "导出2B业务配送时效表")
public void exportB2BDeliveryTimeliness(HttpServletResponse response, B2BDeliveryTimelinessQuery query) {
if(ObjectUtil.isEmpty(query.getStartCreateTime()) || ObjectUtil.isEmpty(query.getEndCreateTime())){
if (ObjectUtil.isEmpty(query.getStartCreateTime()) || ObjectUtil.isEmpty(query.getEndCreateTime())) {
throw new ServiceException("入库时间必须选择");
} else {
// 时间跨度不能大于31天
Duration duration = Duration.between(
query.getStartCreateTime().toInstant(),
query.getEndCreateTime().toInstant()
);
if (duration.toDays() > 31) {
throw new ServiceException("时间跨度不能大于31天");
}
}
trunklinePickupService.exportB2BDeliveryTimeliness(response, query);
}

49
blade-service/logpm-report/src/main/java/com/logpm/report/mapper/TrunklinePickupMapper.xml

@ -288,18 +288,17 @@
when ifnull(sum(t.num), 0) = 0 then 0
else round((ifnull(sum(tt.hgNum), 0)*100) / ifnull(sum(t.num), 0),2) end, '%') as signOnTimeRate
from (select lww.business_line, t.warehouse, t.brand_name,
case when ifnull(lbc.type_service,1) = 1 then '商配'
when ifnull(lbc.type_service,1) = 2 then '市配'
when ifnull(lbc.type_service,1) = 3 then '自提'
when ifnull(lbc.type_service,1) = 4 then '三方中转' end
type_service
, count(distinct t.order_code) orderNum, sum(t.quantity) num
case
when ifnull(ldsa.type_service,'1') = '1' then '商配'
when ifnull(ldsa.type_service,'1') = '2' then '市配'
when ifnull(ldsa.type_service, '1') = '3' then '自提'
when ifnull(ldsa.type_service, '1') = '4' then '三方中转' end as type_service,
count(distinct t.order_code) orderNum, sum(t.quantity) num
from logpm_distribution_parcel_list t
left join logpm_warehouse_waybill lww1 on lww1.waybill_no = t.waybill_number and lww1.is_deleted = 0
left join logpm_basicdata_client lbc on lbc.client_name = lww1.consignee and lbc.is_deleted = 0
join logpm_distribution_stock_article ldsa on ldsa.order_code = t.order_code and ldsa.is_deleted = 0
left join logpm_warehouse_warehouse lww on lww.id = t.warehouse_id
where t.warehouse_entry_time_end >= #{query.startCreateTime} and t.warehouse_entry_time_end &lt;= #{query.endCreateTime}
and t.is_transfer = 0 and (lbc.type_service != 2 or lbc.type_service is null)
and t.is_transfer = 0 and ldsa.type_service != '2'
<if test="query.businessLineRange != null and query.businessLineRange != ''">
and lww.business_line in
<foreach collection="query.businessLineRange.split(',')" item="businessLine" open="(" separator="," close=")">
@ -325,7 +324,7 @@
</foreach>
</if>
<if test="query.typeServiceRange != null and query.typeServiceRange != ''">
and ifnull(lbc.type_service,'1') in
and ifnull(ldsa.type_service,'1') in
<foreach collection="query.typeServiceRange.split(',')" item="typeService" open="(" separator="," close=")">
<if test="typeService == '商配'.toString() ">
'1'
@ -341,14 +340,11 @@
</if>
</foreach>
</if>
group by lww.business_line, t.warehouse, t.brand_name,ifnull(lbc.type_service,1)) t
group by lww.business_line, t.warehouse, t.brand_name,ifnull(ldsa.type_service,1)) t
left join (select t.business_unit,
t.warehouse_name,
t.brand_name, case when ifnull(lbc.type_service,1) = 1 then '商配'
when ifnull(lbc.type_service,1) = 2 then '市配'
when ifnull(lbc.type_service,1) = 3 then '自提'
when ifnull(lbc.type_service,1) = 4 then '三方中转' end
type_service,
t.brand_name,
t.custom_type as type_service,
sum(t.sign_num) signNum,
sum(case when t.sign_type = '文员批量签收' then t.sign_num else 0 end) batchNum,
sum(case
@ -356,10 +352,8 @@
then 1
else 0 end) hgNum
from logpm_quality_deliver t
left join logpm_warehouse_waybill lww1 on lww1.waybill_no = t.waybill_number and lww1.is_deleted = 0
left join logpm_basicdata_client lbc on lbc.client_name = lww1.consignee and lbc.is_deleted = 0
where t.end_warehouse_in_time >= #{query.startCreateTime} and t.end_warehouse_in_time &lt;= #{query.endCreateTime}
and t.sign_num is not null and (lbc.type_service != 2 or lbc.type_service is null)
and t.sign_num is not null and t.custom_type != '市配'
<if test="query.businessLineRange != null and query.businessLineRange != ''">
and t.business_unit in
<foreach collection="query.businessLineRange.split(',')" item="businessLine" open="(" separator="," close=")">
@ -385,23 +379,12 @@
</foreach>
</if>
<if test="query.typeServiceRange != null and query.typeServiceRange != ''">
and ifnull(lbc.type_service,'1') in
and t.custom_type in
<foreach collection="query.typeServiceRange.split(',')" item="typeService" open="(" separator="," close=")">
<if test="typeService == '商配'.toString() ">
'1'
</if>
<if test="typeService == '市配'.toString() ">
'2'
</if>
<if test="typeService == '自提'.toString() ">
'3'
</if>
<if test="typeService == '三方中转'.toString() ">
'4'
</if>
#{typeService}
</foreach>
</if>
group by t.business_unit, t.warehouse_name, t.brand_name,ifnull(lbc.type_service,1)) tt
group by t.business_unit, t.warehouse_name, t.brand_name,t.custom_type) tt
on t.business_line = tt.business_unit and t.warehouse = tt.warehouse_name and
t.brand_name = tt.brand_name and t.type_service = tt.type_service
<if test="(query.businessLineRange != null and query.businessLineRange != '')

Loading…
Cancel
Save