| | |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import cn.hutool.poi.excel.ExcelReader; |
| | | import cn.hutool.poi.excel.ExcelUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.enums.SqlLike; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.sinata.common.enums.*; |
| | | import com.sinata.common.enums.EnumAuditState; |
| | | import com.sinata.common.enums.EnumCityRole; |
| | | import com.sinata.common.enums.EnumIsDelete; |
| | | import com.sinata.common.enums.EnumIsSystemNotice; |
| | | import com.sinata.common.enums.EnumMemberGrade; |
| | | import com.sinata.common.enums.mall.EnumMallGoodsGroupType; |
| | | import com.sinata.common.enums.mall.EnumMallOrderState; |
| | | import com.sinata.core.base.controller.BaseController; |
| | |
| | | import com.sinata.core.common.annotion.BussinessLog; |
| | | import com.sinata.core.common.annotion.Permission; |
| | | import com.sinata.core.common.constant.factory.PageFactory; |
| | | import com.sinata.core.common.exception.BizExceptionEnum; |
| | | import com.sinata.core.exception.GunsException; |
| | | import com.sinata.core.shiro.ShiroKit; |
| | | import com.sinata.core.shiro.ShiroUser; |
| | | import com.sinata.core.util.Convert; |
| | |
| | | import com.sinata.modular.system.service.ISystemNoticeService; |
| | | import com.sinata.modular.system.service.ITCityRegionService; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import javax.servlet.ServletOutputStream; |
| | | import java.math.BigDecimal; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.Objects; |
| | | import java.util.stream.Collectors; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | |
| | | /** |
| | |
| | | |
| | | List<MemUser> v4UserList = memUserService.getUserListByGrade(EnumMemberGrade.G_4.index); |
| | | List<MemUser> v5UserList = memUserService.getUserListByGrade(EnumMemberGrade.G_5.index); |
| | | |
| | | List<MemUserRelation> userRelationList = memUserRelationService.selectList(null); |
| | | Map<Integer, Integer> userRelationMap = userRelationList.stream().collect(Collectors |
| | | .toMap(u -> u.getId(), p -> p.getParentId())); |
| | | // 封装数据 |
| | | for (Map<String, Object> map : list) { |
| | | map.put("cityCode", |
| | | cityRegionService.getProvinceCityCountyNameByAll(cityAll, Convert.toStr(map.get("agent_county_code"))).stream() |
| | | /* for (Map<String, Object> map : list) { |
| | | map.put("cityCode", |
| | | cityRegionService.getProvinceCityCountyNameByAll(cityAll, |
| | | Convert.toStr(map.get("agent_county_code"))).stream() |
| | | .map(TCityRegion::getName) |
| | | .collect(Collectors.joining("-")) |
| | | ); |
| | | map.put("audit_time", DateUtil.format(DateUtil.parse(Convert.toStr(map.get("audit_time"))), "yyyy-MM-dd")); |
| | | map.put("audit_time", |
| | | DateUtil.format(DateUtil.parse(Convert.toStr(map.get("audit_time"))), |
| | | "yyyy-MM-dd")); |
| | | |
| | | // // 权益人信息 |
| | | // MemUser equityUser = equityUserUserList.stream().filter(o -> { |
| | |
| | | }).findFirst().orElse(new MemUser()); |
| | | map.put("equityUserShowId", parentUser.getShowId()); |
| | | map.put("equityUserRealName", parentUser.getRealName()); |
| | | map.put("equityUserCityCode", cityRegionService.getProvinceCityCountyNameByAll(cityAll, parentUser.getCityCode()).stream() |
| | | map.put("equityUserCityCode", cityRegionService.getProvinceCityCountyNameByAll(cityAll, |
| | | parentUser.getCityCode()).stream() |
| | | .map(TCityRegion::getName) |
| | | .collect(Collectors.joining("-"))); |
| | | |
| | | // 用户等级 |
| | | Integer userMemberGradeId = map.get("member_grade_id") == null ? null : (Integer) map.get("member_grade_id"); |
| | | Integer userMemberGradeId = map.get("member_grade_id") == null ? null |
| | | : (Integer) map.get("member_grade_id"); |
| | | // 查询上级城市合伙人、市场总监信息 |
| | | MemUser[] parentV4V5User = memUserRelationService.getParentV4V5ByRelationPath2( |
| | | MemUser[] parentV4V5User = memUserRelationService.getParentV4V5ByRelationPath2( |
| | | map.get("relation_path") == null ? null : map.get("relation_path").toString(), |
| | | userMemberGradeId |
| | | ); |
| | | if (parentV4V5User[0] != null) { |
| | | map.put("v4ShowId", parentV4V5User[0].getShowId()); |
| | | map.put("v4Team", parentV4V5User[0].getRealName()); |
| | | } |
| | | if (parentV4V5User[1] != null) { |
| | | map.put("v5ShowId", parentV4V5User[1].getShowId()); |
| | | map.put("v5Team", parentV4V5User[1].getRealName()); |
| | | } |
| | | |
| | | // 本人是城市合伙人或市场总监时,城市合伙人工号/团队、市场总监工号/团队,显示本人的信息 |
| | | if (parentV4V5User[0] != null) { |
| | | map.put("v4ShowId", parentV4V5User[0].getShowId()); |
| | | map.put("v4Team", parentV4V5User[0].getRealName()); |
| | | } |
| | | if (parentV4V5User[1] != null) { |
| | | map.put("v5ShowId", parentV4V5User[1].getShowId()); |
| | | map.put("v5Team", parentV4V5User[1].getRealName()); |
| | | } |
| | | |
| | | // 本人是城市合伙人或市场总监时,城市合伙人工号/团队、市场总监工号/团队,显示本人的信息 |
| | | if (userMemberGradeId == EnumMemberGrade.G_4.index) { |
| | | map.put("v4ShowId", map.get("show_id")); |
| | | map.put("v4Team", map.get("real_name")); |
| | |
| | | map.put("v5ShowId", map.get("show_id")); |
| | | map.put("v5Team", map.get("real_name")); |
| | | } |
| | | } |
| | | return list; |
| | | }*/ |
| | | List<Map<String, Object>> result = list.stream().peek(map -> { |
| | | map.put("cityCode", |
| | | cityRegionService.getProvinceCityCountyNameByAll(cityAll, |
| | | Convert.toStr(map.get("agent_county_code"))).stream() |
| | | .map(TCityRegion::getName) |
| | | .collect(Collectors.joining("-")) |
| | | ); |
| | | map.put("audit_time", |
| | | DateUtil.format(DateUtil.parse(Convert.toStr(map.get("audit_time"))), |
| | | "yyyy-MM-dd")); |
| | | // 推荐人信息 |
| | | Integer[] parentUserId = new Integer[]{0}; |
| | | for (MemUserRelation ur : parentUserRelationList) { |
| | | if (ur.getId().equals(Convert.toInt(map.get("id")))) { |
| | | parentUserId[0] = ur.getParentId(); |
| | | break; |
| | | } |
| | | } |
| | | MemUser parentUser = parentUserList.stream().filter(o -> { |
| | | if (o.getId().equals(parentUserId[0])) { |
| | | return true; |
| | | } |
| | | return false; |
| | | }).findFirst().orElse(new MemUser()); |
| | | map.put("equityUserShowId", parentUser.getShowId()); |
| | | map.put("equityUserRealName", parentUser.getRealName()); |
| | | map.put("equityUserCityCode", cityRegionService.getProvinceCityCountyNameByAll(cityAll, |
| | | parentUser.getCityCode()).stream() |
| | | .map(TCityRegion::getName) |
| | | .collect(Collectors.joining("-"))); |
| | | |
| | | // 用户等级 |
| | | Integer userMemberGradeId = map.get("member_grade_id") == null ? null |
| | | : (Integer) map.get("member_grade_id"); |
| | | // 查询上级城市合伙人、市场总监信息 |
| | | MemUser[] parentV4V5User = memUserRelationService.getParentV4V5ByRelationPath3( |
| | | Integer.valueOf(map.get("id").toString()), userRelationMap); |
| | | if (parentV4V5User[0] != null) { |
| | | map.put("v4ShowId", parentV4V5User[0].getShowId()); |
| | | map.put("v4Team", parentV4V5User[0].getRealName()); |
| | | } |
| | | if (parentV4V5User[1] != null) { |
| | | map.put("v5ShowId", parentV4V5User[1].getShowId()); |
| | | map.put("v5Team", parentV4V5User[1].getRealName()); |
| | | } |
| | | }).collect(Collectors.toList()); |
| | | return result; |
| | | } |
| | | |
| | | /** |