jyy
2021-04-06 12990a5138e3fa8874a601bfb784a2b1147f0f24
Merge remote-tracking branch 'origin/score_shop' into score_shop
2 files added
6 files modified
469 ■■■■■ changed files
zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateSignAwardSetDto.java 7 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignAwardSetService.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java 41 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesDao.xml 7 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/activity/activity-market.html 67 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-update.html 265 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/test/java/com/matrix/FenxiaoSoreInitTest.java 78 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/activity/dto/UpdateSignAwardSetDto.java
@@ -1,11 +1,12 @@
package com.matrix.system.activity.dto;
import java.util.Date;
import java.util.List;
import com.matrix.system.activity.entity.ActivitySignAwardSet;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.Date;
import java.util.List;
@Data
@ApiModel(value = "UpdateSignAwardSetDto", description = "查询参数")
@@ -25,7 +26,7 @@
    private List<ActivitySignAwardSet> activitySignAwardSets;
    
    @ApiModelProperty(value ="活动主表ID")
    private Long actId;
    private Long actMainId;
    
    @ApiModelProperty(hidden = true)
    private Long companyId;
zq-erp/src/main/java/com/matrix/system/activity/service/ActivitySignAwardSetService.java
@@ -189,7 +189,7 @@
        //获取当前登录人员信息
        QueryUtil.setQueryLimitCom(updateSignAwardSetDto);
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        Long actId = updateSignAwardSetDto.getActId();
        Long actId = updateSignAwardSetDto.getActMainId();
        Long companyId = user.getCompanyId();
        ShopActivities shopActivity = shopActivitiesDao.selectById(actId);
        //更新活动主表信息
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSignAction.java
New file
@@ -0,0 +1,41 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.shopXcx.dao.ShopActivitiesDao;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(tags = "签到活动接口类")
@RestController
@RequestMapping(value = "/wxapi/sign")
public class WxShopActivitiesSignAction {
    @Autowired
    private ShopActivitiesDao shopActivitiesDao;
    @Autowired
    private RedisUserLoginUtils redisUserLoginUtils;
    @ApiOperation(value = "获取签到基本信息", notes = "")
    @GetMapping(value = "/getSignBasicInfo")
    public AjaxResult getSignBasicInfo() {
        //获取登录人信息
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        Long companyId = loginUser.getCompanyId();
//        shopActivitiesDao.selectOneByCompanyIdAndActTypeAndActStatus();
//        BusParameterSettings busParameterSettings = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_PLAN, HostInterceptor.getCompanyId());
        AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("");
//        ajaxResult.setData(busParameterSettings.getParamValue3());
        return ajaxResult;
    }
}
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesDao.xml
@@ -213,6 +213,13 @@
            <if test="record.actName != null and record.actName != '' ">
                act_name  = #{record.actName},
            </if>
            <if test="record.actCode != null ">
                act_code  = #{record.actCode},
            </if>
            <if test="record.actContent != null ">
                act_content  = #{record.actContent},
            </if>
            <if test="record.actType != null ">
                act_type  = #{record.actType}, 
            </if>
zq-erp/src/main/resources/templates/views/admin/activity/activity-market.html
@@ -54,13 +54,46 @@
<body>
<div class="panel-body" id="app" v-cloak>
    <el-row>
        <el-col :span="6">
        <el-col :span="4">
            <el-card class="box-card" :body-style="{ padding: '10px 10px'}">
                <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
                <div style="padding: 5px;">
                    <span style="padding:5px;font-size: 30px;">每日签到</span>
                    <div class="bottom clearfix">
                        <el-button type="primary" class="button" @click="createSign()" round>马上创建</el-button>
                    </div>
                </div>
            </el-card>
        </el-col>
        <el-col :span="4">
            <el-card class="box-card" :body-style="{ padding: '10px 10px'}">
                <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
                <div style="padding: 5px;">
                    <span style="padding:5px;font-size: 30px;">拼团</span>
                    <div class="bottom clearfix">
                        <el-button type="primary" class="button" @click="openAdd(1)" round>马上创建</el-button>
                    </div>
                </div>
            </el-card>
        </el-col>
        <el-col :span="4">
            <el-card class="box-card" :body-style="{ padding: '10px 10px'}">
                <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
                <div style="padding: 5px;">
                    <span style="padding:5px;font-size: 30px;">秒杀</span>
                    <div class="bottom clearfix">
                        <el-button type="primary" class="button" @click="openSecKill()" round>马上创建</el-button>
                    </div>
                </div>
            </el-card>
        </el-col>
        <el-col :span="4">
            <el-card class="box-card" :body-style="{ padding: '10px 10px'}">
                <img src="https://shadow.elemecdn.com/app/element/hamburger.9cf7b091-55e9-11e9-a976-7f4d0b07eef6.png" class="image">
                <div style="padding: 5px;">
                    <span style="padding:5px;font-size: 30px;">沙龙</span>
                    <div class="bottom clearfix">
                        <el-button type="primary" class="button" @click="openSalon()" round>马上创建</el-button>
                    </div>
                </div>
            </el-card>
