无关风月
7 小时以前 b1fb83530b7105e4aa73e4101727dea945eb01c2
cloud-server-management/src/main/java/com/dsh/guns/modular/system/controller/code/TCouponController.java
@@ -12,6 +12,7 @@
import com.dsh.course.feignClient.account.model.TAppUser;
import com.dsh.course.feignClient.activity.CouponClient;
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;
@@ -65,6 +66,8 @@
    private TOperatorService operatorService;
    @Autowired
    private TOperatorCityService operatorCityService;
    @Autowired
    private ITSiteService siteService;
    /**
     * 跳转到优惠券管理首页
@@ -186,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<>();
    }