Merge remote-tracking branch 'origin/score_shop' into score_shop
11 files added
56 files modified
| | |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.annotation.ComponentScan; |
| | | import org.springframework.scheduling.annotation.EnableAsync; |
| | | |
| | | /** |
| | | * spring boot入口 |
| | |
| | | * @description 容器添加组件 |
| | | * @date 2019-06-14 15:50 |
| | | */ |
| | | @Configuration |
| | | @Configuration() |
| | | @PropertySource("classpath:config/system.properties") |
| | | public class MvcCoreConfig implements WebMvcConfigurer { |
| | | |
New file |
| | |
| | | package com.matrix.config; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | @Component |
| | | @EnableScheduling |
| | | @ConditionalOnProperty(name = "scheduling.enabled", havingValue= "true") |
| | | public class TaskScheduleConfig { |
| | | |
| | | public TaskScheduleConfig(){ |
| | | LogUtil.debug("**********定时任务启动**********"); |
| | | } |
| | | } |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @description 奖品设置表 |
| | |
| | | */ |
| | | public interface ActivitySignAwardSetDao extends BaseMapper<ActivitySignAwardSet>{ |
| | | |
| | | List<ActivitySignAwardSetVo> selectListByActIDAndCompanyId(@Param("actId")Long actId, @Param("companyId")Long companyId,@Param("awardState")int awardstateWork); |
| | | |
| | | } |
| | |
| | | package com.matrix.system.activity.dao; |
| | | |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.matrix.system.activity.entity.ActivitySignRecord; |
| | | |
| | |
| | | */ |
| | | public interface ActivitySignRecordDao extends BaseMapper<ActivitySignRecord>{ |
| | | |
| | | ActivitySignRecord selectOneByActIdAndUserIdLikesignTime(@Param("actId")long actId, |
| | | @Param("userId")Long userId, @Param("format")String format); |
| | | |
| | | } |
| | |
| | | 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 = "查询参数") |
| | |
| | | private List<ActivitySignAwardSet> activitySignAwardSets; |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long actId; |
| | | private Long actMainId; |
| | | |
| | | @ApiModelProperty(hidden = true) |
| | | private Long companyId; |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.matrix.core.anotations.Extend; |
| | | import com.matrix.system.score.entity.BaseEntity; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | |
| | | * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品)") |
| | | private int awardType; |
| | | |
| | | |
| | | public static final int AWARDTYPE_CUSTOMIZE = 1; |
| | | public static final int AWARDTYPE_SCORE = 2; |
| | | public static final int AWARDTYPE_COUPON = 3; |
| | | public static final int AWARDTYPE_GOODS = 4; |
| | | |
| | | /** |
| | | * 奖项规则(1:每日奖励(默认)2:累计签到天数) |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="奖项规则(1:每日奖励(默认)2:累计签到天数)") |
| | | private int awardRule; |
| | | |
| | | public static final int AWARDRULE_NORMAL = 1; |
| | | public static final int AWARDRULE_CUMULATIVEDAY = 2; |
| | | |
| | | /** |
| | | * 签到累计天数 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="签到累计天数") |
| | | private int cumulativeDay; |
| | | |
| | | /** |
| | | * 奖项名称 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="奖项名称") |
| | | private String awardName; |
| | | |
| | | /** |
| | | * 图片介绍 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="图片介绍") |
| | | private String introduceImg; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="文字介绍") |
| | | private String introduceTip; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="奖项库存数量") |
| | | private int awardInventoryCnt; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="已派发数量") |
| | | private int awardDistributeCnt; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") |
| | | private int awardWay; |
| | | |
| | | /** |
| | | * 奖品是否有效(1:有效 2:无效) |
| | | */ |
| | | @ApiModelProperty(value ="奖品是否有效(1:有效 2:无效)") |
| | | private int awardState; |
| | | public static final int AWARDSTATE_WORK = 1; |
| | | public static final int AWARDSTATE_UNWORK = 2; |
| | |
| | | * 操作提示 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="操作提示") |
| | | private String operationTip; |
| | | |
| | | /** |
| | | * 兑奖地址 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="兑奖地址") |
| | | private String prizeAddress; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="兑奖期限开始日期") |
| | | private Date prizeStartTime; |
| | | |
| | | /** |
| | | * 兑奖期限结束日期 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="兑奖期限结束日期") |
| | | private Date prizeEndTime; |
| | | |
| | | /** |
| | | * 客服微信 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="客服微信") |
| | | private String wechatImg; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="积分数量") |
| | | private int scoreCnt; |
| | | |
| | | /** |
| | | * 优惠券ID |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="优惠券") |
| | | private String couponName; |
| | | |
| | | @ApiModelProperty(value ="优惠券ID") |
| | | private String couponId; |
| | | |
| | | /** |
| | | * 商品ID |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="商品") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value ="商品ID") |
| | | private String goodsId; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long activityId; |
| | | |
| | | /** |
| | |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="公司ID") |
| | | private Long companyId; |
| | | |
| | | |
| | |
| | | |
| | | |
| | | private Integer state; |
| | | |
| | | public static final int STATE_ING = 1; |
| | | public static final int STATE_DONE = 2; |
| | | |
| | | /** |
| | | * 核销码 |
| | |
| | | //获取当前登录人员信息 |
| | | 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); |
| | | //更新活动主表信息 |
| | |
| | | import com.matrix.system.app.dto.UploadPhotoDto; |
| | | import com.matrix.system.app.utils.Sms106Send; |
| | | import com.matrix.system.app.vo.UserInfoVo; |
| | | import com.matrix.system.common.authority.DefaultAuthorityManager; |
| | | import com.matrix.system.common.authority.strategy.AccountPasswordLogin; |
| | | import com.matrix.system.common.authority.strategy.LoginStrategy; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.service.SysUsersService; |
| | | import com.matrix.system.common.tools.PasswordUtil; |
| | | import com.matrix.system.common.tools.UploadUtil; |
| | |
| | | |
| | | @Autowired |
| | | private AppAuthorityManager authorityManager; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | private RedisClient redisClient; |
| | |
| | | public AjaxResult findAppVersion() { |
| | | return AjaxResult.buildSuccessInstance(sysUsersService.findAppVersion()); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | throw new GlobleException("请选择服务"); |
| | | } |
| | | SysVipInfo vipInfo = sysVipInfoService.findById(serviceOrderDto.getVipId()); |
| | | // if (StringUtils.isBlank(vipInfo.getPassWord())) { |
| | | // return AjaxResult.buildFailInstance("未设置资金密码"); |
| | | // } |
| | | |
| | | |
| | | if (StringUtils.isNotBlank(vipInfo.getPassWord())) { |
| | | if (!vipInfo.getPassWord().equals(serviceOrderDto.getPassword())) { |
New file |
| | |
| | | package com.matrix.system.app.action; |
| | | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.bean.AppVersion; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.CrossOrigin; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * @author jyy |
| | | * @date 2020-12-21 |
| | | **/ |
| | | @CrossOrigin(origins = "*") |
| | | @Api(value = "ApiSettingAction", tags = "配置查询类") |
| | | @RestController |
| | | @RequestMapping(value = "/api/setting") |
| | | public class ApiSettingAction { |
| | | |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | |
| | | @ApiOperation(value = "获取app配置", notes = "获取app配置") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "ok", response = AppVersion.class) |
| | | }) |
| | | @GetMapping(value = "/findAppSettings") |
| | | public AjaxResult findAppSettings() { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); |
| | | result.putInMap(AppConstance.APP_BANNER_GL, busParameterSettingsDao.selectCompanyParamByCode(AppConstance.APP_BANNER_GL,user.getCompanyId())); |
| | | return result; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.app.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * jyy |
| | | */ |
| | | @Data |
| | | @ApiModel(value = "ParameterSettingVo", description = "配置返回参数类") |
| | | public class ParameterSettingVo { |
| | | |
| | | @ApiModelProperty(value = "参数编码ID") |
| | | private Long paramId; |
| | | |
| | | |
| | | @ApiModelProperty(value = "参数编码") |
| | | private String paramCode; |
| | | |
| | | |
| | | |
| | | @ApiModelProperty(value = "参数值") |
| | | private String paramValue; |
| | | |
| | | |
| | | @ApiModelProperty(value = "值1") |
| | | private String paramValue1; |
| | | |
| | | |
| | | @ApiModelProperty(value = "值2") |
| | | private String paramValue2; |
| | | |
| | | |
| | | @ApiModelProperty(value = "值3") |
| | | private String paramValue3; |
| | | |
| | | |
| | | } |
| | |
| | | */ |
| | | public static final String WECHARPAY_CERTLOCAL_PATH = "certLocalPath"; |
| | | |
| | | /** |
| | | * APP管理模块Banner |
| | | */ |
| | | public static final String APP_BANNER_GL = "APP_BANNER_GL"; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | 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 interface ShopSalesmanApplyDao extends BaseMapper<ShopSalesmanApply> { |
| | | |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("id") Long userId, @Param("isSales")String isSales); |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("userId") Long userId, @Param("isSales")String isSales); |
| | | |
| | | IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("userId") Long userId); |
| | | |
| | |
| | | AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); |
| | | |
| | | SysProjUse queryUse = new SysProjUse(); |
| | | if(Objects.nonNull(vipId)){ |
| | | queryUse.setVipId(vipId); |
| | | }else{ |
| | | SysVipInfo vipInfo = getCurrentVioInfo(); |
| | | queryUse.setVipId(vipInfo.getId()); |
| | | } |
| | | |
| | | queryUse.setVipId(vipId); |
| | | queryUse.setType(Dictionary.SHOPPING_GOODS_TYPE_XM); |
| | | queryUse.setTaocanId(-1L); |
| | | queryUse.setStatus(Dictionary.TAOCAN_STATUS_YX); |
| | |
| | | * 购买业绩 |
| | | */ |
| | | private Double goodsCash; |
| | | |
| | | private Double cardCash; |
| | | |
| | | /** |
| | | * 赠送消耗 |
| | |
| | | |
| | | private String cateName; |
| | | |
| | | public Double getCardCash() { |
| | | return cardCash; |
| | | } |
| | | |
| | | public void setCardCash(Double cardCash) { |
| | | this.cardCash = cardCash; |
| | | } |
| | | |
| | | public String getCateName() { |
| | | return cateName; |
| | | } |
| | |
| | | /** |
| | | * 性别 1、男 2、女 0、未知 |
| | | */ |
| | | private String gender; |
| | | private Integer gender; |
| | | |
| | | /** |
| | | * 用户所在国家 |
| | |
| | | import static com.matrix.system.hive.statistics.BusinessDataTypeEnum.*; |
| | | |
| | | /** |
| | | * 定时任务测试类 |
| | | * 业绩统计报表定时任务 |
| | | * |
| | | * @author zhangheng |
| | | * @email 512061637@qq.com |
| | | * @date 2019年1月15日 |
| | | * @author jyy |
| | | */ |
| | | @Component |
| | | public class StatisticsBusinessDataJob { |
| | |
| | | } |
| | | |
| | | |
| | | @Scheduled(cron = "0 0 0 1/1 * ?") |
| | | @Scheduled(cron = "1 0 0 1/1 * ?") |
| | | public boolean executeExt() { |
| | | |
| | | LogUtil.info("业绩统计定时任务开始运行*******************"); |
| | |
| | | package com.matrix.system.job; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.SysProjUse; |
| | |
| | | |
| | | @Scheduled(cron = "0 0 0 * * ?") |
| | | public void setProjUseToInvalid() { |
| | | LogUtil.info("#项目,套餐失效任务处理#"); |
| | | List<SysProjUse> sysProjUses = sysProjUseDao.selectHasValidProjUse(); |
| | | |
| | | List<MoneyCardUse> moneyCardUses = moneyCardUseDao.selectHasValidMoneyCardUse(); |
| | |
| | | |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.constance.Dictionary; |
| | | import com.matrix.system.hive.bean.MoneyCardUse; |
| | | import com.matrix.system.hive.bean.SysProjServices; |
| | | import com.matrix.system.hive.bean.SysProjUse; |
| | | import com.matrix.system.hive.dao.MoneyCardUseDao; |
| | | import com.matrix.system.hive.dao.SysProjServicesDao; |
| | | import com.matrix.system.hive.dao.SysProjUseDao; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.mqTask.MQTaskRouting; |
| | | import com.matrix.system.wechart.templateMsg.UniformMsgParam; |
| | |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | |
| | | /** |
| | | * 每分钟执行一次 |
| | | */ |
| | | @Scheduled(cron = "0 0/1 * * * ?") |
| | | @Scheduled(cron = "0/30 * * * * ?") |
| | | public void serviceOvertimeNotice() { |
| | | |
| | | List<SysProjServices> needNoticeService=projServicesDao.selectNeedNoticeService(); |
| | |
| | | String[] scjfArrayCode={ |
| | | ScoreSettingConstant.CASH_CONSUMPTION_SHOP, |
| | | ScoreSettingConstant.RESERVATION_SERVICE_SHOP, |
| | | ScoreSettingConstant.EVALUATUIN_ORDER_SHOP, |
| | | ScoreSettingConstant.SIGN_SHOP}; |
| | | ScoreSettingConstant.EVALUATUIN_ORDER_SHOP}; |
| | | String[] scjfArrayName={ |
| | | "现金消费", |
| | | "预约服务", |
| | | "评价订单", |
| | | "签到"}; |
| | | "评价订单"}; |
| | | List<ScoreRuleSettingsVo> scjfRuleSettingsVo =getRuleSettingsVo(scjfArrayCode,scjfArrayName,companyId); |
| | | result.putInMap("scjf", scjfRuleSettingsVo); |
| | | return result; |
| | |
| | | */
|
| | | public final static String EVALUATUIN_ORDER_SHOP = "EVALUATUIN_ORDER_SHOP";
|
| | | public final static String EVALUATUIN_ORDER_SHOP_NAME = "评价订单";
|
| | | /**
|
| | | * 签到
|
| | | */
|
| | | public final static String SIGN_SHOP = "SIGN_SHOP";
|
| | | public final static String SIGN_SHOP_NAME = "签到";
|
| | |
|
| | | }
|
| | |
| | | * @return |
| | | */ |
| | | List<ScoreVipDetail> selectEffectiveScore(@Param("vipId")Long vipId); |
| | | |
| | | List<ScoreVipDetail> selectInvalidaVipScore(); |
| | | |
| | | int invalidVipScore(); |
| | | } |
| | |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_REFERRER=3; |
| | | /** |
| | | * 获取类型(4参加活动) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_JOIN_ACTIVE=4; |
| | | |
| | | |
| | | /** |
| | | * 获取类型(4人工调整) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_USERCHANGE=4; |
| | | /** |
| | | * 获取类型(5积分失效) |
| | | */ |
| | | public static final int SCORE_OVER_TIME=5; |
| | | |
| | | /** 有效*/ |
| | | public static final int SCORE_STATUS_YX=1; |
New file |
| | |
| | | package com.matrix.system.score.scheduledJob; |
| | | |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | import com.matrix.system.score.dao.ScoreUseRecordDao; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.score.entity.ScoreUseRecord; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 用户积分相关定时任务 |
| | | * |
| | | * @author jyy |
| | | */ |
| | | @Component |
| | | public class ScoreScheduledJob { |
| | | |
| | | |
| | | @Autowired |
| | | ScoreVipDetailDao scoreVipDetailDao; |
| | | |
| | | @Autowired |
| | | ScoreUseRecordDao scoreUseRecordDao; |
| | | |
| | | @Scheduled(cron = "1 0 0 1/1 * ?") |
| | | public boolean invalidVipScore() { |
| | | |
| | | LogUtil.info("计算无效积分定时任务开始运行****************"); |
| | | |
| | | //获取所有失效的积分,生成失效记录 |
| | | List<ScoreVipDetail> invalidavipScoreList = scoreVipDetailDao.selectInvalidaVipScore(); |
| | | |
| | | for (ScoreVipDetail scoreVipDetail : invalidavipScoreList) { |
| | | ScoreUseRecord scoreUseRecord=new ScoreUseRecord(); |
| | | scoreUseRecord.setCreateBy(AppConstance.SYSTEM_USER); |
| | | scoreUseRecord.setUpdateBy(AppConstance.SYSTEM_USER); |
| | | scoreUseRecord.setCreateTime(DateTime.now()); |
| | | scoreUseRecord.setUpdateTime(DateTime.now()); |
| | | scoreUseRecord.setNowScore(0); |
| | | scoreUseRecord.setCompanyId(scoreVipDetail.getCompanyId()); |
| | | scoreUseRecord.setScoreVipDetailId(scoreVipDetail.getId()); |
| | | scoreUseRecord.setBusinessId(0L); |
| | | scoreUseRecord.setRecNum(-scoreVipDetail.getRemainScore()); |
| | | scoreUseRecord.setType(ScoreVipDetail.SCORE_OVER_TIME); |
| | | scoreUseRecord.setVipId(scoreVipDetail.getVipId()); |
| | | scoreUseRecord.setPreScore(scoreVipDetail.getRemainScore()); |
| | | scoreUseRecord.setRemarks("积分失效"); |
| | | scoreUseRecordDao.insert(scoreUseRecord); |
| | | } |
| | | //更新失效积分记录状态 |
| | | scoreVipDetailDao.invalidVipScore(); |
| | | LogUtil.info("计算无效积分定时任务结束*******************"); |
| | | return true; |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.dao.ScoreUseRecordDao; |
| | |
| | | * 扣除用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deductionScore(Long vipId,Long oprationUserId,Long shopId, Integer score, Long businessId, int type,String remark) { |
| | | Long companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | public void deductionScore(Long vipId, Long oprationUserId, Long shopId, Integer score, Long businessId, int type, String remark) { |
| | | Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | String createBy=MatrixConstance.SYSTEM_USER; |
| | | if(oprationUserId!=null){ |
| | | createBy=sysUsersDao.selectById(oprationUserId).getSuName(); |
| | | String createBy = MatrixConstance.SYSTEM_USER; |
| | | if (oprationUserId != null) { |
| | | createBy = sysUsersDao.selectById(oprationUserId).getSuName(); |
| | | } |
| | | |
| | | List<ScoreVipDetail> effectiveScoreList = scoreVipDetailDao.selectEffectiveScore(vipId); |
| | |
| | | //余额充足 |
| | | currentDedution = score; |
| | | scoreVipDetail.setRemainScore(surplus); |
| | | if(surplus==0){ |
| | | if (surplus == 0) { |
| | | scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_WX); |
| | | } |
| | | scoreVipDetailDao.updateById(scoreVipDetail); |
| | | score=0; |
| | | score = 0; |
| | | } else { |
| | | currentDedution = scoreVipDetail.getRemainScore(); |
| | | scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_WX); |
| | | scoreVipDetail.setRemainScore(0); |
| | | scoreVipDetailDao.updateById(scoreVipDetail); |
| | | score=Math.abs(surplus); |
| | | score = Math.abs(surplus); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | //新增扣除记录 |
| | |
| | | scoreUseRecord.setOprationUserId(oprationUserId); |
| | | scoreUseRecordDao.insert(scoreUseRecord); |
| | | |
| | | if(surplus > 0 || surplus == 0){ |
| | | if (surplus > 0 || surplus == 0) { |
| | | break; |
| | | } |
| | | } |
| | | if(score>0){ |
| | | if (score > 0) { |
| | | throw new GlobleException("积分不足"); |
| | | } |
| | | } |
| | |
| | | * 新增用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addScore(Long vipId, Long oprationUserId,Long shopId, Integer score, Long businessId, int type,String remark) { |
| | | Long companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | public void addScore(Long vipId, Long oprationUserId, Long shopId, Integer score, Long businessId, int type, String remark) { |
| | | Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if(score<0){ |
| | | if (score < 0) { |
| | | throw new IllegalArgumentException("score必须有为大于零的数"); |
| | | } |
| | | |
| | | String createBy=MatrixConstance.SYSTEM_USER; |
| | | if(oprationUserId!=null){ |
| | | createBy=sysUsersDao.selectById(oprationUserId).getSuName(); |
| | | String createBy = MatrixConstance.SYSTEM_USER; |
| | | if (oprationUserId != null) { |
| | | createBy = sysUsersDao.selectById(oprationUserId).getSuName(); |
| | | } |
| | | |
| | | //计算过期时间 |
| | | BusParameterSettings yxqSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.VALID_PERIOD_POINTS, companyId); |
| | | Calendar cal=Calendar.getInstance(); |
| | | Calendar cal = Calendar.getInstance(); |
| | | int year = cal.get(Calendar.YEAR); |
| | | int sxYear=year+(Integer.parseInt(yxqSetting.getParamValue())-1); |
| | | Date sxys=DateUtil.stringToDate(sxYear+"-12-31 23:59",DateUtil.DATE_FORMAT_MM ); |
| | | int sxYear = year + (Integer.parseInt(yxqSetting.getParamValue()) - 1); |
| | | Date sxys = DateUtil.stringToDate(sxYear + "-12-31 23:59", DateUtil.DATE_FORMAT_MM); |
| | | |
| | | ScoreVipDetail scoreVipDetail=new ScoreVipDetail(); |
| | | ScoreVipDetail scoreVipDetail = new ScoreVipDetail(); |
| | | |
| | | scoreVipDetail.setCreateBy(createBy); |
| | | scoreVipDetail.setUpdateBy(createBy); |
| | |
| | | scoreVipDetailDao.insert(scoreVipDetail); |
| | | |
| | | //新增添加记录 |
| | | ScoreUseRecord scoreUseRecord = new ScoreUseRecord(); |
| | | ScoreUseRecord scoreUseRecord = new ScoreUseRecord(); |
| | | scoreUseRecord.setPreScore(score); |
| | | scoreUseRecord.setCreateBy(createBy); |
| | | scoreUseRecord.setUpdateBy(createBy); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 根据固定等级规则新增用户积分 |
| | | */ |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void addScoreByParamSetting(Long vipId, Long oprationUserId, Long shopId, Long businessId, int type, String remark, BusParameterSettings parameterSetting) { |
| | | |
| | | if (parameterSetting != null) { |
| | | SysVipInfo vipInfo = sysVipInfoDao.selectById(vipId); |
| | | //添加自己的积分 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue())) { |
| | | Integer firstScore = new Integer(parameterSetting.getParamValue()); |
| | | if (firstScore > 0) { |
| | | addScore( |
| | | vipInfo.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | firstScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | } |
| | | |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue1()) |
| | | && vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | Integer secondScore = new Integer(parameterSetting.getParamValue1()); |
| | | if (secondScore > 0) { |
| | | addScore( |
| | | referrerVip.getId(), |
| | | oprationUserId, |
| | | shopId, |
| | | secondScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | //推荐注册二级带新积分奖励 |
| | | if (StringUtils.isNotBlank(parameterSetting.getParamValue2()) |
| | | && referrerVip.getRecommendId() != null) { |
| | | Integer threeScore = new Integer(parameterSetting.getParamValue2()); |
| | | if (threeScore > 0) { |
| | | addScore( |
| | | referrerVip.getRecommendId(), |
| | | oprationUserId, |
| | | shopId, |
| | | threeScore, |
| | | businessId, |
| | | type, |
| | | remark |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 退积分 |
| | | */ |
| | | public void refundScore(Long vipId, Integer score, Long oldBusinessId, int type){ |
| | | public void refundScore(Long vipId, Integer score, Long oldBusinessId, int type) { |
| | | |
| | | Long companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if(score<0){ |
| | | if (score < 0) { |
| | | throw new IllegalArgumentException("score必须有为大于零的数"); |
| | | } |
| | | //查询原始使用记录 |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("business_id",oldBusinessId); |
| | | queryWrapper.eq("company_id",companyId); |
| | | queryWrapper.eq("type",type); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("business_id", oldBusinessId); |
| | | queryWrapper.eq("company_id", companyId); |
| | | queryWrapper.eq("type", type); |
| | | List<ScoreUseRecord> scoreUseRecordList = scoreUseRecordDao.selectList(queryWrapper); |
| | | scoreUseRecordList.forEach(scoreUseRecord -> { |
| | | ScoreVipDetail scoreVipDetail = scoreVipDetailDao.selectById(scoreUseRecord.getScoreVipDetailId()); |
| | | if(scoreVipDetail!=null){ |
| | | if(DateTime.now().isAfter(scoreVipDetail.getValiditeTime())){ |
| | | if (scoreVipDetail != null) { |
| | | if (DateTime.now().isAfter(scoreVipDetail.getValiditeTime())) { |
| | | //积分还有效 |
| | | scoreVipDetail.setRemainScore( scoreVipDetail.getRemainScore()+score); |
| | | scoreVipDetail.setUsedScore(scoreVipDetail.getUsedScore()-score); |
| | | scoreVipDetail.setRemainScore(scoreVipDetail.getRemainScore() + score); |
| | | scoreVipDetail.setUsedScore(scoreVipDetail.getUsedScore() - score); |
| | | scoreVipDetail.setState(ScoreVipDetail.SCORE_STATUS_YX); |
| | | scoreVipDetailDao.updateById(scoreVipDetail); |
| | | scoreUseRecordDao.deleteById(scoreUseRecord.getId()); |
| | |
| | | }); |
| | | } |
| | | |
| | | public void removeByBusinessId( Long vipId, Long oldBusinessId){ |
| | | Long companyId= vipInfoDao.selectById(vipId).getCompanyId(); |
| | | public void removeByBusinessId(Long vipId, Long oldBusinessId) { |
| | | Long companyId = vipInfoDao.selectById(vipId).getCompanyId(); |
| | | |
| | | if(oldBusinessId==null){ |
| | | if (oldBusinessId == null) { |
| | | throw new IllegalArgumentException("oldBusinessId必须有"); |
| | | } |
| | | QueryWrapper queryWrapper=new QueryWrapper(); |
| | | queryWrapper.eq("business_id",oldBusinessId); |
| | | queryWrapper.eq("company_id",companyId); |
| | | QueryWrapper queryWrapper = new QueryWrapper(); |
| | | queryWrapper.eq("business_id", oldBusinessId); |
| | | queryWrapper.eq("company_id", companyId); |
| | | scoreVipDetailDao.delete(queryWrapper); |
| | | scoreUseRecordDao.delete(queryWrapper); |
| | | } |
| | |
| | | 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; |
| | |
| | | |
| | | 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") |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.constance.AppConstance; |
| | | |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.bean.ShopProductComment; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | |
| | | @Autowired |
| | | private ShopOrderDao shopOrderDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | /** |
| | | * 根据ID逻辑删除产品评价 |
| | | * @param |
| | |
| | | modifyMap.put("id", orderId); |
| | | modifyMap.put("orderStatus", ShopOrder.ORDER_STATUS_ALREADY_REMARK); |
| | | shopOrderDao.updateByMap(modifyMap); |
| | | |
| | | //添加用户积分 |
| | | BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.EVALUATUIN_ORDER_SHOP_NAME, loginUser.getCompanyId()); |
| | | scoreVipDetailService.addScoreByParamSetting(loginUser.getId(), null,null, commentList.get(0).getComId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"评价送积分", parameterSetting); |
| | | |
| | | |
| | | return new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功"); |
| | | } |
| | | |
| | |
| | | } |
| | | ShopShareQrcord queryOrcode = new ShopShareQrcord(); |
| | | queryOrcode.setProductId(qrcodeVo.getProductId()); |
| | | queryOrcode.setUserId(loginUser.getOpenId()); |
| | | queryOrcode.setUserId(loginUser.getId()); |
| | | |
| | | if (isGroupProduct ) { |
| | | queryOrcode.setProductId(Integer.parseInt(qrcodeVo.getActId() + "")); |
| | |
| | | //如果未查询到就先插入数据再更新数据 |
| | | shareQrcord.setCreateBy(loginUser.getOpenId()); |
| | | shareQrcord.setUpdateBy(loginUser.getOpenId()); |
| | | shareQrcord.setUserId(loginUser.getOpenId()); |
| | | shareQrcord.setUserId(loginUser.getId()); |
| | | shareQrcord.setShopId(qrcodeVo.getShopId()); |
| | | //拼团活动 |
| | | if (isGroupProduct ) { |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import cn.hutool.core.date.DateTime; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.system.activity.dao.ActivitySignAwardSetDao; |
| | | import com.matrix.system.activity.dao.ActivitySignReceiveRecordDao; |
| | | import com.matrix.system.activity.dao.ActivitySignRecordDao; |
| | | import com.matrix.system.activity.entity.ActivitySignAwardSet; |
| | | import com.matrix.system.activity.entity.ActivitySignReceiveRecord; |
| | | import com.matrix.system.activity.entity.ActivitySignRecord; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.shopXcx.api.dto.ClickSignDTO; |
| | | import com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo; |
| | | import com.matrix.system.shopXcx.api.vo.SignBasicInfoJsonVo; |
| | | import com.matrix.system.shopXcx.api.vo.SignBasicInfoVo; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | | 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.transaction.annotation.Transactional; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Api(tags = "签到活动接口类") |
| | | @RestController |
| | | @RequestMapping(value = "/wxapi/sign") |
| | | public class WxShopActivitiesSignAction { |
| | | |
| | | @Autowired |
| | | private ShopActivitiesDao shopActivitiesDao; |
| | | |
| | | @Autowired |
| | | private RedisUserLoginUtils redisUserLoginUtils; |
| | | |
| | | @Autowired |
| | | private ActivitySignAwardSetDao activitySignAwardSetDao; |
| | | |
| | | @Autowired |
| | | private ActivitySignReceiveRecordDao activitySignReceiveRecordDao; |
| | | |
| | | @Autowired |
| | | private ActivitySignRecordDao activitySignRecordDao; |
| | | |
| | | @ApiOperation(value = "获取签到基本信息", notes = "") |
| | | @GetMapping(value = "/getSignBasicInfo") |
| | | public AjaxResult getSignBasicInfo() { |
| | | //获取登录人信息 |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | Long companyId = loginUser.getCompanyId(); |
| | | //获取签到活动的信息 |
| | | SignBasicInfoVo signBasicInfoVo = new SignBasicInfoVo(); |
| | | ShopActivities shopActivities = shopActivitiesDao.selectOneByCompanyIdAndActTypeAndActStatus(companyId,ShopActivities.ACTIVITIES_TYPE_SIGN,ShopActivities.ACTSTATUS_STATUS_ING); |
| | | Long actId = shopActivities.getId(); |
| | | signBasicInfoVo.setActName(shopActivities.getActName()); |
| | | signBasicInfoVo.setActCode(shopActivities.getActCode()); |
| | | signBasicInfoVo.setId(shopActivities.getId()); |
| | | String actContent = shopActivities.getActContent(); |
| | | SignBasicInfoJsonVo signBasicInfoJsonVo = JSON.parseObject(actContent, SignBasicInfoJsonVo.class); |
| | | signBasicInfoVo.setSignBasicInfoJsonVo(signBasicInfoJsonVo); |
| | | |
| | | List<ActivitySignAwardSetVo> activitySignAwardSetVos = activitySignAwardSetDao |
| | | .selectListByActIDAndCompanyId(actId,companyId,ActivitySignAwardSet.AWARDSTATE_WORK); |
| | | signBasicInfoVo.setActivitySignAwardSetVos(activitySignAwardSetVos); |
| | | |
| | | AjaxResult ajaxResult = AjaxResult.buildSuccessInstance(""); |
| | | ajaxResult.setData(signBasicInfoVo); |
| | | return ajaxResult; |
| | | } |
| | | |
| | | /** |
| | | * 点击签到 |
| | | * |
| | | */ |
| | | @ApiOperation(value = "点击签到", notes = "") |
| | | @PostMapping(value = "/clickSign") |
| | | @Transactional |
| | | public AjaxResult clickSign(@RequestBody ClickSignDTO clickSignDTO) { |
| | | SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | long actId = clickSignDTO.getActId(); |
| | | Long userId = user.getId(); |
| | | Long companyId = user.getCompanyId(); |
| | | /** |
| | | * 活动是否存在 |
| | | * 活动是否已经开始 |
| | | * 今日是否已经参与 |
| | | * 新增签到记录表 |
| | | * 判断累计连续签到天数是否+1 |
| | | * 查询是否有签到奖品 |
| | | * 日常奖励和自定义奖品 |
| | | */ |
| | | //活动是否存在 |
| | | ShopActivities shopActivities = shopActivitiesDao.selectById(actId); |
| | | if (ObjectUtil.isEmpty(shopActivities)) { |
| | | return AjaxResult.buildFailInstance("活动不存在"); |
| | | } |
| | | //活动是否已经开始 |
| | | Integer actStatus = shopActivities.getActStatus(); |
| | | if(ShopActivities.ACTSTATUS_STATUS_ING != actStatus) { |
| | | return AjaxResult.buildFailInstance("活动未开始"); |
| | | } |
| | | //今日是否已经参与 |
| | | ActivitySignRecord activitySignRecord = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,DateUtil.today()); |
| | | if (ObjectUtil.isNotEmpty(activitySignRecord)) { |
| | | return AjaxResult.buildFailInstance("今日用户已经签到成功"); |
| | | } |
| | | //前一天是否签到 |
| | | Date date = new Date(); |
| | | DateTime offsetDay = DateUtil.offsetDay(date, -1); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | ActivitySignRecord activitySignRecordOld = activitySignRecordDao.selectOneByActIdAndUserIdLikesignTime(actId,userId,sdf.format(offsetDay.getTime())); |
| | | ActivitySignRecord activitySignRecordAdd = new ActivitySignRecord(); |
| | | activitySignRecordAdd.setCompanyId(companyId); |
| | | activitySignRecordAdd.setActivityId(actId); |
| | | activitySignRecordAdd.setSignTime(date); |
| | | activitySignRecordAdd.setUserId(userId); |
| | | Integer cumulativeDay = activitySignRecordOld.getCumulativeDay(); |
| | | if(ObjectUtil.isEmpty(activitySignRecordOld)) { |
| | | //新增签到记录表,累计连续签到天数是1 |
| | | activitySignRecordAdd.setCumulativeDay(1); |
| | | }else { |
| | | //新增签到记录表,累计连续签到天数是否+1 |
| | | activitySignRecordAdd.setCumulativeDay(cumulativeDay+1); |
| | | } |
| | | activitySignRecordDao.insert(activitySignRecordAdd); |
| | | /** |
| | | * 查询是否有签到奖品 |
| | | * 日常奖励和自定义奖品 |
| | | */ |
| | | //日常奖励,新增奖品领取记录 |
| | | QueryWrapper<ActivitySignAwardSet> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("award_rule",ActivitySignAwardSet.AWARDRULE_NORMAL); |
| | | queryWrapper.eq("company_id",companyId); |
| | | queryWrapper.eq("activity_id",actId); |
| | | ActivitySignAwardSet activitySignAwardSetNormal = activitySignAwardSetDao.selectOne(queryWrapper); |
| | | if(ObjectUtil.isNotEmpty(activitySignAwardSetNormal)) { |
| | | ActivitySignReceiveRecord activitySignReceiveRecord = new ActivitySignReceiveRecord(); |
| | | activitySignReceiveRecord.setUserId(userId); |
| | | activitySignReceiveRecord.setReceiveTime(date); |
| | | activitySignReceiveRecord.setAwardId(activitySignAwardSetNormal.getId()); |
| | | activitySignReceiveRecord.setState(ActivitySignReceiveRecord.STATE_DONE); |
| | | activitySignReceiveRecord.setActivityId(actId); |
| | | activitySignReceiveRecord.setCompanyId(companyId); |
| | | activitySignReceiveRecordDao.insert(activitySignReceiveRecord); |
| | | } |
| | | //自定义奖励 |
| | | QueryWrapper<ActivitySignAwardSet> queryWrapperCumulativeDay = new QueryWrapper<>(); |
| | | queryWrapperCumulativeDay.eq("award_rule",ActivitySignAwardSet.AWARDRULE_CUMULATIVEDAY); |
| | | queryWrapperCumulativeDay.eq("cumulative_day",activitySignRecordAdd.getCumulativeDay()); |
| | | queryWrapperCumulativeDay.eq("company_id",companyId); |
| | | queryWrapperCumulativeDay.eq("activity_id",actId); |
| | | ActivitySignAwardSet activitySignAwardSetCumulativeDay = activitySignAwardSetDao.selectOne(queryWrapperCumulativeDay); |
| | | if(ObjectUtil.isNotEmpty(activitySignAwardSetCumulativeDay)) { |
| | | //奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) |
| | | if(ActivitySignAwardSet.AWARDTYPE_CUSTOMIZE == activitySignAwardSetCumulativeDay.getAwardType()) { |
| | | |
| | | } |
| | | //获取对应奖品的领取方式(兑奖方式(1:线下兑换2:物流配送3:客服兑换) |
| | | // if() { |
| | | // |
| | | // } |
| | | } |
| | | |
| | | |
| | | return AjaxResult.buildSuccessInstance("申请成功,等待审核"); |
| | | } |
| | | } |
| | |
| | | sysVipInfo.setSessionKey(sessionKey); |
| | | sysVipInfo.setCompanyId(HostInterceptor.getCompanyId()); |
| | | sysVipInfo.setArrivalWay("微商城"); |
| | | sysVipInfo.setVipName("微信用户"); |
| | | sysVipInfo.setVipState(Dictionary.VIP_STATE_HY); |
| | | sysVipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); |
| | | sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); |
| | | |
| | | sysVipInfo.setVipNo(openId); |
| | | sysVipInfoService.add(sysVipInfo); |
| | | |
| | |
| | | SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); |
| | | SysVipInfo sysVipInfo=new SysVipInfo(); |
| | | sysVipInfo.setId(loginUser.getId()); |
| | | |
| | | BeanUtil.copyProperties(xcxUserSaveUserInfoDto,sysVipInfo); |
| | | sysVipInfo.setPhone(xcxUserSaveUserInfoDto.getPhoneNumber()); |
| | | if(StringUtils.isBlank(loginUser.getVipName())||loginUser.getVipName().equals("微信用户")){ |
| | | sysVipInfo.setVipName(xcxUserSaveUserInfoDto.getNickName()); |
| | | } |
| | | if(StringUtils.isBlank(loginUser.getSex())){ |
| | | sysVipInfo.setSex(xcxUserSaveUserInfoDto.getGender()==1?"男":"女"); |
| | | } |
| | | |
| | | int i = sysVipInfoDao.update(sysVipInfo); |
| | | |
| | |
| | | package com.matrix.system.shopXcx.api.action; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.component.rabbitmq.RabiitMqTemplate; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.exception.GlobleException; |
| | |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.app.mapper.SysProjUseMapper; |
| | | import com.matrix.system.app.vo.*; |
| | | import com.matrix.system.app.vo.ServiceProductListVo; |
| | | import com.matrix.system.app.vo.ServiceProjVo; |
| | | import com.matrix.system.app.vo.ServiceTcVo; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.common.interceptor.HostInterceptor; |
| | | import com.matrix.system.common.tools.LocationUtil; |
| | |
| | | import com.matrix.system.hive.dao.*; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.service.*; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.api.dto.ErpServiceCommentDto; |
| | | import com.matrix.system.shopXcx.api.dto.ErpServiceOrderListDto; |
| | | import com.matrix.system.shopXcx.api.vo.ErpServiceOrderListVo; |
| | |
| | | import com.matrix.system.shopXcx.dao.ShopSkuDao; |
| | | import com.matrix.system.shopXcx.dto.YYDayOfWeek; |
| | | import com.matrix.system.shopXcx.dto.YYmonth; |
| | | import io.swagger.annotations.*; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.annotations.ApiResponse; |
| | | import io.swagger.annotations.ApiResponses; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Controller; |
| | |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author jiangyouyao |
| | |
| | | |
| | | @Autowired |
| | | ShoppingGoodsDao shoppingGoodsDao; |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Value("${evn}") |
| | | private String evn; |
| | |
| | | sysProjServices.setState(Dictionary.SERVICE_STATU_DQR); |
| | | SysProjServices newSysProjServices = projServicesService.addSysProjServices(sysProjServices); |
| | | if (newSysProjServices != null) { |
| | | |
| | | //添加用户积分 |
| | | BusParameterSettings parameterSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.RESERVATION_SERVICE_SHOP, sysVipInfo.getCompanyId()); |
| | | scoreVipDetailService.addScoreByParamSetting(sysVipInfo.getId(), null,null, newSysProjServices.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_JOIN_ACTIVE,"预约送积分", parameterSetting); |
| | | |
| | | |
| | | return AjaxResult.buildSuccessInstance("下单成功"); |
| | | } else { |
| | | return new AjaxResult(AjaxResult.STATUS_FAIL, "下单失败!"); |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.dto; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @ApiModel(value = "ClickSignDTO", description = "点击签到接收参数类") |
| | | @Data |
| | | public class ClickSignDTO { |
| | | |
| | | @NotBlank(message = "签到活动ID不能为空") |
| | | @ApiModelProperty(value = "签到活动ID", example = "1") |
| | | private long actId; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.vo; |
| | | |
| | | import java.util.Date; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ActivitySignAwardSetVo", description = "奖品明细") |
| | | public class ActivitySignAwardSetVo{ |
| | | |
| | | private Long id; |
| | | |
| | | /** |
| | | * 奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品) |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="奖项类型(1:自定义产品2:积分3:优惠券4:店铺商品)") |
| | | private int awardType; |
| | | |
| | | /** |
| | | * 奖项规则(1:每日奖励(默认)2:累计签到天数) |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="奖项规则(1:每日奖励(默认)2:累计签到天数)") |
| | | private int awardRule; |
| | | |
| | | /** |
| | | * 签到累计天数 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="签到累计天数") |
| | | private int cumulativeDay; |
| | | |
| | | /** |
| | | * 奖项名称 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="奖项名称") |
| | | private String awardName; |
| | | |
| | | /** |
| | | * 图片介绍 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="图片介绍") |
| | | private String introduceImg; |
| | | |
| | | /** |
| | | * 文字介绍 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="文字介绍") |
| | | private String introduceTip; |
| | | |
| | | /** |
| | | * 奖项库存数量 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="奖项库存数量") |
| | | private int awardInventoryCnt; |
| | | |
| | | /** |
| | | * 已派发数量 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="已派发数量") |
| | | private int awardDistributeCnt; |
| | | |
| | | /** |
| | | * 兑奖方式(1:线下兑换2:物流配送3:客服兑换) |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="兑奖方式(1:线下兑换2:物流配送3:客服兑换)") |
| | | private int awardWay; |
| | | |
| | | /** |
| | | * 奖品是否有效(1:有效 2:无效) |
| | | */ |
| | | @ApiModelProperty(value ="奖品是否有效(1:有效 2:无效)") |
| | | private int awardState; |
| | | public static final int AWARDSTATE_WORK = 1; |
| | | public static final int AWARDSTATE_UNWORK = 2; |
| | | |
| | | /** |
| | | * 操作提示 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="操作提示") |
| | | private String operationTip; |
| | | |
| | | /** |
| | | * 兑奖地址 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="兑奖地址") |
| | | private String prizeAddress; |
| | | |
| | | /** |
| | | * 兑奖期限开始日期 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="兑奖期限开始日期") |
| | | private Date prizeStartTime; |
| | | |
| | | /** |
| | | * 兑奖期限结束日期 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="兑奖期限结束日期") |
| | | private Date prizeEndTime; |
| | | |
| | | /** |
| | | * 客服微信 |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="客服微信") |
| | | private String wechatImg; |
| | | |
| | | /** |
| | | * 积分数量 |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="积分数量") |
| | | private int scoreCnt; |
| | | |
| | | /** |
| | | * 优惠券ID |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="优惠券") |
| | | private String couponName; |
| | | |
| | | @ApiModelProperty(value ="优惠券ID") |
| | | private String couponId; |
| | | |
| | | /** |
| | | * 商品ID |
| | | */ |
| | | |
| | | @ApiModelProperty(value ="商品") |
| | | private String goodsName; |
| | | |
| | | @ApiModelProperty(value ="商品ID") |
| | | private String goodsId; |
| | | |
| | | /** |
| | | * 活动主表ID |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="活动主表ID") |
| | | private Long activityId; |
| | | |
| | | /** |
| | | * 公司ID |
| | | */ |
| | | |
| | | |
| | | @ApiModelProperty(value ="公司ID") |
| | | private Long companyId; |
| | | |
| | | |
| | | |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | @Data |
| | | @ApiModel(value = "SignBasicInfoJsonVo", description = "签到活动") |
| | | public class SignBasicInfoJsonVo { |
| | | |
| | | @ApiModelProperty(value ="标题图片") |
| | | private String imageUrlTitle; |
| | | @ApiModelProperty(value ="头部图片") |
| | | private String imageUrlHead; |
| | | @ApiModelProperty(value ="按钮图片") |
| | | private String imageUrlButton; |
| | | @ApiModelProperty(value ="状态图片") |
| | | private String imageUrlState; |
| | | |
| | | @ApiModelProperty(value ="规则内容") |
| | | private String ruleExplain; |
| | | @ApiModelProperty(value ="字体颜色") |
| | | private String typographyColor; |
| | | @ApiModelProperty(value ="背景颜色") |
| | | private String backgroundColor; |
| | | @ApiModelProperty(value ="字体大小") |
| | | private Integer typographyNum; |
| | | @ApiModelProperty(value ="字体透明度") |
| | | private Integer typographyLight; |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix.system.shopXcx.api.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | @Data |
| | | |
| | | @ApiModel(value = "SignBasicInfoVo", description = "签到活动") |
| | | public class SignBasicInfoVo { |
| | | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value ="活动名称") |
| | | private String actName; |
| | | @ApiModelProperty(value ="活动编码") |
| | | private String actCode; |
| | | @ApiModelProperty(value ="活动开始时间") |
| | | private Date beginTime; |
| | | @ApiModelProperty(value ="活动结束时间") |
| | | private Date endTime; |
| | | @ApiModelProperty(value ="活动基本参数") |
| | | private SignBasicInfoJsonVo signBasicInfoJsonVo; |
| | | @ApiModelProperty(value ="奖品信息") |
| | | private List<ActivitySignAwardSetVo> activitySignAwardSetVos; |
| | | |
| | | } |
| | |
| | | /** |
| | | * 主键 |
| | | */ |
| | | private Integer comId; |
| | | private Long comId; |
| | | |
| | | |
| | | /** |
| | |
| | | auditStatus = auditStatus; |
| | | } |
| | | |
| | | public Integer getComId() { |
| | | public Long getComId() { |
| | | return comId; |
| | | } |
| | | |
| | | public void setComId(Integer comId) { |
| | | this.comId=comId; |
| | | |
| | | public void setComId(Long comId) { |
| | | this.comId = comId; |
| | | } |
| | | |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | |
| | | package com.matrix.system.shopXcx.bean; |
| | | |
| | | import com.matrix.system.common.bean.EntityDTOExt; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 分享二维码 |
| | | */ |
| | | @Data |
| | | public class ShopShareQrcord extends EntityDTOExt { |
| | | |
| | | |
| | |
| | | /** |
| | | * 用户ID |
| | | */ |
| | | private String userId; |
| | | private Long userId; |
| | | |
| | | |
| | | /** |
| | |
| | | */ |
| | | private Long shopId; |
| | | |
| | | public Long getShopId() { |
| | | return shopId; |
| | | } |
| | | |
| | | public void setShopId(Long shopId) { |
| | | this.shopId = shopId; |
| | | } |
| | | |
| | | |
| | | |
| | | public String getId() { |
| | | return id; |
| | | } |
| | | |
| | | public void setId(String id) { |
| | | this.id = id; |
| | | } |
| | | |
| | | public Integer getProductId() { |
| | | return productId; |
| | | } |
| | | |
| | | public void setProductId(Integer productId) { |
| | | this.productId = productId; |
| | | } |
| | | |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | |
| | | public Integer getStatus() { |
| | | return status; |
| | | } |
| | | |
| | | public void setStatus(Integer status) { |
| | | this.status = status; |
| | | } |
| | | |
| | | public Integer getVisitorCount() { |
| | | return visitorCount; |
| | | } |
| | | |
| | | public void setVisitorCount(Integer visitorCount) { |
| | | this.visitorCount = visitorCount; |
| | | } |
| | | |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | public String getQrcodeUrl() { |
| | | return qrcodeUrl; |
| | | } |
| | | |
| | | public void setQrcodeUrl(String qrcodeUrl) { |
| | | this.qrcodeUrl = qrcodeUrl; |
| | | } |
| | | } |
| | |
| | | public List<ShopActivities> selectSalonActivityByUser(@Param("record") SalonVO salonVO); |
| | | |
| | | public IPage<ActivitiesListVo> findActivitiesList(Page<ActivitiesListVo> page, @Param("record")ActivitiesListDto activitiesListDto); |
| | | |
| | | public ShopActivities selectOneByCompanyIdAndActTypeAndActStatus(@Param("companyId")Long companyId, @Param("activitiesTypeSign")int activitiesTypeSign, |
| | | @Param("actstatusStatusIng")int actstatusStatusIng); |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.mqTask; |
| | | |
| | | |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import com.matrix.system.hive.service.SysVipInfoService; |
| | | import com.matrix.system.score.constant.ScoreSettingConstant; |
| | | import com.matrix.system.score.entity.ScoreVipDetail; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | |
| | | SysVipInfoService sysVipInfoService; |
| | | |
| | | |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | |
| | | @Autowired |
| | | SysVipInfoDao sysVipInfoDao; |
| | | |
| | | @Override |
| | | public void handle(String consumerTag, Delivery message) throws IOException { |
| | |
| | | List<ShopOrderDetails> orderDetails = shopOrderDetailsDao.selectByOrderId(Integer.valueOf(orderId)); |
| | | order.setDetails(orderDetails); |
| | | //扣除积分 |
| | | if(order.getScorePay()!=null&&order.getScorePay()>0){ |
| | | scoreVipDetailService.deductionScore(order.getUserId(),null, |
| | | Long.parseLong(order.getStoreId()+""),order.getScorePay(), |
| | | Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH,"商城积分抵扣"); |
| | | }else{ |
| | | if (order.getScorePay() != null && order.getScorePay() > 0) { |
| | | scoreVipDetailService.deductionScore(order.getUserId(), null, |
| | | Long.parseLong(order.getStoreId() + ""), order.getScorePay(), |
| | | Long.parseLong(order.getId() + ""), ScoreVipDetail.SCORE_VIP_TYPE_CASH, "商城积分抵扣"); |
| | | } else { |
| | | |
| | | //消费获得积分 |
| | | int addScore=0; |
| | | int addScore = 0; |
| | | BusParameterSettings cashConsumptionShop = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.CASH_CONSUMPTION_SHOP, order.getCompanyId()); |
| | | for(ShopOrderDetails shopOrderDetail : orderDetails) { |
| | | if(shopOrderDetail.getPayType()==ShopOrderDetails.PAYTYPE_MICRO){ |
| | | Integer xfkdScore= shopOrderDetail.getShopSku().getScore(); |
| | | if(xfkdScore!=null && xfkdScore>0){ |
| | | addScore+=xfkdScore; |
| | | }else{ |
| | | if(StringUtils.isNotBlank(cashConsumptionShop.getParamValue())){ |
| | | addScore+= shopOrderDetail.getTotalPrice().divide(new BigDecimal(cashConsumptionShop.getParamValue())).intValue(); |
| | | for (ShopOrderDetails shopOrderDetail : orderDetails) { |
| | | if (shopOrderDetail.getPayType() == ShopOrderDetails.PAYTYPE_MICRO) { |
| | | Integer xfkdScore = shopOrderDetail.getShopSku().getScore(); |
| | | if (xfkdScore != null && xfkdScore > 0) { |
| | | addScore += xfkdScore; |
| | | } else { |
| | | if (StringUtils.isNotBlank(cashConsumptionShop.getParamValue())) { |
| | | addScore += shopOrderDetail.getTotalPrice().divide(new BigDecimal(cashConsumptionShop.getParamValue())).intValue(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if(addScore>0){ |
| | | if (addScore > 0) { |
| | | //插入新的积分 |
| | | scoreVipDetailService.addScore( |
| | | order.getUserId(), |
| | | null, |
| | | Long.parseLong(order.getStoreId()+""), |
| | | Long.parseLong(order.getStoreId() + ""), |
| | | addScore, |
| | | Long.parseLong(orderId+""), |
| | | Long.parseLong(orderId + ""), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "微商城消费"); |
| | | |
| | | //插入上级积分 |
| | | SysVipInfo vipInfo = sysVipInfoService.findById(order.getUserId()); |
| | | |
| | | |
| | | if (vipInfo.getRecommendId() != null) { |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | if (StringUtils.isNotBlank(cashConsumptionShop.getParamValue1())) { |
| | | |
| | | int parentScore = order.getOrderMoney().divide(new BigDecimal(cashConsumptionShop.getParamValue1())).intValue(); |
| | | if (parentScore > 0) { |
| | | scoreVipDetailService.addScore( |
| | | referrerVip.getId(), |
| | | null, |
| | | Long.parseLong(order.getStoreId() + ""), |
| | | parentScore, |
| | | Long.parseLong(order.getId() + ""), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "推荐消费奖励" |
| | | ); |
| | | } |
| | | } |
| | | |
| | | //推荐注册二级带新积分奖励 |
| | | if (referrerVip.getRecommendId() != null && StringUtils.isNotBlank(cashConsumptionShop.getParamValue2())) { |
| | | SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); |
| | | int topParentScore = order.getOrderMoney().divide(new BigDecimal(cashConsumptionShop.getParamValue2())).intValue(); |
| | | if (topParentScore > 0) { |
| | | scoreVipDetailService.addScore( |
| | | topVipInfo.getId(), |
| | | null, |
| | | Long.parseLong(order.getStoreId() + ""), |
| | | topParentScore, |
| | | Long.parseLong(order.getId() + ""), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_CASH, |
| | | "推荐消费奖励" |
| | | ); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | package com.matrix.system.shopXcx.quartz; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.bean.ShopActivities; |
| | | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesDao; |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinDao; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | |
| | | import java.util.List; |
| | |
| | | * @author wzy |
| | | */ |
| | | @Configuration |
| | | @EnableScheduling |
| | | public class ShopActivityGroupJoinTimeOutQuartz { |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private ShopActivitiesDao shopActivitiesDao ; |
| | | |
| | | @Value("${scheduling.enabled}") |
| | | private boolean taskSwitch; |
| | | |
| | | |
| | | |
| | | @Scheduled(cron = "0 */1 * * * ?") |
| | | public boolean executeExt() { |
| | | if (taskSwitch) { |
| | | LogUtil.info("#开团时间超时任务处理#"); |
| | | List<ShopActivitiesGroupJoin> groupJoins = shopActivitiesGroupJoinDao.selectGroupJoinWithEnd(); |
| | | ShopActivityTimeOutQuartz timeOutQuartz = new ShopActivityTimeOutQuartz(); |
| | |
| | | timeOutQuartz.doUnVirtualGroup(groupJoin); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return true; |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.quartz; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoin; |
| | | import com.matrix.system.shopXcx.bean.ShopActivitiesGroupJoinUser; |
| | |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinDao; |
| | | import com.matrix.system.shopXcx.dao.ShopActivitiesGroupJoinUserDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | |
| | | import java.util.List; |
| | |
| | | * @author wzy |
| | | */ |
| | | @Configuration |
| | | @EnableScheduling |
| | | public class ShopActivityPayTimeOutQuartz { |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private ShopActivitiesGroupJoinDao shopActivitiesGroupJoinDao; |
| | | |
| | | @Value("${scheduling.enabled}") |
| | | private boolean taskSwitch; |
| | | |
| | | |
| | | @Scheduled(cron = "0 */1 * * * ?") |
| | | public void executeExt() { |
| | | if (taskSwitch) { |
| | | |
| | | LogUtil.info("#拼团支付超时处理任务#"); |
| | | List<ShopActivitiesGroupJoinUser> joinUserList = shopActivitiesGroupJoinUserDao.selectGroupJoinUserEnd(); |
| | | if (CollectionUtils.isNotEmpty(joinUserList)) { |
| | |
| | | shopOrder.setOrderStatus(ShopOrder.ORDER_STATUS_CANCEL); |
| | | shopOrderDao.updateByModel(shopOrder); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.matrix.system.shopXcx.bean.*; |
| | | import com.matrix.system.shopXcx.dao.*; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | |
| | | import java.util.ArrayList; |
| | |
| | | * @author wzy |
| | | */ |
| | | @Configuration |
| | | @EnableScheduling |
| | | public class ShopActivityTimeOutQuartz { |
| | | |
| | | @Autowired |
| | |
| | | @Autowired |
| | | private ShopActivitiesGroupJoinUserDao shopActivitiesGroupJoinUserDao; |
| | | |
| | | @Value("${scheduling.enabled}") |
| | | private boolean taskSwitch; |
| | | |
| | | |
| | | @Scheduled(cron = "0 */1 * * * ?") |
| | | public void executeExt() { |
| | | if (taskSwitch) { |
| | | |
| | | LogUtil.info("#拼团活动自动结束任务#"); |
| | | List<ShopActivities> actList = shopActivitiesDao.selectShopActivitiesHasEnd(); |
| | | if (CollectionUtils.isNotEmpty(actList)) { |
| | |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | |
| | | /** |
| | |
| | | package com.matrix.system.shopXcx.quartz; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.shopXcx.api.tools.WxShopOrderUtil; |
| | | import com.matrix.system.shopXcx.bean.ShopDeliveryInfo; |
| | | import com.matrix.system.shopXcx.bean.ShopOrder; |
| | | import com.matrix.system.shopXcx.dao.ShopDeliveryInfoDao; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDao; |
| | | import org.apache.commons.collections.CollectionUtils; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | |
| | | import java.util.HashMap; |
| | |
| | | * 15天自动确认收货定时任务 |
| | | */ |
| | | @Configuration |
| | | @EnableScheduling |
| | | public class ShopAutomaticReceiveQuartz { |
| | | |
| | | @Value("${scheduling.enabled}") |
| | | private boolean taskSwitch; |
| | | |
| | | @Autowired |
| | | private ShopDeliveryInfoDao shopDeliveryInfoDao; |
| | |
| | | |
| | | @Scheduled(cron = "0/30 * * * * ?") |
| | | public void executeExt() { |
| | | if(taskSwitch) { |
| | | |
| | | |
| | | LogUtil.info("#15天自动收货任务处理#"); |
| | | |
| | | List<ShopDeliveryInfo> shopDeliveryInfos = shopDeliveryInfoDao.selectAutomaticReceive(); |
| | | int flag = 0; |
| | |
| | | } |
| | | } |
| | | LogUtil.info("自动确认收货更新条数:" + flag); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | package com.matrix.system.shopXcx.quartz; |
| | | |
| | | import com.matrix.core.tools.LogUtil; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.system.shopXcx.dao.ShopCouponDao; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.context.annotation.Configuration; |
| | | import org.springframework.scheduling.annotation.EnableScheduling; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | |
| | | /** |
| | |
| | | * 优惠券定时任务 |
| | | */ |
| | | @Configuration |
| | | @EnableScheduling |
| | | public class ShopCouponQuartz { |
| | | |
| | | |
| | | |
| | | @Value("${scheduling.enabled}") |
| | | private boolean taskSwitch; |
| | | |
| | | @Autowired |
| | | private ShopCouponDao shopCouponDao; |
| | | |
| | | @Scheduled(cron = "0 */1 * * * ?") |
| | | public void executeExt() { |
| | | if(taskSwitch){ |
| | | int i = shopCouponDao.updateAllCouponStatus(); |
| | | LogUtil.info("优惠券状态更新条数:" + i); |
| | | } |
| | | |
| | | int i = shopCouponDao.updateAllCouponStatus(); |
| | | LogUtil.info("优惠券状态更新条数:" + i); |
| | | } |
| | | |
| | | |
| | |
| | | groupBuy.pay.timeLimit=30 |
| | | |
| | | #定时任务 |
| | | scheduling.enabled=false |
| | | scheduling.enabled=true |
| | | |
| | | swagger.enable=true |
| | | swagger.security.username=admin |
| | |
| | | ALTER TABLE `activity_sign_award_set` |
| | | ADD COLUMN `coupon_name` varchar(200) NULL COMMENT '优惠券名' AFTER `score_cnt`; |
| | | |
| | | ALTER TABLE `activity_sign_record` |
| | | CHANGE COLUMN `open_id` `user_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'openID' AFTER `id`; |
| | | |
| | | ALTER TABLE `activity_sign_receive_record` |
| | | CHANGE COLUMN `open_id` `user_id` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT 'openID' AFTER `id`; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.matrix.system.activity.dao.ActivitySignAwardSetDao"> |
| | | <!-- 定义ActivitySignAwardSet 的复杂关联map --> |
| | | <resultMap type="com.matrix.system.activity.entity.ActivitySignAwardSet" id="ActivitySignAwardSetMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="awardType" column="award_type" /> |
| | | <result property="awardRule" column="award_rule" /> |
| | | <result property="cumulativeDay" column="cumulative_day" /> |
| | | <result property="awardName" column="award_name" /> |
| | | <result property="introduceImg" column="introduce_img" /> |
| | | <result property="introduceTip" column="introduce_tip" /> |
| | | <result property="awardInventoryCnt" column="award_inventory_cnt" /> |
| | | <result property="awardDistributeCnt" column="award_distribute_cnt" /> |
| | | <result property="awardWay" column="award_way" /> |
| | | <result property="operationTip" column="operation_tip" /> |
| | | <result property="prizeAddress" column="prize_address" /> |
| | | <result property="prizeStartTime" column="prize_start_time" /> |
| | | <result property="prizeEndTime" column="prize_end_time" /> |
| | | <result property="wechatImg" column="wechat_img" /> |
| | | <result property="scoreCnt" column="score_cnt" /> |
| | | <result property="couponId" column="coupon_id" /> |
| | | <result property="goodsId" column="goods_id" /> |
| | | <result property="activityId" column="activity_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | | |
| | | <!-- 定义ActivitySignAwardSet 的简单map ,本map不添加其他的关联属性 --> |
| | | <resultMap type="com.matrix.system.activity.entity.ActivitySignAwardSet" id="ActivitySignAwardSetSimpleMap"> |
| | | <id property="id" column="id" /> |
| | | <result property="createBy" column="create_by" /> |
| | | <result property="createTime" column="create_time" /> |
| | | <result property="updateBy" column="update_by" /> |
| | | <result property="updateTime" column="update_time" /> |
| | | <result property="awardType" column="award_type" /> |
| | | <result property="awardRule" column="award_rule" /> |
| | | <result property="cumulativeDay" column="cumulative_day" /> |
| | | <result property="awardName" column="award_name" /> |
| | | <result property="introduceImg" column="introduce_img" /> |
| | | <result property="introduceTip" column="introduce_tip" /> |
| | | <result property="awardInventoryCnt" column="award_inventory_cnt" /> |
| | | <result property="awardDistributeCnt" column="award_distribute_cnt" /> |
| | | <result property="awardType" column="award_type" /> |
| | | <result property="operationTip" column="operation_tip" /> |
| | | <result property="prizeAddress" column="prize_address" /> |
| | | <result property="prizeStartTime" column="prize_start_time" /> |
| | | <result property="prizeEndTime" column="prize_end_time" /> |
| | | <result property="wechatImg" column="wechat_img" /> |
| | | <result property="scoreCnt" column="score_cnt" /> |
| | | <result property="couponId" column="coupon_id" /> |
| | | <result property="goodsId" column="goods_id" /> |
| | | <result property="activityId" column="activity_id" /> |
| | | <result property="companyId" column="company_id" /> |
| | | </resultMap> |
| | | |
| | | <select id="selectListByActIDAndCompanyId" resultType="com.matrix.system.shopXcx.api.vo.ActivitySignAwardSetVo"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | activity_sign_award_set a |
| | | where |
| | | a.activity_id = #{actId} |
| | | and a.company_id = #{companyId} |
| | | and a.award_state = #{awardState} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.matrix.system.activity.dao.ActivitySignRecordDao"> |
| | | |
| | | <select id="selectOneByActIdAndUserIdLikesignTime" resultType="com.matrix.system.activity.entity.ActivitySignRecord"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | activity_sign_record a |
| | | where |
| | | a.actId = #{actId} |
| | | and a.open_id = #{userId} |
| | | and a.sign_time like concat('%',#{format},'%') |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | <result property="freeConsume" column="free_consume" /> |
| | | <result property="hisConsume" column="his_consume" /> |
| | | <result property="goodsCash" column="goods_cash" /> |
| | | <result property="cardCash" column="card_cash" /> |
| | | <result property="projNum" column="proj_num" /> |
| | | <result property="numberOfPeople" column="number_of_people" /> |
| | | <result property="shopName" column="shop_name" /> |
| | |
| | | c.vip_name, |
| | | e.name as pro_name, |
| | | b.ZK_TOTAL as zk_total, |
| | | a.goods_cash, |
| | | a.his_consume, |
| | | a.free_consume, |
| | | f.su_name meiliao, |
| | |
| | | h.shop_short_name shop_name, |
| | | a.order_type, |
| | | a.achieveType, |
| | | case when a.pay_method = '现金' then goods_cash end goods_cash, |
| | | case when a.pay_method = '划扣' then goods_cash end card_cash, |
| | | j.pay_method |
| | | from |
| | | achieve_new a |
| | |
| | | |
| | | </select> |
| | | |
| | | |
| | | <select id="selectInvalidaVipScore" resultType="com.matrix.system.score.entity.ScoreVipDetail"> |
| | | select * from score_vip_detail where state=1 and remain_score>0 and validite_time <![CDATA[ < now()]]> |
| | | </select> |
| | | |
| | | <update id="invalidVipScore"> |
| | | update score_vip_detail set state = 2 , remain_score=0 where state=1 and validite_time <![CDATA[ < now()]]> |
| | | </update> |
| | | |
| | | </mapper> |
| | |
| | | <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> |
| | |
| | | a.${record.sort} ${record.order} |
| | | </if> |
| | | </select> |
| | | |
| | | <select id="selectOneByCompanyIdAndActTypeAndActStatus" resultType="com.matrix.system.shopXcx.bean.ShopActivities"> |
| | | SELECT |
| | | * |
| | | FROM |
| | | shop_activities a |
| | | where |
| | | a.company_id=#{companyId} |
| | | and a.act_type=#{activitiesTypeSign} |
| | | and a.act_status=#{actstatusStatusIng} |
| | | </select> |
| | | </mapper> |
| | |
| | | } |
| | | |
| | | |
| | | function openAddService() { |
| | | function openAddService(id) { |
| | | layer.full(layer.open({ |
| | | type: 2, |
| | | title: "添加服务单", |
| | | maxmin: true, |
| | | area: [MUI.SIZE_L, '500px'], |
| | | content: [basePath + '/admin/redirect/hive/beautySalon/servicceAddForm'] |
| | | content: [basePath + '/admin/redirect/hive/beautySalon/servicceAddForm?id='+id] |
| | | })); |
| | | } |
| | | |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | 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({ |
| | |
| | | <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> |
| | |
| | | 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> |
| | |
| | | </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;"> |
| | |
| | | </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> |
| | |
| | | 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', |
| | | //背景颜色 |
| | |
| | | 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; |
| | |
| | | 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; |
| | | }, |
| | | |
| | | //保存 |
| | |
| | | this.loadInfo(); |
| | | window.addEventListener("keydown", this.keydown); |
| | | //初始化编辑器 |
| | | ue = UE.getEditor('description'); |
| | | ue = UE.getEditor('description', { |
| | | toolbars: [ |
| | | [ |
| | | 'anchor', |
| | | 'bold', //加粗 |
| | | 'indent', //首行缩进 |
| | | 'italic', //斜体 |
| | | 'underline', //下划线 |
| | | 'strikethrough', //删除线 |
| | | 'subscript', //下标 |
| | | 'fontborder', //字符边框 |
| | | 'superscript', //上标 |
| | | 'formatmatch', //格式刷 |
| | | 'pasteplain', //纯文本粘贴模式 |
| | | 'selectall', //全选 |
| | | 'horizontal', //分隔线 |
| | | 'removeformat', //清除格式 |
| | | 'unlink', //取消链接 |
| | | 'inserttitle', //插入标题 |
| | | 'cleardoc', //清空文档 |
| | | 'fontfamily', //字体 |
| | | 'fontsize', //字号 |
| | | 'paragraph', //段落格式 |
| | | 'simpleupload', //单图上传 |
| | | 'insertimage', //多图上传 |
| | | 'link', //超链接 |
| | | 'emotion', //表情 |
| | | 'justifyleft', //居左对齐 |
| | | 'justifyright', //居右对齐 |
| | | 'justifycenter', //居中对齐 |
| | | 'justifyjustify', //两端对齐 |
| | | 'forecolor', //字体颜色 |
| | | 'backcolor', //背景色 |
| | | 'insertorderedlist', //有序列表 |
| | | 'insertunorderedlist', //无序列表 |
| | | 'fullscreen', //全屏 |
| | | 'rowspacingtop', //段前距 |
| | | 'rowspacingbottom', //段后距 |
| | | 'imagecenter', //居中 |
| | | 'lineheight', //行间距 |
| | | 'customstyle', //自定义标题 |
| | | 'autotypeset', //自动排版 |
| | | 'background', //背景 |
| | | ] |
| | | ]}); |
| | | }, |
| | | mounted: function () { |
| | | }, |
| | |
| | | <el-col :span="3"> |
| | | <el-input v-model="paramSettingShop.paramValue" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> |
| | | </el-col> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> |
| | | <div v-show="paramSettingShop.paramName !== '现金消费'"> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">积分/次</el-col> |
| | | </div> |
| | | <div v-show="paramSettingShop.paramName === '现金消费'"> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> |
| | | </div> |
| | | <el-col :span="3"> |
| | | <el-input v-model="paramSettingShop.paramValue1" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> |
| | | </el-col> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> |
| | | <div v-show="paramSettingShop.paramName !== '现金消费'"> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">积分/次</el-col> |
| | | </div> |
| | | <div v-show="paramSettingShop.paramName === '现金消费'"> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> |
| | | </div> |
| | | <el-col :span="3"> |
| | | <el-input v-model="paramSettingShop.paramValue2" oninput ="value=value.replace(/[^0-9.]/g,'')"></el-input> |
| | | </el-col> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> |
| | | <div v-show="paramSettingShop.paramName !== '现金消费'"> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">积分/次</el-col> |
| | | </div> |
| | | <div v-show="paramSettingShop.paramName === '现金消费'"> |
| | | <el-col class="line" :span="4" style="margin-left: 10px">元/积分</el-col> |
| | | </div> |
| | | </el-form-item> |
| | | </template> |
| | | </el-col> |
| | |
| | | <el-table-column prop="proName" label="产品" width="200"></el-table-column> |
| | | <el-table-column prop="cateName" label="产品分类"></el-table-column> |
| | | <el-table-column prop="zkTotal" label="订单金额"></el-table-column> |
| | | <el-table-column prop="goodsCash" label="现金"></el-table-column> |
| | | <el-table-column prop="cardCash" label="划扣"></el-table-column> |
| | | <!-- <el-table-column prop="goodsCash" label="订单业绩"></el-table-column>--> |
| | | <el-table-column prop="meiliao" label="员工"></el-table-column> |
| | | <el-table-column v-for="(item, index) in customColumns" width="120" :key="index" :label="item.value"> |
| | |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <el-row style="text-align: center; margin-top: 10px;"> |
| | | <el-pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handleCurrentChange" |
| | | :current-page="page.currentPage" |
| | | :page-sizes="[10, 20, 30, 50]" |
| | | :page-size="page.pageSize" |
| | | layout="total, prev, pager, next, jumper" |
| | | :total="page.total"> |
| | | </el-pagination> |
| | | </el-row> |
| | | <el-row class="btn-box"> |
| | | <el-button size="mini" type="danger" @click="closeXm()">关闭</el-button> |
| | | <el-button size="mini" type="primary" @click="chouseGoods()">确认</el-button> |
| | |
| | | searchTableData: [], |
| | | //表格加载效果 |
| | | loading: false, |
| | | page : { |
| | | currentPage : 1, |
| | | pageSize : 10, |
| | | total : 0 |
| | | }, |
| | | /******搜索表格数据END********/ |
| | | |
| | | dialogSettleVisible : false, |
| | |
| | | let count = parseFloat(item.count); |
| | | let zkPrice = parseFloat(item.zkPrice); |
| | | |
| | | if (optionType != 1) { |
| | | // if (optionType != 1) { |
| | | //直接修改支付金额不重置支付金额 |
| | | item.payMoney = zkPrice * count; |
| | | } |
| | | // } |
| | | _this.order.payMoney += parseFloat(item.payMoney); |
| | | |
| | | //重新计算业绩金额 |
| | |
| | | */ |
| | | searchGoods() { |
| | | let _this = this; |
| | | var currentPage = this.page.currentPage; |
| | | var pageSize = this.page.pageSize; |
| | | var offset = (currentPage - 1) * pageSize; |
| | | if (this.queryKey && this.queryKey.trim().length > 0) { |
| | | this.showSearchTable = true; |
| | | this.loading = true; |
| | |
| | | app: _this, |
| | | contentType: 'application/x-www-form-urlencoded', |
| | | //TODO 优化下拉加载 |
| | | data: {name: _this.queryKey, limit: 10000}, |
| | | data: {name: _this.queryKey, limit: pageSize, offset : offset}, |
| | | url: basePath + "/admin/shoppinggoods/showList", |
| | | callback: function (data) { |
| | | _this.searchTableData = data.rows; |
| | | _this.page.total = data.total; |
| | | _this.loading = false; |
| | | } |
| | | }); |
| | |
| | | this.showSearchTable = false; |
| | | } |
| | | }, |
| | | |
| | | |
| | | handleSizeChange(val) { |
| | | this.page.pageSize = val; |
| | | this.searchGoods(); |
| | | }, |
| | | handleCurrentChange(val) { |
| | | this.page.currentPage = val; |
| | | this.searchGoods(); |
| | | }, |
| | | remoteMethod(query) { |
| | | if (query !== '') { |
| | | this.vipLoading = true; |
| | |
| | | return; |
| | | } |
| | | vipId = this.vipInfo.id; |
| | | openAddService(); |
| | | openAddService(vipId); |
| | | }, |
| | | // 开订单 |
| | | addOrder() { |
| | |
| | | <el-table-column prop="proName" label="产品" width="200"></el-table-column> |
| | | <el-table-column prop="cateName" label="产品分类"></el-table-column> |
| | | <el-table-column prop="zkTotal" label="订单金额"></el-table-column> |
| | | <el-table-column prop="goodsCash" label="现金"></el-table-column> |
| | | <el-table-column prop="cardCash" label="划扣"></el-table-column> |
| | | <!-- <el-table-column prop="goodsCash" label="订单业绩"></el-table-column>--> |
| | | <el-table-column prop="meiliao" label="员工"></el-table-column> |
| | | <el-table-column v-for="(item, index) in customColumns" width="120" :key="index" :label="item.value"> |
New file |
| | |
| | | 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; |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.matrix; |
| | | |
| | | import cn.hutool.core.collection.CollectionUtil; |
| | | import com.matrix.system.common.bean.BusParameterSettings; |
| | | import com.matrix.system.common.bean.SysCompany; |
| | | import com.matrix.system.common.dao.BusParameterSettingsDao; |
| | | import com.matrix.system.common.dao.SysCompanyDao; |
| | | import com.matrix.system.hive.bean.ParameterSettings; |
| | | import com.matrix.system.hive.dao.ParameterSettingsDao; |
| | | 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; |
| | | |
| | | /** |
| | | * 配置工具 |
| | | * |
| | | * @author jiangyouyao |
| | | * @email 512061637@qq.com |
| | | * @date 2019年2月25日 |
| | | */ |
| | | @RunWith(SpringRunner.class) |
| | | @SpringBootTest(classes = {ZqErpApplication.class},webEnvironment =SpringBootTest.WebEnvironment.RANDOM_PORT) |
| | | public class ParameterSettingsTool { |
| | | |
| | | |
| | | @Autowired |
| | | private ParameterSettingsDao parameterSettingsDao; |
| | | |
| | | @Autowired |
| | | private BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | private SysCompanyDao sysCompanyDao; |
| | | |
| | | /* |
| | | 给所有公司加上多个配置,如果已经存在则跳过 |
| | | */ |
| | | @Test |
| | | public void addSettings(){ |
| | | |
| | | List<ParameterSettings> newSettings=new ArrayList<>(); |
| | | |
| | | |
| | | ParameterSettings newSetting1=new ParameterSettings(); |
| | | newSetting1.setCode("APP_BANNER_GL"); |
| | | newSetting1.setName("APP管理模块Banner"); |
| | | newSetting1.setType(1); |
| | | newSetting1.setCategory("APP设置"); |
| | | newSettings.add(newSetting1); |
| | | |
| | | for (ParameterSettings newSetting : newSettings) { |
| | | List<ParameterSettings> parameterSettings = parameterSettingsDao.selectByModel(newSetting); |
| | | if(CollectionUtil.isEmpty(parameterSettings)){ |
| | | parameterSettingsDao.insert(newSetting); |
| | | System.out.println("新增配置"+newSetting.getName()); |
| | | }else { |
| | | System.out.println("配置"+newSetting.getName()+"已经存在"); |
| | | } |
| | | addSettingsTOAllCompany(newSetting); |
| | | } |
| | | } |
| | | |
| | | private void addSettingsTOAllCompany(ParameterSettings newSetting) { |
| | | |
| | | List<SysCompany> allCompany = sysCompanyDao.selectByModel(null); |
| | | |
| | | for (SysCompany sysCompany : allCompany) { |
| | | BusParameterSettings checkExist = busParameterSettingsDao.selectCompanyParamByCode(newSetting.getCode(), sysCompany.getComId()); |
| | | if(checkExist==null){ |
| | | BusParameterSettings busParameterSettings=new BusParameterSettings(); |
| | | busParameterSettings.setCompanyId(sysCompany.getComId()); |
| | | busParameterSettings.setParamCode(newSetting.getCode()); |
| | | busParameterSettings.setParamValue(""); |
| | | busParameterSettingsDao.insert(busParameterSettings); |
| | | System.out.println(sysCompany.getComName()+"新增成功"); |
| | | }else{ |
| | | System.out.println("公司"+sysCompany.getComName()+"已经存在配置"+newSetting.getName()); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | } |