瀏覽代碼

Merge remote-tracking branch 'origin/master'

# Conflicts:
#	fs-service-system/src/main/resources/mapper/course/FsCourseWatchLogMapper.xml
zx 1 天之前
父節點
當前提交
f338c31bfc

+ 68 - 1
fs-service-system/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java

@@ -297,7 +297,74 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
 
     @Override
     public List<FsCourseWatchLogListVO> selectFsCourseWatchLogListVOexport(FsCourseWatchLogListParam param) {
-        return fsCourseWatchLogMapper.selectFsCourseWatchLogListVOexport(param);
+
+        List<FsCourseWatchLogListVO> list = fsCourseWatchLogMapper.selectFsCourseWatchLogListVOexport(param);
+        for (FsCourseWatchLogListVO item : list) {
+            // 项目
+            if(ObjectUtils.isNotNull(item.getProject())) {
+                String sysCourseProject = DictUtils.getDictLabel("sys_course_project", String.valueOf(item.getProject()));
+                if(StringUtils.isNotBlank(sysCourseProject)){
+                    item.setProjectName(sysCourseProject);
+                }
+            }
+            // 用户名
+            if(ObjectUtils.isNotNull(item.getUserId())) {
+                FsUser fsUser = fsUserCacheService.selectFsUserById(item.getUserId());
+                if(ObjectUtils.isNotNull(fsUser)){
+                    item.setUserName(String.format("%s_%d",fsUser.getNickname(),fsUser.getUserId()));
+                    item.setFsNickName(fsUser.getNickname());
+                    item.setFsAvatar(fsUser.getAvatar());
+                }
+            }
+            // 公司名
+            if(ObjectUtils.isNotNull(item.getCompanyId())){
+                Company company = companyCacheService.selectCompanyById(Long.valueOf(item.getCompanyId()));
+                if(ObjectUtils.isNotNull(company)){
+                    item.setCompanyName(String.format("%s_%d", company.getCompanyName(), company.getCompanyId()));
+                }
+            }
+
+            // 销售名
+            if(ObjectUtils.isNotNull(item.getCompanyUserId())){
+                CompanyUser companyUser = companyUserCacheService.selectCompanyUserById(item.getCompanyUserId());
+                if(ObjectUtils.isNotNull(companyUser)){
+                    item.setCompanyUserName(String.format("%s_%d", companyUser.getNickName(), companyUser.getUserId()));
+                }
+            }
+
+            // 课程
+            if(ObjectUtils.isNotNull(item.getCourseId())){
+                FsUserCourse course = fsUserCourseCacheService.selectFsUserCourseByCourseId(item.getCourseId());
+                if(ObjectUtils.isNotNull(course)){
+                    item.setCourseName(course.getCourseName());
+                }
+            }
+            // 小节
+            if(ObjectUtils.isNotNull(item.getVideoId())){
+                FsUserCourseVideo fsUserCourseVideo = fsUserCourseVideoCacheService.selectFsUserCourseVideoByVideoId(item.getVideoId());
+                if(ObjectUtils.isNotNull(fsUserCourseVideo)){
+                    item.setVideoName(fsUserCourseVideo.getTitle());
+                }
+            }
+
+            // 企微用户名
+            if(ObjectUtils.isNotNull(item.getQwUserId())){
+                String qwUserName = qwUserCacheService.queryQwUserNameByUserId(item.getQwUserId());
+                if(StringUtils.isNotBlank(qwUserName)){
+                    item.setQwUserName(qwUserName);
+                }
+            }
+
+            // 企微外部联系人
+            if(ObjectUtils.isNotNull(item.getQwExternalContactId())){
+                String qwExternalContactName = qwExternalContactCacheService.selectQwExternalContactById(item.getQwExternalContactId());
+                if(StringUtils.isNotBlank(qwExternalContactName)){
+                    item.setExternalUserName(qwExternalContactName);
+                }
+            }
+
+        }
+        return list;
     }
 
     @Override

+ 2 - 2
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreAfterSalesServiceImpl.java

@@ -606,7 +606,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService
                                 paymentMap.setPaymentId(payment.getPaymentId());
                                 paymentMap.setStatus(-1);
                                 paymentMap.setRefundTime(DateUtils.getNowDate());
