goupan
2024-04-29 727d4605fd6826ee9078553b5c7626b7803629d8
修复改出的问题
15个文件已修改
1个文件已添加
268 ■■■■ 已修改文件
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/dto/MentalTestMyTestOrderDTO.java 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/dto/MentalTestMyTestRecordTopicDTO.java 79 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/dto/MentalTestMyTestTopicDTO.java 28 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/MentalAnalysisTimeConfigMapper.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/MentalTestRecordMapper.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/mapping/MentalAnalysisTimeConfigMapper.xml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/mapping/MentalAppointmentMapper.xml 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/mapping/MentalTestRecordMapper.xml 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/IMentalAnalysisTimeConfigService.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/IMentalTestRecordService.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/MentalAnalysisTimeConfigServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/MentalAppointmentServiceImpl.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/MentalTestRecordServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rest/src/main/java/cn/stylefeng/rest/modular/user/controller/MyMentalTestController.java 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
rest/src/main/java/cn/stylefeng/rest/modular/work/MentalAppointmentWork.java 31 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
roses/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/enums/PayTypeEnum.java 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/dto/MentalTestMyTestOrderDTO.java
@@ -52,10 +52,6 @@
    @ChineseDescription("咨询费用")
    private BigDecimal consultAmount;
    @ApiModelProperty(value = "是否购买")
    @ChineseDescription("是否购买")
    private Boolean payFlag;
    @ApiModelProperty(value = "测试人数")
    @ChineseDescription("测试人数")
    private Integer testPeopleNum;
