| | |
| | | import com.matrix.system.fenxiao.entity.ShopSalesmanGrade; |
| | | import com.matrix.system.fenxiao.vo.*; |
| | | import com.matrix.system.hive.action.util.QueryUtil; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderDaoV2; |
| | | import com.matrix.system.shopXcx.dao.ShopOrderV2Dao; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | |
| | | BizUserService bizUserService; |
| | | |
| | | @Autowired |
| | | ShopOrderDaoV2 shopOrderDaoV2; |
| | | ShopOrderV2Dao shopOrderV2Dao; |
| | | |
| | | /** |
| | | * 申请成为推广员 |
| | |
| | | public ShopSalesmanApply applyToBeAnSalesman(String openId,String gradeId,String invitationId,int applyWay) { |
| | | |
| | | BizUser loginUser=bizUserDao.findByOpenId(openId); |
| | | //验证申请条件 |
| | | VerificationResult verificationResult = isAbleToBeAnSalesman(openId); |
| | | if(verificationResult.isJudgeResult()){ |
| | | //校验审核状态,和是否重复发起 |
| | | QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>(); |
| | | queryWrapper.eq("user_id",loginUser.getOpenId()); |
| | |
| | | }else{ |
| | | throw new GlobleException("不能重复申请"); |
| | | } |
| | | |
| | | }else{ |
| | | throw new GlobleException(verificationResult.getMsg()); |
| | | } |
| | | } |
| | | |
| | | |
| | |
| | | VerificationResult.buildVerificationResult(true); |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP: |
| | | VerificationResult.buildVerificationResult(true); |
| | | int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(openId,applyCondition.getParamValue1()); |
| | | if(buyZdcpCount>0){ |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费指定产品后再申请!"); |
| | | } |
| | | |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP: |
| | | |
| | | //判断用户是否有确认收货的产品 |
| | | int receivedOrderCount= shopOrderDaoV2.selectReceivedOrderCount(openId); |
| | | |
| | | int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(openId); |
| | | if(receivedOrderCount>0){ |
| | | verificationResult= VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费任意产品后再申请!"); |
| | | } |
| | | |
| | | case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: |
| | | Double zdje=Double.parseDouble(applyCondition.getParamValue2()); |
| | | Double yxfje=shopOrderV2Dao.countOrderAmount(openId); |
| | | if(zdje>yxfje){ |
| | | verificationResult=VerificationResult.buildVerificationResult(true); |
| | | }else{ |
| | | verificationResult= VerificationResult.buildVerificationResult(false,"不符合申请条件,请消费满"+zdje+"元后再申请!"); |
| | | } |
| | | VerificationResult.buildVerificationResult(true); |
| | | default: |
| | | VerificationResult.buildVerificationResult(true); |