|  |  |  | 
|---|
|  |  |  | import com.xzx.gc.entity.SysMessage; | 
|---|
|  |  |  | import com.xzx.gc.entity.UserHeadRelate; | 
|---|
|  |  |  | import com.xzx.gc.entity.UserShareInfo; | 
|---|
|  |  |  | import com.xzx.gc.user.dto.HeadProfitLitDto; | 
|---|
|  |  |  | import com.xzx.gc.user.dto.HeadTeamDto; | 
|---|
|  |  |  | import com.xzx.gc.user.mapper.*; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.HeadInfoVo; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.HeadProfitListVo; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.HeadTeamVo; | 
|---|
|  |  |  | import com.xzx.gc.user.dto.AdddistribDto; | 
|---|
|  |  |  | import com.xzx.gc.user.dto.DistribInfoListDto; | 
|---|
|  |  |  | import com.xzx.gc.user.dto.DistribListDto; | 
|---|
|  |  |  | import com.xzx.gc.user.mapper.AccountMapper; | 
|---|
|  |  |  | import com.xzx.gc.user.mapper.SysMessageMapper; | 
|---|
|  |  |  | import com.xzx.gc.user.mapper.UserHeadRelateMapper; | 
|---|
|  |  |  | import com.xzx.gc.user.mapper.UserShareInfoMapper; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.DistribListVo; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.HeadInfoVo; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.*; | 
|---|
|  |  |  | import cn.hutool.core.util.ObjectUtil; | 
|---|
|  |  |  | import cn.hutool.core.util.StrUtil; | 
|---|
|  |  |  | import com.xzx.gc.entity.RedPaperRule; | 
|---|
|  |  |  | import com.xzx.gc.model.JsonResult; | 
|---|
|  |  |  | import com.xzx.gc.user.dto.UpdateSettingDto; | 
|---|
|  |  |  | import com.xzx.gc.user.mapper.RedPaperRuleMapper; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.JhyInfoListVo; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.ViewSettingVo; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.stereotype.Service; | 
|---|
|  |  |  | import org.springframework.transaction.annotation.Transactional; | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import java.math.BigDecimal; | 
|---|
|  |  |  | import java.util.Date; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Service | 
|---|
|  |  |  | 
|---|
|  |  |  | private RedPaperRuleMapper redPaperRuleMapper; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private UserHeadRelateMapper userHeadRelateMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private UserHeadDetailsMapper userHeadDetailsMapper; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private AccountMapper accountMapper; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | 
|---|
|  |  |  | return headInfoVo; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public List<HeadProfitListVo> findHeadProfitListInPage(HeadProfitLitDto profitLitDto) { | 
|---|
|  |  |  | PageHelper.startPage(profitLitDto.getPage(), profitLitDto.getLimit()); | 
|---|
|  |  |  | return userHeadDetailsMapper.selectHeadProfitListInPage(profitLitDto.getUserId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public List<HeadTeamVo> findHeadTeamListInPage(HeadTeamDto teamDto) { | 
|---|
|  |  |  | PageHelper.startPage(teamDto.getPage(), teamDto.getLimit()); | 
|---|
|  |  |  | return userHeadRelateMapper.selectHeadTeamListInPage(teamDto.getUserId()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void addSetting(UpdateSettingDto model) { | 
|---|
|  |  |  | RedPaperRule redPaperRule = new RedPaperRule(); | 
|---|
|  |  |  | StringBuffer stringBuffer = new StringBuffer(); | 
|---|
|  |  |  | 
|---|
|  |  |  | accountInfo.setIsHead(1); | 
|---|
|  |  |  | accountMapper.updateByPrimaryKey(accountInfo); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Map<String, Object> distribInfoList(DistribInfoListDto distribInfoListDto) { | 
|---|
|  |  |  | PageHelper.startPage(distribInfoListDto.getPage(), distribInfoListDto.getLimit()); | 
|---|
|  |  |  | if(StrUtil.isNotEmpty(distribInfoListDto.getName())){ | 
|---|
|  |  |  | String decode = StringUtils.encode(distribInfoListDto.getName()); | 
|---|
|  |  |  | distribInfoListDto.setName(decode); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<DistribInfoListVo> distribInfoListVos = accountMapper.selectDsitribInfoListByQueryCol(distribInfoListDto); | 
|---|
|  |  |  | if(CollUtil.isNotEmpty(distribInfoListVos)){ | 
|---|
|  |  |  | for(DistribInfoListVo distribInfoListVo : distribInfoListVos){ | 
|---|
|  |  |  | String nickname = distribInfoListVo.getNickname(); | 
|---|
|  |  |  | String decode = StringUtils.decode(nickname); | 
|---|
|  |  |  | distribInfoListVo.setNickname(decode); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | PageInfo<DistribInfoListVo> pageInfo = new PageInfo<>(distribInfoListVos); | 
|---|
|  |  |  | Map<String, Object> data = new HashMap<>(); | 
|---|
|  |  |  | int count = Convert.toInt(pageInfo.getTotal()); | 
|---|
|  |  |  | data.put("data", distribInfoListVos); | 
|---|
|  |  |  | data.put("count", count); | 
|---|
|  |  |  | data.put("code", 0); | 
|---|
|  |  |  | return data; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|