Merge branch 'api' into hive2.0
| | |
| | | // url权限拦截 |
| | | registry.addInterceptor(suAuthorityInterceptor).addPathPatterns("/**/su/**"); |
| | | //小程序公司与域名对应关系拦截 |
| | | registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**"); |
| | | registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**") |
| | | .excludePathPatterns("/wxCommon/wxapi/wxpayCallback"); |
| | | } |
| | | |
| | | |
| | |
| | | public @ResponseBody |
| | | AjaxResult modifyShopAdvertisType(@RequestBody ShopAdvertisType newShopAdvertisType) { |
| | | SysUsers user = (SysUsers) WebUtil.getSession().getAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | if (StringUtils.isNotBlank(newShopAdvertisType.getNodeStyle())) { |
| | | String style = newShopAdvertisType.getNodeStyle(); |
| | | style = style.replaceAll("px", "rpx") |
| | |
| | | |
| | | newShopAdvertisType.setCreateBy(user.getSuName()); |
| | | newShopAdvertisType.setUpdateBy(user.getSuName()); |
| | | |
| | | newShopAdvertisType.setCompanyId(user.getCompanyId()); |
| | | shopAdvertisTypeDao.insert(newShopAdvertisType); |
| | | } else { |
| | | shopAdvertisTypeDao.updateByModel(newShopAdvertisType); |
| | |
| | | collect.forEach(ad -> { |
| | | ad.setCreateBy(user.getSuName()); |
| | | ad.setUpdateBy(user.getSuName()); |
| | | ad.setCompanyId(user.getCompanyId()); |
| | | ad.setTypeId(newShopAdvertisType.getAdtId()); |
| | | }); |
| | | |
| | |
| | | package com.matrix.system.shopXcx.action; |
| | | |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.constance.SystemMessageCode; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.ModelUtils; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.web.BaseAction; |
| | | import com.matrix.core.constance.SystemErrorCode; |
| | | import com.matrix.core.anotations.RemoveRequestToken; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.tools.ServiceUtil; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.shopXcx.bean.ShopPage; |
| | | import com.matrix.system.shopXcx.dao.ShopPageDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import com.matrix.core.anotations.SaveRequestToken; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import com.matrix.system.shopXcx.bean.ShopPage; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | /** |
| | | * @description 小程序页面 |
| | |
| | | @RemoveRequestToken |
| | | @RequestMapping(value = "/addShopPage") |
| | | public @ResponseBody AjaxResult addShopPage(ShopPage shopPage) { |
| | | if (serviceUtil.addCheckRepeat("shop_page", "code", shopPage.getCode())) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | if (serviceUtil.addCheckRepeatTowColumn("shop_page", "code", shopPage.getCode(),"company_id", user.getCompanyId())) { |
| | | throw new GlobleException("code重复"); |
| | | } |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | | shopPage.setCreateBy(user.getSuName()); |
| | | shopPage.setUpdateBy(user.getSuName()); |
| | | shopPage.setCompanyId(user.getCompanyId()); |
| | |
| | | @RequestMapping(value = "/modifyShopPage") |
| | | public @ResponseBody AjaxResult modifyShopPage(ShopPage newShopPage) { |
| | | ShopPage oldShopPage = WebUtil.getSessionAttribute(BEV); |
| | | |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | // 校验去重 |
| | | if (serviceUtil.updateCheckRepeat("shop_page", |
| | | if (serviceUtil.updateCheckRepeatTowColumn("shop_page", |
| | | "company_id", user.getCompanyId(), |
| | | "code", newShopPage.getCode(), |
| | | "id",newShopPage.getId())) { |
| | | throw new GlobleException("编号" + newShopPage.getCode() + "重复"); |
| | |
| | | } |
| | | } |
| | | //获取当前购物车产品可用的优惠券 |
| | | List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(addShopOrderPOJO.getShopId(),notCouponuyCart); |
| | | List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(HostInterceptor.getCompanyId(),notCouponuyCart); |
| | | |
| | | //获取用户使用的优惠券 |
| | | CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO(); |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping(value = "getMyCouponInfoByStatus/{shopId}/{status}") |
| | | @RequestMapping(value = "getMyCouponInfoByStatus/{status}") |
| | | @ResponseBody |
| | | public AjaxResult getMyCouponInfo(@PathVariable("shopId") Long shopId,@PathVariable("status") Integer status, @RequestBody PaginationVO pageVo) { |
| | | public AjaxResult getMyCouponInfo(@PathVariable("status") Integer status, @RequestBody PaginationVO pageVo) { |
| | | |
| | | return shopCouponService.getMyCouponInfoByStatus(shopId,status, pageVo); |
| | | return shopCouponService.getMyCouponInfoByStatus(HostInterceptor.getCompanyId(),status, pageVo); |
| | | } |
| | | |
| | | /** |
| | |
| | | * 根据状态获取我的优惠券 |
| | | * |
| | | * |
| | | * @param shopId |
| | | * @param companyId |
| | | * @param status |
| | | * @param pageVo |
| | | * @return |
| | | */ |
| | | AjaxResult getMyCouponInfoByStatus(Long shopId, Integer status, PaginationVO pageVo); |
| | | AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo); |
| | | |
| | | /** |
| | | * 根据产品ID获取优惠券列表 |
| | |
| | | * |
| | | * @return |
| | | */ |
| | | public List<CouponReceiveInfoVO> getCartVoCouponList(Long shopId,List<ShopShoppingCart> shopShoppingCarts) { |
| | | public List<CouponReceiveInfoVO> getCartVoCouponList(Long companyId,List<ShopShoppingCart> shopShoppingCarts) { |
| | | |
| | | //可用优惠券列表 |
| | | List<CouponReceiveInfoVO> shopCoupons = new ArrayList<>(); |
| | |
| | | |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | //1.找到用户所有的优惠券 |
| | | List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(shopId, bizUser.getOpenId(), AppConstance.MY_COUPON_NOT_USE, |
| | | List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(companyId, bizUser.getOpenId(), AppConstance.MY_COUPON_NOT_USE, |
| | | null); |
| | | if (CollectionUtils.isNotEmpty(userAllCoupon)) { |
| | | //根据优惠力度排序,优惠力度大的先参与计算 |
| | |
| | | * 根据订单状态查询优惠券列表 |
| | | * |
| | | * |
| | | * @param shopId |
| | | * @param companyId |
| | | * @param status 1=已使用;2=未使用;3=过期 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public AjaxResult getMyCouponInfoByStatus(Long shopId, Integer status, PaginationVO pageVo) { |
| | | public AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo) { |
| | | BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class); |
| | | // 如果查询使用或未使用状态的优惠券列表 |
| | | if (AppConstance.MY_COUPON_USE.equals(status) || AppConstance.MY_COUPON_NOT_USE.equals(status)) { |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(shopId,bizUser.getOpenId(), status, |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(companyId,bizUser.getOpenId(), status, |
| | | pageVo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); |
| | | } |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(shopId,bizUser.getOpenId(), pageVo); |
| | | List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(companyId,bizUser.getOpenId(), pageVo); |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, list); |
| | | } |
| | | |
| | |
| | | |
| | | CouponReceiveInfoVO selectMyCouponByReceiveId(@Param("receiveId") Integer receiveId); |
| | | |
| | | List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("shopId") Long shopId, @Param("userId") String userId, @Param("status") Integer status, |
| | | List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("companyId") Long shopId, @Param("userId") String userId, @Param("status") Integer status, |
| | | @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("shopId")Long shopId, @Param("userId") String userId, @Param("pageVo") PaginationVO pageVo); |
| | | List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("companyId")Long shopId, @Param("userId") String userId, @Param("pageVo") PaginationVO pageVo); |
| | | |
| | | } |
| | |
| | | |
| | | #线上测试环境 |
| | | |
| | | #spring.datasource.username=ct_test |
| | | #spring.datasource.password=123456 |
| | | #spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | spring.datasource.username=ct_test |
| | | spring.datasource.password=123456 |
| | | spring.datasource.url=jdbc:mysql://120.27.238.55:3306/hive_test?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | spring.datasource.username=chuhuan |
| | | spring.datasource.password=chuhuan |
| | | spring.datasource.url=jdbc:mysql://121.37.162.173:3306/hive_prd?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=CONVERT_TO_NULL&allowMultiQueries=true&transformedBitIsBoolean=true&serverTimezone=GMT%2B8 |
| | | |
| | | |
| | | spring.datasource.type=com.alibaba.druid.pool.DruidDataSource |
| | |
| | | sc.min_amount minAmount, sc.offset_amount offsetAmount, sc.is_all isAll, |
| | | sc.product_ids productIds, sc.attr_ids attrIds, scr.is_using isUsing |
| | | from shop_coupon sc, shop_coupon_record scr |
| | | where sc.shop_id=#{shopId} and sc.id = scr.c_id and scr.user_id = #{userId} and is_using = #{status} |
| | | where sc.company_id=#{companyId} and sc.id = scr.c_id and scr.user_id = #{userId} and is_using = #{status} |
| | | and is_open = 1 |
| | | <if test="status == 2"> |
| | | and now() >= begin_time and end_time >= now() |
| | |
| | | sc.min_amount minAmount, sc.offset_amount offsetAmount, sc.is_all isAll, |
| | | sc.product_ids productIds, sc.attr_ids attrIds, scr.is_using isUsing |
| | | from shop_coupon sc, shop_coupon_record scr |
| | | where sc.shop_id=#{shopId} and sc.id = scr.c_id and scr.user_id = #{userId} |
| | | where sc.company_id=#{companyId} and sc.id = scr.c_id and scr.user_id = #{userId} |
| | | and (isnull(order_id) or order_id = 0) |
| | | and now() > end_time and is_open = 1 |
| | | <if test="pageVo != null"><!-- 判断pageVo对象是否为空 --> |