Commit ccbc4b37 authored by libin's avatar libin

分公司统计

parent 48f39131
...@@ -187,12 +187,12 @@ public enum StatisticsStatusEnum { ...@@ -187,12 +187,12 @@ public enum StatisticsStatusEnum {
feeTypeBo.setOrderRefundAmount(feeTypeBo.getOrderRefundAmount().add(accountDetailEntity.getOrderAmount()).subtract(feeTypeBo.getNoDeductibleRefundAmount())); feeTypeBo.setOrderRefundAmount(feeTypeBo.getOrderRefundAmount().add(accountDetailEntity.getOrderAmount()).subtract(feeTypeBo.getNoDeductibleRefundAmount()));
} }
} }
//订单支付金额(不包含免赔,押金)减去退款的金额 /* //订单支付金额(不包含免赔,押金)减去退款的金额
feeTypeBo.setTotalAmount(feeTypeBo.getTotalAmount().subtract(feeTypeBo.getOrderRefundAmount())); feeTypeBo.setTotalAmount(feeTypeBo.getTotalAmount().subtract(feeTypeBo.getOrderRefundAmount()));
//订单押金减去退款押金 //订单押金减去退款押金
feeTypeBo.setDepositAmount(feeTypeBo.getDepositAmount().subtract(feeTypeBo.getDepositRefundAmount())); feeTypeBo.setDepositAmount(feeTypeBo.getDepositAmount().subtract(feeTypeBo.getDepositRefundAmount()));
//订单免赔金额减去退款的免赔金额 //订单免赔金额减去退款的免赔金额
feeTypeBo.setNoDeductibleAmount(feeTypeBo.getNoDeductibleAmount().subtract(feeTypeBo.getDepositRefundAmount())); feeTypeBo.setNoDeductibleAmount(feeTypeBo.getNoDeductibleAmount().subtract(feeTypeBo.getDepositRefundAmount()));*/
return feeTypeBo; return feeTypeBo;
} }
......
...@@ -71,11 +71,11 @@ ...@@ -71,11 +71,11 @@
`company_id` AS `companyId`, `company_id` AS `companyId`,
`year`, `year`,
`date`, `date`,
SUM(`member_amount`) AS `memberAmount`, SUM(`member_amount`-`member_refund_amount`) AS `memberAmount`,
SUM(`travel_amount`) AS `travelAmount`, SUM(`travel_amount`-`travel_refund_amount` ) AS `travelAmount`,
SUM(`rent_vehicle_amount`) AS `rentVehilceAmount`, SUM(`rent_vehicle_amount`-`rent_vehicle_refund_amount`) AS `rentVehilceAmount`,
SUM(`no_deductible_amount`) as `noDeductibleAmount`, SUM(`no_deductible_amount` - `no_deductible_refund_amount`) as `noDeductibleAmount`,
SUM(`deposit_amount`) as `depositAmount` SUM(`deposit_amount` - `deposit_refund_amount`) as `depositAmount`
FROM FROM
`order_received_statistics` WHERE `has_pay`=1 `order_received_statistics` WHERE `has_pay`=1
<if test="companyName!=null and companyName!=''"> <if test="companyName!=null and companyName!=''">
...@@ -139,28 +139,28 @@ ...@@ -139,28 +139,28 @@
`count_date` `count_date`
) AS `ovss` ON ovss.cyid = ors.companyId ) AS `ovss` ON ovss.cyid = ors.companyId
AND ovss.count_date = ors.date AND ovss.count_date = ors.date
<!-- order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc--> <!-- order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc-->
</select> </select>
<!--按月统计--> <!--按月统计-->
<select id="selectCompanyPerformanceWithMonth" <select id="selectCompanyPerformanceWithMonth"
resultType="com.xxfc.platform.order.bo.CompanyPerformanceBo"> resultType="com.xxfc.platform.order.bo.CompanyPerformanceBo">
SELECT SELECT
ors.*, ors.*,
IFNULL(ovss.departureNum,0) as `departureNum`, IFNULL(ovss.departureNum,0) as `departureNum`,
IFNULL(ovss.rentDays,0) as `rentDays`, IFNULL(ovss.rentDays,0) as `rentDays`,
IFNULL(ovss.arrivalNum,0) as `arrivalNum` IFNULL(ovss.arrivalNum,0) as `arrivalNum`
FROM FROM
( (
SELECT SELECT
company_id AS `companyId`, company_id AS `companyId`,
`year`, `year`,
`month`, `month`,
SUM(`member_amount`) AS `memberAmount`, SUM(`member_amount`-`member_refund_amount`) AS `memberAmount`,
SUM(`travel_amount`) AS `travelAmount`, SUM(`travel_amount`-`travel_refund_amount` ) AS `travelAmount`,
SUM(`rent_vehicle_amount`) AS `rentVehilceAmount`, SUM(`rent_vehicle_amount`-`rent_vehicle_refund_amount`) AS `rentVehilceAmount`,
SUM(`no_deductible_amount`) as `noDeductibleAmount`, SUM(`no_deductible_amount` - `no_deductible_refund_amount`) as `noDeductibleAmount`,
SUM(`deposit_amount`) as `depositAmount` SUM(`deposit_amount` - `deposit_refund_amount`) as `depositAmount`
FROM FROM
`order_received_statistics` WHERE `has_pay`=1 `order_received_statistics` WHERE `has_pay`=1
<if test="companyName!=null and companyName!=''"> <if test="companyName!=null and companyName!=''">
...@@ -240,11 +240,11 @@ ...@@ -240,11 +240,11 @@
company_id AS `companyId`, company_id AS `companyId`,
`year`, `year`,
`week_of_year` AS `weekOfYear`, `week_of_year` AS `weekOfYear`,
SUM(`member_amount`) AS `memberAmount`, SUM(`member_amount`-`member_refund_amount`) AS `memberAmount`,
SUM(`travel_amount`) AS `travelAmount`, SUM(`travel_amount`-`travel_refund_amount` ) AS `travelAmount`,
SUM(`rent_vehicle_amount`) AS `rentVehilceAmount`, SUM(`rent_vehicle_amount`-`rent_vehicle_refund_amount`) AS `rentVehilceAmount`,
SUM(`no_deductible_amount`) as `noDeductibleAmount`, SUM(`no_deductible_amount` - `no_deductible_refund_amount`) as `noDeductibleAmount`,
SUM(`deposit_amount`) as `depositAmount` SUM(`deposit_amount` - `deposit_refund_amount`) as `depositAmount`
FROM FROM
`order_received_statistics` WHERE `has_pay`=1 `order_received_statistics` WHERE `has_pay`=1
<if test="companyName!=null and companyName!=''"> <if test="companyName!=null and companyName!=''">
...@@ -309,11 +309,11 @@ ...@@ -309,11 +309,11 @@
`count_week` `count_week`
) AS `ovss` ON ovss.cyid = ors.companyId ) AS `ovss` ON ovss.cyid = ors.companyId
AND ovss.count_week = ors.weekOfYear AND ovss.count_week = ors.weekOfYear
<!-- order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc--> <!-- order by ors.rentVehilceAmount desc,ors.memberAmount desc,ors.travelAmount desc,ors.depositAmount desc,ors.noDeductibleAmount desc ,rentDays desc,departureNum desc, arrivalNum desc-->
</select> </select>
<select id="selectCountByDate" resultType="int"> <select id="selectCountByDate" resultType="int">
select count(0) from (SELECT `date` FROM `order_received_statistics` WHERE `has_pay`=1 select count(*) from (SELECT `date` FROM `order_received_statistics` WHERE `has_pay`=1
<if test="companyName!=null and companyName!=''"> <if test="companyName!=null and companyName!=''">
AND `company_name` LIKE CONCAT('%',#{companyName},'%') AND `company_name` LIKE CONCAT('%',#{companyName},'%')
</if> </if>
...@@ -336,12 +336,12 @@ ...@@ -336,12 +336,12 @@
GROUP BY GROUP BY
company_id, company_id,
`year`, `year`,
`date` `date`
) as `ds` ) as `ds`
</select> </select>
<select id="selectCountByMonth" resultType="int"> <select id="selectCountByMonth" resultType="int">
select count(0) from (SELECT `month` FROM `order_received_statistics` WHERE `has_pay`=1 select count(*) from (SELECT `month` FROM `order_received_statistics` WHERE `has_pay`=1
<if test="companyName!=null and companyName!=''"> <if test="companyName!=null and companyName!=''">
AND `company_name` LIKE CONCAT('%',#{companyName},'%') AND `company_name` LIKE CONCAT('%',#{companyName},'%')
</if> </if>
...@@ -369,7 +369,7 @@ ...@@ -369,7 +369,7 @@
</select> </select>
<select id="selectCountByWeekOfYear" resultType="int"> <select id="selectCountByWeekOfYear" resultType="int">
select count(0) from (SELECT `week_of_year` FROM `order_received_statistics` WHERE `has_pay`=1 select count(*) from (SELECT `week_of_year` FROM `order_received_statistics` WHERE `has_pay`=1
<if test="companyName!=null and companyName!=''"> <if test="companyName!=null and companyName!=''">
AND `company_name` LIKE CONCAT('%',#{companyName},'%') AND `company_name` LIKE CONCAT('%',#{companyName},'%')
</if> </if>
......
...@@ -130,7 +130,7 @@ public class ServiceTest { ...@@ -130,7 +130,7 @@ public class ServiceTest {
// cn.hutool.core.date.DateTime offset = DateUtil.offset(dateTime, DateField.DAY_OF_MONTH, 1); // cn.hutool.core.date.DateTime offset = DateUtil.offset(dateTime, DateField.DAY_OF_MONTH, 1);
orderReceivedStatisticsJobHandler.execute("2019-11-29");*/ orderReceivedStatisticsJobHandler.execute("2019-11-29");*/
LocalDate startLocalDate = LocalDate.of(2019, 10, 1); LocalDate startLocalDate = LocalDate.of(2019, 10, 1);
LocalDate endLocalDate = LocalDate.of(2019,11,28); LocalDate endLocalDate = LocalDate.of(2019,11,29);
while (startLocalDate.isBefore(endLocalDate)){ while (startLocalDate.isBefore(endLocalDate)){
String dateStr = startLocalDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd")); String dateStr = startLocalDate.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"));
startLocalDate = startLocalDate.plusDays(1); startLocalDate = startLocalDate.plusDays(1);
......
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