- 一、项目介绍
- 二、技术栈以及项目特点
- 三、系统设计
- 四、系统功能演示
- 店铺功能演示图
- 商品功能演示图
- 订单功能演示图
- 客户功能演示图
- 数据功能演示图
- 营销功能演示图
- 设置功能演示图
- 五、系统源代码
- 更多详情与本系统源码获取
- 作者:KJ.JK
个人博客首页: KJ.JK
欢迎大家点赞收藏评论关注
源码获取 | 学习交流 | 欄商务合作 | 私信作者
一、项目介绍
今天为大家带来的是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)系统架构图
四、系统功能演示
店铺功能演示图
商品功能演示图
订单功能演示图
客户功能演示图
数据功能演示图
营销功能演示图
设置功能演示图
五、系统源代码
@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()); //查询展示数量 Listlist = bargainService.selectList(formMap); //返回到list页面 UIview result = UIView("/center/ump/bargain/bargainList", false); //绑定分页返回 result.addObject("pageInfo", new PageInfo (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 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() param.put("state", 0); }else if (System.currentTimeMillis() 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 list = bargainService.selectBargainDetailList(formMap); //返回到list页面 UIview result = UIView("/center/ump/bargain/bargainDetailList", false); //绑定分页返回 result.addObject("pageInfo", new PageInfo (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 list = bargainService.selectBargainNancyList(formMap); //返回到list页面 UIview result = UIView("/center/ump/bargain/bargainNancyList", false); //绑定分页返回 result.addObject("pageInfo", new PageInfo (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 productList = bargainService.selectProductList(formMap); List productJson = new ArrayList (); for (E e : productList) { E productinfo = new E(); productinfo.set("product_name", " + WeiitUtil.getFileDomain() + e.getStr("product_img") + "' width='60px' height='60px'/>" + 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", " + e.getStr("product_id") + "' style='height: 22px;padding-top: 0px;' οnclick='selectProduct(" + e.getStr("product_id") + ")' price='" + e.getStr("sale_price") + "'spec_config='" + e.getStr("spec_config") + "'>选取"); } else { productinfo.set("option", "已参加"); } productJson.add(productinfo); } return toJsonAPI(productJson); } catch (Exception e) { e.printStackTrace(); throw new Exception("出错啦..."); } } @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 list = productService.selectItemList(formMap); E productInfo = productService.selectById(formMap); List productJson = new ArrayList (); for (E e : list) { E productinfo = new E(); formMap.put("specIds", e.getStr("spec_custom").split(";")); List 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", " + e.getStr("item_id") + "' style='height: 22px;padding-top: 0px;' οnclick='selectItem(" + e.getStr("item_id") + ")' specDesc='" + specString + "' product_id='" + e.getStr("product_id") + "' product_img='" + WeiitUtil.getFileDomain()+productInfo.getStr("product_img") + "' stock='" + e.getStr("stock") + "' price='" + e.getStr("sale_price") + "'>选取"); productJson.add(productinfo); } return toJsonAPI(productJson); } @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 BargainList = bargainService.getProductByBargainIds(formMap); return toJsonAPI(BargainList); } }
@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()); Listlist=couponService.selectList(formMap); view.addObject("pageInfo", new PageInfo (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; } @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 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 list=couponService.selectNoCouponUserList(formMap); view.addObject("pageInfo", new PageInfo (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; } @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; } @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 list=couponService.selectCouponUserList(formMap); view.addObject("pageInfo", new PageInfo (list)); view.addObject("queryParam", formMap); view.addObject("coupon", coupon); return view; } @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 list = couponService.selectList(formMap); result.put("couponList",list); //绑定上一次参数 return result; } @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 list = couponService.couponListByIds(formMap); return toJsonAPI(list); } }
更多详情与本系统源码获取
gitee开源地址: weiit/weiit-saas
github开源地址: weiit/weiit-saas
作者:KJ.JK
文章对你有所帮助的话,欢迎给个赞或者 star,你的支持是对作者最大的鼓励,不足之处可以在评论区多多指正,交流学习