|
|
@@ -102,6 +102,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(PjOrder::getBsType, "XS")
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
|
|
|
"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ "OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.apply("FIND_IN_SET( status, '已发货,已收货' ) and busines_date = CURDATE()"));
|
|
|
if (!pjOrderListD.isEmpty()) {
|
|
|
@@ -135,6 +136,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(PjOrder::getBsType, "XS")
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
|
|
|
"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ "OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.apply("FIND_IN_SET( status, '已发货,已收货' ) and DATE_FORMAT(busines_date, '%Y-%m') = DATE_FORMAT(CURRENT_DATE(), '%Y-%m')"));
|
|
|
if (!pjOrderListM.isEmpty()) {
|
|
|
@@ -186,6 +188,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.apply("find_in_set(status,'录入,待确认')")
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
|
|
|
"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ "OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.ge(!quer.getDateList().isEmpty(), PjOrder::getBusinesDate, quer.getDateList().get(0))
|
|
|
.le(!quer.getDateList().isEmpty(), PjOrder::getBusinesDate, quer.getDateList().get(1)));
|
|
|
@@ -325,6 +328,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(PjOrder::getBsType, "XS")
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
|
|
|
"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ "OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.apply("status = '已发货' and busines_date = CURDATE()"));
|
|
|
if (!pjOrderList.isEmpty()) {
|
|
|
@@ -358,6 +362,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.le(PjOrder::getBusinesDate, endDate)
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
|
|
|
"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ "OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.apply("status = '已发货'"));
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
@@ -407,6 +412,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.le(PjOrder::getBusinesDate, endDate)
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
|
|
|
"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ "OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.apply("status = '已发货'"));
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
@@ -455,7 +461,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.ge(PjOrder::getBusinesDate, statusDate)
|
|
|
.le(PjOrder::getBusinesDate, endDate)
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3' ) ) " +
|
|
|
- "OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' ))" +
|
|
|
+ "OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ "OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
"OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3' )))")
|
|
|
.apply("status = '已发货'"));
|
|
|
List<Map<String, Object>> mapList = new ArrayList<>();
|
|
|
@@ -512,6 +519,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.le(PjOrder::getBusinesDate, endDate)
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) ) " +
|
|
|
"OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ "OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
"OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.apply("status = '已发货'"));
|
|
|
//销售
|
|
|
@@ -1001,8 +1009,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(ObjectUtils.isNotNull(saleDetailDto.getStorageId()), PjOrder::getStorageId, saleDetailDto.getStorageId())
|
|
|
.ge(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateStart()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateStart())
|
|
|
.le(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateEnd()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateEnd())
|
|
|
- .ge(ObjectUtils.isNotNull(saleDetailDto.getDateStart()), PjOrder::getDeliveryBusinesDate, saleDetailDto.getDateStart())
|
|
|
- .le(ObjectUtils.isNotNull(saleDetailDto.getDateEnd()), PjOrder::getDeliveryBusinesDate, saleDetailDto.getDateEnd());
|
|
|
+ .apply(ObjectUtils.isNotNull(saleDetailDto.getDateStart()),"DATE_FORMAT( delivery_busines_date, '%Y-%m-%d' ) >= '" + saleDetailDto.getDateStart()+"'")
|
|
|
+ .apply(ObjectUtils.isNotNull(saleDetailDto.getDateEnd()),"DATE_FORMAT( delivery_busines_date, '%Y-%m-%d' ) >= '" + saleDetailDto.getDateEnd()+"'");
|
|
|
if ("2".equals(saleDetailDto.getBsType())) {
|
|
|
lambdaQueryWrapper.isNotNull(PjOrder::getSalerId);
|
|
|
lambdaQueryWrapper.groupBy(PjOrder::getSalerName);
|
|
|
@@ -1028,8 +1036,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(ObjectUtils.isNotNull(saleDetailDto.getStorageId()), PjOrder::getStorageId, saleDetailDto.getStorageId())
|
|
|
.ge(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateStart()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateStart())
|
|
|
.le(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateEnd()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateEnd())
|
|
|
- .ge(ObjectUtils.isNotNull(saleDetailDto.getDateStart()), PjOrder::getDeliveryBusinesDate, saleDetailDto.getDateStart())
|
|
|
- .le(ObjectUtils.isNotNull(saleDetailDto.getDateEnd()), PjOrder::getDeliveryBusinesDate, saleDetailDto.getDateEnd());
|
|
|
+ .apply(ObjectUtils.isNotNull(saleDetailDto.getDateStart()),"DATE_FORMAT( delivery_busines_date, '%Y-%m-%d' ) >= '" + saleDetailDto.getDateStart()+"'")
|
|
|
+ .apply(ObjectUtils.isNotNull(saleDetailDto.getDateEnd()),"DATE_FORMAT( delivery_busines_date, '%Y-%m-%d' ) >= '" + saleDetailDto.getDateEnd()+"'");
|
|
|
if ("2".equals(saleDetailDto.getBsType())) {
|
|
|
orderLambdaQueryWrapper.apply("find_in_set(saler_name,'" + name + "')");
|
|
|
} else {
|
|
|
@@ -1291,8 +1299,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(ObjectUtils.isNotNull(saleDetailDto.getStorageId()), PjOrder::getStorageId, saleDetailDto.getStorageId())
|
|
|
.ge(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateStart()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateStart())
|
|
|
.le(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateEnd()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateEnd())
|
|
|
- .ge(ObjectUtils.isNotNull(saleDetailDto.getDateStart()), PjOrder::getDeliveryBusinesDate, saleDetailDto.getDateStart())
|
|
|
- .le(ObjectUtils.isNotNull(saleDetailDto.getDateEnd()), PjOrder::getDeliveryBusinesDate, saleDetailDto.getDateEnd());
|
|
|
+ .apply(ObjectUtils.isNotNull(saleDetailDto.getDateStart()),"DATE_FORMAT( delivery_busines_date, '%Y-%m-%d' ) >= '" + saleDetailDto.getDateStart()+"'")
|
|
|
+ .apply(ObjectUtils.isNotNull(saleDetailDto.getDateEnd()),"DATE_FORMAT( delivery_busines_date, '%Y-%m-%d' ) >= '" + saleDetailDto.getDateEnd()+"'");
|
|
|
if ("2".equals(saleDetailDto.getBsType())) {
|
|
|
lambdaQueryWrapper.isNotNull(PjOrder::getSalerId);
|
|
|
lambdaQueryWrapper.groupBy(PjOrder::getSalerName);
|
|
|
@@ -1317,8 +1325,8 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(ObjectUtils.isNotNull(saleDetailDto.getStorageId()), PjOrder::getStorageId, saleDetailDto.getStorageId())
|
|
|
.ge(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateStart()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateStart())
|
|
|
.le(ObjectUtils.isNotNull(saleDetailDto.getBusinesDateEnd()), PjOrder::getBusinesDate, saleDetailDto.getBusinesDateEnd())
|
|
|
- .ge(ObjectUtils.isNotNull(saleDetailDto.getDateStart()), PjOrder::getDeliveryBusinesDate, saleDetailDto.getDateStart())
|
|
|
- .le(ObjectUtils.isNotNull(saleDetailDto.getDateEnd()), PjOrder::getDeliveryBusinesDate, saleDetailDto.getDateEnd());
|
|
|
+ .apply(ObjectUtils.isNotNull(saleDetailDto.getDateStart()),"DATE_FORMAT( delivery_busines_date, '%Y-%m-%d' ) >= '" + saleDetailDto.getDateStart()+"'")
|
|
|
+ .apply(ObjectUtils.isNotNull(saleDetailDto.getDateEnd()),"DATE_FORMAT( delivery_busines_date, '%Y-%m-%d' ) >= '" + saleDetailDto.getDateEnd()+"'");
|
|
|
if ("2".equals(saleDetailDto.getBsType())) {
|
|
|
orderLambdaQueryWrapper.apply("find_in_set(saler_name,'" + name + "')");
|
|
|
} else {
|
|
|
@@ -1511,6 +1519,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(PjOrder::getBsType, "XS")
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) )" +
|
|
|
" OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ " OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.eq(ObjectUtils.isNotNull(corpBuySingular.getBusinessSource()), PjOrder::getBusinessSource, corpBuySingular.getBusinessSource())
|
|
|
.like(ObjectUtils.isNotNull(corpBuySingular.getSalerName()), PjOrder::getSalerName, corpBuySingular.getSalerName())
|
|
|
@@ -1568,6 +1577,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(PjOrder::getBsType, "XS")
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) )" +
|
|
|
" OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ " OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.eq(ObjectUtils.isNotNull(corpBuySingular.getBusinessSource()), PjOrder::getBusinessSource, corpBuySingular.getBusinessSource())
|
|
|
.like(ObjectUtils.isNotNull(corpBuySingular.getSalerName()), PjOrder::getSalerName, corpBuySingular.getSalerName())
|
|
|
@@ -1625,6 +1635,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(PjOrder::getBsType, "XS")
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) )" +
|
|
|
" OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ " OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.eq(ObjectUtils.isNotNull(corpBuySingular.getBusinessSource()), PjOrder::getBusinessSource, corpBuySingular.getBusinessSource())
|
|
|
.like(ObjectUtils.isNotNull(corpBuySingular.getSalerName()), PjOrder::getSalerName, corpBuySingular.getSalerName())
|
|
|
@@ -1677,6 +1688,7 @@ public class StatisticsServiceImpl implements IStatisticsService {
|
|
|
.eq(PjOrder::getBsType, "XS")
|
|
|
.apply("(( business_source = '外部销售' AND FIND_IN_SET( actual_payment_status, '2,3,4' ) )" +
|
|
|
" OR (business_source = '内部销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
+ " OR (business_source = '共享销售' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' ))" +
|
|
|
" OR (business_source = '额度支付' AND FIND_IN_SET( actual_payment_status, '0,1,2,3,4' )))")
|
|
|
.eq(ObjectUtils.isNotNull(corpBuySingular.getBusinessSource()), PjOrder::getBusinessSource, corpBuySingular.getBusinessSource())
|
|
|
.like(ObjectUtils.isNotNull(corpBuySingular.getSalerName()), PjOrder::getSalerName, corpBuySingular.getSalerName())
|