Bladeren bron

Merge branch 'master' of http://1.14.104.71:10880/root/ylrz_his_scrm_java

caoliqin 2 weken geleden
bovenliggende
commit
89cdb8ed9b

+ 21 - 0
fs-service/src/main/java/com/fs/config/im/IMSystemConfig.java

@@ -0,0 +1,21 @@
+package com.fs.config.im;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @description: IM配置
+ * @author: Xgb
+ * @createDate: 2026/1/30
+ * @version: 1.0
+ */
+@Data
+public class IMSystemConfig implements Serializable {
+
+    // 离线推送 小米系统申请channel_id
+    private String xm_channel_id;
+
+    //离线推送 华为系统申请channel_id
+    private String hw_channel_id;
+}

+ 1 - 2
fs-service/src/main/java/com/fs/course/mapper/FsCourseRedPacketLogMapper.java

@@ -203,6 +203,5 @@ public interface FsCourseRedPacketLogMapper
 
     List<FsCourseRedPacketLog> selectFsCourseRedPacketLogListBySending(@Param("maps") Map<String, Object> map);
 
-    @MapKey("qwUserId")
-    Map<Long, FsCourseWatchLogStatisticsListVO> selectFsCourseRedPacketLogByQwUserIdList(@Param("param") FsCourseWatchLogStatisticsListParam param);
+    List<FsCourseWatchLogStatisticsListVO> selectFsCourseRedPacketLogByQwUserIdList(@Param("param") FsCourseWatchLogStatisticsListParam param);
 }

+ 1 - 1
fs-service/src/main/java/com/fs/course/mapper/FsCourseWatchLogMapper.java