@@ -64,4 +60,16 @@
    @ChineseDescription("测试配置人数")
    private Integer testSetNum;
    @ApiModelProperty(value = "是否后台创建")
    @ChineseDescription("是否后台创建")
    private Boolean isBack;
    @ApiModelProperty(value = "是否测试")
    @ChineseDescription("是否测试")
    private Boolean testFlag;
    @ApiModelProperty(value = "是否购买")
    @ChineseDescription("是否购买")
    private Boolean payFlag;
}
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/dto/MentalTestMyTestRecordTopicDTO.java
New file
@@ -0,0 +1,79 @@
package cn.stylefeng.guns.modular.business.dto;
import cn.stylefeng.guns.modular.business.entity.MentalTestRecord;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
@Data
@ApiModel(value = "我的测试记录-响应参数")
public class MentalTestMyTestRecordTopicDTO extends MentalTestRecord {
    @ApiModelProperty(value = "题库ID")
    @ChineseDescription("题库ID")
    private Long topicId;
    @ApiModelProperty(value = "状态:1正常,2冻结")
    @ChineseDescription("状态:1正常,2冻结")
    private Integer topicStatus;
    @ApiModelProperty(value = "状态:1正常,2冻结")
    @ChineseDescription("状态:1正常,2冻结")
    private Integer statusFlag;
    @ApiModelProperty(value = "标题")
    @ChineseDescription("标题")
    private String title;
    @ApiModelProperty(value = "分类")
    @ChineseDescription("分类")
    private String classId;
    @ApiModelProperty(value = "简介")
    @ChineseDescription("简介")
    private String intro;
    @ApiModelProperty(value = "图片")
    @ChineseDescription("图片")
    private String image;
    @ApiModelProperty(value = "测试类型:0免费,1付费")
    @ChineseDescription("测试类型:0免费,1付费")
    private Integer testType;
    @ApiModelProperty(value = "测试费用")
    @ChineseDescription("测试费用")
    private BigDecimal testAmount;
    @ApiModelProperty(value = "咨询1V1,0无,1有")
    @ChineseDescription("咨询1V1,0无,1有")
    private Integer consultOne;
    @ApiModelProperty(value = "咨询费用")
    @ChineseDescription("咨询费用")
    private BigDecimal consultAmount;
    @ApiModelProperty(value = "是否后台创建")
    @ChineseDescription("是否后台创建")
    private Boolean isBack;
    @ApiModelProperty(value = "是否测试")
    @ChineseDescription("是否测试")
    private Boolean testFlag;
    @ApiModelProperty(value = "是否购买")
    @ChineseDescription("是否购买")
    private Boolean payFlag;
    @ApiModelProperty(value = "测试人数")
    @ChineseDescription("测试人数")
    private Integer testPeopleNum;
    @ApiModelProperty(value = "测试配置人数")
    @ChineseDescription("测试配置人数")
    private Integer testSetNum;
}
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/dto/MentalTestMyTestTopicDTO.java
@@ -1,6 +1,6 @@
package cn.stylefeng.guns.modular.business.dto;
import cn.stylefeng.guns.modular.business.entity.MentalTestRecord;
import cn.stylefeng.guns.modular.business.entity.OrderMentalTest;
import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -10,7 +10,11 @@
@Data
@ApiModel(value = "我的测试-响应参数")
public class MentalTestMyTestTopicDTO extends MentalTestRecord {
public class MentalTestMyTestTopicDTO extends OrderMentalTest {
    @ApiModelProperty(value = "心理测试记录ID")
    @ChineseDescription("心理测试记录ID")
    private Long mentalTestRecordId;
    @ApiModelProperty(value = "题库ID")
    @ChineseDescription("题库ID")
@@ -19,10 +23,6 @@
    @ApiModelProperty(value = "状态:1正常,2冻结")
    @ChineseDescription("状态:1正常,2冻结")
    private Integer topicStatus;
    @ApiModelProperty(value = "状态:1正常,2冻结")
    @ChineseDescription("状态:1正常,2冻结")
    private Integer statusFlag;
    @ApiModelProperty(value = "标题")
    @ChineseDescription("标题")
@@ -56,6 +56,14 @@
    @ChineseDescription("咨询费用")
    private BigDecimal consultAmount;
    @ApiModelProperty(value = "测试人数")
    @ChineseDescription("测试人数")
    private Integer testPeopleNum;
    @ApiModelProperty(value = "测试配置人数")
    @ChineseDescription("测试配置人数")
    private Integer testSetNum;
    @ApiModelProperty(value = "是否后台创建")
    @ChineseDescription("是否后台创建")
    private Boolean isBack;
@@ -67,13 +75,5 @@
    @ApiModelProperty(value = "是否购买")
    @ChineseDescription("是否购买")
    private Boolean payFlag;
    @ApiModelProperty(value = "测试人数")
    @ChineseDescription("测试人数")
    private Integer testPeopleNum;
    @ApiModelProperty(value = "测试配置人数")
    @ChineseDescription("测试配置人数")
    private Integer testSetNum;
}
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/MentalAnalysisTimeConfigMapper.java
@@ -20,6 +20,6 @@
    Page<MentalAnalysisTimeConfigPageDTO> getWorkerPage(@Param("page") Page<Object> page, @Param("nickName") String nickName);
    List<MentalAnalysisTimeConfig> getWorkerListByAppointmentTime(@Param("mentalAnalysisStatus") Integer mentalAnalysisStatus, @Param("weekDay") Integer weekDay, @Param("appointmentDay") String appointmentDay, @Param("beginTimePoint") String beginTimePoint, @Param("endTimePoint") String endTimePoint);
    List<MentalAnalysisTimeConfig> getWorkerListByAppointmentTime(@Param("workStatus") Integer workStatus, @Param("mentalAnalysisStatus") Integer mentalAnalysisStatus, @Param("weekDay") Integer weekDay, @Param("appointmentDay") String appointmentDay, @Param("beginTimePoint") String beginTimePoint, @Param("endTimePoint") String endTimePoint);
}
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/MentalTestRecordMapper.java
@@ -1,6 +1,7 @@
package cn.stylefeng.guns.modular.business.mapper;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestOrderDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestRecordTopicDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestRecordPageDTO;
import cn.stylefeng.guns.modular.business.entity.MentalTestRecord;
@@ -22,7 +23,7 @@
    List<MentalTestMyTestTopicDTO> myTestTopic(@Param("userId") Long userId, @Param("topicId") Long topicId);
    List<MentalTestMyTestTopicDTO> myTestRecordTopicByMentalAppointmentId(@Param("mentalAppointmentId") Long mentalAppointmentId, @Param("mentalAppointmentIdList") List<Long> mentalAppointmentIdList);
    List<MentalTestMyTestRecordTopicDTO> myTestRecordTopicByMentalAppointmentId(@Param("mentalAppointmentId") Long mentalAppointmentId, @Param("mentalAppointmentIdList") List<Long> mentalAppointmentIdList);
    List<MentalTestMyTestOrderDTO> myTestOrder(@Param("userId") Long userId, @Param("topicId") Long topicId);
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/mapping/MentalAnalysisTimeConfigMapper.xml
@@ -24,9 +24,11 @@
        FROM
            t_mental_analysis_time_config tc
            LEFT JOIN toc_customer u ON tc.counselling_info_id = u.customer_id
            LEFT JOIN t_counselling_special_time_config stc ON stc.counselling_info_id = u.customer_id
        <where>
            AND u.status_flag = 1
            <if test="workStatus != null">
                AND u.work_status = #{workStatus}
            </if>
            <if test="mentalAnalysisStatus != null">
                AND u.mental_analysis_status = #{mentalAnalysisStatus}
            </if>