@@ -96,6 +129,38 @@
                    content : [ basePath + '/admin/redirect/activity/activity-sign']
                }));
            },
            // 打新增拼团界面
            openAdd(value) {
                layer.full(layer.open({
                    type : 2,
                    title : "新建拼团",
                    area : [ MUI.SIZE_L, MUI.SIZE_L ],
                    maxmin : true,
                    content : [ basePath+'/admin/redirect/shop/activities/activitiesGroupBuy-form']
                }));
            },
            // 打开新增秒杀界面
            openSecKill() {
                layer.full(layer.open({
                    type : 2,
                    title : "新建秒杀",
                    area : [ MUI.SIZE_L, MUI.SIZE_L ],
                    maxmin : true,
                    content : [ basePath+'/admin/redirect/shop/activities/activitiesSecKill-form']
                }));
            },
            // 打开新增沙龙界面
            openSalon() {
                layer.full(layer.open({
                    type : 2,
                    title : "新建秒杀",
                    area : [ MUI.SIZE_L, MUI.SIZE_L ],
                    maxmin : true,
                    content : [ basePath+'/admin/redirect/shop/activities/activitiesSalon-form']
                }));
            },
        }
    })
</script>
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign-update.html
@@ -302,6 +302,67 @@
                                                        </el-button>
                                                    </el-col>
                                                </el-row>
                                                <el-drawer
                                                        title="选择商城优惠券"
                                                        :visible.sync="drawerCoupon"
                                                        :direction="directionCoupon"
                                                        size="90%">
                                                    <el-row style="margin-left: 50px;">
                                                        <el-col :span="24">
                                                            <el-row>
                                                                <el-form ref="formCoupon" :model="formCoupon" inline >
                                                                    <el-form-item prop="yhjmc">
                                                                        <el-input v-model="formCoupon.yhjmc" placeholder="请输入优惠券名称"></el-input>
                                                                    </el-form-item>
                                                                    <el-button type="primary" @click="searchFormCoupon" >搜索</el-button>
                                                                    <el-button @click="resetFormCoupon('formCoupon')">重置</el-button>
                                                                </el-form>
                                                            </el-row>
                                                            <el-row class="table-style" >
                                                                <el-table ref="multipleTable"
                                                                          :data="couponList.rows"
                                                                          :height="tableHeightCoupon"
                                                                          stripe:true
                                                                          style="width: 100%">
                                                                    <el-table-column
                                                                            prop="cname"
                                                                            label="优惠券名称"
                                                                            show-overflow-tooltip>
                                                                    </el-table-column>
                                                                    <el-table-column
                                                                            prop="endTime"
                                                                            label="截止日期"
                                                                            show-overflow-tooltip>
                                                                    </el-table-column>
                                                                    <el-table-column
                                                                            prop="address"
                                                                            label="操作">
                                                                        <template slot-scope="scope">
                                                                            <el-button type="primary"
                                                                                       size="mini"
                                                                                       @click="chooseOneCoupon(scope.row)">选择
                                                                            </el-button>
                                                                        </template>
                                                                    </el-table-column>
                                                                </el-table>
                                                            </el-row>
                                                            <el-row class="paginationStyle"  >
                                                                <el-pagination background
                                                                               @size-change="changePageSizeCoupon"
                                                                               @current-change="changeCurrentPageCoupon"
                                                                               :current-page="couponList.currentPage"
                                                                               :page-sizes="[10, 20, 30, 50]"
                                                                               :page-size="couponList.pageSize"
                                                                               layout="total, sizes, prev, pager, next, jumper"
                                                                               :total="couponList.total">
                                                                </el-pagination>
                                                            </el-row>
                                                        </el-col>
                                                    </el-row>
                                                </el-drawer>
                                            </div>
                                            <div v-show="item.content.awardType === 4">
                                                <el-row style="display:flex;">
