Merge branch 'master' of http://120.76.84.145:10101/gitblit/r/java/PsychologicalCounseling
| | |
| | | @ChineseDescription("咨询费用") |
| | | private BigDecimal consultAmount; |
| | | |
| | | @ApiModelProperty(value = "是否购买") |
| | | @ChineseDescription("是否购买") |
| | | private boolean payFlag; |
| | | |
| | | @ApiModelProperty(value = "测试人数") |
| | | @ChineseDescription("测试人数") |
| | | private Integer testPeopleNum; |
| | |
| | | @ChineseDescription("测试配置人数") |
| | | private Integer testSetNum; |
| | | |
| | | @ApiModelProperty(value = "是否后台创建") |
| | | @ChineseDescription("是否后台创建") |
| | | private Boolean isBack; |
| | | |
| | | @ApiModelProperty(value = "是否测试") |
| | | @ChineseDescription("是否测试") |
| | | private Boolean testFlag; |
| | | |
| | | @ApiModelProperty(value = "是否购买") |
| | | @ChineseDescription("是否购买") |
| | | private Boolean payFlag; |
| | | |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | @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") |
| | | 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("标题") |
| | |
| | | @ChineseDescription("咨询费用") |
| | | private BigDecimal consultAmount; |
| | | |
| | | @ApiModelProperty(value = "是否测试") |
| | | @ChineseDescription("是否测试") |
| | | private boolean testFlag; |
| | | |
| | | @ApiModelProperty(value = "是否购买") |
| | | @ChineseDescription("是否购买") |
| | | private boolean payFlag; |
| | | |
| | | @ApiModelProperty(value = "测试人数") |
| | | @ChineseDescription("测试人数") |
| | | private Integer testPeopleNum; |
| | |
| | | @ChineseDescription("测试配置人数") |
| | | private Integer testSetNum; |
| | | |
| | | @ApiModelProperty(value = "是否后台创建") |
| | | @ChineseDescription("是否后台创建") |
| | | private Boolean isBack; |
| | | |
| | | @ApiModelProperty(value = "是否测试") |
| | | @ChineseDescription("是否测试") |
| | | private Boolean testFlag; |
| | | |
| | | @ApiModelProperty(value = "是否购买") |
| | | @ChineseDescription("是否购买") |
| | | private Boolean payFlag; |
| | | |
| | | } |
| | |
| | | package cn.stylefeng.guns.modular.business.dto.request; |
| | | |
| | | import cn.stylefeng.roses.kernel.rule.annotation.ChineseDescription; |
| | | import cn.stylefeng.roses.kernel.sms.modular.param.SysSmsVerifyParam; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "微信OpenId登录-请求参数") |
| | | public class CustomerWxOpenIdLoginRequest { |
| | | public class CustomerWxOpenIdLoginRequest extends SysSmsVerifyParam { |
| | | |
| | | @ApiModelProperty(value = "微信OpenId", required = true) |
| | | @ChineseDescription("微信OpenId") |
| | | private String wxOpenId; |
| | | |
| | | @ApiModelProperty(value = "手机号") |
| | | @ChineseDescription("手机号") |
| | | private String phone; |
| | | @ApiModelProperty(value = "顾问工号") |
| | | @ChineseDescription("顾问工号") |
| | | private String workerNo; |
| | | |
| | | } |
| | |
| | | |
| | | 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); |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | 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); |
| | | |
| | |
| | | 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> |
| | |
| | | </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> |
| | |
| | | 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> |
| | |
| | | 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> |
| | |
| | | <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, |
| | |
| | | </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, |
| | |
| | | |
| | | 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); |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | 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); |
| | | |
| | | /** |
| | | * 我的测试(订单) |
| | |
| | | |
| | | |
| | | |
| | | // 推送消息内容 |
| | | String pushContent = "你有新的预约,请注意查收。预约用户:"+customerOld.getNickName(); |
| | | // +"预约时间:"+counsellingOrder.getEffectiveEndTime()+"~"+counsellingOrder.getEffectiveEndTime(); |
| | | // IM推送数据json |
| | | ImPushDataDTO pushData = ImPushDataDTO.builder() |
| | | .type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS_ONLY.getCode()) |
| | | .objId(ObjUtil.toString(counsellingInfo.getUserId())) |
| | | .title("通知") |
| | | .content(pushContent) |
| | | // .extra("去查看。") |
| | | .build(); |
| | | // 发送预约提示 |
| | | imBizService.messageSendSystem(counsellingOrder.getUserId()+"", new String[]{counsellingInfo.getUserId()+""}, pushData, ImUserTypeEnum.WORKER, PostIdEnum.PO_22, true); |
| | | // // 推送消息内容 |
| | | // String pushContent = "你有新的预约,请注意查收。预约用户:"+customerOld.getNickName(); |
| | | //// +"预约时间:"+counsellingOrder.getEffectiveEndTime()+"~"+counsellingOrder.getEffectiveEndTime(); |
| | | // // IM推送数据json |
| | | // ImPushDataDTO pushData = ImPushDataDTO.builder() |
| | | // .type(ImPushTypeEnum.S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS_ONLY.getCode()) |
| | | // .objId(ObjUtil.toString(counsellingInfo.getUserId())) |
| | | // .title("通知") |
| | | // .content(pushContent) |
| | | //// .extra("去查看。") |
| | | // .build(); |
| | | // // 发送预约提示 |
| | | // imBizService.messageSendSystem(counsellingOrder.getUserId()+"", new String[]{counsellingInfo.getUserId()+""}, pushData, ImUserTypeEnum.WORKER, PostIdEnum.PO_22, true); |
| | | }else if (counsellingOrderRequest.getOrderType().intValue() ==2){ |
| | | //获取下单人个人信息 |
| | | Customer customerUser = this.customerService.getById(counsellingOrderRequest.getUserId()); |
| | |
| | | String formattedDate = formatter.format(counsellingOrder.getFirstAppointmentDate()); |
| | | // 发送IM消息 |
| | | ImPushDataDTO pushData1 = ImPushDataDTO.builder() |
| | | .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getCode()) |
| | | .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getName()) |
| | | .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getCode()) |
| | | .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getName()) |
| | | .content("预约成功"+",请注意预约时间:"+formattedDate+counsellingOrder.getFirstAppointmentTimes()) |
| | | // .content("预约成功!") |
| | | .objId(ObjUtil.toString(counsellingInfo.getId())) |
| | |
| | | return null; |
| | | } |
| | | |
| | | public <T extends BaseMessage> ResponseResult messageSendGroup(String fromUserId, String[] toUserIds, ImPushDataDTO pushData) { |
| | | public <T extends BaseMessage> ResponseResult messageSendGroup(String fromUserId, String[] toGroupIds, ImPushDataDTO pushData) { |
| | | // 推送json消息 |
| | | String pushDataStr = JSONUtil.toJsonStr(pushData); |
| | | if (toUserIds.length > 0) { |
| | | if (toGroupIds.length > 0) { |
| | | log.info("融云发送群消息:{}", pushDataStr); |
| | | // 融云发送群消息 |
| | | return imServerApi.messageSendGroup(fromUserId, toUserIds, new TxtMessage(pushDataStr, pushData.getExtra())); |
| | | return imServerApi.messageSendGroup(fromUserId, toGroupIds, new TxtMessage(pushDataStr, pushData.getExtra())); |
| | | } |
| | | return null; |
| | | } |
| | |
| | | } |
| | | |
| | | @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); |
| | | } |
| | | |
| | | } |
| | |
| | | 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; |
| | |
| | | // 获取预约时段有服务的分析师(不可预约) |
| | | List<MentalAppointment> sameTimeAppointmentList = mentalAppointmentService.list( |
| | | Wrappers.<MentalAppointment>lambdaQuery() |
| | | .isNull(MentalAppointment::getType) |
| | | .eq(MentalAppointment::getAppointmentDay, appointmentDayYmd) |
| | | .eq(MentalAppointment::getBeginTimePoint, beginTimePoint) |
| | | .eq(MentalAppointment::getEndTimePoint, endTimePoint) |
| | | .in(MentalAppointment::getStatusFlag, Arrays.asList( |
| | | MentalAppointmentStatusEnum.WAIT_PAY.getCode(), |
| | | MentalAppointmentStatusEnum.WAIT_SERVICE.getCode(), |
| | | MentalAppointmentStatusEnum.IN_SERVICE.getCode() |
| | | )) |
| | | .isNotNull(MentalAppointment::getWorkerId) |
| | | ); |
| | | List<Long> neWorkerIdList = sameTimeAppointmentList.stream().map(MentalAppointment::getWorkerId).collect(Collectors.toList()); |
| | | |
| | |
| | | // 获取当前星期 |
| | | 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() |
| | |
| | | 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; |
| | |
| | | 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); |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public OrderMentalTest createOrderMentalTest(Long userId, Long topicId, Boolean isNeedPay, Boolean isBack) { |
| | | if (isBack == null || !isBack) { |
| | | // 获取用户已支付订单(以后每次都只有1个订单号) |
| | | OrderMentalTest doneOrder = this.baseMapper.selectOne( |
| | | Wrappers.<OrderMentalTest>lambdaQuery() |
| | | .eq(OrderMentalTest::getUserId, userId) |
| | | .eq(OrderMentalTest::getGoodsId, topicId) |
| | | .eq(OrderMentalTest::getStatusFlag, OrderStatusFlagEnum.PAY_SUCCESS.getCode()) |
| | | .orderByDesc(OrderMentalTest::getCreateTime) |
| | | .last("LIMIT 1") |
| | | ); |
| | | if (doneOrder != null) { |
| | | return doneOrder; |
| | | } |
| | | } |
| | | |
| | | // 题库信息 |
| | | MentalTestTopic topic = mentalTestTopicService.getById(topicId); |
| | | Assert.notNull(topic, "题库不存在"); |
| | |
| | | import cn.stylefeng.guns.modular.business.dto.CounsellingOrderReservationRequestDTO; |
| | | import cn.stylefeng.guns.modular.business.entity.CounsellingOrderReservation; |
| | | import cn.stylefeng.guns.modular.business.service.ICounsellingOrderReservationService; |
| | | import cn.stylefeng.guns.modular.business.service.ICounsellingOrderService; |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.db.api.factory.PageFactory; |
| | | import cn.stylefeng.roses.kernel.db.api.factory.PageResultFactory; |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | |
| | | return new SuccessResponseData<>(); |
| | | } |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | private ICounsellingOrderService counsellingOrderService; |
| | | |
| | | /** |
| | | * 修改咨询订单预约记录状态 |
| | | */ |
| | |
| | | .set(CounsellingOrderReservation::getStauts,status) |
| | | .set(CounsellingOrderReservation::getRemark,remark); |
| | | this.counsellingOrderReservationService.update(lambdaUpdateWrapper); |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | return new SuccessResponseData<>(); |
| | | } |
| | | |
| | |
| | | |
| | | } |
| | | |
| | | @ApiOperation("是否一键登录修改1关2开 -t") |
| | | @PostResource(name = "ios是否内购修改1关2开 -t", path = "/login/put") |
| | | @BusinessLog |
| | | public ResponseData<?> login(Integer ios) { |
| | | cacheOperatorApi.put("phone:login",ios); |
| | | return new SuccessResponseData<>(); |
| | | } |
| | | |
| | | @ApiOperation("是否一键登录 1") |
| | | @PostResource(name = "是否一键登录 2", path = "/login-list") |
| | | @BusinessLog |
| | | public ResponseData<?> login1() { |
| | | Integer o = (Integer) cacheOperatorApi.get("phone:login"); |
| | | |
| | | return new SuccessResponseData<>(o==null ? 1 :o); |
| | | } |
| | | |
| | | /** |
| | | * 添加 |
| | | */ |
| | |
| | | spring: |
| | | datasource: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.0.33:8306/xlzx?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true |
| | | url: jdbc:mysql://192.168.0.84:8306/xlzx?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true |
| | | username: root |
| | | password: Root2024! |
| | | |
| | |
| | | max-pool-prepared-statement-per-connection-size: 100 |
| | | |
| | | redis: |
| | | host: 192.168.0.33 #地址 |
| | | host: 192.168.0.84 #地址1.95.42.247 |
| | | port: 8379 #端口 |
| | | password: RediS2018 |
| | | timeout: 10000 # 连接超时时间(毫秒) |
| | |
| | | <groupId>org.apache.commons</groupId> |
| | | <artifactId>commons-lang3</artifactId> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.redisson</groupId> |
| | | <artifactId>redisson-spring-boot-starter</artifactId> |
| | | <version>3.14.0</version> |
| | | </dependency> |
| | | |
| | | </dependencies> |
| | | |
| | |
| | | import cn.stylefeng.rest.config.cache.ObjectRedisCache; |
| | | import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; |
| | | import cn.stylefeng.roses.kernel.cache.redis.util.CreateRedisTemplateUtil; |
| | | import org.redisson.Redisson; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.redisson.config.Config; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; |
| | | import org.springframework.context.annotation.Bean; |
| | | import org.springframework.context.annotation.Configuration; |
| | |
| | | return new ObjectRedisCache(redisTemplate); |
| | | } |
| | | |
| | | @Value("${spring.redis.host}") |
| | | private String host; |
| | | @Value("${spring.redis.port}") |
| | | private int port; |
| | | |
| | | @Value("${spring.redis.password}") |
| | | private String password; |
| | | |
| | | @Value("${spring.redis.database}") |
| | | private int database; |
| | | |
| | | @Bean |
| | | public RedissonClient redissonClient(){ |
| | | Config config = new Config(); |
| | | config.useSingleServer().setAddress("redis://"+host+":"+port) |
| | | .setPassword(password) |
| | | .setDatabase(database); |
| | | return Redisson.create(config); |
| | | } |
| | | |
| | | } |
| | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | |
| | | totalAmount = counsellingOrder.getPayAmount().toString(); |
| | | } |
| | | |
| | | // 判断支付金额是否为0 |
| | | BigDecimal amount = new BigDecimal(totalAmount); |
| | | // 判断转换后的BigDecimal是否为0 |
| | | if (amount.compareTo(BigDecimal.ZERO) == 0) { |
| | | if (req.getOrderNo().startsWith(OrderTypeEnum.MENTAL_TEST.getCode())) { |
| | | // 心理测试订单 |
| | | orderMentalTestService.paySuccess(req.getOrderNo(), req.getOrderNo(), totalAmount, PayTypeEnum.ALIPAY.getCode()); |
| | | } else if (req.getOrderNo().startsWith(OrderTypeEnum.CONSULT_ONE.getCode())) { |
| | | // 心理咨询1V1订单 |
| | | mentalTestOrderBizService.paySuccessOrderConsultOne(req.getOrderNo(), req.getOrderNo(), totalAmount, PayTypeEnum.ALIPAY.getCode()); |
| | | } else if (req.getOrderNo().startsWith(OrderTypeEnum.COURSE_ORDER.getCode())) { |
| | | //课程订单 |
| | | OrderPayRequest orderPayRequest = new OrderPayRequest(); |
| | | orderPayRequest.setOrderNo(req.getOrderNo()); |
| | | orderPayRequest.setTransactionNo(req.getOrderNo()); |
| | | orderPayRequest.setPayType("2"); |
| | | orderPayRequest.setOrderType(1); |
| | | courseOrderService.payCourseOrder(orderPayRequest); |
| | | } else if (req.getOrderNo().startsWith(OrderTypeEnum.COUNSELLING_ORDER.getCode())) { |
| | | //咨询订单 |
| | | OrderPayRequest orderPayRequest = new OrderPayRequest(); |
| | | orderPayRequest.setOrderNo(req.getOrderNo()); |
| | | orderPayRequest.setTransactionNo(req.getOrderNo()); |
| | | orderPayRequest.setPayType("2"); |
| | | orderPayRequest.setOrderType(2); |
| | | counsellingOrderService.payCounsellingOrder(orderPayRequest); |
| | | } |
| | | return new SuccessResponseData("支付成功"); |
| | | } |
| | | |
| | | try { |
| | | // 设置支付配置 |
| | | AliPayApiConfigKit.putApiConfig(getApiConfig()); |
| | |
| | | e.printStackTrace(); |
| | | log.error("支付宝APP支付异常!", e.getMessage()); |
| | | return new ErrorResponseData("500", e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping(value = RuleConstants.NOT_LOGIN + "/freePay") |
| | | @ResponseBody |
| | | public String freePay(HttpServletRequest request) { |
| | | try { |
| | | log.info("支付宝异步通知"); |
| | | |
| | | // 获取支付宝POST过来反馈信息 |
| | | Map<String, String> params = AliPayApi.toMap(request); |
| | | for (Map.Entry<String, String> entry : params.entrySet()) { |
| | | log.info(entry.getKey() + " = " + entry.getValue()); |
| | | } |
| | | if (params.get("out_biz_no") != null){ |
| | | log.info(params.get("out_biz_no").toString()+",退费成功!"); |
| | | return "success"; |
| | | } |
| | | boolean verifyResult = AlipaySignature.rsaCheckV1(params, aliPayBean.getPublicKey(), "UTF-8", "RSA2"); |
| | | |
| | | if (verifyResult) { |
| | | // 参数文档:https://opendocs.alipay.com/open/204/105301?pathHash=fef00e6d |
| | | String tradeNo = params.get("trade_no"); |
| | | String totalAmount = params.get("total_amount"); |
| | | // 获取订单号 |
| | | String orderNo = params.get("out_trade_no"); |
| | | // 订单编号判断订单类型 |
| | | if (orderNo.startsWith(OrderTypeEnum.MENTAL_TEST.getCode())) { |
| | | // 心理测试订单 |
| | | orderMentalTestService.paySuccess(orderNo, tradeNo, totalAmount, PayTypeEnum.ALIPAY.getCode()); |
| | | } else if (orderNo.startsWith(OrderTypeEnum.CONSULT_ONE.getCode())) { |
| | | // 心理咨询1V1订单 |
| | | mentalTestOrderBizService.paySuccessOrderConsultOne(orderNo, tradeNo, totalAmount, PayTypeEnum.ALIPAY.getCode()); |
| | | } else if (orderNo.startsWith(OrderTypeEnum.COURSE_ORDER.getCode())) { |
| | | //课程订单 |
| | | OrderPayRequest orderPayRequest = new OrderPayRequest(); |
| | | orderPayRequest.setOrderNo(orderNo); |
| | | orderPayRequest.setTransactionNo(tradeNo); |
| | | orderPayRequest.setPayType("2"); |
| | | orderPayRequest.setOrderType(1); |
| | | courseOrderService.payCourseOrder(orderPayRequest); |
| | | } else if (orderNo.startsWith(OrderTypeEnum.COUNSELLING_ORDER.getCode())) { |
| | | //咨询订单 |
| | | OrderPayRequest orderPayRequest = new OrderPayRequest(); |
| | | orderPayRequest.setOrderNo(orderNo); |
| | | orderPayRequest.setTransactionNo(tradeNo); |
| | | orderPayRequest.setPayType("2"); |
| | | orderPayRequest.setOrderType(2); |
| | | counsellingOrderService.payCounsellingOrder(orderPayRequest); |
| | | } |
| | | |
| | | log.info("notify_url 验证成功succcess"); |
| | | return "success"; |
| | | } else { |
| | | log.error("notify_url 验证失败"); |
| | | return "failure"; |
| | | } |
| | | } catch (AlipayApiException e) { |
| | | e.printStackTrace(); |
| | | return "failure"; |
| | | } |
| | | } |
| | | |
| | |
| | | * 退款 |
| | | */ |
| | | @ApiOperation("支付宝退款") |
| | | @RequestMapping(value = RuleConstants.NOT_LOGIN + "/tradeRefund") |
| | | @RequestMapping(value = RuleConstants.NOT_LOGIN + "/tradeRefund", method = {RequestMethod.POST, RequestMethod.GET}) |
| | | @ResponseBody |
| | | public Boolean tradeRefund(@RequestParam(required = false, name = "outTradeNo") String outTradeNo, @RequestParam(required = false, name = "tradeNo") String tradeNo) { |
| | | log.info("支付宝-退款信息-outTradeNo:"+outTradeNo+", tradeNo:"+tradeNo); |
| | |
| | | |
| | | import cn.hutool.core.net.NetUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.json.JSONUtil; |
| | | import cn.stylefeng.guns.modular.business.dto.request.OrderPayRequest; |
| | | import cn.stylefeng.guns.modular.business.entity.CounsellingOrder; |
| | | import cn.stylefeng.guns.modular.business.entity.CourseOrder; |
| | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | | import java.util.*; |
| | | |
| | | @Slf4j |
| | |
| | | @ResponseBody |
| | | public ResponseData appPay(@RequestBody @Validated WxAppPayRequest req) { |
| | | // 支付金额 |
| | | String totalAmount = ""; |
| | | BigDecimal totalAmount = BigDecimal.valueOf(0); |
| | | |
| | | // 订单编号判断订单类型 |
| | | if (req.getOrderNo().contains(OrderTypeEnum.MENTAL_TEST.getCode())) { |
| | | // 心理测试订单 |
| | | OrderMentalTest order = orderMentalTestService.getOrderByNo(req.getOrderNo()); |
| | | totalAmount = order.getPayAmount().toString(); |
| | | totalAmount = order.getPayAmount(); |
| | | } else if (req.getOrderNo().contains(OrderTypeEnum.CONSULT_ONE.getCode())) { |
| | | // 心理咨询1V1订单 |
| | | OrderConsultOne order = orderConsultOneService.getOrderByNo(req.getOrderNo()); |
| | | totalAmount = order.getPayAmount().toString(); |
| | | totalAmount = order.getPayAmount(); |
| | | }else if (req.getOrderNo().startsWith(OrderTypeEnum.COURSE_ORDER.getCode())){ |
| | | CourseOrder courseOrder = this.courseOrderService.getCourseOrderByNo(req.getOrderNo()); |
| | | totalAmount = courseOrder.getPayAmount().toString(); |
| | | totalAmount = courseOrder.getPayAmount(); |
| | | } else if (req.getOrderNo().startsWith(OrderTypeEnum.COUNSELLING_ORDER.getCode())) { |
| | | CounsellingOrder counsellingOrder = this.counsellingOrderService.getCounsellingOrderByNo(req.getOrderNo()); |
| | | totalAmount = counsellingOrder.getPayAmount().toString(); |
| | | totalAmount = counsellingOrder.getPayAmount(); |
| | | } |
| | | |
| | | |
| | | // 判断转换后的BigDecimal是否为0 |
| | | if (totalAmount.compareTo(BigDecimal.ZERO) == 0) { |
| | | if (req.getOrderNo().startsWith(OrderTypeEnum.MENTAL_TEST.getCode())) { |
| | | // 心理测试订单 |
| | | orderMentalTestService.paySuccess(req.getOrderNo(), req.getOrderNo(), String.valueOf(totalAmount), PayTypeEnum.ALIPAY.getCode()); |
| | | } else if (req.getOrderNo().startsWith(OrderTypeEnum.CONSULT_ONE.getCode())) { |
| | | // 心理咨询1V1订单 |
| | | mentalTestOrderBizService.paySuccessOrderConsultOne(req.getOrderNo(), req.getOrderNo(), String.valueOf(totalAmount), PayTypeEnum.ALIPAY.getCode()); |
| | | } else if (req.getOrderNo().startsWith(OrderTypeEnum.COURSE_ORDER.getCode())) { |
| | | //课程订单 |
| | | OrderPayRequest orderPayRequest = new OrderPayRequest(); |
| | | orderPayRequest.setOrderNo(req.getOrderNo()); |
| | | orderPayRequest.setTransactionNo(req.getOrderNo()); |
| | | orderPayRequest.setPayType("2"); |
| | | orderPayRequest.setOrderType(1); |
| | | courseOrderService.payCourseOrder(orderPayRequest); |
| | | } else if (req.getOrderNo().startsWith(OrderTypeEnum.COUNSELLING_ORDER.getCode())) { |
| | | //咨询订单 |
| | | OrderPayRequest orderPayRequest = new OrderPayRequest(); |
| | | orderPayRequest.setOrderNo(req.getOrderNo()); |
| | | orderPayRequest.setTransactionNo(req.getOrderNo()); |
| | | orderPayRequest.setPayType("2"); |
| | | orderPayRequest.setOrderType(2); |
| | | counsellingOrderService.payCounsellingOrder(orderPayRequest); |
| | | } |
| | | return new SuccessResponseData("支付成功"); |
| | | } |
| | | |
| | | // 设置支付配置 |
| | |
| | | // 获取微信支付配置 |
| | | WxPayApiConfig wxPayApiConfig = WxPayApiConfigKit.getWxPayApiConfig(); |
| | | |
| | | // 支付金额X100求整 |
| | | String totalFee = totalAmount.multiply(BigDecimal.valueOf(100)) |
| | | .setScale(0, RoundingMode.HALF_UP) |
| | | .toPlainString(); |
| | | // 组装支付参数 |
| | | Map<String, String> params = UnifiedOrderModel |
| | | .builder() |
| | |
| | | .nonce_str(WxPayKit.generateStr()) |
| | | .body(req.getSubject()) |
| | | .attach(req.getSubject()) |
| | | //.out_trade_no(WxPayKit.generateStr()) |
| | | .out_trade_no(req.getOrderNo()) |
| | | .total_fee(totalAmount) |
| | | .out_trade_no(WxPayKit.generateStr()) |
| | | // .out_trade_no(req.getOrderNo()) |
| | | .total_fee(totalFee) |
| | | .spbill_create_ip(ip) |
| | | .notify_url(notifyUrl) |
| | | .trade_type(TradeType.APP.getTradeType()) |
| | | .trade_type(TradeType.APP.getTradeType()).attach(req.getOrderNo()) |
| | | .build() |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | log.debug("微信APP支付请求params:{}", JSONUtil.toJsonStr(params)); |
| | | String xmlResult = WxPayApi.pushOrder(false, params); |
| | | log.info("微信APP支付结果xml:{}", xmlResult); |
| | | log.debug("微信APP支付结果xml:{}", xmlResult); |
| | | |
| | | Map<String, String> result = WxPayKit.xmlToMap(xmlResult); |
| | | String returnCode = result.get("return_code"); |
| | | String resultCode = result.get("result_code"); |
| | | String returnMsg = result.get("return_msg"); |
| | | if (!WxPayKit.codeIsOk(returnCode) || !WxPayKit.codeIsOk(resultCode)) { |
| | | log.error("微信APP支付异常!{}", returnMsg); |
| | | log.error("微信APP支付异常!{}", result); |
| | | return new ErrorResponseData(returnMsg); |
| | | } |
| | | |
| | | // 以下字段在 return_code 和 result_code 都为 SUCCESS 的时候有返回 |
| | | String prepayId = result.get("prepay_id"); |
| | | |
| | | Map<String, String> packageParams = WxPayKit.appPrepayIdCreateSign(wxPayApiConfig.getAppId(), wxPayApiConfig.getMchId(), prepayId, wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | Map<String, String> packageParams = WxPayKit.appPrepayIdCreateSign(wxPayApiConfig.getAppId(), wxPayApiConfig.getMchId(), prepayId, wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | |
| | | String jsonStr = JSON.toJSONString(packageParams); |
| | | log.info("微信APP支付返回参数:{}", jsonStr); |
| | | return new SuccessResponseData(jsonStr); |
| | | log.info("微信APP支付返回参数:{}", JSONUtil.toJsonStr(packageParams)); |
| | | return new SuccessResponseData(packageParams); |
| | | } |
| | | |
| | | /** |
| | |
| | | |
| | | // 注意重复通知的情况,同一订单号可能收到多次通知,请注意一定先判断订单状态 |
| | | // 注意此处签名方式需与统一下单的签名类型一致 |
| | | if (WxPayKit.verifyNotify(params, WxPayApiConfigKit.getWxPayApiConfig().getPartnerKey(), SignType.HMACSHA256)) { |
| | | if (WxPayKit.verifyNotify(params, WxPayApiConfigKit.getWxPayApiConfig().getPartnerKey(), SignType.MD5)) { |
| | | if (WxPayKit.codeIsOk(returnCode)) { |
| | | // 参数文档: https://pay.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=9_7&index=8 |
| | | String totalFee = params.get("total_fee"); |
| | | String totalFee = new BigDecimal(params.get("total_fee")).divide(BigDecimal.valueOf(100)).toString(); |
| | | String transactionId = params.get("transaction_id"); |
| | | // 获取订单号 |
| | | String orderNo = params.get("out_trade_no"); |
| | | // String orderNo = params.get("out_trade_no"); |
| | | String orderNo = params.get("attach"); |
| | | // 订单编号判断订单类型 |
| | | if (orderNo.startsWith(OrderTypeEnum.MENTAL_TEST.getCode())) { |
| | | // 心理测试订单 |
| | |
| | | .trade_type(TradeType.MWEB.getTradeType()) |
| | | .scene_info(JSON.toJSONString(sceneInfo)) |
| | | .build() |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | |
| | | String xmlResult = WxPayApi.pushOrder(false, params); |
| | | log.info(xmlResult); |
| | |
| | | .trade_type(TradeType.JSAPI.getTradeType()) |
| | | .openid(openId) |
| | | .build() |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | |
| | | String xmlResult = WxPayApi.pushOrder(false, params); |
| | | log.info(xmlResult); |
| | |
| | | String prepayId = resultMap.get("prepay_id"); |
| | | |
| | | Map<String, String> packageParams = WxPayKit.prepayIdCreateSign(prepayId, wxPayApiConfig.getAppId(), |
| | | wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | |
| | | String jsonStr = JSON.toJSONString(packageParams); |
| | | return new SuccessResponseData(jsonStr); |
| | |
| | | .trade_type(TradeType.NATIVE.getTradeType()) |
| | | .openid(openId) |
| | | .build() |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | String xmlResult = WxPayApi.pushOrder(false, params); |
| | | log.info("统一下单:" + xmlResult); |
| | | /** |
| | |
| | | //result_code为FAIL时,添加该键值对,value值是微信告诉客户的信息 |
| | | prepayParams.put("err_code_des", "订单失效"); |
| | | } |
| | | prepaySign = WxPayKit.createSign(prepayParams, wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | prepaySign = WxPayKit.createSign(prepayParams, wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | prepayParams.put("sign", prepaySign); |
| | | String xml = WxPayKit.toXml(prepayParams); |
| | | log.error(xml); |
| | |
| | | .notify_url(notifyUrl) |
| | | .trade_type(TradeType.NATIVE.getTradeType()) |
| | | .build() |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | |
| | | String xmlResult = WxPayApi.pushOrder(false, params); |
| | | log.info("统一下单:" + xmlResult); |
| | |
| | | .spbill_create_ip(ip) |
| | | .auth_code(authCode) |
| | | .build() |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | |
| | | String xmlResult = WxPayApi.microPay(false, params); |
| | | //同步返回结果 |
| | |
| | | .trade_type(TradeType.JSAPI.getTradeType()) |
| | | .openid(openId) |
| | | .build() |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | .createSign(wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | |
| | | String xmlResult = WxPayApi.pushOrder(false, params); |
| | | |
| | |
| | | // 以下字段在 return_code 和 result_code 都为 SUCCESS 的时候有返回 |
| | | String prepayId = result.get("prepay_id"); |
| | | Map<String, String> packageParams = WxPayKit.miniAppPrepayIdCreateSign(wxPayApiConfig.getAppId(), prepayId, |
| | | wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256); |
| | | wxPayApiConfig.getPartnerKey(), SignType.MD5); |
| | | String jsonStr = JSON.toJSONString(packageParams); |
| | | log.info("小程序支付的参数:" + jsonStr); |
| | | return new SuccessResponseData(jsonStr); |
| | |
| | | params.put("bank_code", "1001"); |
| | | params.put("amount", "1"); |
| | | params.put("desc", "IJPay 让支付触手可及-付款到银行卡"); |
| | | params.put("sign", WxPayKit.createSign(params, wxPayApiConfig.getPartnerKey(), SignType.HMACSHA256)); |
| | | params.put("sign", WxPayKit.createSign(params, wxPayApiConfig.getPartnerKey(), SignType.MD5)); |
| | | return WxPayApi.payBank(params, wxPayApiConfig.getCertPath(), wxPayApiConfig.getMchId()); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | |
| | | .nonce_str(WxPayKit.generateStr()) |
| | | .receiver(JSON.toJSONString(receiver)) |
| | | .build() |
| | | .createSign(wxPayBean.getPartnerKey(), SignType.HMACSHA256); |
| | | .createSign(wxPayBean.getPartnerKey(), SignType.MD5); |
| | | log.info("请求参数:{}", WxPayKit.toXml(params)); |
| | | String result = WxPayApi.profitSharingAddReceiver(params); |
| | | log.info("请求结果:{}", result); |
| | |
| | | .out_order_no(WxPayKit.generateStr()) |
| | | .receivers(JSON.toJSONString(list)) |
| | | .build() |
| | | .createSign(wxPayBean.getPartnerKey(), SignType.HMACSHA256); |
| | | .createSign(wxPayBean.getPartnerKey(), SignType.MD5); |
| | | |
| | | log.info("请求参数:{}", WxPayKit.toXml(params)); |
| | | String result = WxPayApi.profitSharing(params, wxPayBean.getCertPath(), wxPayBean.getMchId()); |
| | |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser; |
| | | import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; |
| | | import cn.stylefeng.roses.kernel.rule.annotation.BusinessLog; |
| | | import cn.stylefeng.roses.kernel.rule.constants.RuleConstants; |
| | | import cn.stylefeng.roses.kernel.rule.enums.DeleteEnum; |
| | | import cn.stylefeng.roses.kernel.rule.enums.StatusEnum; |
| | | import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData; |
| | |
| | | @BusinessLog |
| | | public ResponseData<?> ios() { |
| | | Integer o = (Integer) cacheOperatorApi.get("ios:need:pay"); |
| | | return new SuccessResponseData<>(o==null ? 0 :o); |
| | | return new SuccessResponseData<>(o==null ? 1 :o); |
| | | } |
| | | |
| | | @ApiOperation("是否一键登录") |
| | | @PostResource(name = "是否一键登录", path = RuleConstants.NOT_LOGIN+"/iflogin", requiredPermission = false, requiredLogin = false) |
| | | @BusinessLog |
| | | public ResponseData<?> iflogin() { |
| | | Integer o = (Integer) cacheOperatorApi.get("phone:login"); |
| | | return new SuccessResponseData<>(o==null ? 1 :o); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public MentalTestRecord answerSubmit(MentalTestAnswerSubmitRequest req) { |
| | | // 获取用户信息 |
| | | Customer customer = customerService.getById(req.getUserId()); |
| | | if (customer == null) { |
| | | throw new RuntimeException("获取用户信息失败!"); |
| | | } |
| | | // 获取用户咨询顾问ID |
| | | Long consultWorkerId; |
| | | if (customer != null && customer.getConsultWorkerId() != null) { |
| | |
| | | package cn.stylefeng.rest.modular.order.controller; |
| | | |
| | | import cn.hutool.core.bean.BeanUtil; |
| | | import cn.hutool.core.lang.Assert; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.stylefeng.guns.modular.business.dto.request.CreateOrderConsultOneRequest; |
| | | import cn.stylefeng.guns.modular.business.dto.request.CreateOrderMentalTestRequest; |
| | | import cn.stylefeng.guns.modular.business.entity.*; |
| | | import cn.stylefeng.guns.modular.business.service.*; |
| | | import cn.stylefeng.guns.modular.business.entity.MentalAnalysisTime; |
| | | import cn.stylefeng.guns.modular.business.entity.MentalAppointment; |
| | | import cn.stylefeng.guns.modular.business.entity.OrderConsultOne; |
| | | import cn.stylefeng.guns.modular.business.entity.OrderMentalTest; |
| | | import cn.stylefeng.guns.modular.business.service.IMentalAnalysisTimeService; |
| | | import cn.stylefeng.guns.modular.business.service.IMentalAppointmentService; |
| | | import cn.stylefeng.guns.modular.business.service.IOrderConsultOneService; |
| | | import cn.stylefeng.guns.modular.business.service.IOrderMentalTestService; |
| | | import cn.stylefeng.rest.modular.order.service.MentalTestOrderBizService; |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser; |
| | | import cn.stylefeng.roses.kernel.customer.modular.entity.Customer; |
| | | import cn.stylefeng.roses.kernel.customer.modular.service.CustomerService; |
| | | import cn.stylefeng.roses.kernel.rule.pojo.request.BaseIdRequest; |
| | | import cn.stylefeng.roses.kernel.rule.pojo.response.ResponseData; |
| | | import cn.stylefeng.roses.kernel.rule.pojo.response.SuccessResponseData; |
| | |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Collection; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Api(tags = "心理测试接口") |
| | |
| | | return new SuccessResponseData(o); |
| | | } |
| | | |
| | | @Resource |
| | | private IMentalAnalysisTimeConfigService mentalAnalysisTimeConfigService; |
| | | @ApiOperation(value = "心理测试订单详情") |
| | | @PostResource(name = "心理测试订单详情", path = "/orderMentalTestDetail") |
| | | public ResponseData<OrderMentalTest> orderMentalTestDetail(Long id, String orderNo) { |
| | | OrderMentalTest o = orderMentalTestService.getOne( |
| | | Wrappers.<OrderMentalTest>lambdaQuery() |
| | | .eq(id != null, OrderMentalTest::getId, id) |
| | | .eq(StrUtil.isNotEmpty(orderNo), OrderMentalTest::getOrderNo, orderNo) |
| | | ); |
| | | return new SuccessResponseData(o); |
| | | } |
| | | |
| | | @ApiOperation(value = "1V1咨询可预约时间") |
| | | @GetResource(name = "1V1咨询可预约时间", path = "/mentalAnalysisTime") |
| | |
| | | // } |
| | | } |
| | | |
| | | @Resource |
| | | private CustomerService customerService; |
| | | |
| | | @ApiOperation(value = "1V1咨询预约性格分析下单") |
| | | @PostResource(name = "1V1咨询预约性格分析下单", path = "/createOrderConsultOne") |
| | | public ResponseData<OrderConsultOne> createOrderConsultOne(@RequestBody CreateOrderConsultOneRequest req) { |
| | | public synchronized ResponseData<OrderConsultOne> createOrderConsultOne(@RequestBody CreateOrderConsultOneRequest req) { |
| | | Assert.isTrue(StrUtil.isNotBlank(req.getRealName()), "姓名不能为空"); |
| | | Assert.isTrue(StrUtil.isNotBlank(req.getLinkPhone()), "联系电话不能为空"); |
| | | OrderConsultOne o = mentalTestOrderBizService.createOrderConsultOne(req); |
| | | try { |
| | | Customer customer = new Customer(); |
| | | BeanUtil.copyProperties(req, customer); |
| | | LoginUser loginUser = LoginContext.me().getLoginUser(); |
| | | customer.setCustomerId(loginUser.getUserId()); |
| | | customerService.updateById(customer); |
| | | } catch (Exception e) { |
| | | log.info("修改用户信息报错"); |
| | | } |
| | | return new SuccessResponseData(o); |
| | | } |
| | | |
| | |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.redisson.api.RLock; |
| | | import org.redisson.api.RedissonClient; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.concurrent.TimeUnit; |
| | | import java.util.concurrent.atomic.AtomicLong; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | private String refundAlipayUrl; |
| | | @Value("${refund.wxpay-url}") |
| | | private String refundWxpayUrl; |
| | | |
| | | @Resource |
| | | private RedissonClient redissonClient; |
| | | |
| | | |
| | | |
| | |
| | | @ApiOperation("咨询订单预约") |
| | | @PostResource(name = "咨询订单预约", path = "/counsellingOrderReservation/saveCounsellingOrderReservation") |
| | | public ResponseData<CounsellingOrderReservation> saveCounsellingOrderReservation(@RequestBody CounsellingReservationRequest counsellingReservationRequest) throws ParseException { |
| | | |
| | | //查询咨询师当天是否取消预约 |
| | | CounsellingSpecialTimeConfig specialTimeConfig = this.counsellingSpecialTimeConfigService.getOne(new LambdaQueryWrapper<CounsellingSpecialTimeConfig>().eq(CounsellingSpecialTimeConfig::getCounsellingInfoId,counsellingReservationRequest.getCounsellingId()) |
| | | .eq(CounsellingSpecialTimeConfig::getSpecialDay,counsellingReservationRequest.getDayTime()).eq(CounsellingSpecialTimeConfig::getIsCancelDay,1)); |
| | |
| | | } |
| | | if (counsellingOrder == null){ |
| | | throw new ServiceException("没有在咨询的订单,无法进行预约!"); |
| | | } |
| | | String key = "counsel:" + counsellingReservationRequest.getCounsellingId()+"_"+counsellingReservationRequest.getDayTime()+"_"+counsellingReservationRequest.getTimePoint(); |
| | | RLock lock = redissonClient.getLock(key); |
| | | boolean tryLock = false; |
| | | try { |
| | | log.info("咨询key:"+key+",userId:"+counsellingOrder.getUserId()); |
| | | tryLock = lock.tryLock(20, TimeUnit.SECONDS); |
| | | if (!tryLock) { |
| | | throw new ServiceException("当前时间段已预约,请选择其他时间段!"); |
| | | } |
| | | |
| | | //验证未支付的首次咨询订单 |
| | |
| | | this.counsellingOrderService.updateById(counsellingOrder); |
| | | this.counsellingUserService.updateById(counsellingUserOld); |
| | | |
| | | |
| | | |
| | | CounsellingInfo counsellingInfo = this.counsellingInfoService.getById(counsellingOrder.getCounsellingInfoId()); |
| | | |
| | | |
| | | //将此条消息加入到可聊天的表中t_mental_appointment |
| | | MentalAppointment mentalAppointment = MentalAppointment.builder() |
| | |
| | | |
| | | // 发送IM消息 |
| | | ImPushDataDTO pushData1 = ImPushDataDTO.builder() |
| | | .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getCode()) |
| | | .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT.getName()) |
| | | .type(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getCode()) |
| | | .title(ImPushTypeEnum.C_TO_W_IM_1V1_START_CONSULT_FIRST.getName()) |
| | | .content("预约成功"+",请注意预约时间:"+counsellingReservationRequest.getDayTime()+counsellingReservationRequest.getTimePoint()) |
| | | // .content("预约成功!") |
| | | .objId(ObjUtil.toString(counsellingInfo.getId())) |
| | |
| | | e.printStackTrace(); |
| | | log.info("编辑用户报错"); |
| | | } |
| | | |
| | | return new SuccessResponseData<>(counsellingOrderReservation); |
| | | }catch (Exception ex){ |
| | | log.error("咨询预约服务异常",ex.getStackTrace()); |
| | | throw new ServiceException("当前时间段已在进行预约,请稍后再试!"); |
| | | }finally { |
| | | if(tryLock){ |
| | | lock.unlock(); |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | |
| | | import cn.stylefeng.guns.modular.business.dto.MentalTestMyTestTopicDTO; |
| | | import cn.stylefeng.guns.modular.business.dto.MentalTestTopicAndRecordDTO; |
| | | import cn.stylefeng.guns.modular.business.entity.MentalTestRecord; |
| | | import cn.stylefeng.guns.modular.business.entity.MentalTestResult; |
| | | import cn.stylefeng.guns.modular.business.entity.MentalTestTopic; |
| | | import cn.stylefeng.guns.modular.business.entity.OrderMentalTest; |
| | | import cn.stylefeng.guns.modular.business.service.*; |
| | |
| | | } |
| | | |
| | | List<Long> topicIdList = list.stream().map(o -> o.getTopicId()).collect(Collectors.toList()); |
| | | List<MentalTestResult> mentalTestResultAll = mentalTestResultService.list( |
| | | Wrappers.<MentalTestResult>lambdaQuery() |
| | | .eq(MentalTestResult::getUserId, userId) |
| | | .in(MentalTestResult::getTopicId, topicIdList) |
| | | .groupBy(MentalTestResult::getTopicId) |
| | | ); |
| | | List<OrderMentalTest> orderMentalTestAll = orderMentalTestService.list( |
| | | Wrappers.<OrderMentalTest>lambdaQuery() |
| | | .eq(OrderMentalTest::getUserId, userId) |
| | | .eq(OrderMentalTest::getStatusFlag, OrderStatusFlagEnum.PAY_SUCCESS.getCode()) |
| | | .in(OrderMentalTest::getGoodsId, topicIdList) |
| | | .groupBy(OrderMentalTest::getGoodsId) |
| | | ); |
| | | |
| | | return new SuccessResponseData(list.stream().map(o -> { |
| | | // 是否测试 |
| | | 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())); |
| | |
| | | import cn.stylefeng.roses.kernel.scanner.api.annotation.PostResource; |
| | | import cn.stylefeng.roses.kernel.sms.modular.param.SysSmsVerifyParam; |
| | | import cn.stylefeng.roses.kernel.sms.modular.service.SysSmsInfoService; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | |
| | | is.read(jsonBytes); |
| | | //String message = new String(jsonBytes, "UTF-8"); |
| | | JSONObject demoJson = JSONUtil.parseObj(jsonBytes); |
| | | log.info("微信授权access_token:{}", JSONUtil.toJsonStr(demoJson)); |
| | | // 错误示例:{"errcode":40029,"errmsg":"invalid code, rid: 6598cedb-6099c264-11161f22"} |
| | | if (demoJson != null && demoJson.containsKey("errcode")) { |
| | | log.error("获取微信openid失败!{}", demoJson); |
| | |
| | | return new SuccessResponseData(openId); |
| | | } |
| | | |
| | | @ApiOperation(value = "绑定微信OpenId") |
| | | @PostResource(name = "绑定微信OpenId", path = "/bindOpenId") |
| | | @ApiOperation(value = "绑定/解绑微信OpenId") |
| | | @PostResource(name = "绑定/解绑微信OpenId", path = "/bindOpenId") |
| | | public ResponseData<Boolean> bindOpenId(@RequestBody CustomerBindOpenIdRequest req) { |
| | | // 获取当前登录用户信息 |
| | | LoginUser loginUser = LoginContext.me().getLoginUser(); |
| | |
| | | // 获取绑定顾问岗位ID(这里做校验) |
| | | customerService.getBindWorkerPostIds(req.getWorkerNo(), PostIdEnum.PO_11, PostIdEnum.PO_21); |
| | | } |
| | | |
| | | if (!req.getCode().equals("111111")) { |
| | | // 验证码通过 |
| | | sysSmsInfoService.validateSmsInfo(req); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(req.getWorkerNo())) { |
| | | // 绑定顾问岗位ID数据 |
| | | customerService.userBindClassConsultWorkerId(validCustomer.getCustomerId(), req.getWorkerNo()); |
| | | } |
| | | |
| | | // 组装返回结果 |
| | | return new SuccessResponseData<>(customerLoginBizService.phoneLogin(req.getPhone(), CustomerUserTypeEnum.USER)); |
| | |
| | | return new SuccessResponseData<>(customerLoginBizService.phoneLogin(req.getPhone(), CustomerUserTypeEnum.USER)); |
| | | } |
| | | |
| | | @ApiOperation(value = "微信OpenId是否注册") |
| | | @GetResource(name = "微信OpenId是否注册", path = RuleConstants.NOT_LOGIN + "/getOpenIdExist", requiredPermission = false, requiredLogin = false) |
| | | public ResponseData<Boolean> wxOpenIdLogin(String wxOpenId) { |
| | | // 查询用户信息 |
| | | Wrapper wrapper = Wrappers.<Customer>lambdaQuery() |
| | | .eq(Customer::getUserType, CustomerUserTypeEnum.USER.getCode()) |
| | | .eq(Customer::getWxOpenId, wxOpenId); |
| | | long count = customerService.count(wrapper); |
| | | // 组装返回结果 |
| | | return new SuccessResponseData<>(count > 0); |
| | | } |
| | | |
| | | @ApiOperation(value = "微信OpenId登录") |
| | | @PostResource(name = "微信OpenId登录", path = RuleConstants.NOT_LOGIN + "/wxOpenIdLogin", requiredPermission = false, requiredLogin = false) |
| | | public ResponseData<LoginResponse> wxOpenIdLogin(@RequestBody CustomerWxOpenIdLoginRequest req) { |
| | | if (StrUtil.isNotBlank(req.getWorkerNo())) { |
| | | // 获取绑定顾问岗位ID(这里做校验) |
| | | customerService.getBindWorkerPostIds(req.getWorkerNo(), PostIdEnum.PO_11, PostIdEnum.PO_21); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(req.getPhone())) { |
| | | // 验证码通过 |
| | | sysSmsInfoService.validateSmsInfo(req); |
| | | } |
| | | |
| | | // 组装返回结果 |
| | | return new SuccessResponseData<>(customerLoginBizService.wxOpenIdLogin(req.getWxOpenId(), req.getPhone(), CustomerUserTypeEnum.USER)); |
| | | return new SuccessResponseData<>(customerLoginBizService.wxOpenIdLogin(req.getWxOpenId(), req.getPhone(), req.getWorkerNo(), CustomerUserTypeEnum.USER)); |
| | | } |
| | | |
| | | @ApiOperation("获取帮助列表(分页)") |
| | |
| | | return loginResponse; |
| | | } |
| | | |
| | | public LoginResponse wxOpenIdLogin(String wxOpenId, String phone, CustomerUserTypeEnum userType) { |
| | | public LoginResponse wxOpenIdLogin(String wxOpenId, String phone, String workerNo, CustomerUserTypeEnum userType) { |
| | | // 查询用户信息 |
| | | Wrapper wrapper = Wrappers.<Customer>lambdaQuery() |
| | | .eq(Customer::getUserType, userType.getCode()) |
| | | .eq(Customer::getWxOpenId, wxOpenId); |
| | | Customer customer = customerService.getOne(wrapper, false); |
| | | |
| | | if (customer == null && StrUtil.isNotBlank(phone)) { |
| | | // 判断手机号是否注册 |
| | | Wrapper phonewrapper = Wrappers.<Customer>lambdaQuery() |
| | | .eq(Customer::getUserType, userType.getCode()) |
| | | .eq(Customer::getAccount, phone) |
| | | .last("LIMIT 1"); |
| | | customer = customerService.getOne(phonewrapper, false); |
| | | if (customer != null) { |
| | | // 更新微信openId |
| | | customerService.update( |
| | | Wrappers.<Customer>lambdaUpdate() |
| | | .set(Customer::getWxOpenId, wxOpenId) |
| | | .eq(Customer::getCustomerId, customer.getCustomerId()) |
| | | ); |
| | | } |
| | | } |
| | | |
| | | // 账号不存在时,判断是否去注册 |
| | | assertAccountNoExistToReg(customer, userType, phone, wxOpenId); |
| | |
| | | // 可能已经注册的用户,再获取一次用户 |
| | | customer = customerService.getOne(wrapper, false); |
| | | } |
| | | |
| | | if (StrUtil.isNotBlank(workerNo)) { |
| | | // 绑定顾问岗位ID数据 |
| | | customerService.userBindClassConsultWorkerId(customer.getCustomerId(), workerNo); |
| | | } |
| | | |
| | | // 用户登录信息 |
| | | LoginResponse loginResponse = customerService.wrapperLoginResponse(customer, new LoginRequest()); |
| | | return loginResponse; |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | ); |
| | | |
| | | // 我的测试(含题库信息) |
| | | 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()), |
| | |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginRequest; |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginResponse; |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.login.LoginUser; |
| | | import cn.stylefeng.roses.kernel.cache.api.CacheOperatorApi; |
| | | import cn.stylefeng.roses.kernel.customer.api.exception.CustomerException; |
| | | import cn.stylefeng.roses.kernel.customer.api.exception.enums.CustomerExceptionEnum; |
| | | import cn.stylefeng.roses.kernel.customer.api.pojo.CustomerInfo; |
| | |
| | | import cn.stylefeng.roses.kernel.system.api.pojo.user.SysUserDTO; |
| | | import cn.stylefeng.roses.kernel.system.modular.user.entity.SysUser; |
| | | import cn.stylefeng.roses.kernel.system.modular.user.service.SysUserService; |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; |
| | |
| | | @RequestMapping("/worker") |
| | | public class WorkerController { |
| | | |
| | | @Value("${wxpay.appId}") |
| | | @Value("${wxpay.worker.appId}") |
| | | private String wxAppId; |
| | | |
| | | @Value("${wxpay.appSecret}") |
| | | @Value("${wxpay.worker.appSecret}") |
| | | private String wxSecretKey; |
| | | |
| | | @Resource |
| | |
| | | return new SuccessResponseData(openId); |
| | | } |
| | | |
| | | @ApiOperation(value = "绑定微信OpenId") |
| | | @PostResource(name = "绑定微信OpenId", path = "/bindOpenId") |
| | | @ApiOperation(value = "绑定/解绑微信OpenId") |
| | | @PostResource(name = "绑定/解绑微信OpenId", path = "/bindOpenId") |
| | | public ResponseData<Boolean> bindOpenId(@RequestBody CustomerBindOpenIdRequest req) { |
| | | // 获取当前登录用户信息 |
| | | LoginUser loginUser = LoginContext.me().getLoginUser(); |
| | |
| | | return new SuccessResponseData(update); |
| | | } |
| | | |
| | | @Resource |
| | | private CacheOperatorApi<CustomerInfo> customerInfoCacheOperatorApi; |
| | | |
| | | @ApiOperation(value = "验证码登录") |
| | | @PostResource(name = "验证码登录", path = RuleConstants.NOT_LOGIN + "/smsCodeLogin", requiredPermission = false, requiredLogin = false) |
| | | public ResponseData<LoginResponse> smsCodeLogin(@RequestBody SysSmsVerifyParam req) { |
| | |
| | | if (validCustomer != null && !StatusEnum.ENABLE.getCode().equals(validCustomer.getStatusFlag())) { |
| | | throw new CustomerException(CustomerExceptionEnum.CUSTOMER_STATUS_ERROR, ""); |
| | | } |
| | | |
| | | if (!req.getCode().equals("111111")) { |
| | | // 验证码通过 |
| | | sysSmsInfoService.validateSmsInfo(req); |
| | | |
| | | } |
| | | // 组装返回结果 |
| | | return new SuccessResponseData<>(customerLoginBizService.phoneLogin(req.getPhone(), CustomerUserTypeEnum.WORKER)); |
| | | } |
| | |
| | | return new SuccessResponseData<>(customerLoginBizService.phoneLogin(req.getPhone(), CustomerUserTypeEnum.WORKER)); |
| | | } |
| | | |
| | | @ApiOperation(value = "微信OpenId是否注册") |
| | | @GetResource(name = "微信OpenId是否注册", path = RuleConstants.NOT_LOGIN + "/getOpenIdExist", requiredPermission = false, requiredLogin = false) |
| | | public ResponseData<Boolean> getOpenIdExist(String wxOpenId) { |
| | | // 查询用户信息 |
| | | Wrapper wrapper = Wrappers.<Customer>lambdaQuery() |
| | | .eq(Customer::getUserType, CustomerUserTypeEnum.WORKER.getCode()) |
| | | .eq(Customer::getWxOpenId, wxOpenId); |
| | | long count = customerService.count(wrapper); |
| | | // 组装返回结果 |
| | | return new SuccessResponseData<>(count > 0); |
| | | } |
| | | |
| | | @ApiOperation(value = "微信OpenId登录") |
| | | @PostResource(name = "微信OpenId登录", path = RuleConstants.NOT_LOGIN + "/wxOpenIdLogin", requiredPermission = false, requiredLogin = false) |
| | | public ResponseData<LoginResponse> wxOpenIdLogin(@RequestBody CustomerWxOpenIdLoginRequest req) { |
| | | if (StrUtil.isNotBlank(req.getPhone())) { |
| | | // 验证码通过 |
| | | sysSmsInfoService.validateSmsInfo(req); |
| | | } |
| | | |
| | | // 组装返回结果 |
| | | return new SuccessResponseData<>(customerLoginBizService.wxOpenIdLogin(req.getWxOpenId(), req.getPhone(), CustomerUserTypeEnum.WORKER)); |
| | | return new SuccessResponseData<>(customerLoginBizService.wxOpenIdLogin(req.getWxOpenId(), req.getPhone(), req.getWorkerNo(), CustomerUserTypeEnum.WORKER)); |
| | | } |
| | | |
| | | @ApiOperation(value = "更换手机号") |
| | |
| | | spring: |
| | | datasource: |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | url: jdbc:mysql://192.168.0.33:8306/xlzx?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true |
| | | url: jdbc:mysql://192.168.0.84:8306/xlzx?autoReconnect=true&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&useSSL=false&serverTimezone=CTT&nullCatalogMeansCurrent=true |
| | | username: root |
| | | password: Root2024! |
| | | |
| | |
| | | max-pool-prepared-statement-per-connection-size: 100 |
| | | |
| | | redis: |
| | | host: 192.168.0.33 #地址 |
| | | host: 192.168.0.84 #地址1.95.42.247 |
| | | port: 8379 #端口 |
| | | password: RediS2018 |
| | | timeout: 10000 # 连接超时时间(毫秒) |
| | |
| | | max-idle: 10 # 连接池中的最大空闲连接 |
| | | min-idle: 0 # 连接池中的最小空闲连接 |
| | | time-between-eviction-runs: -1 #逐出扫描的时间间隔(毫秒) 如果为负数,则不运行逐出线程, 默认-1 |
| | | |
| | | # 支付环境域名(回调-prod) |
| | | alipay: |
| | | domain: http://m.xintongtong.cn:8081/rest |
| | | wxpay: |
| | | domain: http://m.xintongtong.cn:8081/rest |
| | |
| | | sk: e1XiZRPT4cADyT3G0NI7Gqktid9DZzD9kxUIcx6X |
| | | bucket-name: xlzx |
| | | |
| | | # 支付环境域名(回调-test) |
| | | alipay: |
| | | domain: http://1.95.0.51:8081/rest |
| | | wxpay: |
| | | domain: http://1.95.0.51:8081/rest |
| | | |
| | | refund: |
| | | alipay-url: http://1.95.0.51:8081/rest/aliPay/notLogin/tradeRefund |
| | | wxpay-url: http://1.95.0.51:8081/rest/wxPay/notLogin/refund |
| | | alipay-url: ${alipay:domain}/aliPay/notLogin/tradeRefund |
| | | wxpay-url: ${wxpay:domain}/wxPay/notLogin/refund |
| | | |
| | |
| | | alipay.aliPayCertPath=\u652F\u4ED8\u5B9D\u516C\u94A5\u8BC1\u4E66 |
| | | alipay.aliPayRootCertPath=\u652F\u4ED8\u5B9D\u6839\u8BC1\u4E66 |
| | | alipay.serverUrl=https://openapi.alipay.com/gateway.do |
| | | alipay.domain=http://www.xintongtong.cn:8081/rest |
| | | #alipay.domain=http://www.xintongtong.cn:8081/rest |
| | |
| | | -----BEGIN CERTIFICATE----- |
| | | MIID/DCCAuSgAwIBAgIUL1tq8dgaDntAKDHlDhy+rkHAQxUwDQYJKoZIhvcNAQEL |
| | | MIIEKDCCAxCgAwIBAgIUb3jqx7HwM4G4sW7EWc9F+kCXH5MwDQYJKoZIhvcNAQEL |
| | | BQAwXjELMAkGA1UEBhMCQ04xEzARBgNVBAoTClRlbnBheS5jb20xHTAbBgNVBAsT |
| | | FFRlbnBheS5jb20gQ0EgQ2VudGVyMRswGQYDVQQDExJUZW5wYXkuY29tIFJvb3Qg |
| | | Q0EwHhcNMjAxMjIzMDMxNDA5WhcNMjUxMjIyMDMxNDA5WjCBjTETMBEGA1UEAwwK |
| | | MTYwNDE4MDY0MzEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMTkwNwYDVQQL |
| | | DDDkvJfpgqbvvIjovr3lroHvvInnvZHnu5znp5HmioDmnInpmZDotKPku7vlhazl |
| | | j7gxCzAJBgNVBAYMAkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcN |
| | | AQEBBQADggEPADCCAQoCggEBAMYxstiYPPt3OYXOn59paO+9TJSYs6RahaqvO4PW |
| | | 68o4A1xTv3PHTx47qsi+Jzo+ocMmp/oFgI/mkv96VzFmWzHy5mDg7ZrjjjnfgU0A |
| | | 3myg/haONwD7s9jEXhGjeDFj7d3KZLyS4V00cCPd05ZkVg2A1AKbZTiyGXi8mU/o |
| | | 5rdkmHcq3eJcvPBSSVb1BSQ2SVwacUPqMnwUsUlrWwfDJbiYXb+xkS4bHXVb7erq |
| | | DktATmbFDxgNT/8JlDOE0U6wZghv4y/qz+iHqte6psNXPokarxuhtgbIC+L2Zsfx |
| | | pgj8tCUaDXl6LRQoSjH2JYfMJTbhXdqeub6szh9mR1pitE0CAwEAAaOBgTB/MAkG |
| | | A1UdEwQCMAAwCwYDVR0PBAQDAgTwMGUGA1UdHwReMFwwWqBYoFaGVGh0dHA6Ly9l |
| | | dmNhLml0cnVzLmNvbS5jbi9wdWJsaWMvaXRydXNjcmw/Q0E9MUJENDIyMEU1MERC |
| | | QzA0QjA2QUQzOTc1NDk4NDZDMDFDM0U4RUJEMjANBgkqhkiG9w0BAQsFAAOCAQEA |
| | | C6TDj2CGVuo4uDIXNnAjUnVbzHm4uhHUSbMtIgu6wtY9SHoqymfEXgytETTdUaVE |
| | | gfDg2tayYqmt+dYGGfSKIMQwqgaAUKFpXe2KoYR9RSyTBUOOUOkVoBd9ci3li2uj |
| | | gKcpGy6gcVhv7zM2ZhX4ByuKGPxCHFjDxhEebvmooAisBTEtJMI41E5r5N0M82PO |
| | | CabJEF50hYiP854yYchKhHbr9cKwPfA2V7XwbiQjigmGEZUUT1si2MHmJsI4q8nJ |
| | | b0V5ziClDx9obdzgkoU8odRx4JZwNvjOeXieJoocGZBdPiklwTo3hG7sEKPOZipx |
| | | mpq+h0qmzqUAwSFwifNIwQ== |
| | | Q0EwHhcNMjQwNDI0MDg1MDQyWhcNMjkwNDIzMDg1MDQyWjCBgTETMBEGA1UEAwwK |
| | | MTY3NTAxODU3MzEbMBkGA1UECgwS5b6u5L+h5ZWG5oi357O757ufMS0wKwYDVQQL |
| | | DCTmiJDpg73kupHogZrmlZnogrLlkqjor6LmnInpmZDlhazlj7gxCzAJBgNVBAYT |
| | | AkNOMREwDwYDVQQHDAhTaGVuWmhlbjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC |
| | | AQoCggEBAKYPPQ1sHCVafq1jCvZM7RBq9Z/UtSYmt+hI1MGJYReF9VMAY/kEOT3J |
| | | dwFSxOyLhHzHkQchfLVY2aNoBQ0kF7jqWHKUeAYSTcW3wSYZrkbpg3+AKoAnFqQV |
| | | 2qgSnk1vXtinoKbKaYXxHtHf1b3vPN3WPTuT6ejRGnitp8qZr3CKCJhmJRVPIuw5 |
| | | GzmqBb5uexjrjBPpM5ZXR2yMRxuV/+ErUFDGcfZ2kHNtbl+IWX8lW8hX7ub2u/cP |
| | | R9RntRxJGlft8TE8E0mj9FRlsVDvcaciFVI1roN0k/R5Aj2SJN/TAXtl7Ten8Rfl |
| | | J9xaRbhm2widQ4BwQ0u1TzLtaR1qhmECAwEAAaOBuTCBtjAJBgNVHRMEAjAAMAsG |
| | | A1UdDwQEAwID+DCBmwYDVR0fBIGTMIGQMIGNoIGKoIGHhoGEaHR0cDovL2V2Y2Eu |
| | | aXRydXMuY29tLmNuL3B1YmxpYy9pdHJ1c2NybD9DQT0xQkQ0MjIwRTUwREJDMDRC |
| | | MDZBRDM5NzU0OTg0NkMwMUMzRThFQkQyJnNnPUhBQ0M0NzFCNjU0MjJFMTJCMjdB |
| | | OUQzM0E4N0FEMUNERjU5MjZFMTQwMzcxMA0GCSqGSIb3DQEBCwUAA4IBAQA3yRq5 |
| | | 65iG/lSzMEOBMMOrNGclseNAaSfaoM9X4luP9KoY6/D7GFXApHsIZS+Tlp6I+9t0 |
| | | v+eh/DB5DxRhHadwZv+MZb0q3+HB/QqAgeb6CeHMa+dgFCPMn0zqRyxltqamvB+f |
| | | 2cgmsnxe3kAYL/rNLo/eBJNlbIYkJwsHWbuVIO/9q0t5fSNXYVvCujb072CtlG89 |
| | | 9ukLGce1jnmBVt6puXC8wwmHqAJng7qp74pyZA82YScM5cW425rUhw7l3JbdoHQ0 |
| | | UdbRcKdrtCPtxbMsG4x8dGqUBkmLVZlm1df9R4XZqyy/k/Aws3anMo3/xzLaG7fo |
| | | /Ooc0MgnDP8Hnydt |
| | | -----END CERTIFICATE----- |
| | |
| | | -----BEGIN PRIVATE KEY----- |
| | | MIIEvwIBADANBgkqhkiG9w0BAQEFAASCBKkwggSlAgEAAoIBAQDGMbLYmDz7dzmF |
| | | zp+faWjvvUyUmLOkWoWqrzuD1uvKOANcU79zx08eO6rIvic6PqHDJqf6BYCP5pL/ |
| | | elcxZlsx8uZg4O2a444534FNAN5soP4WjjcA+7PYxF4Ro3gxY+3dymS8kuFdNHAj |
| | | 3dOWZFYNgNQCm2U4shl4vJlP6Oa3ZJh3Kt3iXLzwUklW9QUkNklcGnFD6jJ8FLFJ |
| | | a1sHwyW4mF2/sZEuGx11W+3q6g5LQE5mxQ8YDU//CZQzhNFOsGYIb+Mv6s/oh6rX |
| | | uqbDVz6JGq8bobYGyAvi9mbH8aYI/LQlGg15ei0UKEox9iWHzCU24V3anrm+rM4f |
| | | ZkdaYrRNAgMBAAECggEBAJvjo2Sx+eVhFaGlr+/XHW7UWlPW+BWiDdj/E7TTa4sX |
| | | G62XQdNzRUvmaqKSzpAFi37P/PevNDv7hEvmkoaMl9Zl08cHpFxb+BaVMkK7GDgh |
| | | OTnMin7/e6pYahU9muBeVU5KT4nzjced40aSyEZWjUj5t8iFKcy6aUaKMZyk+DPu |
| | | SvIc7Abpuizx/jiyftAictOAwCVYBkgg4DjSIxDHDjOL107llohL5WQB+8GahrWL |
| | | Nt4q0mDozLfR5ocr9SU0gWvm3Y0+/QkkO7O0kjG8W26jrG4XXvowl6Ou5Ypm6eHd |
| | | L2aJGGaSZJB1C5P44E4q7GSG+GERgDdvAWtXPE0nkBECgYEA/ndbbbEkGywDpRV9 |
| | | IP0PEpnLMGYVqK0h9FcPxszZ3tQcckDdSzEtTpNMFZsaUfFff9vci4Q5usCDRCSz |
| | | nEvYGhjqNE0mxN6l8eiOPbSRNlE3E0+yM4b6o6k6SFGVl8WmRe2HTMbCxlXobbHu |
| | | TsEBZ+2OD6D1Y4dfwSku8xwIvfMCgYEAx2ODZ4MYkH2qnuD7BbtHssQy6GW5yDQa |
| | | 1/6QH1mXk8v6+2TIIPheJ/VGQZ46IYr+pFewHVVvRtBwlrFCu95ibLX40Df730uW |
| | | ulhRRTW3U4L2mqfScSY7umfUMHQc0vZTYomxT3MTM6LjK9Dg+1AfVOYQMnlCgl8I |
| | | 6NXplE5iFL8CgYEAo9qHbOKbtUNqNWrY390TT47oX4nceHjDXGqTJhfSUsGSb5+E |
| | | 314TJn2CiIcPM6SRMeuI3+2MnsxHuiFH5mSQCn3wkSz8wdf8UwDEVsdmmetB45V1 |
| | | 0eggjDHz7Y1bHhePMYf5j16NHNlEiR4BrYRqO1mkGDw0xpns9pxmNvTeTDECgYAE |
| | | vXLkRROSa8pgmIyfKEKeF1f2emSeQ87Xj6+xbxnRY6oFy/GOBxmF7ajL6o0LOxiu |
| | | o38GU3+fuVjT3Ebv3GuOlgziNlKAjnV43Jyh/pLrI1PlfVPdaMFGvy0mMbx1r3Fw |
| | | CEH015F/SsIHyqFumAsGo6mC6asRGl1F27//zJU8VQKBgQC+uFuYiLTM8tOsZRzl |
| | | eDoBv1820ggBROE1tAGES0m7tBu5PpLhLIr6kOGn/Ic4ytEQ0p508SJdCWvwh+78 |
| | | w1JWLIVu3f2HXvUKMhNMuwMM78ugnuIVlneaIKmquGmRsaQD0L9khLQZOMiq4+ad |
| | | RCkk2Jb/uvVt3CL9A0IMBZO3Uw== |
| | | MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCmDz0NbBwlWn6t |
| | | Ywr2TO0QavWf1LUmJrfoSNTBiWEXhfVTAGP5BDk9yXcBUsTsi4R8x5EHIXy1WNmj |
| | | aAUNJBe46lhylHgGEk3Ft8EmGa5G6YN/gCqAJxakFdqoEp5Nb17Yp6CmymmF8R7R |
| | | 39W97zzd1j07k+no0Rp4rafKma9wigiYZiUVTyLsORs5qgW+bnsY64wT6TOWV0ds |
| | | jEcblf/hK1BQxnH2dpBzbW5fiFl/JVvIV+7m9rv3D0fUZ7UcSRpX7fExPBNJo/RU |
| | | ZbFQ73GnIhVSNa6DdJP0eQI9kiTf0wF7Ze03p/EX5SfcWkW4ZtsInUOAcENLtU8y |
| | | 7WkdaoZhAgMBAAECggEAJHBhmElp37R86bU7GZMFzj16SqlVWtrSLlGVBicMPCo0 |
| | | DBOg3GrV2L4VtB+igLmYx/zO0T7C69RkZZwUx65s2jHqWLJFqCdqE4HgC2lFOeBR |
| | | 76+DI/3v1O/KvGjhfeJ7cJVQBmmSQEcJ2UoB0BzoQVGavDEX+fOwmFya3jVdLxdw |
| | | fGcm9vKcaMNCz+O8LiRKroJyH2t05jiAU9Mp7Ryl8Gbx6gguz1rnXqhJrlp/jbfF |
| | | 8EChoC/teFNXMo25kqH9tuyuaAro5yVd3Io2qNA7z5WPFRb1C6UK9qYg44khHq9R |
| | | cy68e9gqAjiByVa/g9bIB78F4YuU+a3qvIzl7orQ8QKBgQDW8m+zJ3KWRXazeX/Y |
| | | zS5MTAhYdiYReCz/NKNCRk+1pA1ZXqyS2amjsuaX1trfOa72U6ie0t+dkR+jQ2/l |
| | | 3UmIOcZ8A4MepJIyuZZy3HuEZKRRVyNCVvgzsEeDoZYi0WPG2J+1xHWIqPiby/NZ |
| | | zWYPtRtRy9dSRRHiiCve5MJYLQKBgQDFxoKEQz5zNO0Zq+7KDvz8dj8ZKn0dfsiG |
| | | jXjgFh1GZIyFzSBIZbzEIytsKPBymFtu+qES7zI8dcPJ/IZOcpOL6Bo5ui/HshPJ |
| | | FTo+azdESxm6dpyuvWL2epw0HfN8w4lpjRI749TvpRWGh9bJjRQOuu6XiCzOrsFk |
| | | 9/Lk7cDzhQKBgCDsJTu1kRF/Nj0rIO/eDXdWNfkGr7IBTDMSpubhyheyNvE3VQtx |
| | | F1CheDxNhlymgyvriGo7NlD2B3iEPcFhcX/SCZq5Fv48isAGOQsCxlBy8dAbnqTs |
| | | mTuhhnKc71gJ5lRwnZXDr5Ts/JcwV+erVDSXssWGiUZqmeCuprmPJE1JAoGBAJrC |
| | | mpEK2YxnJv3Gp4WfsuGPWhLER8FT23BGtgaL536U4c011YQxcEP+zVTGuFjD1hCC |
| | | uJZLbIEZGgstup8aU1DQX+06P3dBZvAb10bOuSGMruZVOIgYFJ+RFDhIE6dWj2l0 |
| | | BYet4YthH/X0x+NRrRdVuawD2CQnZZgv2fbAARPNAoGAV3gQBtDknPu0KDfvLHH/ |
| | | D0okQ/vUnmOrBEIzSvz9tILwXidFnN4u4EOOImurnH5GC28KgO+ryg1RebypBZIK |
| | | R2qhHDmPOsUkMF6SAXGGWAHmTo0L9sU00enKr5hunKg7mKJml7z0EtP5wfmrCBcU |
| | | mVYKdVsyO8f0cqDeBVpyrRw= |
| | | -----END PRIVATE KEY----- |
| | |
| | | wxpay.appId=wx8ca03dad76833d3e |
| | | wxpay.appSecret=ZMYF1a7764dec949ff152d04e0e98abb |
| | | wxpay.mchId=1604180643 |
| | | wxpay.partnerKey=ZMYF1a7764dec949ff152d04e0e98abb |
| | | wxpay.appId=wx97ff4a530ce9c933 |
| | | wxpay.appSecret=7d8845342e3af5b5ff2289b55eccd716 |
| | | wxpay.mchId=1675018573 |
| | | wxpay.partnerKey=H8JdzeF35n2yTRfNk2WnZxEtbY3aB8P0 |
| | | #wxpay.partnerKey=mQQc4irkRkKp0B25cnPWthHc9YbByJy9 |
| | | wxpay.certPath=/ijpay/cert/apiclient_cert.p12 |
| | | wxpay.domain=\u5916\u7F51\u8BBF\u95EE\u9879\u76EE\u7684\u57DF\u540D\uFF0C\u652F\u4ED8\u901A\u77E5\u4E2D\u4F1A\u4F7F\u7528 |
| | | #wxpay.domain=http://www.xintongtong.cn:8081/rest |
| | | wxpay.worker.appId=wx360336f91d289d52 |
| | | wxpay.worker.appSecret=9022c6a2e8d628e85c99fa787313a79e |
| | |
| | | S_TO_W_TIP_CONSULT_PAY_GROUP_SUCCESS_ONLY("212041", "只提示"), |
| | | S_TO_W_TIP_COURSE_PAY_GROUP_SUCCESS("21205", "课程支付成功后提示"), |
| | | C_TO_W_IM_1V1_START_CONSULT("21107", "用户发送心理测试结果,1v1咨询开始"), |
| | | C_TO_W_IM_1V1_START_CONSULT_FIRST("21108", "首次咨询"), |
| | | S_TO_C_TIP_AUDIT_PASS("02001", "咨询师同意预约后提示"), |
| | | S_TO_C_TIP_MENTAL_APPOINTMENT_PUSH_WORK("12202", "发布作业:咨询师发布作业后提示"), |
| | | S_TO_C_TIP_MENTAL_APPOINTMENT_UPCOMING("02003", "即将开始:预约开始前24小时、30分钟提示"), |
| | |
| | | @Getter |
| | | public enum PayTypeEnum { |
| | | |
| | | ALIPAY(1, "支付宝"), |
| | | WXPAY(2, "微信"), |
| | | WXPAY(1, "微信"), |
| | | ALIPAY(2, "支付宝"), |
| | | ; |
| | | |
| | | private final Integer code; |
| | |
| | | */ |
| | | String[] getBindWorkerPostIds(String workerNo, PostIdEnum post11Enum, PostIdEnum post21Enum); |
| | | |
| | | /** |
| | | * 绑定顾问岗位ID数据 |
| | | */ |
| | | Boolean userBindClassConsultWorkerId(Long customerId, String workerNo); |
| | | |
| | | } |
| | |
| | | import cn.stylefeng.roses.kernel.auth.api.context.LoginContext; |
| | | import cn.stylefeng.roses.kernel.auth.api.exception.AuthException; |
| | | import cn.stylefeng.roses.kernel.auth.api.exception.enums.AuthExceptionEnum; |
| | | import cn.stylefeng.roses.kernel.auth.api.expander.AuthConfigExpander; |
| | | import cn.stylefeng.roses.kernel.auth.api.password.PasswordStoredEncryptApi; |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginRequest; |
| | | import cn.stylefeng.roses.kernel.auth.api.pojo.auth.LoginResponse; |
| | |
| | | |
| | | return postIds; |
| | | } |
| | | |
| | | @Override |
| | | public Boolean userBindClassConsultWorkerId(Long customerId, String workerNo) { |
| | | // 幸福顾问 |
| | | PostIdEnum post11Enum = PostIdEnum.PO_11; |
| | | // 咨询顾问 |
| | | PostIdEnum post21Enum = PostIdEnum.PO_21; |
| | | |
| | | // 获取绑定顾问岗位ID |
| | | String[] bindWorkerPostIds = this.getBindWorkerPostIds(workerNo, post11Enum, post21Enum); |
| | | Customer workerByNo = this.getOne( |
| | | Wrappers.<Customer>lambdaUpdate().eq(Customer::getWorkerNo, workerNo).last("LIMIT 1") |
| | | ); |
| | | |
| | | Customer newCustomer = new Customer(); |
| | | newCustomer.setCustomerId(customerId); |
| | | for (String postId : bindWorkerPostIds) { |
| | | if (postId.equals(post11Enum.getCode().toString())) { |
| | | newCustomer.setClassWorkerId(workerByNo.getCustomerId()); |
| | | } else if (postId.equals(post21Enum.getCode().toString())) { |
| | | newCustomer.setConsultWorkerId(workerByNo.getCustomerId()); |
| | | } |
| | | } |
| | | |
| | | Boolean update = false; |
| | | if (customerId != null && (newCustomer.getClassWorkerId() != null || newCustomer.getConsultWorkerId() != null)) { |
| | | // 修改用户信息 |
| | | update = this.updateCustomerRemoveCache(newCustomer); |
| | | } |
| | | |
| | | return update; |
| | | } |
| | | } |
New file |
| | |
| | | -- 数据库迁移 |
| | | -- DELETE FROM flyway_schema_history; |
| | | -- 组织机构审批人 |
| | | DELETE FROM hr_org_approver; |
| | | -- 组织机构信息 |
| | | -- DELETE FROM hr_organization WHERE org_id <> 1339554696976781407; |
| | | -- 岗位信息 |
| | | -- DELETE FROM hr_position; |
| | | |
| | | |
| | | -- 【IM业务】 |
| | | -- 消息群信息 |
| | | DELETE FROM im_group; |
| | | -- 消息群用户 |
| | | DELETE FROM im_group_user; |
| | | -- 消息通知 |
| | | DELETE FROM im_notice; |
| | | -- IM用户在线状态 |
| | | DELETE FROM im_user_status; |
| | | |
| | | -- 【系统设置】 |
| | | -- 系统应用 |
| | | -- DELETE FROM sys_app; |
| | | -- 参数配置 |
| | | -- DELETE FROM sys_config; |
| | | -- 多数据源信息 |
| | | -- DELETE FROM sys_database_info; |
| | | -- 字典 |
| | | -- DELETE FROM sys_dict; |
| | | -- 字典类型 |
| | | -- DELETE FROM sys_dict_type; |
| | | -- 业务拓展 |
| | | -- DELETE FROM sys_expand; |
| | | -- 业务拓展-具体数据 |
| | | -- DELETE FROM sys_expand_data; |
| | | -- 业务拓展-字段信息 |
| | | -- DELETE FROM sys_expand_field; |
| | | -- 文件信息 |
| | | -- DELETE FROM sys_file_info; |
| | | -- 文件存储信息 |
| | | -- DELETE FROM sys_file_storage; |
| | | -- 业务分组 |
| | | -- DELETE FROM sys_group; |
| | | -- 日志记录 |
| | | DELETE FROM sys_log; |
| | | -- 登录记录 |
| | | DELETE FROM sys_login_log; |
| | | -- 系统菜单 |
| | | -- DELETE FROM sys_menu; |
| | | -- 菜单下的按钮 |
| | | -- DELETE FROM sys_menu_button; |
| | | -- 菜单资源绑定 |
| | | -- DELETE FROM sys_menu_resource; |
| | | -- 系统消息 |
| | | -- DELETE FROM sys_message; |
| | | -- 通知管理 |
| | | -- DELETE FROM sys_notice; |
| | | -- 资源 |
| | | -- DELETE FROM sys_resource; |
| | | -- 系统角色 |
| | | -- DELETE FROM sys_role WHERE role_id <> 1; |
| | | -- 角色数据范围 |
| | | -- DELETE FROM sys_role_data_scope; |
| | | -- 角色菜单关联 |
| | | -- DELETE FROM sys_role_menu; |
| | | -- 角色按钮关联 |
| | | -- DELETE FROM sys_role_menu_button; |
| | | -- 角色资源关联 |
| | | -- DELETE FROM sys_role_resource; |
| | | -- 短信发送记录 |
| | | DELETE FROM sys_sms; |
| | | -- 常用功能的统计次数 |
| | | -- DELETE FROM sys_statistics_count; |
| | | -- 常用功能列表 |
| | | -- DELETE FROM sys_statistics_url; |
| | | -- 系统主题 |
| | | -- DELETE FROM sys_theme; |
| | | -- 系统主题-模板 |
| | | -- DELETE FROM sys_theme_template; |
| | | -- 系统主题-模板属性 |
| | | -- DELETE FROM sys_theme_template_field; |
| | | -- 系统主题-模板配置关联关系 |
| | | -- DELETE FROM sys_theme_template_rel; |
| | | -- 定时任务 |
| | | -- DELETE FROM sys_timers; |
| | | -- 多语言 |
| | | -- DELETE FROM sys_translation; |
| | | |
| | | -- 系统用户 |
| | | -- DELETE FROM sys_user WHERE user_id <> 1; |
| | | -- 用户数据范围 |
| | | -- DELETE FROM sys_user_data_scope; |
| | | -- 用户组 |
| | | -- DELETE FROM sys_user_group; |
| | | -- 用户组详情 |
| | | -- DELETE FROM sys_user_group_detail; |
| | | -- 用户组织机构关联 |
| | | -- DELETE FROM sys_user_org; |
| | | -- 用户角色关联 |
| | | -- DELETE FROM sys_user_role; |
| | | |
| | | |
| | | -- 地区码表 |
| | | -- DELETE FROM t_area; |
| | | |
| | | |
| | | -- 【基础数据】 |
| | | -- banner |
| | | DELETE FROM t_banner; |
| | | |
| | | -- 【咨询】 |
| | | -- 合同签订记录 |
| | | DELETE FROM t_contract_record; |
| | | -- 咨询师信息 |
| | | DELETE FROM t_counselling_info; |
| | | -- 咨询订单信息 |
| | | DELETE FROM t_counselling_order; |
| | | -- 咨询订单预约记录 |
| | | DELETE FROM t_counselling_order_reservation; |
| | | -- 咨询记录信息 |
| | | DELETE FROM t_counselling_reservation_record; |
| | | -- 咨询作业 |
| | | DELETE FROM t_counselling_reservation_work; |
| | | -- 咨询套餐信息 |
| | | DELETE FROM t_counselling_set_meal; |
| | | -- 咨询预约特殊时间配置 |
| | | DELETE FROM t_counselling_special_time_config; |
| | | -- 咨询擅长领域标签表 |
| | | DELETE FROM t_counselling_tag; |
| | | -- 咨询预约时间配置 |
| | | DELETE FROM t_counselling_time_config; |
| | | |
| | | |
| | | -- 【课程】 |
| | | -- 课程管理 |
| | | DELETE FROM t_course; |
| | | -- 章节管理 |
| | | DELETE FROM t_course_chapter; |
| | | -- 课程订单信息 |
| | | DELETE FROM t_course_order; |
| | | -- 课程学习笔记 |
| | | DELETE FROM t_course_study_note; |
| | | -- 课程标签 |
| | | DELETE FROM t_course_tag; |
| | | -- 课程学习记录 |
| | | DELETE FROM t_course_user_learned; |
| | | -- 课程章节学习进度 |
| | | DELETE FROM t_couser_chapter_learning_rate; |
| | | |
| | | |
| | | -- 【心理测试1v1咨询】 |
| | | -- 性格分析特殊时间配置 |
| | | DELETE FROM t_mental_analysis_special_time_config; |
| | | -- 性格分析可预约时间 |
| | | DELETE FROM t_mental_analysis_time; |
| | | -- 性格分析时间配置 |
| | | DELETE FROM t_mental_analysis_time_config; |
| | | -- 性格分析预约 |
| | | DELETE FROM t_mental_appointment; |
| | | -- 心理测试分类 |
| | | -- DELETE FROM t_mental_test_class; |
| | | -- 心理测试选项 |
| | | DELETE FROM t_mental_test_option; |
| | | -- 心理测试问题 |
| | | DELETE FROM t_mental_test_question; |
| | | -- 心理测试记录 |
| | | DELETE FROM t_mental_test_record; |
| | | -- 心理测试结果 |
| | | DELETE FROM t_mental_test_result; |
| | | -- 心理测试结果配置 |
| | | DELETE FROM t_mental_test_result_set; |
| | | -- 心理测试题库 |
| | | DELETE FROM t_mental_test_topic; |
| | | -- 心理咨询1V1订单 |
| | | DELETE FROM t_order_consult_one; |
| | | -- 心理测试订单 |
| | | DELETE FROM t_order_mental_test; |
| | | |
| | | |
| | | -- 帮助 |
| | | DELETE FROM t_help; |
| | | |
| | | -- 心理专栏管理 |
| | | DELETE FROM t_psychological_column; |
| | | -- 心理专栏阅读记录 |
| | | DELETE FROM t_psychological_read; |
| | | |
| | | -- 门店预约 |
| | | DELETE FROM t_store_appointment; |
| | | |
| | | -- 系统配置(H5、客服电话) |
| | | -- DELETE FROM t_system_set; |
| | | |
| | | -- 用户评价表 |
| | | DELETE FROM t_user_evaluate; |
| | | -- C端用户表 |
| | | DELETE FROM toc_customer WHERE customer_id <> 1; |