@@ -41,7 +43,7 @@
            </if>
            <if test="appointmentDay != null and appointmentDay != ''">
                AND u.customer_id NOT IN (
                    SELECT counselling_info_id FROM t_counselling_special_time_config stc
                    SELECT counselling_info_id FROM t_mental_analysis_special_time_config stc
                    WHERE stc.special_day <![CDATA[ <> ]]> #{appointmentDay} AND stc.is_cancel_day = 1
            )
            </if>
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/mapping/MentalAppointmentMapper.xml
@@ -44,7 +44,8 @@
        FROM
            t_mental_appointment o
            LEFT JOIN toc_customer wu ON o.worker_id = wu.customer_id
        <where> AND o.is_delete = 0
        <where>
            o.`type` is null AND o.is_delete = 0
            <if test="counsellingInfoId != null">
                AND o.worker_id = #{counsellingInfoId}
            </if>
@@ -81,6 +82,7 @@
        SELECT * FROM t_mental_appointment o
        LEFT JOIN toc_customer tw ON tw.customer_id = o.worker_id
        <where>
            o.`type` is null
            <if test="userId != null">
                AND o.user_id = #{userId}
            </if>
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/mapper/mapping/MentalTestRecordMapper.xml
@@ -3,6 +3,71 @@
<mapper namespace="cn.stylefeng.guns.modular.business.mapper.MentalTestRecordMapper">
    <select id="myTestTopic" resultType="cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO">
        (SELECT omt.id          AS id,
                omt.order_no    AS orderNo,
                o.id            AS mentalTestRecordId,
                o.create_time   AS createTime,
                omt.status_flag AS statusFlag,
                omt.is_back     AS isBack,
                omt.test_flag   AS testFlag,
                tt.id           AS topicId,
                tt.status_flag  AS topicStatus,
                tt.title,
                tt.class_id,
                tt.intro,
                tt.image,
                tt.test_type,
                tt.test_amount,
                tt.consult_one,
                tt.consult_amount,
                tt.test_people_num,
                tt.test_set_num
        FROM t_mental_test_record o
            LEFT JOIN t_order_mental_test omt ON o.answer_no = omt.order_no
            LEFT JOIN t_mental_test_topic tt ON o.topic_id = tt.id
        <where>
            <if test="userId != null">
                AND o.user_id = #{userId}
            </if>
            <if test="topicId != null">
                AND o.topic_id = #{topicId}
            </if>
        </where>
        )
        UNION ALL
        (SELECT o.id           AS id,
                o.order_no     AS orderNo,
                NULL           AS mentalTestRecordId,
                o.create_time  AS createTime,
                o.status_flag  AS statusFlag,
                o.is_back      AS isBack,
                o.test_flag    AS testFlag,
                tt.id          AS topicId,
                tt.status_flag AS topicStatus,
                tt.title,
                tt.class_id,
                tt.intro,
                tt.image,
                tt.test_type,
                tt.test_amount,
                tt.consult_one,
                tt.consult_amount,
                tt.test_people_num,
                tt.test_set_num
        FROM t_order_mental_test o
            LEFT JOIN t_mental_test_topic tt ON o.goods_id = tt.id
        <where> order_no NOT IN (SELECT answer_no FROM t_mental_test_record)
            AND o.status_flag = 1
            <if test="userId != null">
                AND o.user_id = #{userId}
            </if>
            <if test="topicId != null">
                AND o.topic_id = #{topicId}
            </if>
        </where>
        )
    </select>
    <!--<select id="myTestTopic" resultType="cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO">
        SELECT
            o.*,
            tt.status_flag topicStatus,
