| | |
| | | package com.dsh.guns.modular.system.controller.code; |
| | | |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.dsh.course.feignClient.activity.CouponClient; |
| | | import com.dsh.course.feignClient.activity.model.Coupon; |
| | |
| | | import com.dsh.guns.core.common.constant.factory.PageFactory; |
| | | import com.dsh.guns.core.exception.GunsException; |
| | | import com.dsh.guns.core.util.ToolUtil; |
| | | import com.dsh.guns.modular.system.model.TOperator; |
| | | import com.dsh.guns.modular.system.model.TStore; |
| | | import com.dsh.guns.modular.system.model.User; |
| | | import com.dsh.guns.modular.system.service.IStoreService; |
| | | import com.dsh.guns.modular.system.service.IUserService; |
| | | import com.dsh.guns.modular.system.service.TOperatorService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.ui.Model; |
| | |
| | | private CouponClient client; |
| | | @Autowired |
| | | private IUserService userService; |
| | | @Autowired |
| | | private TOperatorService operatorService; |
| | | @Autowired |
| | | private IStoreService storeService; |
| | | |
| | | /** |
| | | * 优惠券审核列表页 |
| | |
| | | ofSearch.setDistributionMethod(distributionMethod); |
| | | ofSearch.setUserPopulation(userPopulation); |
| | | ofSearch.setAuditStatus(auditStatus); |
| | | return client.getCouponExamineListOfSearch(ofSearch); |
| | | List<Map<String, Object>> res = client.getCouponExamineListOfSearch(ofSearch); |
| | | for (Map<String, Object> re : res) { |
| | | if (re.get("publisherType")!=null){ |
| | | |
| | | } |
| | | switch (Integer.valueOf(re.get("publisherType").toString())){ |
| | | case 1: |
| | | // 运营商添加 |
| | | if (re.get("cityManagerId")!=null){ |
| | | TOperator one = operatorService.getOne(new QueryWrapper<TOperator>() |
| | | .eq("id", Integer.valueOf(re.get("cityManagerId").toString()))); |
| | | if (one!=null){ |
| | | User id = userService.getOne(new QueryWrapper<User>().eq("id", one.getUserId())); |
| | | if (id!=null){ |
| | | re.put("account",one.getName()+"-"+id.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | case 2: |
| | | re.put("account","平台"); |
| | | // 平台添加 |
| | | break; |
| | | case 3: |
| | | // 门店添加 |
| | | if (re.get("cityManagerId")!=null){ |
| | | TStore one = storeService.getOne(new QueryWrapper<TStore>() |
| | | .eq("id", Integer.valueOf(re.get("cityManagerId").toString()))); |
| | | if (one!=null){ |
| | | User id = userService.getOne(new QueryWrapper<User>().eq("id", one.getStoreStaffId())); |
| | | if (id!=null){ |
| | | re.put("account",one.getName()+"-"+id.getPhone()); |
| | | } |
| | | } |
| | | } |
| | | break; |
| | | } |
| | | } |
| | | return res; |
| | | } |
| | | |
| | | /** |