-                                paymentMap.setRefundMoney(payment.getPayMoney());
+                                paymentMap.setRefundMoney(refundAmount);
                                 paymentService.updateFsStorePayment(paymentMap);
                             }
                             else {
@@ -626,7 +626,7 @@ public class FsStoreAfterSalesServiceImpl implements IFsStoreAfterSalesService
                         HuiFuRefundResult refund = huiFuService.refund(request);
                         logger.info("退款:"+refund);
                         if((refund.getResp_code().equals("00000000")||refund.getResp_code().equals("00000100"))&&(refund.getTrans_stat().equals("S")||refund.getTrans_stat().equals("P"))){
-                            payment.setRefundMoney(payment.getPayMoney());
+                            payment.setRefundMoney(refundAmount);
                             payment.setStatus(-1);
                             payment.setRefundTime(new Date());
                             paymentService.updateFsStorePayment(payment);

+ 4 - 1
fs-service-system/src/main/java/com/fs/store/service/impl/FsStoreOrderServiceImpl.java

@@ -584,11 +584,13 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             }
             else if(param.getPayType().equals("3")){
                 //货到付款
-                storeOrder.setStatus(1);
                 BigDecimal amount = param.getAmount();  //货到付款 自定义代收金额
                 if (amount != null && amount.compareTo(BigDecimal.ZERO) > 0){
+                    storeOrder.setStatus(0);
                     storeOrder.setPayMoney(amount);
                     storeOrder.setPayDelivery(storeOrder.getPayPrice().subtract(amount) );
+                } else {
+                    storeOrder.setStatus(1);
                 }
             }
             storeOrder.setOrderCreateType(param.getOrderCreateType());
@@ -682,6 +684,7 @@ public class FsStoreOrderServiceImpl implements IFsStoreOrderService
             }
             SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
             String payLimitTime = format.format(calendar.getTime() );
