• Java版本新零售小程序saas商城全开源系统



    🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈 🌈
     
    🍂个人博客首页: KJ.JK
     
    欢迎大家点赞👍收藏💖评论💬关注🔒
     
    💖源码获取 | 💻学习交流 | 🤝商务合作 | 💨私信作者
     
    🍂项目实战gitee开源地址: weiit/weiit-saas
     
    🍂项目实战github开源地址: weiit/weiit-saas
     
    ⭐希望大家可以在gitee和github点个star呀⭐


    一、项目介绍

    今天为大家带来的是weiit-saas这款Java开源项目,属于weiit团队自研产品,该系统意在通过技术封装,让企业无需代码开发,帮助企业一键生成小程序、公众号,让企业拥有独立品牌的自营商城weiit-saas是完全开源电商SaaS系统,属于weiit开源的社区版,旧版已不在维护和更新,仅供学习和参考,新版saas从底层架构到前后端UI设计已经全面优化和升级新版访问地址👉 weiit
    该团队的后续作品博主将会为大家不断分享,也希望大家多多支持博主以及weiit团队!!!


    二、技术栈以及项目特点


    ⭐新版saas技术栈使用⭐

    • SpringCloud + Oauth2.0 + ShiroRedis + JWT + Gateway + Nacos + Nginx + Vue
       

    ⭐项目特点⭐

    • 项目采用Spring+SpringMVC+Mybatis主流开源框架,遵循MVC架构,设计轻巧,使用简单,开发人员接手与二次开发简单易懂;
    • 项目完成了对阿里云、腾讯云、微信生态的快速接入与代码示例,并成功运用到了商业中,方便大家学习对OSS/COS/短信服务/快递服务/公众号/小程序/微信开放平台/微信支付的技术点与应用场景的学习
    • 小程序与公众号第三方授权集成,让开发者与企业省去繁琐的配置,对AppId/AppSecret集成彻底告别
    • 微信支付第三方授权集成,让开发者与企业省去繁琐的配置,让企业服务成本大大降低;
    • 小程序代码自动push与升级,公众号基本常规功能(自定义菜单、图文、素材,群发)全部接管,让企业无需登录微信官方入口,统一化管理企业信息与数据
    • 微信消息通知与模板自动同步与管理,让企业场景融合无障碍;
    • 自定义装修功能,实现企业电商场景多元化,解决不同行业不同模板,让企业需求得到真正解决;
    • 丰富的营销工具,解决企业微营销需求,并集中化管理。拼团活动、积分活动、砍价,优惠券,卡券,礼品卡,邀请有礼等营销活动,方便二次开发;
    • 不同企业数据隔离,真正实现SAAS数据隔离模型,让企业数据互不干扰
    • 不同企业不同域名自动分配,让企业小程序、公众号前端隔离,避免因为公众号或者小程序推广时导致域名被检测导致的封号问题出现,即不同企业不同域,意在防止saas平台中的企业受到其他企业的影响

    三、系统设计


    SAAS微信小程序电商系统系统的主要功能模块包括 概况模块,店铺管理模块,商品模块,订单管理模块,客户管理模块,数据模块,营销模块,设置模块


              (1)概况模块: 可以看到具体各个功能的具体信息


              (2)商品模块: 该模块包含微页面,全店风格,底部菜单,底部导航


              (3)店铺模块: 该模块包含出售中的商品、库存紧张商品、仓库商品、商品标签、商品分组、商品导入


              (4)订单管理模块: 该模块包含所有订单、维权订单、加星订单、订单设置


              (5)客户模块: 该模块包含会员管理、会员卡管理、标签组管理、会员提现、会员设置


              (6)数据模块: 该模块包含综合统计、店铺的概况、订单的概况、客户的分析


              (7)营销模块: 该模块包含常规营销、人口设置


              (8)设置模块: 该模块包含店铺设置、服务协议、支付交易、物流配送、修改密码


              (9)系统架构图

    在这里插入图片描述


    在这里插入图片描述


    四、系统功能演示


    🚩店铺功能演示图


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    🚩商品功能演示图


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    🚩订单功能演示图


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    🚩客户功能演示图


    请添加图片描述


    请添加图片描述


    请添加图片描述


    🚩数据功能演示图


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    🚩营销功能演示图


    请添加图片描述


    🚩设置功能演示图


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    请添加图片描述


    五、系统源代码

    /**
     * 砍价 活动
     * @company http://www.wei-it.com
     */
    @Controller
    @RequestMapping(value = "/ump/bargain")
    public class BargainController extends AdminController {
    
        public static Logger logger = Logger.getLogger(BargainController.class);
    
        @Resource
        private BargainService bargainService;
    
        @Resource
        ProductService productService;
    
    
        /**
         * 砍价活动 列表
         */
        @RequestMapping("/bargainList")
        public UIview bargainList() throws Exception {
            logger.info("进入 bargainController-list,砍价活动列表");
            //获取请求参数
            FormMap formMap = getFormMap();
            //开启分页
            PageHelper.startPage(formMap.getPage(), formMap.getRows());
            //查询展示数量
            List<E> list = bargainService.selectList(formMap);
    
            //返回到list页面
            UIview result = UIView("/center/ump/bargain/bargainList", false);
            //绑定分页返回
            result.addObject("pageInfo", new PageInfo<E>(list));
            //绑定上一次参数
            result.addObject("queryParam", formMap);
            return result;
        }
    
        /**
         * 砍价活动 新增
         */
        @RequestMapping("/add")
        public UIview add() throws Exception {
    
            UIview result = UIView("/center/ump/bargain/bargainCreate", false);
    
            this.getRequest().setAttribute("title", "砍价活动新增");
    
            return result;
        }
    
    
    
        /**
         * 砍价活动 编辑
         */
        @RequestMapping("/edit")
        public UIview edit() throws Exception {
    
            FormMap formMap = getFormMap();
    
            E infoMap = bargainService.selectOne(formMap);
            formMap.put("item_id",infoMap.get("item_id"));
            E itemInfo = productService.getItemById(formMap);
    
    
            String specString ="";
            if (itemInfo!=null && itemInfo.get("spec_custom")!=null){
                formMap.put("specIds", itemInfo.getStr("spec_custom").split(";"));
                List<E> specList = productService.getSpecCustomByIds(formMap);
    
                for(E spec :specList){
                    specString+=spec.getStr("key_name")+";";
                }
            }
            specString=specString==""?infoMap.getStr("product_name"):specString;
    
            infoMap.put("skuName",specString);
            UIview result = UIView("/center/ump/bargain/bargainCreate", false);
    
            this.getRequest().setAttribute("infoMap", infoMap);
    
            this.getRequest().setAttribute("title", "砍价活动编辑");
    
            return result;
        }
    
        /**
         * 砍价活动 保存
         */
        @RequestMapping("/save")
        public UIview save() throws Exception {
    
            FormMap param = getFormMap();
            if (param.get("validate_id") == null || param.get("validate_id").equals("")) {
    
                //根据生效时间判断是否现在生效
                if (System.currentTimeMillis()> DateUtil.getTimeByString(param.getStr("start_time"),"yyyy/MM/dd HH:mm:ss")){
                    param.put("state", 0);
                }else {
                    //未开始状态
                    param.put("state", -2);
                }
    
                bargainService.insert(param);
            } else {
                param.set("eivt", null);
                //失效后再编辑
                if (System.currentTimeMillis()> DateUtil.getTimeByString(param.getStr("start_time"),"yyyy/MM/dd HH:mm:ss") && System.currentTimeMillis()<DateUtil.getTimeByString(param.getStr("end_time"),"yyyy/MM/dd HH:mm:ss")){
                    param.put("state", 0);
                }else if (System.currentTimeMillis()<DateUtil.getTimeByString(param.getStr("start_time"),"yyyy/MM/dd HH:mm:ss")){
                    param.put("state", -2);
                }
    
                bargainService.edit(param);
            }
            UIview result = UIView("redirect:bargainList", false);
    
            return result;
        }
    
        /**
         * 砍价活动 状态修改
         */
        @RequestMapping("/status")
        public UIview status() throws Exception {
    
            FormMap formMap = getFormMap();
    
            formMap.set("eivt", "state");
    
            bargainService.edit(formMap);
    
            UIview result = UIView("redirect:bargainList", false);
    
            return result;
        }
    
        /**
         * 秒杀活动 删除
         */
        @RequestMapping("/remove")
        public UIview remove() throws Exception {
    
            FormMap map = getFormMap();
    
            bargainService.remove(map);
    
            UIview result = UIView("redirect:bargainList", false);
    
            return result;
        }
    
        /**
         * 砍价活动记录列表
         */
        @RequestMapping("/bargainDetailList")
        public UIview bargainOrderList() throws Exception {
            logger.info("进入 bargainController-bargainOrderList,满减送活动列表");
            //获取请求参数
            FormMap formMap = getFormMap();
            //开启分页
            PageHelper.startPage(formMap.getPage(), formMap.getRows());
            //查询展示数量
            List<E> list = bargainService.selectBargainDetailList(formMap);
            //返回到list页面
            UIview result = UIView("/center/ump/bargain/bargainDetailList", false);
            //绑定分页返回
            result.addObject("pageInfo", new PageInfo<E>(list));
            //绑定上一次参数
            result.addObject("queryParam", formMap);
            return result;
        }
    
        /**
         * 砍价活动 列表
         */
        @RequestMapping("/bargainNancyList")
        public UIview bargainNancyList() throws Exception {
            logger.info("进入 bargainController-bargainOrderList,砍价活动列表");
            //获取请求参数
            FormMap formMap = getFormMap();
            //开启分页
            PageHelper.startPage(formMap.getPage(), formMap.getRows());
            //查询展示数量
            List<E> list = bargainService.selectBargainNancyList(formMap);
            //返回到list页面
            UIview result = UIView("/center/ump/bargain/bargainNancyList", false);
            //绑定分页返回
            result.addObject("pageInfo", new PageInfo<E>(list));
            //绑定上一次参数
            result.addObject("queryParam", formMap);
            return result;
        }
    
    
        /**
         * 查询商品列表
         */
        @ResponseBody
        @RequestMapping("/productList.json")
        public String productList() throws Exception {
            logger.info("进入seckillController-productList,查询商品");
            try {
                FormMap formMap = getFormMap();
                formMap.set("product_name", new String(formMap.getStr("product_name").getBytes("ISO-8859-1")));
                List<E> productList = bargainService.selectProductList(formMap);
                List<E> productJson = new ArrayList<E>();
                for (E e : productList) {
                    E productinfo = new E();
                    productinfo.set("product_name", "" + e.getStr("product_name"));
                    productinfo.set("sale_price", e.getStr("sale_price"));
                    productinfo.set("stock", e.getStr("stock"));
                    if (StringUtils.isEmpty(e.getStr("state"))) {
                        productinfo.set("option", "选取");
                    } else {
                        productinfo.set("option", "已参加");
                    }
                    productJson.add(productinfo);
                }
                return toJsonAPI(productJson);
            } catch (Exception e) {
                e.printStackTrace();
                throw new Exception("出错啦...");
            }
        }
    
        /**
         * 选择多规格商品  规格、价格、库存、操作
         * produce_id
         */
        @ResponseBody
        @RequestMapping("/skuList.json")
        public String skuList() throws Exception {
            logger.info("BargainController-skuList,选择多规格商品");
            FormMap formMap = getFormMap();
            formMap.put("is_deleted", 0);
            formMap.put("is_disabled", 0);
            List<E> list = productService.selectItemList(formMap);
    
            E productInfo = productService.selectById(formMap);
    
            List<E> productJson = new ArrayList<E>();
            for (E e : list) {
                E productinfo = new E();
                formMap.put("specIds", e.getStr("spec_custom").split(";"));
                List<E> specList = productService.getSpecCustomByIds(formMap);
                String specString ="";
                for(E spec :specList){
                    specString+=spec.getStr("key_name")+";";
                }
                specString=specString==""?productInfo.getStr("product_name"):specString;
                productinfo.set("specDesc",specString);
                productinfo.set("sale_price", e.getStr("sale_price"));
                productinfo.set("stock", e.getStr("stock"));
                productinfo.set("option", "选取");
    
                productJson.add(productinfo);
    
            }
            return toJsonAPI(productJson);
        }
    
    
        /**
         * 微页面(活动页) 根据bargain_ids 获取砍价商品活动列表
         */
        @ResponseBody
        @RequestMapping("/getProductByBargainIds")
        public String getProductByBargainIds(@RequestParam String token,String bargain_ids,Integer bargainGetType) throws Exception {
            logger.info("进入 bargainController-getProductByBargainIds,微页面根据bargain_ids 获取砍价商品活动列表");
            FormMap formMap = new FormMap();
            try {
                formMap.put("shop_id", DesUtil.decrypt(token));
            } catch (Exception e) {
                e.printStackTrace();
                logger.error("token 解密失败");
                return "";
            }
            if (!StringUtils.isEmpty(bargain_ids)&& bargainGetType==0) {
                formMap.put("bargain_ids", StringUtils.strip(bargain_ids, "[]").split(","));
            }
    		formMap.put("end_time",new Date());
            List<E> BargainList = bargainService.getProductByBargainIds(formMap);
            return toJsonAPI(BargainList);
        }
    
    
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290

    /**
     * 营销管理-》优惠券
     * @company http://www.wei-it.com 微邦互联
     */
    @Controller
    @RequestMapping(value = "/ump/coupons")
    public class CouponsController extends AdminController {
    
    	public static Logger logger= Logger.getLogger(CouponsController.class);
    
    	@Resource
    	private CouponService couponService;
    
    	@Resource
    	ParameterService parameterService;
    
    	@Resource
    	WeixinOpenService weixinOpenService;
    	  
    	/**
    	 * 优惠券》优惠券列表
    	 */
    	@RequestMapping("/couponsList")
    	public UIview couponsList(){
    		logger.info("进入CouponsController-couponsList,优惠券列表展示");
    		
    		UIview view = UIView("/center/ump/coupons/couponsList",false);
        	FormMap formMap=getFormMap();
        	PageHelper.startPage(formMap.getPage(), formMap.getRows());
        	List<E> list=couponService.selectList(formMap);
           
        	view.addObject("pageInfo", new PageInfo<E>(list));
        	view.addObject("queryParam", formMap);
    		return view;
    	}
    	
        /**
         * 优惠券》优惠券创建
         */
    	@RequestMapping("/create")
    	public UIview create(){
    		UIview view=UIView("/center/ump/coupons/couponsCreate", false);
    		return view;
    	}
    	
        /**
         * 优惠券 》编辑
         */
    	@RequestMapping("/edit")
    	public UIview edit(){
    		logger.info("进入CouponsController-edit,优惠券编辑");
    		
    		UIview view=UIView("/center/ump/coupons/couponsCreate", false);
    		FormMap formMap=getFormMap();
    		E coupon=couponService.selectCoupon(formMap);
    		
    		view.addObject("coupon", coupon);
    		return view;
    	}
    	
        /**
         * 优惠券 》优惠券新增保存
         * @throws Exception 
         */
    	@RequestMapping("/save")
    	public ModelAndView save(){
    		logger.info("进入CouponsController-save,优惠券新增保存");
    		
    		UIview view=UIView("couponsList", true);
    	    FormMap formMap=getFormMap();
    	    //判断优惠形式type=1,2,3
    	    if(formMap.getInt("type")==1){//优惠形式表示“指定金额”
    	        formMap.set("coupon_discount", null);
    	        formMap.set("random_min_price", null);
    	        formMap.set("random_max_price", null);
    	    }else if(formMap.getInt("type")==2){//优惠形式表示“打折”
    	        formMap.set("coupon_price", null);
    	        formMap.set("random_min_price", null);
    	        formMap.set("random_max_price", null);
    	    }else{//优惠形式表示“指定金额(随机)”
    	        formMap.set("coupon_discount", null);
    	        formMap.set("coupon_price", null);
    	    }
    	    //判断生效条件is_condition=-1,1
    		//生效条件表示“无条件”
    	    if(formMap.getInt("is_condition")==-1){
    	        formMap.set("condition_price", null);
    	    }
    		formMap.put("state",1);
    
    	    //判断使用有效期方式use_type=1 固定范围  ,2  指定时间范围
    		//使用有效期表示“固定范围”
    	    if(formMap.getInt("use_type")==1){
    	        formMap.set("from_day", null);
    	        formMap.set("to_day", null);
    	        //如果开始时间小于当前时间   则优惠券处于未生效状态  ,其他情况都是生效状态
    			if (System.currentTimeMillis()< DateUtil.getTimeByString(formMap.getStr("start_time"),"yyyy/MM/dd HH:mm:ss")){
    				formMap.put("state",-2);
    			}
    	    }else{
    	        formMap.set("start_time", null);
    	        formMap.set("end_time", null);
    	    }
    	    //判断没人领取限制
    		//使用有效期表示“不限制领取熟量”
    	    if(formMap.getInt("maxLimitType")==1){
    	        formMap.set("max_limit", 0);
    	    }
    	    //判断可使用商品
    		//使用有效期表示“全网商品通用”
    	    if(formMap.getInt("product_range_type")==1){
    	        formMap.set("product_ids", null);
    	    }else{
    	        formMap.set("product_ids", formMap.getStr("selectProductValues"));
    	    }
    	    //判断是新增还是修改
    		//新增优惠券判断
    		if(StringUtils.isEmpty(formMap.getStr("validate_id"))){
    			couponService.insert(formMap);
    		}else{//修改优惠券
    			couponService.edit(formMap);
    		}
    		return view;
    	}
    	
    	/**
    	 * 优惠券》优惠券列表》生效&不生效
    	 */
    	@RequestMapping("/state")
    	public UIview state(){
    		logger.info("进入CouponsController-state,优惠券生效&不生效操作");
    		
    		UIview view=UIView("couponsList", true);
    		FormMap formMap=getFormMap();
    		formMap.set("onlyUpdateState", "state");
    		couponService.edit(formMap);
    		return view;
    	}
    	
    	/**
    	 * 优惠券》优惠券列表》删除
    	 */
    	@RequestMapping("/remove")
    	public UIview remove(){
    		logger.info("进入CouponsController-remove,优惠券删除");
    		
    		UIview view=UIView("couponsList", true);
    		FormMap formMap=getFormMap();
    		formMap.set("state", "0");
    		List<E> list=couponService.selectCouponUserList(formMap);
    		if(list.size() > 0){//该优惠券还有未使用的用户
    			view.addErrorMessage("删除失败,该优惠券还有未使用的用户!");
    		}else{
    			couponService.remove(formMap);
    			view.addPNotifyMessage("优惠券删除成功!");
    		} 
    		return view;
    	}
     
        /**
         * 优惠券 派发用户列表 
         */ 
    	@RequestMapping("/couponsGive")
    	public UIview couponsGive(){
    		logger.info("进入CouponsController-couponsGive,优惠券推广与派发");
    		
    		UIview view = UIView("/center/ump/coupons/couponsGive",false);
        	FormMap formMap=getFormMap();
        	PageHelper.startPage(formMap.getPage(), formMap.getRows());
        	//查询没有领取该优惠券的用户列表与领取了但是没有超过优惠券最大设置限购数的用户列表
    
        	List<E> list=couponService.selectNoCouponUserList(formMap);
        	
        	view.addObject("pageInfo", new PageInfo<E>(list));
        	view.addObject("queryParam", formMap);
    
    
    		E publicInfo=(E)this.getSession().getAttribute("publicInfo");
    		if (publicInfo!=null){
    			//获取公众号优惠券地址  和 链接
    			formMap.put("item_name","COUPONSMPQRCODE");
    			E paramInfo = parameterService.selectShopParamByName(formMap);
    			this.getSession().setAttribute("couponMpQrCodeUrl",String.format(Constants.COUPON_QR_CODE,publicInfo.getStr("authorizer_app_id")));
    			if (paramInfo!=null){
    				this.getSession().setAttribute("couponMpQrcode",paramInfo.getStr("item_value"));
    			}else {
    				WeiitQrCodeUtil qrCodeUtil = new WeiitQrCodeUtil();
    				String qrCodePath = qrCodeUtil.createQRCodeAndUploadQcloud(String.format(Constants.COUPON_QR_CODE,publicInfo.getStr("authorizer_app_id")));
    				//入库
    				FormMap insertParam = new FormMap();
    				insertParam.put("item_code","COUPONQRCODE");
    				insertParam.put("item_name","COUPONSMPQRCODE");
    				insertParam.put("item_value",WeiitUtil.getFileDomain()+qrCodePath);
    				insertParam.put("item_desc","公众号优惠券领取二维码");
    				insertParam.put("state",0);
    				insertParam.put("shop_id",formMap.get("shop_id"));
    				parameterService.insert(insertParam);
    				this.getSession().setAttribute("couponMpQrcode",WeiitUtil.getFileDomain()+qrCodePath);
    			}
    		}
    		E miniPublicInfo = (E) this.getSession().getAttribute("miniPublicInfo");
    		if (miniPublicInfo!=null){
    			//获取公众号优惠券地址  和 链接
    			formMap.put("item_name","COUPONSMAQRCODE");
    			E paramInfo = parameterService.selectShopParamByName(formMap);
    			if (paramInfo!=null){
    				this.getSession().setAttribute("couponMaQrcode",paramInfo.getStr("item_value"));
    			}else {
    				try {
    					formMap.put("appid",miniPublicInfo.getStr("authorizer_app_id"));
    					File file = weixinOpenService.getInstance(formMap).getWxOpenComponentService().getWxMaServiceByAppid(miniPublicInfo.getStr("authorizer_app_id")).getQrcodeService().createWxaCode("pages/Receive_coupons/Receive_coupons",225);
    					String qrCodePath = WeiitUtil.uploadFile(FileUtils.readFileToByteArray(file),"png");
    
    					FormMap insertParam = new FormMap();
    					insertParam.put("item_code","COUPONQRCODE");
    					insertParam.put("item_name","COUPONSMAQRCODE");
    					insertParam.put("item_value",WeiitUtil.getFileDomain()+qrCodePath);
    					insertParam.put("item_desc","小程序优惠券领取二维码");
    					insertParam.put("state",0);
    					insertParam.put("shop_id",formMap.get("shop_id"));
    					parameterService.insert(insertParam);
    					this.getSession().setAttribute("couponMaQrcode",WeiitUtil.getFileDomain()+qrCodePath);
    				} catch (Exception e) {
    					e.printStackTrace();
    				}
    			}
    		}
    
    		return view;
    	}
    	
    	/**
    	 * 派发优惠券  保存 
    	 * @return
    	 * @throws Exception
    	 */
    	@RequestMapping("/couponsGiveSave")
    	public UIview couponsGiveSave(){
    		logger.info("进入CouponsController-couponsGiveSave,优惠券推广提交");
    		
    		FormMap formMap=getFormMap();
    		String message=couponService.insertCouponUserTrans(formMap);
    		UIview view = UIView("couponsGive?validate_id="+formMap.getStr("validate_id")+"&validate_id_token="+formMap.getStr("validate_id_token"),true);
    		if(message==null){
    			view.addPNotifyMessage("会员优惠券派送成功!");
    		}else{
    			view.addErrorMessage(message);
    		}
    		return view;
    	}
    	
    	/**
    	 * 派发优惠券记录
    	 * @return
    	 * @throws Exception
    	 */
    	@RequestMapping("/couponsUserList")
    	public UIview couponsUserList(){
    		logger.info("进入CouponsController-couponsUserList,发优惠券记录");
    		
    		UIview view = UIView("/center/ump/coupons/couponsUserList",false);
        	FormMap formMap=getFormMap();
        	E coupon = couponService.selectOne(formMap);
        	PageHelper.startPage(formMap.getPage(), formMap.getRows());
        	//查询该优惠券已经派发过的用户
        	List<E> list=couponService.selectCouponUserList(formMap);
        	
        	view.addObject("pageInfo", new PageInfo<E>(list));
        	view.addObject("queryParam", formMap);
        	view.addObject("coupon", coupon);
    		return view; 
    	}
    
    	
    	/**
    	 * 派发优惠券》回收
    	 * @return
    	 * @throws Exception
    	 */
    	@RequestMapping("/couponsUserRemove")
    	public UIview couponsUserRemove(){
    		logger.info("进入CouponsController-couponsUserRemove,派发优惠券 回收");
    		
    		FormMap formMap=getFormMap();
    		String message=couponService.removeCouponUserTrans(formMap);
    		UIview view = UIView("couponsUserList?validate_id="+formMap.getStr("validate_id")+"&validate_id_token="+formMap.getStr("validate_id_token"),true);
    		if(message==null){
    			view.addPNotifyMessage("优惠券回收成功!");
    		}else{
    			view.addErrorMessage(message);
    		}
    		return view;
    	}
    
    
    	/**
    	 * 装修页面 获取优惠券列表
    	 *
    	 *
    	 * */
    	@RequestMapping(value = "/getCouponList",method = RequestMethod.GET)
    	@ResponseBody
    	public E getCouponList(@RequestParam String token,String coupon_name) {
    		logger.info("进入CouponsController-getCouponList,获取优惠券列表");
    		FormMap formMap=new FormMap();
    		E result = new E();
    		try {
    			formMap.put("shop_id", DesUtil.decrypt(token));
    		} catch (Exception e) {
    			e.printStackTrace();
    			logger.error("token 解密失败");
    			result.put("couponList",null);
    			return result;
    		}
    		formMap.put("coupon_name",coupon_name);
    		List<E> list = couponService.selectList(formMap);
    		result.put("couponList",list);
    		//绑定上一次参数
    		return result;
    	}
    
    
    	/**
    	 * 微页面  优惠券展示   不展示是否领取  过滤失效优惠券
    	 * @author lhq
    	 * @date 2018年5月10日
    	 * */
    
    	@RequestMapping(value = "/couponListByIds",method = RequestMethod.GET)
    	@ResponseBody
    	public String couponListByIds(@RequestParam String token,String coupon_ids,Integer couponType){
    		logger.info("ActivityController-couponListByIds,微页面  优惠券展示");
    		FormMap formMap = new FormMap();
    		try {
    			formMap.put("shop_id", DesUtil.decrypt(token));
    		} catch (Exception e) {
    			e.printStackTrace();
    			logger.error("token 解密失败");
    			return "";
    		}
    		formMap.put("couponType",couponType);
    		if (!StringUtils.isEmpty(coupon_ids) && couponType==0){
    			formMap.put("coupon_ids", StringUtils.strip(coupon_ids, "[]").split(","));
    		}
    		formMap.put("end_time",new Date());
    		List<E> list = couponService.couponListByIds(formMap);
    		return toJsonAPI(list);
    	}
    	
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72
    • 73
    • 74
    • 75
    • 76
    • 77
    • 78
    • 79
    • 80
    • 81
    • 82
    • 83
    • 84
    • 85
    • 86
    • 87
    • 88
    • 89
    • 90
    • 91
    • 92
    • 93
    • 94
    • 95
    • 96
    • 97
    • 98
    • 99
    • 100
    • 101
    • 102
    • 103
    • 104
    • 105
    • 106
    • 107
    • 108
    • 109
    • 110
    • 111
    • 112
    • 113
    • 114
    • 115
    • 116
    • 117
    • 118
    • 119
    • 120
    • 121
    • 122
    • 123
    • 124
    • 125
    • 126
    • 127
    • 128
    • 129
    • 130
    • 131
    • 132
    • 133
    • 134
    • 135
    • 136
    • 137
    • 138
    • 139
    • 140
    • 141
    • 142
    • 143
    • 144
    • 145
    • 146
    • 147
    • 148
    • 149
    • 150
    • 151
    • 152
    • 153
    • 154
    • 155
    • 156
    • 157
    • 158
    • 159
    • 160
    • 161
    • 162
    • 163
    • 164
    • 165
    • 166
    • 167
    • 168
    • 169
    • 170
    • 171
    • 172
    • 173
    • 174
    • 175
    • 176
    • 177
    • 178
    • 179
    • 180
    • 181
    • 182
    • 183
    • 184
    • 185
    • 186
    • 187
    • 188
    • 189
    • 190
    • 191
    • 192
    • 193
    • 194
    • 195
    • 196
    • 197
    • 198
    • 199
    • 200
    • 201
    • 202
    • 203
    • 204
    • 205
    • 206
    • 207
    • 208
    • 209
    • 210
    • 211
    • 212
    • 213
    • 214
    • 215
    • 216
    • 217
    • 218
    • 219
    • 220
    • 221
    • 222
    • 223
    • 224
    • 225
    • 226
    • 227
    • 228
    • 229
    • 230
    • 231
    • 232
    • 233
    • 234
    • 235
    • 236
    • 237
    • 238
    • 239
    • 240
    • 241
    • 242
    • 243
    • 244
    • 245
    • 246
    • 247
    • 248
    • 249
    • 250
    • 251
    • 252
    • 253
    • 254
    • 255
    • 256
    • 257
    • 258
    • 259
    • 260
    • 261
    • 262
    • 263
    • 264
    • 265
    • 266
    • 267
    • 268
    • 269
    • 270
    • 271
    • 272
    • 273
    • 274
    • 275
    • 276
    • 277
    • 278
    • 279
    • 280
    • 281
    • 282
    • 283
    • 284
    • 285
    • 286
    • 287
    • 288
    • 289
    • 290
    • 291
    • 292
    • 293
    • 294
    • 295
    • 296
    • 297
    • 298
    • 299
    • 300
    • 301
    • 302
    • 303
    • 304
    • 305
    • 306
    • 307
    • 308
    • 309
    • 310
    • 311
    • 312
    • 313
    • 314
    • 315
    • 316
    • 317
    • 318
    • 319
    • 320
    • 321
    • 322
    • 323
    • 324
    • 325
    • 326
    • 327
    • 328
    • 329
    • 330
    • 331
    • 332
    • 333
    • 334
    • 335
    • 336
    • 337
    • 338
    • 339
    • 340
    • 341
    • 342
    • 343
    • 344
    • 345
    • 346
    • 347
    • 348
    • 349
    • 350

    💨更多详情与本系统源码获取👇

    🍂gitee开源地址: weiit/weiit-saas
     
    🍂github开源地址: weiit/weiit-saas
     
    ⭐希望大家可以在gitee和github点个star呀⭐


    作者:KJ.JK

    文章对你有所帮助的话,欢迎给个赞或者 star,你的支持是对作者最大的鼓励,不足之处可以在评论区多多指正,交流学习

  • 相关阅读:
    Java笔记(七)
    成绩统计-蓝桥杯
    安卓使用动画启动Acitvity
    计算机图形学之圆
    vue3在setup中获取DOM元素
    我在Vscode学OpenCV 图像运算(权重、逻辑运算、掩码、位分解、数字水印)
    SnapHelper解析
    主动配电网故障恢复的重构与孤岛划分matlab程序
    JavaScript变量存储机制
    HyperBDR云容灾深度解析一:云原生跨平台容灾,让数据流转更灵活
  • 原文地址:https://blog.csdn.net/m0_47384542/article/details/126085194