jyy
2021-03-09 708fd530fe4c1565ca2f20707a911b03e59c925f
Merge branch 'api' into hive2.0
10 files modified
77 ■■■■ changed files
zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopAdvertisTypeAction.java 4 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopPageAction.java 29 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java 12 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/application.properties 9 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/config/MvcCoreConfig.java
@@ -76,7 +76,8 @@
        // url权限拦截
        registry.addInterceptor(suAuthorityInterceptor).addPathPatterns("/**/su/**");
        //小程序公司与域名对应关系拦截
        registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**");
        registry.addInterceptor(hostInterceptor).addPathPatterns("/**/wxapi/**")
                .excludePathPatterns("/wxCommon/wxapi/wxpayCallback");
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopAdvertisTypeAction.java
@@ -103,6 +103,7 @@
    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")
@@ -116,7 +117,7 @@
            newShopAdvertisType.setCreateBy(user.getSuName());
            newShopAdvertisType.setUpdateBy(user.getSuName());
            newShopAdvertisType.setCompanyId(user.getCompanyId());
            shopAdvertisTypeDao.insert(newShopAdvertisType);
        } else {
            shopAdvertisTypeDao.updateByModel(newShopAdvertisType);
@@ -135,6 +136,7 @@
            collect.forEach(ad -> {
                ad.setCreateBy(user.getSuName());
                ad.setUpdateBy(user.getSuName());
                ad.setCompanyId(user.getCompanyId());
                ad.setTypeId(newShopAdvertisType.getAdtId());
            });
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopPageAction.java
@@ -1,30 +1,29 @@
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 小程序页面
@@ -77,10 +76,11 @@
    @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());
@@ -103,9 +103,10 @@
       @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() + "重复");
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java
@@ -117,7 +117,7 @@
            }
        }
        //获取当前购物车产品可用的优惠券
        List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(addShopOrderPOJO.getShopId(),notCouponuyCart);
        List<CouponReceiveInfoVO> usefulCoupon = wxShopCouponService.getCartVoCouponList(HostInterceptor.getCompanyId(),notCouponuyCart);
        //获取用户使用的优惠券
        CouponReceiveInfoVO shopCoupon = new CouponReceiveInfoVO();
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopCouponAction.java
@@ -58,11 +58,11 @@
     *
     * @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);
    }
    /**
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopCouponService.java
@@ -42,12 +42,12 @@
     * 根据状态获取我的优惠券
     * 
     *
     * @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获取优惠券列表
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java
@@ -57,7 +57,7 @@
     *
     * @return
     */
    public List<CouponReceiveInfoVO> getCartVoCouponList(Long shopId,List<ShopShoppingCart> shopShoppingCarts) {
    public List<CouponReceiveInfoVO> getCartVoCouponList(Long companyId,List<ShopShoppingCart> shopShoppingCarts) {
        //可用优惠券列表
        List<CouponReceiveInfoVO> shopCoupons = new ArrayList<>();
@@ -65,7 +65,7 @@
        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)) {
            //根据优惠力度排序,优惠力度大的先参与计算
@@ -215,20 +215,20 @@
     * 根据订单状态查询优惠券列表
     *
     *
     * @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);
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java
@@ -43,9 +43,9 @@
    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);
}
zq-erp/src/main/resources/config/application.properties
@@ -4,13 +4,10 @@
#线上测试环境
#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
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCouponRecordDao.xml
@@ -270,7 +270,7 @@
        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()
@@ -296,7 +296,7 @@
        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对象是否为空 -->