| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import com.matrix.component.redis.RedisClient; |
| | | import com.matrix.component.redis.RedisUserLoginUtils; |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.pojo.AjaxResult; |
| | | import com.matrix.core.tools.LogUtil; |
| | |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.system.common.bean.SysUsers; |
| | | import com.matrix.system.common.dao.SysUsersDao; |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.dao.SysVipInfoDao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | @Override |
| | | public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception { |
| | | /*if ("dev".equals(evn)) { |
| | | SysUsers sysUsers = sysUsersDao.selectById(1012L); |
| | | if ("dev".equals(evn)) { |
| | | SysUsers sysUsers = sysUsersDao.selectById(2L); |
| | | request.getSession().setAttribute(MatrixConstance.LOGIN_KEY, sysUsers); |
| | | return true; |
| | | }*/ |
| | | } |
| | | |
| | | String token = resolveToken(request,privateKey); |
| | | AjaxResult ajaxResult = new AjaxResult(); |
| | |
| | | import com.matrix.core.constance.MatrixConstance; |
| | | import com.matrix.core.exception.GlobleException; |
| | | import com.matrix.core.pojo.PaginationVO; |
| | | import com.matrix.core.tools.*; |
| | | import com.matrix.core.tools.DateUtil; |
| | | import com.matrix.core.tools.EncrypUtil; |
| | | import com.matrix.core.tools.StringUtils; |
| | | import com.matrix.core.tools.WebUtil; |
| | | import com.matrix.core.tools.excl.ExcelSheetPO; |
| | | import com.matrix.core.tools.excl.ExcelUtil; |
| | | import com.matrix.system.app.dto.AddVipDto; |
| | |
| | | import com.matrix.system.app.dto.VipInfoListDto; |
| | | import com.matrix.system.app.vo.VipInfoDetailVo; |
| | | import com.matrix.system.app.vo.VipInfoListVo; |
| | | 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.tools.DataAuthUtil; |
| | | import com.matrix.system.common.tools.ServiceUtil; |
| | | import com.matrix.system.constance.Dictionary; |
| | |
| | | import com.matrix.system.hive.plugin.util.CollectionUtils; |
| | | import com.matrix.system.hive.pojo.VipInfoVo; |
| | | 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; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | |
| | | @Value("${default.vip.photo.man}") |
| | | String defaultMan; |
| | | @Autowired |
| | | BusParameterSettingsDao busParameterSettingsDao; |
| | | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional |
| | | public int apiAddVip(AddVipDto addVipDto) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | |
| | |
| | | if (CollectionUtils.isNotEmpty(addVipDto.getLabels())) { |
| | | batchInsertLabel(addVipDto.getLabels(), vipInfo.getId()); |
| | | } |
| | | //添加推荐人积分 |
| | | addReferrerVipScore(vipInfo); |
| | | |
| | | //创建用户默认储值卡 |
| | | addVipDefaultCard(vipInfo.getId()); |
| | | return i; |
| | | } |
| | | |
| | | /** |
| | | * 添加推荐人积分 |
| | | * @param vipInfo |
| | | */ |
| | | public void addReferrerVipScore(SysVipInfo vipInfo) { |
| | | if(vipInfo.getRecommendId()!=null){ |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | | BusParameterSettings referrerScoreSetting = busParameterSettingsDao.selectCompanyParamByCode(ScoreSettingConstant.REFERRALS_CONSUMPTION, user.getCompanyId()); |
| | | //推荐注册老带新积分奖励 |
| | | SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId()); |
| | | |
| | | if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue())){ |
| | | |
| | | scoreVipDetailService.addScore(referrerVip.getOpenId(), |
| | | referrerVip.getId(), |
| | | user.getSuId(), |
| | | vipInfo.getShopId(), |
| | | Integer.parseInt(referrerScoreSetting.getParamValue()), |
| | | vipInfo.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_REFERRER, |
| | | "推荐会员" |
| | | ); |
| | | } |
| | | |
| | | //推荐注册二级带新积分奖励 |
| | | |
| | | if(referrerVip.getRecommendId()!=null){ |
| | | |
| | | SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId()); |
| | | |
| | | |
| | | if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue1())){ |
| | | scoreVipDetailService.addScore(topVipInfo.getOpenId(), |
| | | topVipInfo.getId(), |
| | | user.getSuId(), |
| | | vipInfo.getShopId(), |
| | | Integer.parseInt(referrerScoreSetting.getParamValue1()), |
| | | vipInfo.getId(), |
| | | ScoreVipDetail.SCORE_VIP_TYPE_REFERRER, |
| | | "推荐人"+topVipInfo.getVipName()+"推荐会员" |
| | | ); |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public int apiModifyVip(ModifyVipDto modifyVipDto) { |
| | | SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); |
| | |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_CASH=1; |
| | | |
| | | |
| | | /** |
| | | * 获取类型(2:赠送等) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_CONSUME=2; |
| | | /** |
| | | * 获取类型(3推荐客户) |
| | | */ |
| | | public static final int SCORE_VIP_TYPE_REFERRER=3; |
| | | |
| | | /** 有效*/ |
| | | public static final int SCORE_STATUS_YX=1; |
| | | /** 无效*/ |
| | |
| | | Calendar cal=Calendar.getInstance(); |
| | | int year = cal.get(Calendar.YEAR); |
| | | int sxYear=year+(Integer.parseInt(yxqSetting.getParamValue())-1); |
| | | Date sxys=DateUtil.stringToDate(year+"-12-31 23:59",DateUtil.DATE_FORMAT_MM ); |
| | | Date sxys=DateUtil.stringToDate(sxYear+"-12-31 23:59",DateUtil.DATE_FORMAT_MM ); |
| | | |
| | | ScoreVipDetail scoreVipDetail=new ScoreVipDetail(); |
| | | |
| | |
| | | evn=jyy |
| | | evn=dev |
| | | server.port=8080 |
| | | |
| | | |
| | |
| | | <result property="guwen" column="guwen" /> |
| | | <result property="meiliao" column="meiliao" /> |
| | | <result property="zkTotal" column="zk_total" /> |
| | | |
| | | <result property="payMethod" column="pay_method" /> |
| | | <result property="arriveCnt" column="arrive_cnt" /> |
| | | |
| | | <result property="goodsNo" column="goodsNo" /> |
| | | <result property="goodsName" column="goodsName" /> |
| | | <result property="payMethod" column="pay_method" /> |
| | | |
| | | <result property="cateName" column="cateName" /> |
| | | |
| | | </resultMap> |
| | |
| | | <result property="remark" column="remark" /> |
| | | <result property="orderType" column="order_type" /> |
| | | <result property="projPercentage" column="proj_percentage" /> |
| | | |
| | | <result property="payMethod" column="pay_method" /> |
| | | <result property="t1" column="t1" /> |
| | | <result property="t2" column="t2" /> |
| | | <result property="achieveType" column="achieveType" /> |
| | |
| | | t6, |
| | | t8, |
| | | t9, |
| | | company_id |
| | | company_id, |
| | | pay_method |
| | | </sql> |
| | | |
| | | <!-- 属性sql --> |
| | |
| | | #{item.t6}, |
| | | #{item.t8}, |
| | | #{item.t9}, |
| | | #{item.companyId} |
| | | #{item.companyId}, |
| | | #{item.payMethod} |
| | | </sql> |
| | | |
| | | <!-- where sql --> |
| | |
| | | <if test="_parameter.containsKey('t9')"> |
| | | t9 = #{t9}, |
| | | </if> |
| | | <if test="_parameter.containsKey('payMethod')"> |
| | | pay_method = #{payMethod}, |
| | | </if> |
| | | </set> |
| | | WHERE id=#{id} |
| | | </update> |
| | |
| | | </if> |
| | | <if test="record.t9 != null and record.t9 != '' "> |
| | | t9 = #{record.t9}, |
| | | </if> |
| | | <if test="record.payMethod != null and record.payMethod != '' "> |
| | | pay_method = #{record.payMethod}, |
| | | </if> |
| | | </set> |
| | | WHERE id=#{record.id} |
| | |
| | | b.code goodsNo, |
| | | b.name goodsName, |
| | | c.su_name meiliao, |
| | | d.count*d.zk_price zk_total, |
| | | d.pay_method |
| | | d.count*d.zk_price zk_total |
| | | from achieve_new a |
| | | left join shopping_goods b on a.shopping_goods_id=b.id |
| | | left join sys_users c on a.beault_id=c.su_id |
| | |
| | | c.su_name as STAFF_NAME, |
| | | d.SHOP_NAME, |
| | | a.blood, |
| | | a.company_id, |
| | | a.sfCard, |
| | | a.link, |
| | | a.marry, |
| | |
| | | <el-input @change="calculationTotal" v-model="scope.row.zkPrice"></el-input> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="支付方式" |
| | | width="130"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.payMethod" |
| | | placeholder="请选择支付方式"> |
| | | <el-option |
| | | v-for="item in itemSimplePayMethods" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :disabled="item.disabled"> |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="小计"> |
| | | <template slot-scope="scope"> |
| | |
| | | label="收款"> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="支付方式" |
| | | width="130"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.payMethod" |
| | | placeholder="请选择支付方式"> |
| | | <el-option |
| | | v-for="item in itemSimplePayMethods" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :disabled="item.disabled"> |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | label="业绩类型" width="150"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.achieveType" @change="calculationAchieve" placeholder="请选择业绩类型"> |
| | |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | label="业绩" > |
| | | <template slot-scope="scope"> |
| | |
| | | commission : 0, |
| | | achieveType : _this.achieveTypeList[0].value, |
| | | isShare: false, |
| | | payMethod:item.payMethod, |
| | | }); |
| | | }); |
| | | _this.order.payMoney = orderPayMoney; |
| | |
| | | item.price = goods.sealPice; |
| | | item.goodsId = goods.id; |
| | | item.isFree = '否'; |
| | | item.payMethod = '现金'; |
| | | if (type == BUY_TYPE_NOT_FREE) { |
| | | //购买 |
| | | item.zkPrice = goods.sealPice; |
| | |
| | | achieveType : _this.achieveTypeList[0].value, |
| | | commission: 0, |
| | | isShare: false, |
| | | payMethod:'现金', |
| | | }); |
| | | } else { |
| | | //加入业绩 |
| | |
| | | achieveType : _this.achieveTypeList[0].value, |
| | | commission: 0, |
| | | isShare: false, |
| | | payMethod:'现金', |
| | | }); |
| | | } |
| | | this.order.items.push(item); |
| | |
| | | projPercentage: achieve.commission, |
| | | achieveType: achieve.achieveType, |
| | | goodsCash: achieve.goodsCash, |
| | | payMethod: achieve.payMethod, |
| | | }; |
| | | item.achieveList.push(achieveNew); |
| | | break; |
| | |
| | | prop="zkTotal" |
| | | label="收款"> |
| | | </el-table-column> |
| | | |
| | | <el-table-column |
| | | prop="payMethod" |
| | | label="支付方式"> |
| | | label="支付方式" |
| | | width="130"> |
| | | <template slot-scope="scope"> |
| | | <el-select v-model="scope.row.payMethod" |
| | | placeholder="请选择支付方式"> |
| | | <el-option |
| | | v-for="item in itemSimplePayMethods" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | :disabled="item.disabled"> |
| | | </el-option> |
| | | </el-select> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column |
| | | prop="t3" |
| | |
| | | isRefund : false, |
| | | isReturnAchieve : false, |
| | | totalRefund : "", |
| | | itemSimplePayMethods:[{ |
| | | value: '现金', |
| | | label:'现金', |
| | | },{ |
| | | value: '划扣', |
| | | label:'划扣', |
| | | }], |
| | | payMethods: [{ |
| | | value: '现金支付', |
| | | img: '/images/pay/cash.png', |
| | |
| | | package com.matrix; |
| | | |
| | | import com.matrix.system.hive.bean.SysVipInfo; |
| | | import com.matrix.system.hive.service.imp.SysVipInfoServiceImpl; |
| | | import com.matrix.system.score.dao.ScoreVipDetailDao; |
| | | import com.matrix.system.score.service.ScoreVipDetailService; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | |
| | | @Autowired |
| | | ScoreVipDetailService scoreVipDetailService; |
| | | |
| | | |
| | | @Autowired |
| | | SysVipInfoServiceImpl sysVipInfoService; |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | @Test |
| | | public void scoreVipDetailService() throws InterruptedException { |
| | | scoreVipDetailService.addScore("oJkRK4yelehsY4S7I6Ee1ydWtQMI",null,null,null,15,1L,1,"测试"); |