@@ -28,9 +93,9 @@
            </if>
        </where>
        ORDER BY o.create_time DESC
    </select>
    </select>-->
    <select id="myTestRecordTopicByMentalAppointmentId" resultType="cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO">
    <select id="myTestRecordTopicByMentalAppointmentId" resultType="cn.stylefeng.guns.modular.business.dto.MentalTestMyTestRecordTopicDTO">
        SELECT
            o.*,
            tt.status_flag topicStatus,
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/IMentalAnalysisTimeConfigService.java
@@ -26,6 +26,6 @@
    void editTimeConfig(MentalAnalysisTimeConfigAddUpdateRequest req);
    List<MentalAnalysisTimeConfig> getWorkerListByAppointmentTime(Integer mentalAnalysisStatus, Integer weekDay, String appointmentDay, String beginTimePoint, String endTimePoint);
    List<MentalAnalysisTimeConfig> getWorkerListByAppointmentTime(Integer workStatus, Integer mentalAnalysisStatus, Integer weekDay, String appointmentDay, String beginTimePoint, String endTimePoint);
}
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/IMentalTestRecordService.java
@@ -1,6 +1,7 @@
package cn.stylefeng.guns.modular.business.service;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestOrderDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestRecordTopicDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestRecordPageDTO;
import cn.stylefeng.guns.modular.business.entity.MentalTestRecord;
@@ -27,12 +28,12 @@
    List<MentalTestMyTestTopicDTO> myTestTopic(Long userId, Long topicId);
    /**
     * 我的测试(含题库信息)
     * 我的测试记录(含题库信息)
     * @param mentalAppointmentId
     * @param mentalAppointmentIdList
     * @return
     */
    List<MentalTestMyTestTopicDTO> myTestRecordTopicByMentalAppointmentId(Long mentalAppointmentId, List<Long> mentalAppointmentIdList);
    List<MentalTestMyTestRecordTopicDTO> myTestRecordTopicByMentalAppointmentId(Long mentalAppointmentId, List<Long> mentalAppointmentIdList);
    /**
     * 我的测试(订单)
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/MentalAnalysisTimeConfigServiceImpl.java
@@ -82,8 +82,8 @@
    }
    @Override
    public List<MentalAnalysisTimeConfig> getWorkerListByAppointmentTime(Integer mentalAnalysisStatus, Integer weekDay, String appointmentDay, String beginTimePoint, String endTimePoint) {
        return this.baseMapper.getWorkerListByAppointmentTime(mentalAnalysisStatus, weekDay, appointmentDay, beginTimePoint, endTimePoint);
    public List<MentalAnalysisTimeConfig> getWorkerListByAppointmentTime(Integer workStatus, Integer mentalAnalysisStatus, Integer weekDay, String appointmentDay, String beginTimePoint, String endTimePoint) {
        return this.baseMapper.getWorkerListByAppointmentTime(workStatus, mentalAnalysisStatus, weekDay, appointmentDay, beginTimePoint, endTimePoint);
    }
}
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/MentalAppointmentServiceImpl.java
@@ -26,7 +26,6 @@
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
@@ -157,6 +156,7 @@
        // 获取预约时段有服务的分析师(不可预约)
        List<MentalAppointment> sameTimeAppointmentList = mentalAppointmentService.list(
                Wrappers.<MentalAppointment>lambdaQuery()
                        .isNull(MentalAppointment::getType)
                        .eq(MentalAppointment::getAppointmentDay, appointmentDayYmd)
                        .eq(MentalAppointment::getBeginTimePoint, beginTimePoint)
                        .eq(MentalAppointment::getEndTimePoint, endTimePoint).ne(MentalAppointment::getType,1)
@@ -185,7 +185,7 @@
        // 获取当前星期
        Integer weekDay = DateUtil.dayOfWeekEnum(appointmentDay).getIso8601Value();
        // 预约时间段配置匹配的性格分析师
        List<MentalAnalysisTimeConfig> eqWorkerTimeConfigList = mentalAnalysisTimeConfigService.getWorkerListByAppointmentTime(CustomerMentalAnalysisStatusEnum.ON_WORK.getCode(), weekDay, appointmentDayYmd, beginTimePoint, endTimePoint);
        List<MentalAnalysisTimeConfig> eqWorkerTimeConfigList = mentalAnalysisTimeConfigService.getWorkerListByAppointmentTime(CustomerWorkStatusEnum.ON_WORK.getCode(), CustomerMentalAnalysisStatusEnum.ON_WORK.getCode(), weekDay, appointmentDayYmd, beginTimePoint, endTimePoint);
        // 分析师ID(预约时间段配置匹配)
        List<Long> eqWorkerIdByTimeConfigList = eqWorkerTimeConfigList.isEmpty() ? Collections.singletonList(0L) :
                eqWorkerTimeConfigList.stream()
common-buiness/src/main/java/cn/stylefeng/guns/modular/business/service/impl/MentalTestRecordServiceImpl.java
@@ -1,6 +1,7 @@
package cn.stylefeng.guns.modular.business.service.impl;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestOrderDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestRecordTopicDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestRecordPageDTO;
import cn.stylefeng.guns.modular.business.entity.MentalTestRecord;
@@ -29,7 +30,7 @@
        return this.baseMapper.myTestTopic(userId, topicId);
    }
    @Override
    public List<MentalTestMyTestTopicDTO> myTestRecordTopicByMentalAppointmentId(Long mentalAppointmentId, List<Long> mentalAppointmentIdList) {
    public List<MentalTestMyTestRecordTopicDTO> myTestRecordTopicByMentalAppointmentId(Long mentalAppointmentId, List<Long> mentalAppointmentIdList) {
        return this.baseMapper.myTestRecordTopicByMentalAppointmentId(mentalAppointmentId, mentalAppointmentIdList);
    }
rest/src/main/java/cn/stylefeng/rest/modular/user/controller/MyMentalTestController.java
@@ -121,13 +121,7 @@
        return new SuccessResponseData(list.stream().map(o -> {
            // 是否后台创建
            o.setIsBack(orderMentalTestAll.stream().filter(oo -> oo.getOrderNo().equals(o.getAnswerNo()) && oo.getIsBack()).findFirst().map(OrderMentalTest::getIsBack).orElse(false));
            // 是否测试
            o.setTestFlag(mentalTestResultAll.stream().filter(oo -> oo.getTopicId().equals(o.getTopicId())).findFirst().isPresent());
            // 是否购买
            o.setPayFlag(orderMentalTestAll.stream().filter(oo -> oo.getGoodsId().equals(o.getTopicId())).findFirst().isPresent());
            o.setIsBack(orderMentalTestAll.stream().filter(oo -> oo.getOrderNo().equals(o.getOrderNo()) && oo.getIsBack()).findFirst().map(OrderMentalTest::getIsBack).orElse(false));
            return o;
        }).collect(Collectors.toList()));
rest/src/main/java/cn/stylefeng/rest/modular/work/MentalAppointmentWork.java
@@ -1,42 +1,27 @@
package cn.stylefeng.rest.modular.work;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.core.date.DateTime;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.ObjUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.json.JSONUtil;
import cn.stylefeng.guns.modular.business.dto.CounsellinginfoResponseDTO;
import cn.stylefeng.guns.modular.business.dto.CourseResponseDTO;
import cn.stylefeng.guns.modular.business.dto.ImPushDataDTO;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO;
import cn.stylefeng.guns.modular.business.entity.*;
import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestRecordTopicDTO;
import cn.stylefeng.guns.modular.business.entity.MentalAppointment;
import cn.stylefeng.guns.modular.business.service.*;
import cn.stylefeng.guns.modular.business.service.impl.ImBizService;
import cn.stylefeng.roses.kernel.auth.api.context.LoginContext;
import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi;
import cn.stylefeng.roses.kernel.customer.modular.entity.Customer;
import cn.stylefeng.roses.kernel.customer.modular.service.CustomerService;
import cn.stylefeng.roses.kernel.db.api.factory.PageFactory;
import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory;
import cn.stylefeng.roses.kernel.rule.enums.*;
import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
@@ -207,26 +192,26 @@
        );
        // 我的测试(含题库信息)
        List<MentalTestMyTestTopicDTO> myTestRecordTopicList = new ArrayList<>();
        List<MentalTestMyTestRecordTopicDTO> myTestRecordTopicList = new ArrayList<>();
        if (CollUtil.isNotEmpty(mentalAppointmentList)) {
            myTestRecordTopicList = mentalTestRecordService.myTestRecordTopicByMentalAppointmentId(null, mentalAppointmentList.stream().map(MentalAppointment::getId).collect(Collectors.toList()));
        }
        for (MentalAppointment o : mentalAppointmentList) {
            if (o.getType()==null) {
                MentalTestMyTestTopicDTO mentalTestMyTestTopicDTO = myTestRecordTopicList.stream().filter(rt -> rt.getMentalAppointmentId().equals(o.getId())).findFirst().orElse(new MentalTestMyTestTopicDTO());
                MentalTestMyTestRecordTopicDTO mentalTestMyTestRecordTopicDTO = myTestRecordTopicList.stream().filter(rt -> rt.getMentalAppointmentId().equals(o.getId())).findFirst().orElse(new MentalTestMyTestRecordTopicDTO());
                // 发送IM消息
                ImPushDataDTO pushData = ImPushDataDTO.builder()
                        .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getCode())
                        .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getName())
                        .content("做了"
                                + ObjUtil.defaultIfEmpty(mentalTestMyTestTopicDTO.getTitle(), "心理测试题")
                                + ObjUtil.defaultIfEmpty(mentalTestMyTestRecordTopicDTO.getTitle(), "心理测试题")
                                + ",帮我分析一下!")
                        .objId(ObjUtil.toString(o.getId()))
                        .data1(ObjUtil.toString(o.getUserId()))
                        .data2(ObjUtil.toString(o.getWorkerId()))
                        .data3(ObjUtil.toString(mentalTestMyTestTopicDTO.getId()))
                        .data3(ObjUtil.toString(mentalTestMyTestRecordTopicDTO.getId()))
                        .build();
                imBizService.messageSendPrivate(
                        ObjUtil.toString(o.getUserId()),
roses/kernel-a-rule/src/main/java/cn/stylefeng/roses/kernel/rule/enums/PayTypeEnum.java
@@ -10,8 +10,8 @@
@Getter
public enum PayTypeEnum {
    ALIPAY(1, "支付宝"),
    WXPAY(2, "微信"),
    WXPAY(1, "微信"),
    ALIPAY(2, "支付宝"),
    ;
    private final Integer code;