@@ -321,6 +382,67 @@
                                                        </el-button>
                                                    </el-col>
                                                </el-row>
                                                <el-drawer
                                                        title="选择ERP产品"
                                                        :visible.sync="drawerGoods"
                                                        :direction="directionGoods"
                                                        size="90%">
                                                    <el-row style="margin-left: 50px;">
                                                        <el-col :span="24">
                                                            <el-row>
                                                                <el-form ref="formGoods" :model="formGoods" inline >
                                                                    <el-form-item prop="cpmc">
                                                                        <el-input v-model="formGoods.cpmc" placeholder="请输入产品名称"></el-input>
                                                                    </el-form-item>
                                                                    <el-button type="primary" @click="searchFormGoods" >搜索</el-button>
                                                                    <el-button @click="resetFormGoods('formGoods')">重置</el-button>
                                                                </el-form>
                                                            </el-row>
                                                            <el-row class="table-style" >
                                                                <el-table ref="multipleTable"
                                                                          :data="goodsList.rows"
                                                                          :height="tableHeightGoods"
                                                                          stripe:true
                                                                          style="width: 100%">
                                                                    <el-table-column
                                                                            prop="cname"
                                                                            label="优惠券名称"
                                                                            show-overflow-tooltip>
                                                                    </el-table-column>
                                                                    <el-table-column
                                                                            prop="endTime"
                                                                            label="截止日期"
                                                                            show-overflow-tooltip>
                                                                    </el-table-column>
                                                                    <el-table-column
                                                                            prop="address"
                                                                            label="操作">
                                                                        <template slot-scope="scope">
                                                                            <el-button type="primary"
                                                                                       size="mini"
                                                                                       @click="chooseOneGoods(scope.row)">选择
                                                                            </el-button>
                                                                        </template>
                                                                    </el-table-column>
                                                                </el-table>
                                                            </el-row>
                                                            <el-row class="paginationStyle"  >
                                                                <el-pagination background
                                                                               @size-change="changePageSizeGoods"
                                                                               @current-change="changeCurrentPageGoods"
                                                                               :current-page="goodsList.currentPage"
                                                                               :page-sizes="[10, 20, 30, 50]"
                                                                               :page-size="goodsList.pageSize"
                                                                               layout="total, sizes, prev, pager, next, jumper"
                                                                               :total="goodsList.total">
                                                                </el-pagination>
                                                            </el-row>
                                                        </el-col>
                                                    </el-row>
                                                </el-drawer>
                                            </div>
                                        </el-tab-pane>
                                    </el-tabs>
@@ -457,6 +579,40 @@
            imageUrlButton: '',
            imageUrlState: '',
            //优惠券搜索弹出
            drawerCoupon: false,
            directionCoupon: 'rtl',
            tableHeightCoupon: 500,
            //--优惠券
            formCoupon:{
                yhjmc:'',
                order:'',
                sort:''
            },
            couponList:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
            //品项搜索弹出
            drawerGoods: false,
            directionGoods: 'rtl',
            tableHeightGoods: 500,
            //--品项
            formGoods:{
                cpmc:'',
                order:'',
                sort:''
            },
            goodsList:{
                rows:[],
                total:0,
                pageSize:10,
                currentPage:1,
            },
            //字体颜色
            typographyColor: '#409EFF',
            //背景颜色