@@ -225,7 +225,7 @@ public interface FsCourseWatchLogMapper extends BaseMapper<FsCourseWatchLog> {
             "</if> " +
             "from (" +
             "SELECT \n" +
-            "o.video_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time," +
+            "o.video_id,o.course_id,o.company_id,o.qw_user_id,DATE(o.create_time) create_time," +
             "<if test= 'sendType != 1 '> " +
             " qu.qw_user_name qw_user_name," +
             "</if>\n" +

+ 14 - 3
fs-service/src/main/java/com/fs/course/service/impl/FsCourseWatchLogServiceImpl.java

@@ -768,11 +768,22 @@ public class FsCourseWatchLogServiceImpl extends ServiceImpl<FsCourseWatchLogMap
     public List<FsCourseWatchLogStatisticsListVO> selectFsCourseWatchLogStatisticsListVO(FsCourseWatchLogStatisticsListParam param) {
         if (param.getUserIds() != null && !param.getUserIds().isEmpty())param.setUserIds(param.getUserIds());
         List<FsCourseWatchLogStatisticsListVO> statisticsListVOS = fsCourseWatchLogMapper.selectFsCourseWatchLogStatisticsListVO(param);
-        Map<Long,FsCourseWatchLogStatisticsListVO> redAmountMap = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByQwUserIdList(param);
+        Map<String, FsCourseWatchLogStatisticsListVO> redAmountMap = new HashMap<>();
+        List<FsCourseWatchLogStatisticsListVO> redPacketLogs = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByQwUserIdList(param);
+        for (FsCourseWatchLogStatisticsListVO log : redPacketLogs) {
+            // 空值校验
+            if (log.getQwUserId() != null && log.getVideoId() != null) {
+                String key = log.getQwUserId() + "_" + log.getVideoId() + "_" + log.getCreateTime();
+                redAmountMap.put(key, log);
+            }
+        }
         statisticsListVOS.forEach(vo ->{
-            FsCourseWatchLogStatisticsListVO statisticsListVO = redAmountMap.get(vo.getQwUserId());
+            FsCourseWatchLogStatisticsListVO statisticsListVO = redAmountMap.get(vo.getQwUserId() + "_" + vo.getVideoId() + "_" + vo.getCreateTime());
             if(statisticsListVO != null){
-                if(statisticsListVO.getQwUserId().equals(vo.getQwUserId()) && statisticsListVO.getCreateTime().equals(vo.getCreateTime())){
+                if(statisticsListVO.getCourseId().equals(vo.getCourseId()) &&
+                        statisticsListVO.getVideoId().equals(vo.getVideoId()) &&
+                        statisticsListVO.getQwUserId().equals(vo.getQwUserId()) &&
+                        statisticsListVO.getCreateTime().equals(vo.getCreateTime())){
                     vo.setRedAmount(statisticsListVO.getRedAmount());
                 }
             }

+ 5 - 5
fs-service/src/main/java/com/fs/course/service/impl/FsUserCourseVideoServiceImpl.java

@@ -1050,11 +1050,11 @@ public class FsUserCourseVideoServiceImpl extends ServiceImpl<FsUserCourseVideoM
         log.setQwUserId(Long.valueOf(param.getQwUserId()));
         log.setCreateTime(new Date());
         log.setLogType(3);
-       if(param.getTypeFlag()==1){
-           log.setWatchType(1);
-       }else {
-           log.setWatchType(2);
-       }
+        if (param != null && param.getTypeFlag() != null && param.getTypeFlag() == 1) {
+            log.setWatchType(1);
+        } else {
+            log.setWatchType(2);
+        }
         logger.info("【群聊生成看课记录】:{}", param);
         courseWatchLogMapper.insertFsCourseWatchLog(log);
     }

+ 23 - 2
fs-service/src/main/java/com/fs/gtPush/service/impl/uniPush2ServiceImpl.java

@@ -11,6 +11,8 @@ import com.fs.common.utils.DateUtils;
 import com.fs.common.utils.StringUtils;
 import com.fs.company.domain.CompanyUser;
 import com.fs.company.mapper.CompanyUserMapper;
+import com.fs.config.im.IMSystemConfig;
+import com.fs.course.config.CourseConfig;
 import com.fs.gtPush.domain.PushReqBean;
 import com.fs.gtPush.domain.PushResult;
 import com.fs.gtPush.domain.UniPushLog;
@@ -53,6 +55,9 @@ public class uniPush2ServiceImpl implements uniPush2Service {
     @Autowired
     private CompanyUserMapper companyUserMapper;
 
+    @Autowired
+    private IMConfig imConfig;
+
     @Override
     public PushResult pushMessage(PushReqBean push) {
         SysConfig config = iSysConfigService.selectConfigByConfigKey("his.config");
@@ -92,6 +97,10 @@ public class uniPush2ServiceImpl implements uniPush2Service {
             if (param.getPayload() == null) {
                 param.setPayload(new HashMap<>());
             }
+
+            if(imJsonString.length()>100){
+                imJsonString="";
+            }
             param.getPayload().put("url", purl);
             if (StringUtils.isNotBlank(imJsonString)) {
                 param.getPayload().put("extra", imJsonString);
@@ -110,9 +119,13 @@ public class uniPush2ServiceImpl implements uniPush2Service {
             Map<String, Object> options = new HashMap<>();
             Map<String, Object> android = new HashMap<>();
 
+
+            String json = iSysConfigService.selectConfigByKey("im.config");
+            IMSystemConfig config = JSONUtil.toBean(json, IMSystemConfig.class);
             // 小米
             Map<String, Object> xm = new HashMap<>();
-            xm.put("/extra.channel_id", "133892");
+            xm.put("/extra.channel_id", config.getXm_channel_id());
+
             xm.put("/extra.notify_foreground", true);
             android.put("XM", xm);
 
@@ -246,6 +259,11 @@ public class uniPush2ServiceImpl implements uniPush2Service {
             return null;
         }
 
+        if(imJsonString.length()>100 ){
+            // 报文总共只能传 4096 长度
+            imJsonString="";
+        }
+
         // payload
         Map<String, Object> payload = new HashMap<>();
         if (StringUtils.isNotBlank(purl)) {
@@ -266,9 +284,12 @@ public class uniPush2ServiceImpl implements uniPush2Service {
         // options.android
         Map<String, Object> android = new HashMap<>();
 
+        String json = iSysConfigService.selectConfigByKey("im.config");
+        IMSystemConfig config = JSONUtil.toBean(json, IMSystemConfig.class);
+
         // 小米
         Map<String, Object> xm = new HashMap<>();
-        xm.put("/extra.channel_id", "133892");
+        xm.put("/extra.channel_id", config.getXm_channel_id());
         android.put("XM", xm);
 
         // OPPO

+ 10 - 1
fs-service/src/main/java/com/fs/hisStore/service/impl/FsStoreOrderScrmServiceImpl.java

@@ -3629,7 +3629,16 @@ public class FsStoreOrderScrmServiceImpl implements IFsStoreOrderScrmService {
 
     @Override
     public List<OrderStatisticsVo> selectZDYOrderSaleStatisticsList(OrderStatisticsParam param) {
-        return fsStoreOrderMapper.selectZDYOrderSaleStatisticsList(param);
+        List<OrderStatisticsVo> vos = fsStoreOrderMapper.selectZDYOrderSaleStatisticsList(param);
+        if (!CollectionUtils.isEmpty(vos)) {
+            for (OrderStatisticsVo vo : vos) {
+                BigDecimal tNum = NumberUtil.sub(vo.getTotalNum(), NumberUtil.add(vo.getSignForNum(), vo.getChargebackNum()));
+                vo.setTransitNum(tNum.longValue());
+                BigDecimal tPrice = NumberUtil.sub(vo.getTotalPrice(), NumberUtil.add(vo.getChargebackPrice(), vo.getSignFPrice()));
+                vo.setTransitPrice(tPrice);
+            }
+        }
+        return vos;
     }
 
     @Override

+ 18 - 0
fs-service/src/main/java/com/fs/hisStore/vo/OrderStatisticsVo.java

@@ -147,4 +147,22 @@ public class OrderStatisticsVo implements Serializable {
      * 企业ID
      * **/
     private Long companyId;
+
+    /**
+     * 结算金额(郑多燕 已完成 代收+实收)
+     */
+    @Excel(name = "结算金额", sort = 18, width = 20)
+    private BigDecimal settlementPrice;
+
+    /**
+     * 在途订单数量
+     */
+    @Excel(name = "在途订单数量", sort = 19, width = 20)
+    private Long transitNum;
+
+    /**
+     * 在途订单金额
+     */
+    @Excel(name = "在途订单金额", sort = 20, width = 20)
+    private BigDecimal transitPrice;
 }

+ 1 - 1
fs-service/src/main/resources/application-config-druid-mengniu.yml

@@ -42,7 +42,7 @@ wx:
       port: 6379
       timeout: 2000
     configs:
-      - appId: wx0e0e0a27e97af833 # 第一个公众号的appid 舒康医药
+      - appId: wx0e0e0a27e97af833 # 第一个公众号的appid JL舒康
         secret: bc63323ab44a4ededd93a53e43a77c0e # 公众号的appsecret
         token: PPKOdAlCoMO # 接口配置里的Token值
         aesKey: Eswa6VjwtVcw03qZy6Wllgrv5aytIA1SZPEU0kU2 # 接口配置里的EncodingAESKey值

+ 1 - 1
fs-service/src/main/resources/application-config-zlwh.yml

@@ -127,7 +127,7 @@ watch:
   password3: v9xsKuqn_$d2y
 
 fs:
-  commonApi: http://172.21.76.167:8010
+  commonApi: http://127.0.0.1:7771
   jwt:
     # 加密秘钥
     secret: e10tdr3949fa43abbe56e057f2fd883e

+ 6 - 6
fs-service/src/main/resources/application-druid-mengniu.yml

@@ -43,12 +43,12 @@ spring:
                 master:
                     url: jdbc:mysql://192.168.0.251:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
-                    password: Ylrztek250218!3@.
+                    password: Ylrztekmn250218!3@.
                 # 从库数据源
                 slave:
                     url: jdbc:mysql://192.168.0.251:3306/fs_his?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
-                    password: Ylrztek250218!3@.
+                    password: Ylrztekmn250218!3@.
                 # 初始连接数
                 initialSize: 5
                 # 最小连接池数量
@@ -96,11 +96,11 @@ spring:
                 master:
                     url: jdbc:mysql://192.168.0.251:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
-                    password: Ylrztek250218!3@.
+                    password: Ylrztekmn250218!3@.
                 read:
                     url: jdbc:mysql://192.168.0.251:3306/sop?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=true&serverTimezone=GMT%2B8
                     username: root
-                    password: Ylrztek250218!3@.
+                    password: Ylrztekmn250218!3@.
                 # 初始连接数
                 initialSize: 5
                 # 最小连接池数量
@@ -173,6 +173,6 @@ openIM:
 im:
     type: NONE
 #是否为新商户,新商户不走mpOpenId
-isNewWxMerchant: false
+isNewWxMerchant: true
 
-enableRedPackAccount: 1
+enableRedPackAccount: 0

+ 1 - 1
fs-service/src/main/resources/application-druid-zlwh.yml

@@ -153,7 +153,7 @@ openIM:
 im:
     type: NONE
 #是否为新商户,新商户不走mpOpenId
-isNewWxMerchant: false
+isNewWxMerchant: true
 qw:
     enableAutoTag: 1
 tag:

+ 17 - 5
fs-service/src/main/resources/mapper/course/FsCourseRedPacketLogMapper.xml

@@ -276,17 +276,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </choose>
 
     </select>
-    <select id="selectFsCourseRedPacketLogByQwUserIdList" resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
-        select qw_user_id qwUserId, sum(amount) as redAmount,date_format(create_time,'%Y-%m-%d') createTime from fs_course_red_packet_log
+    <select id="selectFsCourseRedPacketLogByQwUserIdList"
+            resultType="com.fs.course.vo.FsCourseWatchLogStatisticsListVO">
+        select f1.qw_user_id qwUserId,f1.video_id videoId,f1.course_id courseId,f1.user_id userId,sum(f1.amount) as redAmount,
+         date_format(f1.create_time,'%Y-%m-%d') createTime from fs_course_red_packet_log f1
+        left join fs_course_watch_log f2 on f1.user_id = f2.user_id and f1.video_id = f2.video_id
         <where>
             <if test="param.companyId != null">
-                and company_id = #{param.companyId}
+                and f1.company_id = #{param.companyId}
             </if>
             <if test=" param.sTime != null and  param.eTime != null">
-                AND date_format(create_time,'%Y-%m-%d') &gt;=  date_format(#{param.sTime},'%Y-%m-%d') and date_format(create_time,'%Y-%m-%d') &lt;= date_format(#{param.eTime},'%Y-%m-%d')
+                AND date_format(f1.create_time,'%Y-%m-%d') &gt;=  date_format(#{param.sTime},'%Y-%m-%d') and date_format(f1.create_time,'%Y-%m-%d') &lt;= date_format(#{param.eTime},'%Y-%m-%d')
+            </if>
+            <if test ='param.courseId !=null'>
+                and f1.course_id = #{param.courseId}
+            </if>
+            <if test ='param.qwSopId !=null and param.qwSopId!=""'>
+                and f2.sop_id = #{param.qwSopId}
+            </if>
+            <if test ='param.videoId !=null'>
+                and f1.video_id = #{param.videoId}
             </if>
         </where>
-        group by qw_user_id,date_format(create_time,'%Y-%m-%d')
+        group by f1.qw_user_id,f1.video_id,f1.course_id,date_format(f1.create_time,'%Y-%m-%d')
     </select>
 
 

+ 30 - 0
fs-user-app/src/main/java/com/fs/app/controller/game/PlayerController.java

@@ -0,0 +1,30 @@
+package com.fs.app.controller.game;
+
+import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.fs.app.annotation.Login;
+import com.fs.common.core.domain.R;
+import com.fs.his.domain.FsUser;
+import com.fs.his.service.IFsUserService;
+import io.swagger.annotations.ApiOperation;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+@RestController
+@RequestMapping("/player")
+public class PlayerController {
+
+    @Autowired
+    private IFsUserService fsUserService;
+
+    @Login
+    @PostMapping("/updateCurrency")
+    @ApiOperation("玩家货币更新")
+    public R updateCurrency(@RequestBody FsUser player){
+        Boolean  flag=fsUserService.updateFsUser(player)>0;
+        return R.ok().put("flag",flag);
+    }
+
+}