This commit is contained in:
2025-01-26 20:09:24 +08:00
parent 1b11342e5d
commit b51048ddfa
4 changed files with 53 additions and 65 deletions

View File

@ -33,10 +33,6 @@ public class AppStatisticsController {
@ApiOperation("支付订单金额、预览_支付转化率、扫码_付费用户转化率") @ApiOperation("支付订单金额、预览_支付转化率、扫码_付费用户转化率")
@PostMapping("/one") @PostMapping("/one")
public ApiResponse<AppSta1VO> oneStatistics(@RequestBody CommonQueryReq query) { public ApiResponse<AppSta1VO> oneStatistics(@RequestBody CommonQueryReq query) {
JwtInfo worker = JwtTokenUtil.getWorker();
log.info("oneStatistics 当前用户信息:{}", worker);
Long scenicId = worker.getScenicId();
query.setScenicId(scenicId);
return statisticsService.oneStatistics(query); return statisticsService.oneStatistics(query);
} }

View File

@ -193,7 +193,6 @@ public class ViidController {
*/ */
@RequestMapping(value = "/Faces", method = RequestMethod.POST) @RequestMapping(value = "/Faces", method = RequestMethod.POST)
@IgnoreLogReq @IgnoreLogReq
@RequestToFile
public VIIDBaseResp faces(@RequestBody FaceUploadReq req) { public VIIDBaseResp faces(@RequestBody FaceUploadReq req) {
FaceListObject faceListObject = req.getFaceListObject(); FaceListObject faceListObject = req.getFaceListObject();
List<FaceObject> faceObject = faceListObject.getFaceObject(); List<FaceObject> faceObject = faceListObject.getFaceObject();

View File

@ -245,7 +245,7 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
private String calculateConversionRate(Integer num1,Integer num2){ private String calculateConversionRate(Integer num1,Integer num2){
//转化率格式 //转化率格式
DecimalFormat df = new DecimalFormat("0.00"); DecimalFormat df = new DecimalFormat("0.00");
if(num2==0){ if(num2 == null || num2==0){
return "0.00"; return "0.00";
}else { }else {
BigDecimal result = new BigDecimal(num1).divide(new BigDecimal(num2), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); BigDecimal result = new BigDecimal(num1).divide(new BigDecimal(num2), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
@ -342,12 +342,15 @@ public class AppStatisticsServiceImpl implements AppStatisticsService {
//当前周期的支付订单金额 //当前周期的支付订单金额
vo.setNowOrderAmount(orderAmountDf.format(orderAmount)); vo.setNowOrderAmount(orderAmountDf.format(orderAmount));
//当前周期预览_支付转化率、扫码_付费用户转化率 //当前周期预览_支付转化率、扫码_付费用户转化率
if(pay==0){ if(preview==0){
vo.setNowPreviewPay("0.00"); vo.setNowPreviewPay("0.00");
}else {
BigDecimal previewPay = new BigDecimal(pay).divide(new BigDecimal(preview), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
vo.setNowPreviewPay(df.format(previewPay));
}
if(scanCode==0){
vo.setNowScanCodePay("0.00"); vo.setNowScanCodePay("0.00");
}else { }else {
BigDecimal previewPay = new BigDecimal(payCount).divide(new BigDecimal(preview), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
vo.setNowPreviewPay(df.format(previewPay));
BigDecimal scanCodePay = new BigDecimal(pay).divide(new BigDecimal(scanCode), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100)); BigDecimal scanCodePay = new BigDecimal(pay).divide(new BigDecimal(scanCode), 4, RoundingMode.HALF_UP).multiply(new BigDecimal(100));
vo.setNowScanCodePay(df.format(scanCodePay)); vo.setNowScanCodePay(df.format(scanCodePay));
} }

View File

@ -20,7 +20,7 @@
</select> </select>
<select id="countPreviewVideoOfMember" resultType="java.lang.Integer"> <select id="countPreviewVideoOfMember" resultType="java.lang.Integer">
SELECT SELECT
IFNULL(count(count), 0) AS count IFNULL(count(1), 0) AS count
FROM ( FROM (
select count(1) as count select count(1) as count
from statistics from statistics
@ -36,7 +36,7 @@
</select> </select>
<select id="countScanCodeOfMember" resultType="java.lang.Integer"> <select id="countScanCodeOfMember" resultType="java.lang.Integer">
SELECT SELECT
IFNULL(count(count), 0) AS count IFNULL(count(1), 0) AS count
FROM ( FROM (
select count(1) as count select count(1) as count
from statistics from statistics
@ -52,51 +52,46 @@
</select> </select>
<select id="countClickPayOfMember" resultType="java.lang.Integer"> <select id="countClickPayOfMember" resultType="java.lang.Integer">
SELECT SELECT
IFNULL(count(count), 0) AS count IFNULL(count(1), 0) AS count
FROM ( FROM (
select count(1) as count select count(1) as count
from statistics from `order`
where type=9 and scenic_id = #{scenicId} where scenic_id = #{scenicId}
<if test="startTime!= null"> <if test="startTime!= null">
and create_time >= #{startTime} and create_at >= #{startTime}
</if> </if>
<if test="endTime!= null"> <if test="endTime!= null">
and create_time &lt;= #{endTime} and create_at &lt;= #{endTime}
</if> </if>
group by member_id group by member_id
)a )a
</select> </select>
<select id="countPayOfMember" resultType="java.lang.Integer"> <select id="countPayOfMember" resultType="java.lang.Integer">
SELECT SELECT
IFNULL(count(count), 0) AS count IFNULL(count(1), 0) AS count
FROM ( FROM (
select count(1) as count select count(1) as count
from statistics from `order`
where type in(3,4) and scenic_id = #{scenicId} where scenic_id = #{scenicId} and pay_at is not null
<if test="startTime!= null"> <if test="startTime!= null">
and create_time >= #{startTime} and create_at >= #{startTime}
</if> </if>
<if test="endTime!= null"> <if test="endTime!= null">
and create_time &lt;= #{endTime} and create_at &lt;= #{endTime}
</if> </if>
group by member_id group by member_id
)a )a
</select> </select>
<select id="countSceneOrderNum" resultType="java.lang.Integer"> <select id="countSceneOrderNum" resultType="java.lang.Integer">
SELECT
IFNULL(SUM(count), 0) AS count
FROM (
select count(1) as count select count(1) as count
from statistics from `order`
where type=3 and scenic_id = #{scenicId} where scenic_id = #{scenicId} and pay_at is not null
<if test="startTime!= null"> <if test="startTime!= null">
and create_time >= #{startTime} and create_at >= #{startTime}
</if> </if>
<if test="endTime!= null"> <if test="endTime!= null">
and create_time &lt;= #{endTime} and create_at &lt;= #{endTime}
</if> </if>
group by morph_id
)a
</select> </select>
<select id="countPushOrderNum" resultType="java.lang.Integer"> <select id="countPushOrderNum" resultType="java.lang.Integer">
SELECT SELECT
@ -116,7 +111,7 @@
</select> </select>
<select id="countPushOfMember" resultType="java.lang.Integer"> <select id="countPushOfMember" resultType="java.lang.Integer">
SELECT SELECT
IFNULL(count(count), 0) AS count IFNULL(count(1), 0) AS count
FROM ( FROM (
select count(1) as count select count(1) as count
from statistics from statistics
@ -147,10 +142,8 @@
select count(1) as count select count(1) as count
from face from face
where scenic_id = #{scenicId} where scenic_id = #{scenicId}
<if test="startTime!= null">and create_at >= #{startTime} <if test="startTime!= null">and create_at >= #{startTime}</if>
</if><if test=" <if test="endTime!= null">and create_at &lt;= #{endTime}</if>
endTime!= null">and create_at &lt;= #{endTime}
</if>
group by member_id group by member_id
) a ) a
</select> </select>
@ -172,7 +165,7 @@
</select> </select>
<select id="countTotalVisitorOfMember" resultType="java.lang.Integer"> <select id="countTotalVisitorOfMember" resultType="java.lang.Integer">
SELECT SELECT
IFNULL(count(count), 0) AS count IFNULL(count(1), 0) AS count
FROM ( FROM (
select count(1) as count select count(1) as count
from statistics from statistics
@ -214,37 +207,34 @@
)a )a
</select> </select>
<select id="countPayOfOrder" resultType="java.lang.Integer"> <select id="countPayOfOrder" resultType="java.lang.Integer">
SELECT
IFNULL(SUM(count), 0) AS count
FROM (
select count(1) as count select count(1) as count
from statistics from `order`
where type in(3,4) and scenic_id = #{scenicId} where
pay_at is not null and scenic_id = #{scenicId}
<if test="startTime!= null"> <if test="startTime!= null">
and create_time >= #{startTime} and create_at >= #{startTime}
</if> </if>
<if test="endTime!= null"> <if test="endTime!= null">
and create_time &lt;= #{endTime} and create_at &lt;= #{endTime}
</if> </if>
group by morph_id
)a
</select> </select>
<select id="countRefundOfOrder" resultType="java.lang.Integer"> <select id="countRefundOfOrder" resultType="java.lang.Integer">
select count(1) as count select count(1) as count
from statistics from `order`
where type =5 and scenic_id = #{scenicId} where
refund_status = 1 and scenic_id = #{scenicId}
<if test="startTime!= null"> <if test="startTime!= null">
and create_time >= #{startTime} and create_at >= #{startTime}
</if> </if>
<if test="endTime!= null"> <if test="endTime!= null">
and create_time &lt;= #{endTime} and create_at &lt;= #{endTime}
</if> </if>
</select> </select>
<select id="countRefundAmount" resultType="java.math.BigDecimal"> <select id="countRefundAmount" resultType="java.math.BigDecimal">
select ifnull(sum(pay_price),0) as payPrice select ifnull(sum(pay_price),0) as payPrice
from `order` from `order`
where where
status = 2 and scenic_id = #{scenicId} refund_status = 1 and scenic_id = #{scenicId}
<if test="startTime!= null"> <if test="startTime!= null">
and create_at >= #{startTime} and create_at >= #{startTime}
</if> </if>