@@ -503,6 +659,115 @@
            this.loadInfo();
        },
        methods: {
            //选择优惠券
            chooseCoupon(val){
                let _this = this;
                _this.drawerCoupon = true;
                _this.formCoupon.yhjmc = val;
                _this.loadCouponList();
            },
            //--优惠券
            loadCouponList() {
                let _this = this;
                let data=_this.getRequestParamCoupon();
                data.pageSize=_this.couponList.pageSize;
                data.pageNum=_this.couponList.currentPage;
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/admin/activitySignAwardSet/selectCouponList',
                    callback: function (data) {
                        _this.couponList.rows = data.rows;
                        _this.couponList.total = data.total;
                    }
                });
            },
            //查询参数
            getRequestParamCoupon(){
                let _this = this;
                return   {
                    yhjmc:_this.formCoupon.yhjmc,
                    order:_this.formCoupon.order,
                    sort:_this.formCoupon.sort,
                }
            },
            //查询
            searchFormCoupon:function(){
                this.couponList.currentPage=1;
                this.loadCouponList();
            },
            //重置
            resetFormCoupon(formName) {
                // this.formCoupon.yhjmc = ''
                // console.log(this.$refs[formName].resetFields)
                (this.$refs[formName])[0].resetFields();
            },
            changePageSizeCoupon(val) {
                this.couponList.pageSize = val;
                this.loadCouponList();
            },
            changeCurrentPageCoupon(val) {
                this.couponList.currentPage = val;
                this.loadCouponList();
            },
            //选择
            chooseOneCoupon(row) {
                let _this = this;
                _this.editableTabs[_this.tabIndex-1].content.couponId = row.id;
                _this.editableTabs[_this.tabIndex-1].content.couponName = row.cname;
                _this.drawerCoupon = false;
            },
            //--品项
            loadGoodsList() {
                let _this = this;
                let data=_this.getRequestParamGoods();
                data.pageSize=_this.goodsList.pageSize;
                data.pageNum=_this.goodsList.currentPage;
                AjaxProxy.requst({
                    app: _this,
                    data:data,
                    url: basePath + '/admin/activitySignAwardSet/selectGoodsList',
                    callback: function (data) {
                        _this.goodsList.rows = data.rows;
                        _this.goodsList.total = data.total;
                    }
                });
            },
            //查询参数
            getRequestParamGoods(){
                let _this = this;
                return   {
                    cpmc:_this.formCoupon.cpmc,
                    order:_this.formCoupon.order,
                    sort:_this.formCoupon.sort,
                }
            },
            //查询
            searchFormGoods:function(){
                this.goodsList.currentPage=1;
                this.loadGoodsList();
            },
            //重置
            resetFormGoods(formName) {
                (this.$refs[formName])[0].resetFields();
            },
            changePageSizeGoods(val) {
                this.goodsList.pageSize = val;
                this.loadGoodsList();
            },
            changeCurrentPageGoods(val) {
                this.goodsList.currentPage = val;
                this.loadGoodsList();
            },
            //选择
            chooseOneGoods(row) {
                let _this = this;
                _this.editableTabs[_this.tabIndex-1].content.goodsId = row.id;
                _this.editableTabs[_this.tabIndex-1].content.goodsName = row.name;
                _this.drawerGoods = false;
            },
            //加载活动详情
            loadInfo() {
                let _this = this;
zq-erp/src/main/resources/templates/views/admin/activity/activity-sign.html
@@ -776,7 +776,7 @@
                let _this = this;
                _this.editableTabs[_this.tabIndex-1].content.goodsId = row.id;
                _this.editableTabs[_this.tabIndex-1].content.goodsName = row.name;
                _this.drawerCoupon = false;
                _this.drawerGoods = false;
            },
            //保存
zq-erp/src/test/java/com/matrix/FenxiaoSoreInitTest.java
New file
@@ -0,0 +1,78 @@
package com.matrix;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.score.constant.ScoreSettingConstant;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.util.ArrayList;
import java.util.List;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT)
public class FenxiaoSoreInitTest {
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
    @Test
    public void InitByCompanyId() {
        //对应的公司ID
        long companyId = 35L;
        initBusParameterSetting(companyId);
        initBusParameterFenxiaoSetting(companyId);
    }
    /**
     * 初始化默认积分规则设置
     */
    public void initBusParameterSetting(long companyId) {
        List<BusParameterSettings> ruleSettings=new ArrayList<>();
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.VALID_PERIOD_POINTS, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CREDIT_POINTS_CASH, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.PRINCIPAL_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.GIVE_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.REFERRALS_CONSUMPTION, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.CASH_CONSUMPTION_SHOP, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP, companyId));
        ruleSettings.add(addScoreRuleSetting(ScoreSettingConstant.SIGN_SHOP, companyId));
        busParameterSettingsDao.batchInsert(ruleSettings);
    }
    /**
     * 初始化默认分销规则设置
     */
    public void initBusParameterFenxiaoSetting(long companyId) {
        List<BusParameterSettings> ruleSettings=new ArrayList<>();
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_SWITCH, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_MODEL, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_WAY, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_AUDIT_METHOD, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_APPLY_CONDITION, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_PLAN, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_TG_POSTER, companyId));
        ruleSettings.add(addScoreRuleSetting(FenxiaoSettingConstant.FX_ZGFY, companyId));
        busParameterSettingsDao.batchInsert(ruleSettings);
    }
    private BusParameterSettings addScoreRuleSetting(String code,long companyId) {
        BusParameterSettings busParameterSetting = new BusParameterSettings();
        busParameterSetting.setParamCode(code);
        busParameterSetting.setCompanyId(companyId);
        return busParameterSetting;
    }
}