+            redisCache.setCacheObject("orderAmount:"+storeOrder.getId(), storeOrder.getPayMoney(), 24, TimeUnit.HOURS);//物流代收自定义金额
             //删除推荐订单KEY
             String createOrderKey = param.getCreateOrderKey();
             if(StringUtils.isNotEmpty(createOrderKey)){

+ 43 - 43
fs-service-system/src/main/resources/mapper/course/FsCourseWatchLogMapper.xml

@@ -133,74 +133,74 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
 
     <select id="selectFsCourseWatchLogListVOexport" resultType="com.fs.course.vo.FsCourseWatchLogListVO">
-        select l.log_id,
-        l.project as project,
-        l.user_id,uc.course_name,v.title as video_name,u.nickname as fsNickName, u.avatar as fsAvatar,
-        l.log_type,SEC_TO_TIME(l.duration) as duration,c.company_name,l.camp_period_time,l.finish_time,
-        cu.nick_name as company_user_name ,l.send_type,l.create_time,l.update_time,l.last_heartbeat_time,c.company_id
-        from fs_course_watch_log l
-        left join fs_user_course_video v on v.video_id = l.video_id
-        left join fs_user_course uc on uc.course_id = l.course_id
-        left join fs_user u on u.user_id = l.user_id
-        left join company_user cu on cu.user_id = l.company_user_id
-        left join company c on c.company_id = l.company_id
+        SELECT
+        log_id,
+        project AS project,
+        user_id,
+        log_type,
+        SEC_TO_TIME(duration) AS duration,
+        camp_period_time,
+        finish_time,
+        send_type,
+        create_time,
+        update_time,
+        last_heartbeat_time,
+        company_id,
+        company_user_id,
+        course_id,
+        video_id,
+        qw_user_id,
+        qw_external_contact_id
+        FROM
+        fs_course_watch_log
         <where>
-            <if test ='maps.userId !=null'>
-                and l.user_id = #{maps.userId}
-            </if>
-            <if test ='maps.qwExternalContactId !=null'>
-                and l.qw_external_contact_id = #{maps.qwExternalContactId}
-            </if>
-            <if test ='maps.qwUserId !=null'>
-                and l.qw_user_id = #{maps.qwUserId}
-            </if>
-            <if test ='maps.courseId !=null'>
-                and l.course_id = #{maps.courseId}
-            </if>
-            <if test ='maps.videoId !=null'>
-                and l.video_id = #{maps.videoId}
+            <if test='maps.userId != null'>
+                AND user_id = #{maps.userId}
             </if>
-            <if test ='maps.logType !=null'>
-                and l.log_type = #{maps.logType}
+            <if test='maps.courseId != null'>
+                AND course_id = #{maps.courseId}
             </if>
-            <if test ='maps.companyId !=null'>
-                and l.company_id = #{maps.companyId}
+            <if test='maps.videoId != null'>
+                AND video_id = #{maps.videoId}
             </if>
-            <if test ='maps.companyUserId !=null'>
-                and l.company_user_id = #{maps.companyUserId}
+            <if test='maps.logType != null'>
+                AND log_type = #{maps.logType}
             </if>
-            <if test ='maps.companyUserName !=null and maps.companyUserName!=""'>
-                and cu.nick_name  like concat('%', #{maps.companyUserName}, '%')
+            <if test='maps.companyId != null'>
+                AND company_id = #{maps.companyId}
             </if>
-            <if test ='maps.nickName !=null and maps.nickName!=""'>
-                and u.nick_name  like concat('%', #{maps.nickName}, '%')
+            <if test='maps.companyUserId != null'>
+                AND company_user_id = #{maps.companyUserId}
             </if>
             <if test= 'maps.sTime != null '>
-                and DATE(l.create_time) &gt;= DATE(#{maps.sTime})
+                and DATE(create_time) &gt;= DATE(#{maps.sTime})
             </if>
             <if test='maps.eTime != null '>
-                and DATE(l.create_time) &lt;= DATE(#{maps.eTime})
+                and DATE(create_time) &lt;= DATE(#{maps.eTime})
             </if>
             <if test= 'maps.scheduleStartTime != null '>
-                and DATE(l.camp_period_time) &gt;= DATE(#{maps.scheduleStartTime})
+                and DATE(camp_period_time) &gt;= DATE(#{maps.scheduleStartTime})
             </if>
             <if test='maps.scheduleEndTime != null '>
-                and DATE(l.camp_period_time) &lt;= DATE(#{maps.scheduleEndTime})
+                and DATE(camp_period_time) &lt;= DATE(#{maps.scheduleEndTime})
             </if>
             <if test= 'maps.upSTime != null '>
-                and DATE(l.update_time) &gt;= DATE(#{maps.upSTime})
+                and DATE(update_time) &gt;= DATE(#{maps.upSTime})
             </if>
             <if test='maps.upETime != null '>
-                and DATE(l.update_time) &lt;= DATE(#{maps.upETime})
+                and DATE(update_time) &lt;= DATE(#{maps.upETime})
+            </if>
+            <if test="maps.sourceType != null">
+                and send_type = #{maps.sourceType}
             </if>
             <if test="maps.sopIds != null and maps.sopIds.size() > 0">
-                and l.sop_id in
+                AND sop_id IN
                 <foreach item="sopId" index="index" collection="maps.sopIds" open="(" separator="," close=")">
                     #{sopId}
                 </foreach>
             </if>
         </where>
-        order by l.log_id desc
+        ORDER BY log_id DESC
     </select>
 
     <select id="selectFsCourseWatchLogListByParam" resultType="com.fs.course.vo.FsCourseWatchLogListVO">

+ 2 - 4
fs-service-system/src/main/resources/mapper/statis/ConsumptionBalanceMapper.xml

@@ -121,11 +121,10 @@
         </where>
     </select>
     <select id="queryRewardCount" resultType="java.lang.Long">
-        select count(*) from company_red_package_logs rpl
+        select count(*) from fs_course_red_packet_log rpl
             left join fs_course_watch_log log
             on rpl.watch_log_id=log.log_id
         <where>
-            rpl.operate_type=1
             <if test="startTime != null and endTime != null">
                 and rpl.create_time BETWEEN #{startTime} AND #{endTime}
             </if>
@@ -138,11 +137,10 @@
         </where>
     </select>
     <select id="queryRewardMoney" resultType="java.math.BigDecimal">
-        select sum(up_money) from company_red_package_logs rpl
+        select sum(rpl.amount) from fs_course_red_packet_log rpl
         left join fs_course_watch_log log
         on rpl.watch_log_id=log.log_id
         <where>
-            rpl.operate_type=1
             <if test="startTime != null and endTime != null">
                 and rpl.create_time BETWEEN #{startTime} AND #{endTime}
             </if>