Merge branch 'score_shop' of http://120.27.238.55:7000/r/beauty-erp into score_shop
	
		
		4 files added
	
		
		24 files modified
	
	
 
	
	
	
	
	
	
	
	
| New file | 
|  |  |  | 
|---|
|  |  |  | package com.matrix.config; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import org.springframework.context.annotation.Configuration; | 
|---|
|  |  |  | import org.springframework.scheduling.annotation.EnableScheduling; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Configuration | 
|---|
|  |  |  | @EnableScheduling | 
|---|
|  |  |  | public class TaskScheduleConfig { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import com.alibaba.fastjson.JSONObject; | 
|---|
|  |  |  | import com.matrix.component.redis.RedisClient; | 
|---|
|  |  |  | import com.matrix.core.constance.MatrixConstance; | 
|---|
|  |  |  | import com.matrix.core.pojo.AjaxResult; | 
|---|
|  |  |  | import com.matrix.core.tools.*; | 
|---|
|  |  |  | import com.matrix.system.app.authority.AppAuthorityManager; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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.constance.AppConstance; | 
|---|
|  |  |  | 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()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @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; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | 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.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"; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | 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("业绩统计定时任务开始运行*******************"); | 
|---|
|  |  |  | 
|---|
|  |  |  | * @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; | 
|---|
|  |  |  | 
|---|
|  |  |  | scoreVipDetailDao.updateById(scoreVipDetail); | 
|---|
|  |  |  | score=Math.abs(surplus); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | //新增扣除记录 | 
|---|
|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 根据固定等级规则新增用户积分 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @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){ | 
|---|
|  |  |  | 
|---|
|  |  |  | 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, "保存成功"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | 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); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | BeanUtil.copyProperties(xcxUserSaveUserInfoDto,sysVipInfo); | 
|---|
|  |  |  | sysVipInfo.setPhone(xcxUserSaveUserInfoDto.getPhoneNumber()); | 
|---|
|  |  |  | if(StringUtils.isBlank(loginUser.getVipName())){ | 
|---|
|  |  |  | if(StringUtils.isBlank(loginUser.getVipName())||loginUser.getVipName().equals("微信用户")){ | 
|---|
|  |  |  | sysVipInfo.setVipName(xcxUserSaveUserInfoDto.getNickName()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if(StringUtils.isBlank(loginUser.getSex())){ | 
|---|
|  |  |  | 
|---|
|  |  |  | 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, "下单失败!"); | 
|---|
|  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 主键 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | private Integer  comId; | 
|---|
|  |  |  | private Long  comId; | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | 
|---|
|  |  |  | auditStatus = auditStatus; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public Integer getComId() { | 
|---|
|  |  |  | public Long getComId() { | 
|---|
|  |  |  | return comId; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public void setComId(Integer comId) { | 
|---|
|  |  |  | public void setComId(Long comId) { | 
|---|
|  |  |  | this.comId=comId; | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | public String getUserId() { | 
|---|
|  |  |  | return userId; | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 { | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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 | 
|---|
|  |  |  | 
|---|
|  |  |  | 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}") | 
|---|
|  |  |  | 
|---|
|  |  |  | 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   { | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  | <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> | 
|---|
|  |  |  | 
|---|
|  |  |  | <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, | 
|---|
|  |  |  | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | 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; | 
|---|
|  |  |  | 
|---|
|  |  |  | <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 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()); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | } | 
|---|