Merge remote-tracking branch 'origin/test' into test

# Conflicts:
#	src/main/resources/mapper/course/CourseDao.xml
This commit is contained in:
张松
2024-12-30 20:06:15 +08:00
12 changed files with 69 additions and 169 deletions

View File

@@ -31,7 +31,7 @@ public interface UserDao extends BaseMapper<UserEntity> {
Double queryPayMoney(@Param("type") int type, @Param("date") String date,String qdCode);
IPage<Map<String, Object>> queryCourseOrder(Page iPage,@Param("type") int type, @Param("date") String date,Long sysUserId);
IPage<Map<String, Object>> queryCourseOrder(Page iPage,@Param("type") int type, @Param("start") String start, @Param("end") String end,Long sysUserId);
int userMessage( String date, int type,String qdCode,Integer vipType);

View File

@@ -1,6 +1,7 @@
package com.sqx.modules.app.service.impl;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.thread.ThreadUtil;
import cn.hutool.json.JSONUtil;
@@ -55,6 +56,7 @@ import com.sqx.modules.sys.service.SysUserService;
import com.sqx.modules.utils.HttpClientUtil;
import com.sqx.modules.utils.InvitationCodeUtil;
import com.sqx.modules.utils.MD5Util;
import com.sqx.modules.utils.TimeCompleteUtils;
import com.tencentcloudapi.common.Credential;
import com.tencentcloudapi.common.exception.TencentCloudSDKException;
import com.tencentcloudapi.common.profile.ClientProfile;
@@ -1335,7 +1337,7 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
String invitationCode, String startTime, String endTime, String qdCode, String sysUserName, Integer vipType) {
Page<UserEntity> pages = new Page<>(page, limit);
return new PageUtils(baseMapper.selectUserPage(pages, search, sex, platform, sysPhone, status, member,
inviterCode, userName, invitationCode, startTime, endTime, qdCode, sysUserName, vipType));
inviterCode, userName, invitationCode, TimeCompleteUtils.completeStartTime(startTime), TimeCompleteUtils.completeEndTime(endTime), qdCode, sysUserName, vipType));
}
@Override
@@ -1367,7 +1369,18 @@ public class UserServiceImpl extends ServiceImpl<UserDao, UserEntity> implements
@Override
public IPage<Map<String, Object>> queryCourseOrder(Page<Map<String, Object>> iPage, int type, String date, Long sysUserId) {
return baseMapper.queryCourseOrder(iPage, type, date, sysUserId);
DateTime parse = DateUtil.parse(date, "yyyy-MM-dd");
String startTime = DateUtil.format(parse, "yyyy-MM-dd 00:00:00");
String endTime = DateUtil.format(parse, "yyyy-MM-dd 23:59:59");
if (type == 2) {
startTime = DateUtil.format(DateUtil.beginOfMonth(parse), "yyyy-MM-dd 00:00:00");
endTime = DateUtil.format(DateUtil.endOfMonth(parse), "yyyy-MM-dd 23:59:59");
} else if (type == 3) {
startTime = DateUtil.format(DateUtil.beginOfYear(parse), "yyyy-MM-dd 00:00:00");
endTime = DateUtil.format(DateUtil.endOfYear(parse), "yyyy-MM-dd 23:59:59");
}
return baseMapper.queryCourseOrder(iPage, type, startTime, endTime, sysUserId);
}
@Override

View File

@@ -70,6 +70,14 @@ public class AppMessageController {
return Result.success();
}
@Login
@PostMapping("/sendMessage")
@ApiOperation("添加投诉")
public Result sendMessage(@RequestBody MessageInfo messageInfo){
messageService.saveBody(messageInfo);
return Result.success();
}

View File

