| @@ -10,7 +10,6 @@ import com.iformall.domain.po.WxTags; | |||||
| import com.iformall.domain.vo.CUserBaseInfoT; | import com.iformall.domain.vo.CUserBaseInfoT; | ||||
| import com.iformall.domain.vo.MerchantPoiT; | import com.iformall.domain.vo.MerchantPoiT; | ||||
| import com.iformall.service.TtMerchantPoiService; | import com.iformall.service.TtMerchantPoiService; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxTagsService; | import com.iformall.service.WxTagsService; | ||||
| import org.apache.shiro.session.UnknownSessionException; | import org.apache.shiro.session.UnknownSessionException; | ||||
| import org.slf4j.Logger; | import org.slf4j.Logger; | ||||
| @@ -28,8 +27,6 @@ import java.util.concurrent.TimeUnit; | |||||
| public class AsyncTask { | public class AsyncTask { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Autowired | @Autowired | ||||
| private TtMerchantPoiService ttMerchantPoiService; | private TtMerchantPoiService ttMerchantPoiService; | ||||
| @@ -120,19 +117,6 @@ public class AsyncTask { | |||||
| WxTags wxTagsQ = new WxTags(); | WxTags wxTagsQ = new WxTags(); | ||||
| List<WxTags> tagList = wxTagsService.findList(wxTagsQ); | List<WxTags> tagList = wxTagsService.findList(wxTagsQ); | ||||
| try { | |||||
| successList.parallelStream().forEach(uBase -> { | |||||
| try { | |||||
| wxCUserBasicInfoService.importOneMem(importKey, tagList, uBase, user); | |||||
| } catch (UnknownSessionException ue) { | |||||
| logger.error("session :"+ue.getMessage()); | |||||
| } | |||||
| }); | |||||
| } catch (Exception e) { | |||||
| set_redis_value(importKey, "1", "0", "0", "1", true); | |||||
| e.printStackTrace(); | |||||
| logger.error("导入模板失败:"+e.getMessage()); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -15,7 +15,6 @@ import com.iformall.domain.vo.WxBillExcelTemplateOther; | |||||
| import com.iformall.enums.EnumMerchantStatus; | import com.iformall.enums.EnumMerchantStatus; | ||||
| import com.iformall.mapper.WxMerchantMapper; | import com.iformall.mapper.WxMerchantMapper; | ||||
| import com.iformall.service.WxBillAllService; | import com.iformall.service.WxBillAllService; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxTagsService; | import com.iformall.service.WxTagsService; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| import org.apache.shiro.session.UnknownSessionException; | import org.apache.shiro.session.UnknownSessionException; | ||||
| @@ -39,9 +38,6 @@ import java.util.stream.Collectors; | |||||
| public class ImportTemplateTask { | public class ImportTemplateTask { | ||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Autowired | @Autowired | ||||
| private WxTagsService wxTagsService; | private WxTagsService wxTagsService; | ||||
| @@ -324,11 +320,6 @@ public class ImportTemplateTask { | |||||
| try { | try { | ||||
| successList.parallelStream().forEach(uBase -> { | successList.parallelStream().forEach(uBase -> { | ||||
| try { | |||||
| wxCUserBasicInfoService.importOneMem(importKey, tagList, uBase, user); | |||||
| } catch (UnknownSessionException ue) { | |||||
| logger.error("session :" + ue.getMessage()); | |||||
| } | |||||
| }); | }); | ||||
| } catch (Exception e) { | } catch (Exception e) { | ||||
| set_redis_value(importKey, "1", "0", "0", "1", true); | set_redis_value(importKey, "1", "0", "0", "1", true); | ||||
| @@ -9,7 +9,6 @@ import com.iformall.controller.base.BaseController; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.domain.po.WxScoreHistory; | import com.iformall.domain.po.WxScoreHistory; | ||||
| import com.iformall.enums.EnumCUserBasicInfoStatus; | import com.iformall.enums.EnumCUserBasicInfoStatus; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxScoreHistoryService; | import com.iformall.service.WxScoreHistoryService; | ||||
| import io.swagger.annotations.ApiImplicitParam; | import io.swagger.annotations.ApiImplicitParam; | ||||
| import io.swagger.annotations.ApiImplicitParams; | import io.swagger.annotations.ApiImplicitParams; | ||||
| @@ -27,8 +26,6 @@ public class WxScoreHistoryController extends BaseController { | |||||
| @Autowired | @Autowired | ||||
| private WxScoreHistoryService wxScoreHistoryService; | private WxScoreHistoryService wxScoreHistoryService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @ApiOperation("分页列表接口") | @ApiOperation("分页列表接口") | ||||
| @@ -77,11 +74,6 @@ public class WxScoreHistoryController extends BaseController { | |||||
| } | } | ||||
| public boolean checkMemberStatus(Long userId) { | public boolean checkMemberStatus(Long userId) { | ||||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(userId,getTenantInfo().getFinalTenantId()); | |||||
| if (wxCUserBasicInfo != null && wxCUserBasicInfo.getStatus().equals(EnumCUserBasicInfoStatus.LOCKED.getCode())) { | |||||
| logger.info("会员权益被锁定:cUserId:" + userId); | |||||
| return true; | |||||
| } | |||||
| return false; | return false; | ||||
| } | } | ||||
| @@ -54,9 +54,6 @@ public class BaseController { | |||||
| @Autowired | @Autowired | ||||
| private FmOpenService openService; | private FmOpenService openService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Autowired | @Autowired | ||||
| private WxCUserBasicChildService wxCUserBasicChildService; | private WxCUserBasicChildService wxCUserBasicChildService; | ||||
| @@ -127,12 +124,4 @@ public class BaseController { | |||||
| return ipaddress; | return ipaddress; | ||||
| } | } | ||||
| public Integer getPoins() { | |||||
| WxCUserBasicInfo cuser = getCUser(); | |||||
| WxCUserBasicInfo newcuser = wxCUserBasicInfoService.getById(cuser.getId(), cuser.getFinalTenantId()); | |||||
| if (newcuser == null) { | |||||
| throw new MallinkException(ErrorCode.USER_IS_EMPTY); | |||||
| } | |||||
| return newcuser.getPoins(); | |||||
| } | |||||
| } | } | ||||
| @@ -12,7 +12,6 @@ import com.iformall.domain.po.base.BaseCUserEntity; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.exception.MallinkException; | import com.iformall.exception.MallinkException; | ||||
| import com.iformall.service.CUserTokenService; | import com.iformall.service.CUserTokenService; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxMallService; | import com.iformall.service.WxMallService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -36,9 +35,6 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||||
| @Autowired | @Autowired | ||||
| private CUserTokenService cUserTokenService; | private CUserTokenService cUserTokenService; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Autowired | @Autowired | ||||
| private WxMallService wxMallService; | private WxMallService wxMallService; | ||||
| @@ -68,14 +64,6 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter { | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY.getCode(),"token为空["+token+"]"); | throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY.getCode(),"token为空["+token+"]"); | ||||
| } | } | ||||
| // 查询token信息 | |||||
| WxCUserBasicInfo basicInfo = wxCUserBasicInfoService.getByToken(token); | |||||
| if(basicInfo == null){ | |||||
| throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录"); | |||||
| } | |||||
| request.setAttribute(Constant.LOGIN_MEMBER_KEY,basicInfo.getId()); | |||||
| request.setAttribute(Constant.REQUEST_C_USER_KEY, basicInfo); | |||||
| return true; | return true; | ||||
| } | } | ||||
| @@ -4,7 +4,6 @@ import com.iformall.annotation.LoginUser; | |||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.domain.po.base.BaseCUserEntity; | import com.iformall.domain.po.base.BaseCUserEntity; | ||||
| import com.iformall.service.CUserTokenService; | import com.iformall.service.CUserTokenService; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import org.springframework.beans.factory.annotation.Autowired; | import org.springframework.beans.factory.annotation.Autowired; | ||||
| import org.springframework.core.MethodParameter; | import org.springframework.core.MethodParameter; | ||||
| @@ -24,8 +23,6 @@ import org.springframework.web.method.support.ModelAndViewContainer; | |||||
| @Component | @Component | ||||
| public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { | public class LoginUserHandlerMethodArgumentResolver implements HandlerMethodArgumentResolver { | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Override | @Override | ||||
| public boolean supportsParameter(MethodParameter parameter) { | public boolean supportsParameter(MethodParameter parameter) { | ||||
| @@ -1,216 +0,0 @@ | |||||
| package com.iformall.service; | |||||
| import com.github.pagehelper.PageInfo; | |||||
| import com.iformall.common.ResultData; | |||||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||||
| import com.iformall.domain.dto.WxCUserBasicInfoFilterDto; | |||||
| import com.iformall.domain.dto.WxCUserBasicInfoFilterListDto; | |||||
| import com.iformall.domain.po.*; | |||||
| import com.iformall.domain.po.base.TenantEntity; | |||||
| import com.iformall.domain.vo.CUserBaseInfoT; | |||||
| import com.iformall.domain.vo.UserCountVo; | |||||
| import com.iformall.domain.vo.WxTagsGroupVo; | |||||
| import com.iformall.enums.EnumMsgModel; | |||||
| import com.iformall.enums.EnumScoreType; | |||||
| import javax.servlet.http.HttpServletRequest; | |||||
| import javax.servlet.http.HttpServletResponse; | |||||
| import java.util.List; | |||||
| import java.util.Map; | |||||
| public interface WxCUserBasicInfoService { | |||||
| /** | |||||
| * 根据租户ID获取会员过滤器列表 | |||||
| * | |||||
| * @return | |||||
| */ | |||||
| List<WxTagsGroupVo> listFilters(TenantEntity tenantEntity); | |||||
| long countByFilter(TenantEntity tenantEntity, List<WxCUserBasicInfoFilterDto> filterList); | |||||
| List<WxCUserBasicInfo> listByFilter(TenantEntity tenantEntity, List<WxCUserBasicInfoFilterDto> filterList); | |||||
| List<Long> findIdByFilter(TenantEntity tenantEntity, List<WxCUserBasicInfoFilterDto> filterList); | |||||
| List<WxCUserBasicInfo> listByFilterList(TenantEntity tenantEntity, List<WxCUserBasicInfoFilterListDto> filterList); | |||||
| List<String> listOpenIdByFilter(TenantEntity tenantEntity, List<WxCUserBasicInfoFilterListDto> filterList); | |||||
| /** | |||||
| * 根据实体查询分页列表 | |||||
| * | |||||
| * @param record | |||||
| * @param pageIndex | |||||
| * @param pageSize | |||||
| * @return | |||||
| */ | |||||
| PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize); | |||||
| List<WxCUserBasicInfo> listPhoneAndNameByIds(WxCUserBasicInfo record); | |||||
| Map<Long,WxCUserBasicInfo> getUserMap(TenantEntity tenantEntity, List<Long> cUserIdList); | |||||
| /** | |||||
| * 根据实体查询列表 | |||||
| * @param record | |||||
| * @return | |||||
| */ | |||||
| int countUser(WxCUserBasicInfo record); | |||||
| /** | |||||
| * 根据Id获得实体 | |||||
| * | |||||
| * @param id | |||||
| * @return | |||||
| */ | |||||
| WxCUserBasicInfo getById(Long id,String finalTenantId); | |||||
| WxCUserBasicInfo getById(Long id); | |||||
| /** | |||||
| * 保存实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void save(WxCUserBasicInfo record); | |||||
| /** | |||||
| * 更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void update(WxCUserBasicInfo record); | |||||
| /** | |||||
| * 保存或更新实体 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void updateObj(WxCUserBasicInfo record, WxCUser user); | |||||
| /** | |||||
| * 根据Id删除实体 | |||||
| * | |||||
| */ | |||||
| //void deleteById(Long id); | |||||
| List<WxCUserBasicInfo> findByPhone(TenantEntity tenantEntity, String phone); | |||||
| WxCUserBasicInfo findInfoByPhone(TenantEntity tenantEntity, String phone); | |||||
| WxCUserBasicInfo findInfoByEmail(TenantEntity tenantInfo, String email); | |||||
| /** | |||||
| * 修改会员积分 | |||||
| * | |||||
| * @param record | |||||
| */ | |||||
| void updateScore(WxCUserBasicInfo record); | |||||
| /** | |||||
| * 根据性别查询数量 | |||||
| * | |||||
| * @param dto | |||||
| * @return | |||||
| */ | |||||
| long findCountBySex(WxCUserBasicInfoDto dto); | |||||
| /** | |||||
| * 根据年龄查询数量 | |||||
| * | |||||
| * @param dto | |||||
| * @return | |||||
| */ | |||||
| long findCountByAge(WxCUserBasicInfoDto dto); | |||||
| /** | |||||
| * 根据年龄积分查寻数量 | |||||
| * | |||||
| * @param dto | |||||
| * @return | |||||
| */ | |||||
| long findCountByScore(WxCUserBasicInfoDto dto); | |||||
| int exportDataCount(WxCUserBasicInfo basicInfo); | |||||
| void exportData(WxCUserBasicInfo basicInfo, HttpServletRequest request, HttpServletResponse response); | |||||
| void exportTemplate(HttpServletRequest request, HttpServletResponse response); | |||||
| void importOneMem(String importKey, List<WxTags> tagList, CUserBaseInfoT uBase,MallUserInfo mallUserInfo); | |||||
| long findCount(WxCUserBasicInfoDto record); | |||||
| List<UserCountVo> findCountHistory(WxCUserBasicInfoDto record); | |||||
| /** | |||||
| * 停车会员记录导出 | |||||
| * @param record | |||||
| * @param request | |||||
| * @param response | |||||
| */ | |||||
| void exportCarPayData(WxCarPayRecord record, HttpServletRequest request, HttpServletResponse response); | |||||
| /** | |||||
| * 自然增长用户 | |||||
| * @return | |||||
| */ | |||||
| long findGrowUserCount(TenantEntity tenantEntity); | |||||
| /** | |||||
| * 导入用户数 | |||||
| * @return | |||||
| */ | |||||
| long findImportUserCount(TenantEntity tenantEntity); | |||||
| ResultData updateStatus(WxCUserBasicInfo wxCUserBasicInfo); | |||||
| WxCUserBasicInfo getByObject(WxCUserBasicInfo wxCUserBasicInfo); | |||||
| List<WxCUserBasicInfo> findListByScore(TenantEntity tenantEntity, WxCUserBasicInfoDto wxCUserBasicInfoDto); | |||||
| List<WxCUserBasicInfo> findBirthdayList(TenantEntity tenantEntity, String format, String format1); | |||||
| void cuserOldToNew(Long oldCuserId, Long newCuserId,TenantEntity tenantinfo); | |||||
| WxCUserBasicInfo registerByPhone(TenantEntity tenantEntity, String phone, String nickName,String name, Integer sex, String avatarUrl); | |||||
| int addCredit(Long userId, TenantEntity tenantInfo, EnumScoreType wechatPhone); | |||||
| void registerJinmao(TenantEntity tenantInfo,WxCUserBasicInfo basicInfo); | |||||
| void updateTenantIdMsg(TenantEntity tenantInfo, TenantEntity mallTenant, Long userId); | |||||
| void updateTenantId(String finalTenantId, String tenantId, Long userId); | |||||
| void handleLoginUser(WxCUserBasicInfo basicInfo); | |||||
| void logout(WxCUserBasicInfo basicInfo); | |||||
| WxCUserBasicInfo getByToken(String token); | |||||
| WxCUserBasicInfo register(TenantEntity tenantInfo, String phone, String pwd); | |||||
| WxCUserBasicInfo registerEmail(TenantEntity tenantInfo, String email, String password); | |||||
| /** | |||||
| * 发送激活邮件,修改密码邮件 | |||||
| */ | |||||
| void sendTicketEmail(WxCUserBasicInfo basicInfo, EnumMsgModel type); | |||||
| void updUserInfo(WxCUserBasicInfo cUser, Long memberId); | |||||
| // WxCUserBasicInfo getById1(Long id); | |||||
| // void updateCode(Long id, String mcode); | |||||
| void reducePoints(Long id,String finalTenantId,Integer reducePoints); | |||||
| void addPoints(Long id,String finalTenantId,Integer addPoints); | |||||
| List<Long> findIdsListByPhone(String finalTenantId,String phone); | |||||
| List<WxCUserBasicInfo> findList(WxCUserBasicInfo basicInfo); | |||||
| } | |||||
| @@ -10,7 +10,6 @@ import com.iformall.domain.po.WxCUserCar; | |||||
| import com.iformall.domain.po.base.TenantEntity; | import com.iformall.domain.po.base.TenantEntity; | ||||
| import com.iformall.mapper.WxCUserBasicInfoMapper; | import com.iformall.mapper.WxCUserBasicInfoMapper; | ||||
| import com.iformall.mapper.WxCUserCarMapper; | import com.iformall.mapper.WxCUserCarMapper; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxCUserCarService; | import com.iformall.service.WxCUserCarService; | ||||
| import com.iformall.service.WxMallService; | import com.iformall.service.WxMallService; | ||||
| import org.apache.commons.lang3.StringUtils; | import org.apache.commons.lang3.StringUtils; | ||||
| @@ -35,9 +34,6 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||||
| @Autowired | @Autowired | ||||
| WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | ||||
| @Autowired | |||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Autowired | @Autowired | ||||
| WxMallService wxMallService; | WxMallService wxMallService; | ||||
| @@ -60,13 +56,6 @@ public class WxCUserCarServiceImpl implements WxCUserCarService { | |||||
| return; | return; | ||||
| } | } | ||||
| List<Long> userIds = userCarList.stream().map(uc -> uc.getCUserId()).collect(Collectors.toList()); | List<Long> userIds = userCarList.stream().map(uc -> uc.getCUserId()).collect(Collectors.toList()); | ||||
| Map<Long, WxCUserBasicInfo> userMap = wxCUserBasicInfoService.getUserMap(tenantEntity, userIds); | |||||
| for (WxCUserCar uc:userCarList) { | |||||
| WxCUserBasicInfo basicInfo = userMap.get(uc.getCUserId()); | |||||
| if(basicInfo != null){ | |||||
| uc.setUserPhone(basicInfo.getPhone()); | |||||
| } | |||||
| } | |||||
| } | } | ||||
| @Override | @Override | ||||
| @@ -16,7 +16,6 @@ import com.iformall.domain.vo.WxLevelMerchantCVo; | |||||
| import com.iformall.mapper.WxCUserBasicInfoMapper; | import com.iformall.mapper.WxCUserBasicInfoMapper; | ||||
| import com.iformall.mapper.WxLevelConfigMapper; | import com.iformall.mapper.WxLevelConfigMapper; | ||||
| import com.iformall.mapper.WxLevelMerchantMapper; | import com.iformall.mapper.WxLevelMerchantMapper; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.WxLevelConfigService; | import com.iformall.service.WxLevelConfigService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| import com.iformall.utils.RedisCacheUtils; | import com.iformall.utils.RedisCacheUtils; | ||||
| @@ -52,9 +51,6 @@ public class WxLevelConfigServiceImpl implements WxLevelConfigService { | |||||
| @Autowired | @Autowired | ||||
| WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | ||||
| @Autowired | |||||
| private WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Autowired | @Autowired | ||||
| @Qualifier("objectCommonRedisTemplate") | @Qualifier("objectCommonRedisTemplate") | ||||
| RedisTemplate<String, Object> wxLevelConfigListRedisTemplate; | RedisTemplate<String, Object> wxLevelConfigListRedisTemplate; | ||||
| @@ -82,7 +78,6 @@ public class WxLevelConfigServiceImpl implements WxLevelConfigService { | |||||
| if (i + 1<page.getList().size()) | if (i + 1<page.getList().size()) | ||||
| dto.setLevelEndScore(page.getList().get(i+1).getPoints()); | dto.setLevelEndScore(page.getList().get(i+1).getPoints()); | ||||
| l.setUserCount(wxCUserBasicInfoService.findCountByScore(dto)); | |||||
| } | } | ||||
| return page; | return page; | ||||
| @@ -9,7 +9,6 @@ import org.springframework.context.annotation.Lazy; | |||||
| import org.springframework.stereotype.Service; | import org.springframework.stereotype.Service; | ||||
| import com.iformall.domain.po.Product; | import com.iformall.domain.po.Product; | ||||
| import com.iformall.domain.po.WxCUserBasicInfo; | import com.iformall.domain.po.WxCUserBasicInfo; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.project.entity.CreateBilling; | import com.iformall.service.project.entity.CreateBilling; | ||||
| import com.iformall.service.project.service.ProjectService; | import com.iformall.service.project.service.ProjectService; | ||||
| import com.iformall.utils.Constant; | import com.iformall.utils.Constant; | ||||
| @@ -20,10 +19,6 @@ public class HYProjectService extends BaseProjectService implements ProjectServi | |||||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | private final Logger logger = LoggerFactory.getLogger(this.getClass()); | ||||
| @Lazy | |||||
| @Autowired | |||||
| WxCUserBasicInfoService wxCUserBasicInfoService; | |||||
| @Override | @Override | ||||
| public Object getPayProductExtroInfo(Product product) { | public Object getPayProductExtroInfo(Product product) { | ||||
| //慧影套餐表project_package_detail, 现在暂时不搞那么复杂 | //慧影套餐表project_package_detail, 现在暂时不搞那么复杂 | ||||
| @@ -32,32 +27,21 @@ public class HYProjectService extends BaseProjectService implements ProjectServi | |||||
| @Override | @Override | ||||
| public void handlePaidOrder(Long cUserId,String cUserFinalTenantId,Product product) { | public void handlePaidOrder(Long cUserId,String cUserFinalTenantId,Product product) { | ||||
| //更新用户的币 | |||||
| wxCUserBasicInfoService.addPoints(cUserId, cUserFinalTenantId,product.getGlod()); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public CreateBilling handleCreateVideoBilling(Long cUserId,String cUserFinalTenantId,String videoTimes, Long videoSize) { | public CreateBilling handleCreateVideoBilling(Long cUserId,String cUserFinalTenantId,String videoTimes, Long videoSize) { | ||||
| //慧影视频按照时长来扣币 | //慧影视频按照时长来扣币 | ||||
| CreateBilling cb = new CreateBilling(); | CreateBilling cb = new CreateBilling(); | ||||
| //每分钟扣币,不足一分钟按一分钟算 | |||||
| Integer minitues = new BigDecimal(videoTimes).divide(new BigDecimal(60),BigDecimal.ROUND_CEILING).setScale(0,BigDecimal.ROUND_UP).intValue(); | |||||
| Integer poinsPerMinites = Constant.hyCostPoinsPerMinites; | |||||
| cb.setTotalCostPoins(new BigDecimal(minitues).multiply(new BigDecimal(poinsPerMinites)).intValue()); | |||||
| cb.setDetail("每分钟扣币"+poinsPerMinites+"个,总共时长"+videoTimes+"(秒),按"+minitues+"分钟总计费。"); | |||||
| //扣去当前用户的币 | |||||
| wxCUserBasicInfoService.reducePoints(cUserId, cUserFinalTenantId,cb.getTotalCostPoins()); | |||||
| return cb; | return cb; | ||||
| } | } | ||||
| @Override | @Override | ||||
| public void rollbackCreateVideoBilling(Long cUserId,String cUserFinalTenantId,CreateBilling cb) { | public void rollbackCreateVideoBilling(Long cUserId,String cUserFinalTenantId,CreateBilling cb) { | ||||
| wxCUserBasicInfoService.addPoints(cUserId, cUserFinalTenantId,cb.getTotalCostPoins()); | |||||
| } | } | ||||
| @Override | @Override | ||||
| public void handleAfterRegeister(WxCUserBasicInfo cUser) { | public void handleAfterRegeister(WxCUserBasicInfo cUser) { | ||||
| wxCUserBasicInfoService.addPoints(cUser.getId(), cUser.getFinalTenantId(),Constant.hyRegeisterPoins); | |||||
| } | } | ||||
| @@ -20,7 +20,6 @@ import com.iformall.exception.MallinkException; | |||||
| import com.iformall.mapper.TtOrderMapper; | import com.iformall.mapper.TtOrderMapper; | ||||
| import com.iformall.mapper.TtVideoLibraryMapper; | import com.iformall.mapper.TtVideoLibraryMapper; | ||||
| import com.iformall.service.WxAppinfoService; | import com.iformall.service.WxAppinfoService; | ||||
| import com.iformall.service.WxCUserBasicInfoService; | |||||
| import com.iformall.service.tt.TtCouponService; | import com.iformall.service.tt.TtCouponService; | ||||
| import com.iformall.service.tt.TtOrderService; | import com.iformall.service.tt.TtOrderService; | ||||
| import com.iformall.service.tt.TtVideoLibraryService; | import com.iformall.service.tt.TtVideoLibraryService; | ||||