jyy
2021-04-07 2a4dc73c59eae1e14b0e0660bf04652fa3d322ad
Merge remote-tracking branch 'origin/score_shop' into score_shop
3 files modified
183 ■■■■ changed files
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopActivitiesAction.java 40 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml 1 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html 142 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopActivitiesAction.java
@@ -1,29 +1,32 @@
package com.matrix.system.shopXcx.action;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.constance.SystemMessageCode;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.*;
import com.matrix.core.web.BaseAction;
import com.matrix.core.constance.SystemErrorCode;
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.DateUtil;
import com.matrix.core.tools.ModelUtils;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.shopXcx.bean.*;
import com.matrix.system.shopXcx.dao.*;
import com.matrix.system.shopXcx.dto.SalonDTO;
import com.matrix.system.shopXcx.dto.SecKillDTO;
import org.springframework.stereotype.Controller;
import com.matrix.core.exception.GlobleException;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import com.matrix.core.anotations.SaveRequestToken;
import com.matrix.core.pojo.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
@@ -308,13 +311,8 @@
        shopActivitiesDao.deleteById(actId);
        shopActivitiesGroupInfoDao.deleteByActId(actId);
        int i = shopActivitiesGroupPriceDao.deleteByActId(actId);
        if (i > 0) {
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES, i);
        } else {
            throw new GlobleException(SystemErrorCode.DATA_DELETE_FAIL);
        }
        shopActivitiesGroupPriceDao.deleteByActId(actId);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, SystemMessageCode.DELETE_SUCCES);
    }
    @RequestMapping(value = "/closeAct")
zq-erp/src/main/resources/mybatis/mapper/hive/AchieveNewDao.xml
@@ -979,6 +979,7 @@
        select
            b.su_name name,
            b.su_id id,
            b.SHOP_IMAG photo,
            sum(IFNULL(a.free_consume,0) + IFNULL(a.his_consume, 0) ) amount,
            c.shop_short_name shopName
        from achieve_new a
zq-erp/src/main/resources/templates/views/admin/activity/activity-list.html
@@ -93,8 +93,19 @@
                        <el-table-column
                                label="状态">
                            <template slot-scope="scope">
                                <span v-if="scope.row.actStatus == 1">未发布</span>
                                <span v-if="scope.row.actStatus == 2">未开始</span>
                                <div v-if="scope.row.actType == 4">
                                    <span v-if="scope.row.actStatus == 1">未发布</span>
                                </div>
                                <div v-if="scope.row.actType != 4">
                                    <span v-if="scope.row.actStatus == 1">开启</span>
                                </div>
                                <div v-if="scope.row.actType == 4">
                                    <span v-if="scope.row.actStatus == 2">未开始</span>
                                </div>
                                <div v-if="scope.row.actType != 4">
                                    <span v-if="scope.row.actStatus == 2">关闭</span>
                                </div>
                                <span v-if="scope.row.actStatus == 3">进行中</span>
                                <span v-if="scope.row.actStatus == 4">已结束</span>
                                <span v-if="scope.row.actStatus == 5">已删除</span>
@@ -129,6 +140,12 @@
                                    <el-button type="primary" v-if="[3,4,5].includes(scope.row.actStatus)" @click="openSignReceive(scope.row)" size="mini">活动统计</el-button>
                                    <el-button type="primary" v-if="scope.row.actStatus == 3" @click="beClose(scope.row)" size="mini">关闭</el-button>
                                    <el-button type="danger" v-if="scope.row.actStatus != 5" size="mini" @click="delRow(scope.row)">删除</el-button>
                                </el-row>
                                <el-row style="display:flex;" v-if="scope.row.actType != 4">
                                    <el-button type="primary" @click="openEdit(scope.row)" size="mini">编辑</el-button>
                                    <el-button type="primary" @click="activityStatistics(scope.row)" size="mini">活动统计</el-button>
                                    <el-button type="primary" @click="closeAct(scope.row)" size="mini">关闭</el-button>
                                    <el-button type="danger" @click="delAct(scope.row)" size="mini">删除</el-button>
                                </el-row>
                            </template>
                        </el-table-column>
@@ -197,6 +214,127 @@
                let _this = this;
                _this.loadActivitysList();
            },
            //删除
            delAct(row){
                let _this = this;
                _this.$confirm('确认删除活动吗?', '删除', {
                    distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'info'
                }).then(() => {
                    //通过
                    let id = row.id;
                    $.AjaxProxy().invoke(basePath + "/admin/shopActivities/del?keys="+id, function(loj) {
                        if (loj[0].result.status == '200') {
                            _this.loadActivitysList();
                        }
                    });
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
                        console.log("cancel");
                    }else{
                        //关闭按钮
                        console.log("close");
                    }
                });
            },
            //关闭
            closeAct(row){
                let _this = this;
                _this.$confirm('确认关闭活动吗?', '关闭', {
                    distinguishCancelAndClose: true,//设置关闭按钮和不通过按钮的区别
                    confirmButtonText: '确认',
                    cancelButtonText: '取消',
                    type: 'info'
                }).then(() => {
                    //通过
                    let id = row.id;
                    $.AjaxProxy().invoke(basePath + "/admin/shopActivities/closeAct?id="+id, function(loj) {
                        if (loj[0].result.status == '200') {
                            layer.msg(loj[0].result.info, {
                                icon: 1
                            });
                        }
                    });
                    _this.loadActivitysList();
                }).catch(action => {
                    //不通过
                    if(action === 'cancel'){
                        console.log("cancel");
                    }else{
                        //关闭按钮
                        console.log("close");
                    }
                });
            },
            // 活动统计
            activityStatistics(row) {
                let type = row.actType;
                let id = row.id;
                let name = row.actName;
                console.log("-------");
                if (type == 2) {
                    layer.full(layer.open({
                        type : 2,
                        title : name + "-活动统计",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesSecKill-list?id=' + id]
                    }));
                }
                if (type == 1) {
                    layer.full(layer.open({
                        type : 2,
                        title : name + "-活动统计",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesGroupBuy-list?id=' + id]
                    }));
                }
                if (type == 3) {
                    layer.full(layer.open({
                        type : 2,
                        title : name + "-活动统计",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/shopActivitiesSalon-list?id=' + id]
                    }));
                }
            },
            //打开编辑界面
            openEdit(row) {
                let type = row.actType;
                let id = row.id;
                if (type == 1) {
                    layer.full(layer.open({
                        type : 2,
                        title : "编辑拼团",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/activitiesGroupBuy-form?id=' + id]
                    }));
                } else if (type == 2) {
                    layer.full(layer.open({
                        type : 2,
                        title : "编辑秒杀",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/activitiesSecKill-form?id=' + id]
                    }));
                } else if (type == 3) {
                    layer.full(layer.open({
                        type : 2,
                        title : "编辑沙龙",
                        area : [ MUI.SIZE_L, MUI.SIZE_L ],
                        maxmin : true,
                        content : [ basePath+'/admin/redirect/shop/activities/activitiesSalon-form?id=' + id]
                    }));
                }
            },
            //修改
            beUpdate(row){
                layer.full(layer.open({