@@ -93,7 +93,7 @@ public class OrdersController extends AbstractController {
Double tuiMemberOrdersMoney = ordersService.selectOrdersMoney(2, 2, flag, time, null, sysUserId);
//提现
Integer cashCount = cashOutDao.selectCount(new QueryWrapper<CashOut>()
.eq("sys_user_id", sysUserId)
// .eq("sys_user_id", sysUserId)
.eq("state", 1)
.gt("create_at", DateUtil.format(DateUtil.parse(time, "yyyy-MM-dd"), "yyyy-MM-dd HH:mm:ss")));
Double cashSum = cashOutDao.selectSysUserCashOutSum(sysUserId, DateUtil.format(DateUtil.parse(time, "yyyy-MM-dd"), "yyyy-MM-dd HH:mm:ss"));

View File

@@ -1,6 +1,8 @@
package com.sqx.modules.pay.controller;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import com.alibaba.fastjson.JSON;
import com.alipay.api.AlipayApiException;
import com.alipay.api.AlipayClient;
@@ -211,9 +213,21 @@ public class CashController {
@ApiOperation("财务提现统计")
@GetMapping("/statisticsCashMoney")
public Result statisticsMoney(String time, Integer flag) {
Double sumMoney = cashOutService.sumMoney(time, flag);
Integer countMoney = cashOutService.countMoney(time, flag);
Integer stayMoney = cashOutService.stayMoney(time, flag);
DateTime parse = DateUtil.parse(time, "yyyy-MM-dd");
String startTime = DateUtil.format(parse, "yyyy-MM-dd 00:00:00");
String endTime = DateUtil.format(parse, "yyyy-MM-dd 23:59:59");
if (flag == 2) {
startTime = DateUtil.format(DateUtil.beginOfMonth(parse), "yyyy-MM-dd 00:00:00");
endTime = DateUtil.format(DateUtil.endOfMonth(parse), "yyyy-MM-dd 23:59:59");
} else if (flag == 3) {
startTime = DateUtil.format(DateUtil.beginOfYear(parse), "yyyy-MM-dd 00:00:00");
endTime = DateUtil.format(DateUtil.endOfYear(parse), "yyyy-MM-dd 23:59:59");
}
Double sumMoney = cashOutService.sumMoney(startTime, endTime, flag);
Integer countMoney = cashOutService.countMoney(startTime, endTime, flag);
Integer stayMoney = cashOutService.stayMoney(startTime, endTime, flag);
Map<String, Object> map = new HashMap<>();
map.put("sumMoney", sumMoney == null ? 0.00 : sumMoney);
map.put("countMoney", countMoney == null ? 0 : countMoney);

View File

@@ -32,11 +32,11 @@ public interface CashOutDao extends BaseMapper<CashOut> {
Double selectSysUserCashOutSum(@Param("sysUserId") Long sysUserId, @Param("time") String time);
Double sumMoney(@Param("time") String time, @Param("flag") Integer flag);
Double sumMoney(@Param("start") String start, @Param("end") String end, @Param("flag") Integer flag);
Integer countMoney(@Param("time") String time, @Param("flag") Integer flag);
Integer countMoney(@Param("start") String start, @Param("end") String end, @Param("flag") Integer flag);
Integer stayMoney(@Param("time") String time, @Param("flag") Integer flag);
Integer stayMoney(@Param("start") String start, @Param("end") String end, @Param("flag") Integer flag);
void updateMayMoney(@Param("type") Integer type, @Param("userId") Long userId, @Param("money") Double money);

View File

@@ -31,11 +31,11 @@ public interface CashOutService {
Double selectCashOutSum(Long userId, Date startTime, Date endTime);
Double sumMoney(String time, Integer flag);
Double sumMoney(String time, String end, Integer flag);
Integer countMoney(String time, Integer flag);
Integer countMoney(String time, String end, Integer flag);
Integer stayMoney(String time, Integer flag);
Integer stayMoney(String time, String end, Integer flag);
void updateMayMoney(int i, Long userId, Double money);

View File

@@ -250,18 +250,18 @@ public class CashOutServiceImpl extends ServiceImpl<CashOutDao, CashOut> impleme
}
@Override
public Double sumMoney(String time, Integer flag) {
return cashOutDao.sumMoney(time, flag);
public Double sumMoney(String start, String end, Integer flag) {
return cashOutDao.sumMoney(start, end, flag);
}
@Override
public Integer countMoney(String time, Integer flag) {
return cashOutDao.countMoney(time, flag);
public Integer countMoney(String start, String end, Integer flag) {
return cashOutDao.countMoney(start, end, flag);
}
@Override
public Integer stayMoney(String time, Integer flag) {
return cashOutDao.stayMoney(time, flag);
public Integer stayMoney(String start, String end, Integer flag) {
return cashOutDao.stayMoney(start, end, flag);
}
@Override

View File

@@ -52,13 +52,13 @@
</if>
<if test="startTime!=null and startTime!='' and endTime!=null and endTime!=''">
and date_format(u.create_time,'%Y-%m-%d') BETWEEN #{startTime} and #{endTime}
and u.create_time BETWEEN #{startTime} and #{endTime}
</if>
<if test="startTime!=null and startTime!='' and (endTime==null or endTime=='')">
and date_format(u.create_time,'%Y-%m-%d') &gt;= #{startTime}
and u.create_time &gt;= #{startTime}
</if>
<if test="endTime!=null and endTime!='' and (startTime==null or startTime=='')">
and date_format(u.create_time,'%Y-%m-%d') &lt;= #{endTime}
and u.create_time &lt;= #{endTime}
</if>
order by create_time desc
</select>
@@ -143,15 +143,7 @@
<if test="sysUserId!=null">
and sys_user_id=#{sysUserId}
</if>
<if test="type==1">
and date_format(o.create_time,'%Y-%m-%d')=date_format(#{date},'%Y-%m-%d')
</if>
<if test="type==2">
and date_format(o.create_time,'%Y-%m')=date_format(#{date},'%Y-%m')
</if>
<if test="type==3">
and date_format(o.create_time,'%Y')=date_format(#{date},'%Y')
</if>
and o.create_time between #{start} and #{end}
group by c.course_id
order by coursenum desc
</select>

View File

@@ -7,103 +7,6 @@
where course_id = #{id}
</update>
<select id="selectCourse" resultType="Map">
SELECT
c.classify_id AS classifyId,
c.course_id AS courseId,
c.course_label AS courseLabel,
c.create_time AS createTime,
c.details,
c.img,
c.banner_img AS bannerImg,
c.status,
c.is_delete AS isDelete,
c.msg_type AS msgType,
c.msg_url AS msgUrl,
c.pay_num AS payNum,
c.price,
c.wholesale_price AS wholesalePrice,
c.is_over AS isOver,
c.title,
c.is_price AS isPrice,
c.title_img AS titleImg,
c.update_time AS updateTime,
cc.classification_name AS classificationName,
c.course_type AS courseType,
c.banner_id AS bannerId,
b.name AS bannerName,
0 AS viewCounts,
c.dy_img_id AS dyImgId,
c.dy_course_id AS dyCourseId,
c.wx_course_id AS wxCourseId,
c.wx_show AS wxShow,
c.dy_show AS dyShow,
c.sort,
0 AS goodNum,
d.courseDetailsCount,
NULL AS courseDetailsName,
NULL AS courseDetailsId,
0 AS weekGoodNum,
0 AS isRecommend
FROM
course AS c
LEFT JOIN
course_classification AS cc ON c.classify_id = cc.classification_id
LEFT JOIN
banner AS b ON b.id = c.banner_id
LEFT JOIN
(SELECT course_id, COUNT(*) AS courseDetailsCount FROM course_details GROUP BY course_id) AS d
ON c.course_id = d.course_id
WHERE
c.is_delete = 0
<if test='null != wxShow and wxShow == 1'>
AND c.wx_show = #{wxShow}
</if>
<if test='null != wxShow and wxShow == 2'>
AND (c.wx_show = #{wxShow} OR c.wx_show IS NULL)
</if>
<if test='null != dyShow and dyShow == 1'>
AND c.dy_show = #{dyShow}
</if>
<if test='null != dyShow and dyShow == 2'>
AND (c.dy_show = #{dyShow} OR c.dy_show IS NULL)
</if>
<if test='null != title'>
AND c.title LIKE CONCAT('%', #{title}, '%')
</if>
<if test='null != classifyId and classifyId != 0'>
AND c.classify_id = #{classifyId}
</if>
<if test='null != bannerId and bannerId != 0'>
AND c.banner_id = #{bannerId}
</if>
<if test="classifyId == 0">
AND c.is_recommend = 1
</if>
<if test="over != null">
AND c.is_over = #{over}
</if>
<if test="isRecommend != null and isRecommend != -1">
AND c.course_id IN (SELECT course_id FROM course_details WHERE good = 1)
</if>
<if test="status != null and status != 0">
AND c.status = #{status}
</if>
<if test="isPrice != null">
AND c.is_price = #{isPrice}
</if>
<if test="wxCourse != null">
AND c.wx_course_id IS NOT NULL
</if>
<if test="dyCourse != null">
AND c.dy_status = 4
</if>
ORDER BY
c.sort ASC, c.create_time DESC;
<!--
SELECT
c.classify_id as classifyId,
c.course_id as courseId,
@@ -135,11 +38,11 @@
c.wx_show as wxShow,
c.dy_show as dyShow,
c.sort,
0 as goodNum,
round(10000*rand(),0) as goodNum,
(select count(*) from course_details d where d.course_id=c.course_id ) as courseDetailsCount,
null AS courseDetailsName,
null AS courseDetailsId,
0 as weekGoodNum,
round(10000*rand(),0) as weekGoodNum,
0 as isRecommend
FROM
course AS c
@@ -190,11 +93,8 @@
<if test="dyCourse!=null">
and c.dy_status=4
</if>
order by c.sort asc,c.create_time desc
分割线
<if test="sort==null">
order by c.sort asc
order by c.sort asc,c.create_time desc
</if>
<if test="sort!=null and sort==1">
order by goodNum desc
@@ -202,7 +102,6 @@
<if test="sort!=null and sort==2">
order by weekGoodNum desc
</if>
-->
</select>
<select id="selectCourseAdmin" resultType="Map">

View File

@@ -23,10 +23,12 @@
<select id="findByCourseIdNotUrl" resultType="com.sqx.modules.course.entity.CourseDetails">
select c.course_details_id as courseDetailsId,c.course_id as courseId,c.wx_course_details_id as wxCourseDetailsId,
c.course_details_name as courseDetailsName,c.create_time as createTime,
c.title_img as titleImg,c.content,c.good_num as goodNum,c.price,
if(c.is_price!=1,c.video_url,'') as videoUrl,
c.dy_episode_id as dyEpisodeId,c.advertising, c.view_count as viewCount, c.play_complete_count as playCompleteCount,
(select count(*) from course_collect cc where cc.user_id=#{userId} and cc.course_details_id=c.course_details_id and cc.classify=2) as isGood,
c.title_img as titleImg,c.content,c.good_num as goodNum,c.price
c.dy_episode_id as dyEpisodeId,c.advertising,
c.view_count as viewCount,
c.play_complete_count as playCompleteCount,
(select count(*) from course_collect cc where cc.user_id=#{userId} and cc.course_details_id=c.course_details_id and cc.classify=2) as isGood
from course_details c
where c.course_id=#{id} order by c.sort asc
</select>

View File

@@ -30,43 +30,15 @@
</select>
<select id="sumMoney" resultType="Double">
select sum(money) from cash_out where state =1
<if test="flag!=null and flag==1">
and date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
and date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
and date_format(create_at,'%Y')=date_format(#{time},'%Y')
</if>
select sum(money) from cash_out where state = 1 and create_at between #{start} and #{end}
</select>
<select id="countMoney" resultType="Integer">
select count(*) from cash_out where
<if test="flag!=null and flag==1">
date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
date_format(create_at,'%Y')=date_format(#{time},'%Y')
</if>
select count(*) from cash_out where create_at between #{start} and #{end}
</select>
<select id="stayMoney" resultType="Integer">
select count(*) from cash_out where
<if test="flag!=null and flag==1">
date_format(create_at,'%Y-%m-%d')=date_format(#{time},'%Y-%m-%d')
</if>
<if test="flag!=null and flag==2">
date_format(create_at,'%Y-%m')=date_format(#{time},'%Y-%m')
</if>
<if test="flag!=null and flag==3">
date_format(create_at,'%Y')=date_format(#{time},'%Y')
</if>
and state=0
select count(*) from cash_out where create_at between #{start} and #{end} and state=0
</select>
<select id="selectMayMoney" resultType="Double">