无关风月
7 小时以前 b1fb83530b7105e4aa73e4101727dea945eb01c2
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
@@ -11,10 +11,8 @@
import com.dsh.course.feignClient.account.model.QueryByNamePhone;
import com.dsh.course.feignClient.account.model.TAppUser;
import com.dsh.course.feignClient.activity.CouponClient;
import com.dsh.course.feignClient.activity.model.Coupon;
import com.dsh.course.feignClient.activity.model.CouponCity;
import com.dsh.course.feignClient.activity.model.CouponListOfSearch;
import com.dsh.course.feignClient.activity.model.CouponRecordQuery;
import com.dsh.course.feignClient.activity.model.*;
import com.dsh.course.feignClient.other.model.Site;
import com.dsh.guns.config.UserExt;
import com.dsh.guns.core.base.tips.SuccessTip;
import com.dsh.guns.core.common.constant.factory.PageFactory;
@@ -68,6 +66,8 @@
    private TOperatorService operatorService;
    @Autowired
    private TOperatorCityService operatorCityService;
    @Autowired
    private ITSiteService siteService;
    /**
     * 跳转到优惠券管理首页
@@ -85,7 +85,9 @@
    public String memberCouponAdd(Model model) {
        Integer objectType = UserExt.getUser().getObjectType();
        System.out.println(objectType);
        List<PointsMerchandise> pointsMerchandises = client.goodsList();
        model.addAttribute("userType",objectType);
        model.addAttribute("goods",pointsMerchandises);
        return PREFIX + "TCouponAdd.html";
    }
@@ -165,10 +167,17 @@
        System.out.println(objectType);
        model.addAttribute("item",coupon);
        model.addAttribute("objectType",objectType);
        List<PointsMerchandise> pointsMerchandises = client.goodsList();
        model.addAttribute("goods",pointsMerchandises);
        return PREFIX + "TCouponInfo.html";
    }
    // 积分商品活动状态 未开始和已开始状态 上架
    @RequestMapping("/goodsList")
    @ResponseBody
    public Object goodsList() {
        return client.goodsList();
    }
    /**
     * 跳转到门店管理列表页
@@ -180,7 +189,23 @@
    @RequestMapping("/updateType")
    @ResponseBody
    public Object updateType(Long id) {
        client.updateType(id);
        if (UserExt.getUser().getObjectType()==1){
            client.updateType(id);
        }
        if (UserExt.getUser().getObjectType()!=1){
            if (UserExt.getUser().getObjectType()==2){
                TStore tStore = storeService.getById(UserExt.getUser().getObjectId());
                client.updateTypeOther(id,tStore.getOperatorId()==null?0:tStore.getOperatorId(),
                        tStore.getId(),0);
            }
            if (UserExt.getUser().getObjectType()==3){
                TSite site = siteService.getById(UserExt.getUser().getObjectId());
                TStore tStore = storeService.getById(site.getStoreId());
                client.updateTypeOther(id,tStore.getOperatorId()==null?0:tStore.getOperatorId(),
                        tStore.getId(),site.getId());
            }
        }
        return new SuccessTip<>();
    }
@@ -303,9 +328,21 @@
        return couponListOfSearch;
    }
    /**
     * 根据运营商ID 获取运营商管理的省市
     */
    @RequestMapping(value = "/listSelect")
    @ResponseBody
    public Object listOfDatas(String name, Integer type, Integer status, Integer state) {
        Page<Map<String, Object>> page = new PageFactory<Map<String, Object>>().defaultPage();
        CouponListOfSearch ofSearch = new CouponListOfSearch();
        ofSearch.setPage(page);
        ofSearch.setName(name);
        ofSearch.setType(type);
        ofSearch.setStatus(status);
        ofSearch.setState(state);
        List<Map<String, Object>> couponListOfSearch = client.getCouponListAllOfSearch(ofSearch);
        return couponListOfSearch;
    }
    /**
     * 获取 优惠券管理