合并BizUser表与SysVipInfo表
大部分逻辑已经修正
可能存在问题的
1、拼团秒杀
2、分享图
3、分销结算
1 files added
57 files deleted
119 files modified
6538 ■■■■ changed files
zq-erp/src/main/java/com/matrix/biz/action/1.sql 129 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java 48 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/action/MultipleFileUploadAction.java 170 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/action/SynQueryDemo.java 177 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java 515 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java 45 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java 82 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java 168 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java 9 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java 13 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java 13 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java 31 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java 8 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java 132 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java 16 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java 3 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java 102 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java 701 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/pojo/MoneyCardUserVo.java 102 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java 9 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java 66 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsCategoryAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsImageAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsNavigationAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsSkuAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderItemAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreShoppingCarAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreUseRecordAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/action/ScoreVipDetailAction.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsCategoryDao.java 13 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsDao.java 17 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsImageDao.java 17 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsNavigationDao.java 17 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsSkuDao.java 17 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderDao.java 17 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderItemDao.java 17 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreRuleSettingDao.java 11 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreShoppingCarDao.java 17 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoods.java 103 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsCategory.java 54 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsImage.java 61 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsNavigation.java 47 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsSku.java 79 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrder.java 126 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrderItem.java 75 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreRuleSettingEntity.java 21 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreShoppingCar.java 54 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java 5 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsCategoryService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsImageService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsNavigationService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsSkuService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderItemService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java 12 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreShoppingCarService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreUseRecordService.java 20 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java 58 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java 89 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java 16 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java 39 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java 33 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java 14 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java 18 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java 84 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java 16 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java 16 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java 11 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java 21 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java 5 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java 93 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java 14 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java 2 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java 46 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java 40 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java 47 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java 22 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java 36 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java 31 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java 6 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java 60 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java 8 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java 11 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java 9 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java 107 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java 13 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java 35 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java 26 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java 81 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java 7 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java 4 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/config/db/increment/推广员.sql 14 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml 33 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml 27 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml 77 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/OnlinebookingDao.xml 24 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml 207 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsCategoryDao.xml 33 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsDao.xml 47 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsImageDao.xml 35 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsNavigationDao.xml 31 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsSkuDao.xml 41 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderDao.xml 53 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderItemDao.xml 39 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreRuleSettingDao.xml 5 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreShoppingCarDao.xml 33 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml 22 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml 559 ●●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml 2 ●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml 10 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml 8 ●●●● patch | view | raw | blame | history
zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html 2 ●●● patch | view | raw | blame | history
zq-erp/src/test/java/com/matrix/JyyTests.java 31 ●●●●● patch | view | raw | blame | history
zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java 32 ●●●● patch | view | raw | blame | history
zq-erp/src/test/java/com/matrix/SourceFlowTests.java 6 ●●●● patch | view | raw | blame | history
zq-erp/src/main/java/com/matrix/biz/action/1.sql
File was deleted
zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java
File was deleted
zq-erp/src/main/java/com/matrix/biz/action/MultipleFileUploadAction.java
File was deleted
zq-erp/src/main/java/com/matrix/biz/action/SynQueryDemo.java
File was deleted
zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java
File was deleted
zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java
File was deleted
zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java
File was deleted
zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java
File was deleted
zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java
@@ -43,10 +43,7 @@
        return new ScoreOrderTask();
    }
    @Bean
    VipCreateTask VipCreateTask() {
        return new VipCreateTask();
    }
    @Bean
    OrderTask OrderrCreateTask() {
@@ -89,10 +86,6 @@
        List<MqTask> taskList = new ArrayList<>();
        //注册RabbitMq任务
        taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.CREATE_VIP + evn, MQTaskRouting.CREATE_VIP + evn, VipCreateTask()));
        //订阅模式
        taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_TEMPLATE_MSG + evn,MQTaskRouting.SEND_TEMPLATE_MSG + evn, TemplateMsgTask()));
        taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.ORDER_OUT_SOTORE + evn,MQTaskRouting.ORDER_OUT_SOTORE + evn, OrderOutSotoreTask()));
        taskList.add(new MqTask(MQ_EXCHANGE_A + evn, MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn,MQTaskRouting.SEND_UNIFORM_TEMPLATE_MSG + evn, UniformMsgSentTask()));
zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java
@@ -1,14 +1,11 @@
package com.matrix.system.activity.entity;
import com.matrix.core.pojo.EntityDTO;
import com.matrix.system.score.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.matrix.core.anotations.Extend;
import com.matrix.system.score.entity.BaseEntity;
import lombok.Data;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
 * @description 领
@@ -26,11 +23,11 @@
    
    /**
     * openID
     * userId
     */
    private String  openId;
    private Long  userId;
    
    /**
     * 领取时间
zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java
@@ -1,14 +1,11 @@
package com.matrix.system.activity.entity;
import com.matrix.core.pojo.EntityDTO;
import com.matrix.system.score.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import com.matrix.core.anotations.Extend;
import com.matrix.system.score.entity.BaseEntity;
import lombok.Data;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
/**
 * @description 签到记录表
@@ -26,11 +23,11 @@
    
    /**
     * openID
     * userId
     */
    private String  openId;
    private Long  userId;
    
    /**
     * 签到时间
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java
@@ -2,7 +2,7 @@
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.StrUtil;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
@@ -40,7 +40,7 @@
    private ShoppingGoodsDao shoppingGoodsDao;
    
    @Autowired
    private BizUserDao bizUserDao;
    private SysVipInfoDao sysVipInfoDao;
    
    @Autowired
    private ShopProductDao shopProductDao;
zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java
@@ -1,11 +1,8 @@
package com.matrix.system.fenxiao.action;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
@@ -18,10 +15,11 @@
import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao;
import com.matrix.system.fenxiao.dto.*;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import com.matrix.system.fenxiao.entity.ShopSalesmanGrade;
import com.matrix.system.fenxiao.service.ShopSalesmanApplyService;
import com.matrix.system.fenxiao.vo.*;
import com.matrix.system.hive.action.util.QueryUtil;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
@@ -42,7 +40,7 @@
    @Autowired
    private ShopSalesmanApplyDao shopSalesmanApplyDao;
    @Autowired
    private BizUserDao bizUserDao;
    private SysVipInfoDao sysVipInfoDao;
    @Autowired
    private ShopSalesmanGradeDao shopSalesmanGradeDao;
    @Autowired
@@ -61,10 +59,7 @@
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(loadParamSettingBasicDto);
        AjaxResult result= AjaxResult.buildSuccessInstance("查询成功");
        //根据OPENID查询基础信息
        String userId = loadParamSettingBasicDto.getUserId();
        String applyId = loadParamSettingBasicDto.getApplyId();
        SalesmanBasicDetailVo salesmanBasicDetailVo = shopSalesmanApplyService.selectShopSalesmanDetailByOpenId(userId,Long.parseLong(applyId));
        SalesmanBasicDetailVo salesmanBasicDetailVo = shopSalesmanApplyService.selectShopSalesmanDetailByOpenId(loadParamSettingBasicDto.getUserId(),loadParamSettingBasicDto.getApplyId());
        result.putInMap("basicdetail", salesmanBasicDetailVo);
        return result;
    }
@@ -345,19 +340,12 @@
    @PostMapping(value = "/addSaleManApply")
    public @ResponseBody
    AjaxResult addSaleManApply(@RequestBody AddSaleManApplyDto addSaleManApplyDto) {
        String gradeId = addSaleManApplyDto.getGradeId();
        if(StrUtil.isBlankOrUndefined(gradeId)) {
            return AjaxResult.buildFailInstance("请选择分销等级");
        }
        ShopSalesmanGrade selectById = shopSalesmanGradeDao.selectById(Long.parseLong(gradeId));
        if(ObjectUtil.isEmpty(selectById)) {
        if(addSaleManApplyDto.getGradeId()==null) {
            return AjaxResult.buildFailInstance("请选择分销等级");
        }
        
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(addSaleManApplyDto);
        shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getOpenId(),gradeId);
        shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getUserId(), addSaleManApplyDto.getGradeId());
        return AjaxResult.buildSuccessInstance("设置成功");
    }
    
@@ -380,15 +368,14 @@
    AjaxResult examineSaleManApply(@RequestBody ExamineSaleManApplyDto examineSaleManApplyDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(examineSaleManApplyDto);
        String userId = examineSaleManApplyDto.getUserId();
        //待审核状态才允许提交
        ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectById(examineSaleManApplyDto.getApplyId());
        if(ObjectUtil.isEmpty(shopSalesmanApply)) {
            return  AjaxResult.buildFailInstance("当前记录有误");
        }
        
        BizUser bizUser = bizUserDao.findByOpenId(userId);
        if(ObjectUtil.isEmpty(bizUser)) {
        SysVipInfo sysVipInfo = sysVipInfoDao.selectById(examineSaleManApplyDto.getUserId());
        if(ObjectUtil.isEmpty(sysVipInfo)) {
            return  AjaxResult.buildFailInstance("当前记录有误");
        }
        
zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java
@@ -24,9 +24,9 @@
 */
public interface ShopSalesmanApplyDao extends BaseMapper<ShopSalesmanApply> {
    IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("openId") String openId, @Param("isSales")String isSales);
    IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("id") Long userId, @Param("isSales")String isSales);
    IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("openId") String openId);
    IPage<SalesmanVo> selectInvitationuserInPage(Page<SalesmanVo> page, @Param("userId") Long userId);
    IPage<ShopSalesmanApplyVo> findShopSalesmanApplyList(Page<ShopSalesmanApplyVo> page,
            @Param("record")ShopSalesmanApplyDto shopSalesmanApplyDto);
@@ -37,9 +37,9 @@
    IPage<ShopSalesmanAppliingVo> selectBizUserApplyList(Page<ShopSalesmanAppliingVo> page,
            @Param("record")ShopSalesmanAppliingDto shopSalesmanAppliingDto);
    SalesmanCenterInfo selectSalesmanCenterInfo(String openId);
    SalesmanCenterInfo selectSalesmanCenterInfo(Long id);
    SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(@Param("userId")String userId,
    SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(@Param("userId")Long userId,
            @Param("companyId")Long companyId,@Param("applyId")long applyId);
    IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page,
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java
@@ -9,13 +9,11 @@
public class AddSaleManApplyDto {
    @ApiModelProperty(value ="会员ID")
    private String userId;
    private Long userId;
    
    @ApiModelProperty(value = "申请用户openId")
    private String openId;
    
    @ApiModelProperty(value ="等级ID")
    private String gradeId;
    private Long gradeId;
    @ApiModelProperty(hidden = true)
    private Long companyId;
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java
@@ -8,12 +8,10 @@
@ApiModel(value = "ChangeSaleManGradeDto", description = "查询参数")
public class ChangeSaleManGradeDto {
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="会员id")
    private Long userId;
    @ApiModelProperty(value ="等级ID")
    private Long gradeId;
    @ApiModelProperty(hidden = true)
    private Long companyId;
}
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java
@@ -8,8 +8,8 @@
@ApiModel(value = "DelSaleManGradeApplyDto", description = "查询参数")
public class DelSaleManGradeApplyDto {
    
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="会员id")
    private Long userId;
    
    @ApiModelProperty(value ="申请记录ID")
     private Long applyId;
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java
@@ -12,7 +12,7 @@
    @NotNull
    @ApiModelProperty(value ="会员ID")
    private String userId;
    private Long userId;
    
    @ApiModelProperty(value = "申请记录ID")
    private Long applyId;
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java
@@ -13,8 +13,8 @@
    @ApiModelProperty(hidden = true)
    private Long companyId;
    
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="会员ID")
    private Long userId;
    
    @ApiModelProperty(value ="申请记录ID")
     private Long applyId;
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java
@@ -8,11 +8,11 @@
@ApiModel(value = "LoadParamSettingBasicDto", description = "查询参数")
public class LoadParamSettingBasicDto {
    
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="会员ID")
    private Long userId;
    @ApiModelProperty(value ="申请记录ID")
    private String applyId;
    private Long applyId;
    
    @ApiModelProperty(hidden = true)
    private Long companyId;
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java
@@ -13,11 +13,11 @@
    @ApiModelProperty(value ="会员姓名")
    private String userName;
    
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="会员ID")
    private Long userId;
    @ApiModelProperty(value ="申请记录ID")
    private String applyId;
    private Long applyId;
    
    @ApiModelProperty(hidden = true)
    private Long companyId;
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java
@@ -13,11 +13,11 @@
    @ApiModelProperty(value ="会员姓名")
    private String userName;
    
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="会员ID")
    private Long userId;
    @ApiModelProperty(value ="申请记录ID")
    private String applyId;
    private Long applyId;
    @ApiModelProperty(value = " 结算状态1,待结算,2,已结算,3已退款")
    private Integer orderType;
zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java
@@ -8,8 +8,8 @@
@ApiModel(value = "UnbundlingSaleManDto", description = "查询参数")
public class UnbundlingSaleManDto {
    
    @ApiModelProperty(value ="会员OPENID")
    private String userId;
    @ApiModelProperty(value ="会员ID")
    private Long userId;
    
    @ApiModelProperty(hidden = true)
    private Long companyId;
zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java
@@ -33,7 +33,7 @@
     * 用户id
     */
    @ApiModelProperty(hidden = true)
    private String  userId;
    private Long  userId;
    
    /**
     * 收益说明
zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java
@@ -54,11 +54,11 @@
    private Integer  applyWay;
    @ApiModelProperty(value = "申请用户id")
    private String  userId;
    private Long  userId;
    
    @ApiModelProperty(value = "邀请用户ID")
    private String  parentUserId;
    private Long  parentUserId;
    
    @ApiModelProperty(value = "申请状态1、待审核,2通过,3未通过")
zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java
@@ -55,14 +55,14 @@
     */
    private String  userId;
    private Long  userId;
    
    /**
     * 收益人id
     */
    private String  salesUserId;
    private Long  salesUserId;
    
    /**
     * 收益类型1,推广收益,2邀请收益
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java
@@ -6,14 +6,10 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.biz.service.BizUserService;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.VerificationResult;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.bean.BusParameterSettings;
import com.matrix.system.common.bean.SysUsers;
@@ -26,6 +22,9 @@
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.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.system.shopXcx.dao.ShopOrderV2Dao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -54,36 +53,36 @@
    ShopSalesmanGradeDao shopSalesmanGradeDao;
    @Autowired
    BizUserDao bizUserDao;
    SysVipInfoDao sysVipInfoDao;
    @Autowired
    BizUserService bizUserService;
    SysVipInfoService sysVipInfoService;
    @Autowired
    ShopOrderV2Dao shopOrderV2Dao;
    /**
     * 申请成为推广员
     * @param openId
     * @param userId
     * @param invitationId
     * @return
     */
    public ShopSalesmanApply applyToBeAnSalesman(String openId,String gradeId,String invitationId,int applyWay) {
    public ShopSalesmanApply applyToBeAnSalesman(Long userId,Long gradeId,Long invitationId,int applyWay) {
        BizUser loginUser=bizUserDao.findByOpenId(openId);
        SysVipInfo loginUser=sysVipInfoDao.selectById(userId);
        //验证申请条件
        VerificationResult verificationResult = isAbleToBeAnSalesman(openId,loginUser.getCompanyId());
        VerificationResult verificationResult = isAbleToBeAnSalesman(userId,loginUser.getCompanyId());
        if(verificationResult.isJudgeResult()){
            //校验审核状态,和是否重复发起
            QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>();
            queryWrapper.eq("user_id",loginUser.getOpenId());
            queryWrapper.eq("user_id",loginUser.getId());
            queryWrapper.in("apply_status",Arrays.asList("1,2".split(",")));
            ShopSalesmanApply checkApply = shopSalesmanApplyDao.selectOne(queryWrapper);
            if(checkApply==null||
                    checkApply.getApplyStatus()==ShopSalesmanApply.APPLY_STATUS_WTG){
                ShopSalesmanApply shopSalesmanApply=new ShopSalesmanApply();
                shopSalesmanApply.setUserId(openId);
                shopSalesmanApply.setUserId(userId);
                shopSalesmanApply.setCreateBy(MatrixConstance.SYSTEM_USER);
                shopSalesmanApply.setApplyWay(ShopSalesmanApply.APPLY_WAY_SELF);
@@ -94,14 +93,14 @@
                shopSalesmanApply.setCreateTime(date);
                shopSalesmanApply.setUpdateTime(date);
                if(StringUtils.isNotBlank(invitationId)){
                if(invitationId!=null){
                    shopSalesmanApply.setParentUserId(invitationId);
                }else if(StringUtils.isNotBlank(loginUser.getParentOpenId())){
                }else if(loginUser.getRecommendId()!=null){
                    //如果曾经是被邀请进来的则自动绑定为之前邀请人的下级
                    shopSalesmanApply.setParentUserId(loginUser.getParentOpenId());
                    shopSalesmanApply.setParentUserId(loginUser.getRecommendId());
                }
                if(StringUtils.isNotBlank(gradeId)){
                    shopSalesmanApply.setGradeId(Long.parseLong(gradeId));
                if(gradeId!=null){
                    shopSalesmanApply.setGradeId(gradeId);
                }else{
                    //获取初始等级ID(公司id,是否为初始等级)
                    QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>();
@@ -122,7 +121,7 @@
                    queryWrapperOrepool.eq("is_default", 1);
                    ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool);
                    shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG);
                    bizUserService.setToBeAnSalesman(loginUser.getOpenId(),invitationId,shopSalesmanGrade.getId());
                    sysVipInfoService.setToBeAnSalesman(loginUser.getId(),invitationId,shopSalesmanGrade.getId());
                }else{
                    shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_DSH);
@@ -141,13 +140,13 @@
    /**
     * 判断是否满足申请成为分销员的条件
     */
    public VerificationResult isAbleToBeAnSalesman(String openId,Long companyId) {
    public VerificationResult isAbleToBeAnSalesman(Long userId,Long companyId) {
        VerificationResult verificationResult=null;
        //申请模式
        BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, companyId);
        if (applyWay.getParamValue().equals(FenxiaoSettingConstant.FX_APPLY_WAY_AUTO)) {
        if (FenxiaoSettingConstant.FX_APPLY_WAY_AUTO.equals(applyWay.getParamValue())) {
            verificationResult= VerificationResult.buildVerificationResult(true);
        }else{
            //申请条件
@@ -157,7 +156,7 @@
                    verificationResult= VerificationResult.buildVerificationResult(true);
                    break;
                case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFZDCP:
                    int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(openId,applyCondition.getParamValue1());
                    int buyZdcpCount= shopOrderV2Dao.countBuyZdcp(userId,applyCondition.getParamValue1());
                    if(buyZdcpCount>0){
                        verificationResult= VerificationResult.buildVerificationResult(true);
                    }else{
@@ -166,7 +165,7 @@
                    break;
                case FenxiaoSettingConstant.FX_APPLY_CONDITION_XFRYCP:
                    //判断用户是否有确认收货的产品
                    int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(openId);
                    int receivedOrderCount= shopOrderV2Dao.selectReceivedOrderCount(userId);
                    if(receivedOrderCount>0){
                        verificationResult= VerificationResult.buildVerificationResult(true);
                    }else{
@@ -175,7 +174,7 @@
                    break;
                case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE:
                    Double zdje=Double.parseDouble(applyCondition.getParamValue2());
                    Double yxfje=shopOrderV2Dao.countOrderAmount(openId);
                    Double yxfje=shopOrderV2Dao.countOrderAmount(userId);
                    if(zdje<yxfje){
                        verificationResult=VerificationResult.buildVerificationResult(true);
                    }else{
@@ -208,30 +207,30 @@
    }
    
    @Transactional(rollbackFor = Exception.class)
    public void addSaleManApply(String userId,String gradeId) {
        BizUser user = bizUserDao.findByOpenId(userId);
        applyToBeAnSalesman(user.getOpenId(),gradeId, "",ShopSalesmanApply.APPLY_WAY_HAND_ADD);
    public void addSaleManApply(Long userId,Long gradeId) {
        SysVipInfo user = sysVipInfoDao.selectById(userId);
        applyToBeAnSalesman(user.getId(),gradeId, null,ShopSalesmanApply.APPLY_WAY_HAND_ADD);
    }
    @Transactional(rollbackFor = Exception.class)
    public void examineSaleManApply(ShopSalesmanApply shopSalesmanApply, Integer applyState) {
        String userId = shopSalesmanApply.getUserId();
        String parentUserId = shopSalesmanApply.getParentUserId();
        BizUser bizUser = bizUserDao.findByOpenId(userId);
        Long userId = shopSalesmanApply.getUserId();
        Long parentUserId = shopSalesmanApply.getParentUserId();
        SysVipInfo sysVipInfo = sysVipInfoDao.selectById(userId);
        //修改审核记录
        if(ShopSalesmanApply.APPLY_STATUS_TG == applyState) {
            shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_TG);
            bizUser.setIsSales(BizUser.IS_SALES);
            sysVipInfo.setIsSales(SysVipInfo.IS_SALES);
        }else {
            shopSalesmanApply.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_WTG);
            bizUser.setIsSales(BizUser.NOT_SALES);
            sysVipInfo.setIsSales(SysVipInfo.NOT_SALES);
        }
        shopSalesmanApplyDao.updateById(shopSalesmanApply);
        //修改USER的状态
        bizUser.setParentOpenId(parentUserId);
        bizUser.setBindingParentTime(new Date());
        bizUser.setSalesmanGrade(shopSalesmanApply.getGradeId());
        bizUserDao.updateByModel(bizUser);
        sysVipInfo.setRecommendId(parentUserId);
        sysVipInfo.setBindingParentTime(new Date());
        sysVipInfo.setSalesmanGrade(shopSalesmanApply.getGradeId());
        sysVipInfoDao.update(sysVipInfo);
    }
    public IPage<ShopSalesmanApplyVo> findShopSalesmanDetail(Page<ShopSalesmanApplyVo> page,
@@ -240,11 +239,11 @@
        return null;
    }
    public SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(String userId, long applyId) {
    public SalesmanBasicDetailVo selectShopSalesmanDetailByOpenId(Long userId, long applyId) {
        //获取个人信息
        BizUser bizUser = bizUserDao.findByOpenId(userId);
        Long companyId = bizUser.getCompanyId();
        return shopSalesmanApplyDao.selectShopSalesmanDetailByOpenId(userId,companyId,applyId);
        SysVipInfo sysVipInfo = sysVipInfoDao.selectById(userId);
        Long companyId = sysVipInfo.getCompanyId();
        return shopSalesmanApplyDao.selectShopSalesmanDetailByOpenId(sysVipInfo.getId(),companyId,applyId);
    }
    public IPage<ShopCustomDetailVo> findCustomDetail(Page<ShopCustomDetailVo> page,LoadParamSettingDto loadParamSettingDto) {
@@ -263,41 +262,36 @@
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult changeSaleManGrade(ChangeSaleManGradeDto changeSaleManGradeDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(changeSaleManGradeDto);
        String userId = changeSaleManGradeDto.getUserId();
        Long companyId = changeSaleManGradeDto.getCompanyId();
        SysVipInfo vipInfo = sysVipInfoDao.selectById(changeSaleManGradeDto.getUserId());
        //获取对应的公司的等级
        QueryWrapper<ShopSalesmanGrade> queryWrapperOrepool = new QueryWrapper<>();
        queryWrapperOrepool.eq("is_default", 1);
        queryWrapperOrepool.eq("company_id", companyId);
        queryWrapperOrepool.eq("company_id", vipInfo.getCompanyId());
        ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectOne(queryWrapperOrepool);
        //修改Biz_User的salesman_grade
        BizUser findByOpenId = bizUserDao.findByOpenId(userId);
        if(ObjectUtil.isEmpty(findByOpenId)) {
            return AjaxResult.buildFailInstance("当前用户已不存在");
        }
        //不是分销员不允许修改
        Integer isSales = findByOpenId.getIsSales();
        if(BizUser.IS_SALES != isSales) {
        Integer isSales = vipInfo.getIsSales();
        if(SysVipInfo.IS_SALES != isSales) {
            return AjaxResult.buildFailInstance("当前用户未通过审核,不允许修改");
        }
        
        //修改申请记录的等级
        QueryWrapper<ShopSalesmanApply> queryShopSalesmanApply = new QueryWrapper<>();
        queryShopSalesmanApply.eq("apply_status", 2);
        queryShopSalesmanApply.eq("user_id", userId);
        queryShopSalesmanApply.eq("company_id", companyId);
        queryShopSalesmanApply.eq("user_id", vipInfo.getId());
        queryShopSalesmanApply.eq("company_id", vipInfo.getCompanyId());
        ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyDao.selectOne(queryShopSalesmanApply);
        Long gradeId = changeSaleManGradeDto.getGradeId();
        if(ObjectUtil.isEmpty(gradeId)) {
            findByOpenId.setSalesmanGrade(shopSalesmanGrade.getId());
            vipInfo.setSalesmanGrade(shopSalesmanGrade.getId());
            shopSalesmanApply.setGradeId(shopSalesmanGrade.getId());
        }else {
            findByOpenId.setSalesmanGrade(gradeId);
            vipInfo.setSalesmanGrade(gradeId);
            shopSalesmanApply.setGradeId(gradeId);
        }
        bizUserDao.updateByModel(findByOpenId);
        sysVipInfoDao.update(vipInfo);
        shopSalesmanApplyDao.updateById(shopSalesmanApply);
        
        return AjaxResult.buildSuccessInstance("修改等级成功");
@@ -305,16 +299,9 @@
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult unbundlingSaleMan(UnbundlingSaleManDto unbundlingSaleManDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(unbundlingSaleManDto);
        String userId = unbundlingSaleManDto.getUserId();
        //将Biz_User的parent_open_id置空
        BizUser findByOpenId = bizUserDao.findByOpenId(userId);
        if(ObjectUtil.isEmpty(findByOpenId)) {
            return AjaxResult.buildFailInstance("当前用户已不存在");
        }
        findByOpenId.setParentOpenId("");
        bizUserDao.updateByModel(findByOpenId);
        Long userId = unbundlingSaleManDto.getUserId();
        sysVipInfoDao.unbundlingSaleMan(userId);
        return AjaxResult.buildSuccessInstance("解绑成功");
    }
@@ -322,18 +309,17 @@
    public AjaxResult delSaleManGradeApply(DelSaleManGradeApplyDto delSaleManGradeApplyDto) {
        //设置用户公司ID
        QueryUtil.setQueryLimitCom(delSaleManGradeApplyDto);
        String userId = delSaleManGradeApplyDto.getUserId();
        Long applyid = delSaleManGradeApplyDto.getApplyId();
        
        //将biz_user的is_sale设置成否
        BizUser findByOpenId = bizUserDao.findByOpenId(userId);
        if(ObjectUtil.isEmpty(findByOpenId)) {
        SysVipInfo vipInfo = sysVipInfoDao.selectById(delSaleManGradeApplyDto.getUserId());
        if(ObjectUtil.isEmpty(vipInfo)) {
            return AjaxResult.buildFailInstance("当前用户已不存在");
        }
        findByOpenId.setIsSales(BizUser.NOT_SALES);
        bizUserDao.updateByModel(findByOpenId);
        vipInfo.setIsSales(SysVipInfo.NOT_SALES);
        sysVipInfoDao.update(vipInfo);
        //将记录设置成系统取消
        ShopSalesmanApply selectById = shopSalesmanApplyDao.selectById(applyid);
        ShopSalesmanApply selectById = shopSalesmanApplyDao.selectById(delSaleManGradeApplyDto.getApplyId());
        selectById.setApplyStatus(ShopSalesmanApply.APPLY_STATUS_XTQX);
        shopSalesmanApplyDao.updateById(selectById);
        return AjaxResult.buildSuccessInstance("操作成功");
zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java
@@ -6,8 +6,8 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
@@ -58,7 +58,7 @@
    @Autowired
    ShopOrderDao shopOrderDao;
    @Autowired
    BizUserDao bizUserDao;
    SysVipInfoDao sysVipInfoDao;
    public AjaxResult loadFenxiaoOrderBasic(LoadFenxiaoOrderBasicDto loadFenxiaoOrderBasicDto) {
        //设置用户公司ID
@@ -163,15 +163,15 @@
                shopRevenueFlowDao.insert(salesRevenueFlow);
                //选择微信余额支付,更新用户的金额
                if(ShopSalemanSettlement.SETTLEMENTWAY_YEJS == updateSetOrderDoneDto.getSetType()) {
                    BizUser findByOpenId = bizUserDao.findByOpenId(shopSalesmanOrder.getSalesUserId());
                    if(ObjectUtil.isEmpty(findByOpenId)) {
                    SysVipInfo vipInfo = sysVipInfoDao.selectById(shopSalesmanOrder.getSalesUserId());
                    if(ObjectUtil.isEmpty(vipInfo)) {
                        return AjaxResult.buildFailInstance("收益人信息不存在");
                    }
                    Double withdrawalCash = findByOpenId.getWithdrawalCash();
                    Double withdrawalCash = vipInfo.getWithdrawalCash();
                    Double amount = shopSalesmanOrder.getAmount();
                    withdrawalCash = (withdrawalCash == null?0:withdrawalCash)+(amount== null?0:amount);
                    findByOpenId.setWithdrawalCash(withdrawalCash);
                    bizUserDao.updateByModel(findByOpenId);
                    vipInfo.setWithdrawalCash(withdrawalCash);
                    sysVipInfoDao.update(vipInfo);
                }
            }
        }
zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java
@@ -14,8 +14,6 @@
    @ApiModelProperty(value = "申请用户id")
    private String  userId;
    @ApiModelProperty(value = "申请用户openId")
    private String  openId;
    
    @ApiModelProperty(value = "分销员")
    private String nickname;
zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java
@@ -53,7 +53,7 @@
    })
    AjaxResult getFlowList(@RequestBody  ScoreFlowDto scoreFlowDto) {
        SysVipInfo vipInfo = sysVipInfoDao.selectById(scoreFlowDto.getVipId());
        scoreFlowDto.setUserId(vipInfo.getOpenId());
        scoreFlowDto.setVipId(vipInfo.getId());
        Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize());
        IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page,scoreFlowDto);
        AjaxResult result=AjaxResult.buildSuccessInstance(shopScoreRecord.getRecords(),shopScoreRecord.getTotal());
@@ -74,9 +74,9 @@
        SysUsers sysUsers = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        if(scoreChangeDto.getAmount()>0){
            scoreVipDetailService.addScore(null,vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),scoreChangeDto.getAmount(),0L, ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks());
            scoreVipDetailService.addScore(vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),scoreChangeDto.getAmount(),0L, ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks());
        }else if (scoreChangeDto.getAmount()<0){
            scoreVipDetailService.deductionScore(null,vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),Math.abs(scoreChangeDto.getAmount()),0L,ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks());
            scoreVipDetailService.deductionScore(vipInfo.getId(),sysUsers.getSuId(),sysUsers.getShopId(),Math.abs(scoreChangeDto.getAmount()),0L,ScoreVipDetail.SCORE_VIP_TYPE_USERCHANGE,scoreChangeDto.getRemarks());
        }
        AjaxResult result=AjaxResult.buildSuccessInstance("调整成功");
        return result;
@@ -93,7 +93,7 @@
            @ApiResponse(code = 200, message = "ok", response = AjaxResult.class)
    })
    AjaxResult getUserScore(@PathVariable Long vipId) {
        AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(null,vipId));
        AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(vipId));
        return result;
    }
zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java
@@ -127,7 +127,7 @@
        List<SysVipInfo> vips = vipInfoService.findByVipNoOrTel(keyWord);
        if (vips.size() > 0) {
            vips.get(0).setPointAll(scoreVipDetailDao.selectUserTotalScore(null,vips.get(0).getId()));
            vips.get(0).setPointAll(scoreVipDetailDao.selectUserTotalScore(vips.get(0).getId()));
            vips.get(0).setSysOrder(sysOrderService.findSysOrderTjByVipId(vips.get(0).getId()));
            vips.get(0).setLevelCard(cardUseService.findByVipId(vips.get(0).getId()));
            vips.get(0).setLabels(sysVipLabelDao.selectByVipId(vips.get(0).getId()));
@@ -339,6 +339,7 @@
        vipInfo.setVipState(Dictionary.VIP_STATE_HY);
        vipInfo.setStaffId(getMe().getSuId());
        vipInfo.setShopId(getMe().getShopId());
        vipInfo.setCompanyId(getMe().getCompanyId());
        vipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD);
        vipInfoService.add(vipInfo);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "会员信息注册成功");
zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java
@@ -3,24 +3,48 @@
import com.fasterxml.jackson.annotation.JsonFormat;
import com.matrix.core.anotations.Extend;
import com.matrix.core.tools.DateUtil;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.hive.plugin.util.MoneyUtil;
import com.matrix.system.hive.pojo.MoneyCardUserVo;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
import java.util.Date;
/**
 *
 * @date 2016-09-17 10:17
 */
public class MoneyCardUse extends MoneyCardUserVo implements Serializable{
public class MoneyCardUse  {
    private static final long serialVersionUID = 1L; 
    
    private Long  id;
            
    /**
     * 剩余次数
     */
    String lastCountName;
    /**
     * 数据来源
     */
    String sourceName;
    /*vo对象************/
    /**
     * 剩余次数
     */
    private Integer  lastCount;
    /**
     * 来源,购买,转让,赠送
     */
    private String  source;
    /**
     * 是会籍卡? Y 是,N否
     */
    private String  isVipCar;
    
    /**
     * 订单明细id
@@ -34,11 +58,6 @@
    private Integer  useTotal;
            
    
    /**
     * 剩余次数
     */
    private Integer  lastCount;
            
    
    /**
@@ -59,10 +78,7 @@
    private String  status;
            
    
    /**
     * 来源,购买,转让,赠送
     */
    private String  source;
            
    
    /**
@@ -71,6 +87,7 @@
    @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8")
    @DateTimeFormat(pattern= DateUtil.DATE_FORMAT_DD)
    private Date  failTime;
            
    
    /**
@@ -92,10 +109,7 @@
     */
    private String  isOver;
            
    /**
     * 是默认储值卡? Y 是,N否
     */
    private String  isVipCar;
    /**
     * 备注
     */
@@ -141,6 +155,55 @@
    public void setRemark(String remark) {
        this.remark = remark;
    }
    /**
     * 当大于10000时使用次数为不限,或者为会籍卡时
     * @return
     */
    public String getLastCountName() {
        if(getLastCount()==null){
            return "";
        }
        if(Dictionary.FLAG_YES.equals(getIsVipCar())||getLastCount()>Dictionary.MAX_USE_COUNT_SIGN){
            lastCountName=Dictionary.MAX_USE_STRING;
        }else{
            lastCountName=getLastCount().toString();
        }
        return lastCountName;
    }
    public void setLastCountName(String lastCountName) {
        this.lastCountName = lastCountName;
    }
    public String getSourceName() {
        if(getSource()==null){
            return "";
        }
        if(getSource().contains(Dictionary.TAOCAN_SOURCE_ZS)){
            sourceName=Dictionary.FLAG_YES;
        }else{
            sourceName=Dictionary.FLAG_NO;;
        }
        return sourceName;
    }
    public void setSourceName(String sourceName) {
        this.sourceName = sourceName;
    }
    public String getIsVipCar() {
        return isVipCar;
    }
    public void setIsVipCar(String isVipCar) {
        this.isVipCar = isVipCar;
    }
    /**
     * 扩展对象
     */
@@ -166,13 +229,6 @@
        this.changeRemark = changeRemark;
    }
    public String getIsVipCar() {
        return isVipCar;
    }
    public void setIsVipCar(String isVipCar) {
        this.isVipCar = isVipCar;
    }
    public Long getId() {
        return id;
zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java
@@ -1,8 +1,11 @@
package com.matrix.system.hive.bean;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.gson.annotations.Expose;
import com.matrix.core.tools.DateUtil;
import com.matrix.system.hive.plugin.util.ExcelAnnotation;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.io.Serializable;
@@ -10,17 +13,22 @@
import java.util.List;
/**
 * @Title: SysVipInfo.java  
 * @Package com.zkingsoft.model  
 * @description
 * @author jyy
 * @email 18075895212@qq.com
 * @date  2016年7月14日 上午10:59:29
 */
@Data
public class SysVipInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    /**
     * 是销售员
     */
    public  static final int IS_SALES = 1;
    /**
     * 不是销售员
     */
    public  static final int NOT_SALES = 2;
    /**
     * 1、成交客户
     * **/
@@ -230,9 +238,63 @@
    private SysOrder sysOrder;
    /**
     * 可提现金额
     */
    private Double  withdrawalCash;
    /**
     *推广员等级
     */
    private Long  salesmanGrade;
    /**
     * 用户昵称
     */
    private String  nickName;
    /** 扩展信息 **/
    /**
     * 头像
     */
    private String  avatarUrl;
    /**
     * 性别 1、男  2、女  0、未知
     */
    private String  gender;
    /**
     * 用户所在国家
     */
    private String  country;
    /**
     * 用户是否授权  1、是  2、否
     */
    private Integer  userIsAuthorize;
    /**
     * 绑定上级用户时间
     */
    private Date bindingParentTime;
    /**
     * 是否是销售员(1=是,2=否)
     */
    private Integer isSales;
    /**
     * 用户类型 1、待审核  2、审核通过  0、审核未通过
     */
    private Integer  fenxiaoState;
    private String  sessionKey;
    /**
     * 会员等级id
     */
@@ -268,6 +330,8 @@
     * 页面上的入会时间
     */
    private String inDateVo;
    /**
     * 页面上的生日
     */
@@ -336,208 +400,31 @@
    /**
     * 美疗师集合
     */
    @Expose(serialize = false)
    private List<MyBeatician> beauticains;
    
    
    /**
     * 会员问卷信息-答案,传递数据使用
     */
    @Expose(serialize = false)
    List<VipAnswer> vipAnswers;
    /**
     * 会员标签
     */
    @Expose(serialize = false)
    List<SysVipLabel> labels;
    public List<SysVipLabel> getLabels() {
        return labels;
    }
    public void setLabels(List<SysVipLabel> labels) {
        this.labels = labels;
    }
    public String getAge() {
        return age;
    }
    public void setAge(String age) {
        this.age = age;
    }
    public Long getCompanyId() {
        return companyId;
    }
    public void setCompanyId(Long companyId) {
        this.companyId = companyId;
    }
    public String getOpenId() {
        return openId;
    }
    public void setOpenId(String openId) {
        this.openId = openId;
    }
    public String getProvince() {
        return province;
    }
    public void setProvince(String province) {
        this.province = province;
    }
    public String getCity() {
        return city;
    }
    public void setCity(String city) {
        this.city = city;
    }
    public String getArea() {
        return area;
    }
    public void setArea(String area) {
        this.area = area;
    }
    public Long getRecommendId() {
        return recommendId;
    }
    public void setRecommendId(Long recommendId) {
        this.recommendId = recommendId;
    }
    public SysOrder getSysOrder() {
        return sysOrder;
    }
    public void setSysOrder(SysOrder sysOrder) {
        this.sysOrder = sysOrder;
    }
    public Integer getIsDeal() {
        return isDeal;
    }
    public void setIsDeal(Integer isDeal) {
        this.isDeal = isDeal;
    }
    public Long getParentId() {
        return parentId;
    }
    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }
    public Date getCreateDistributionTime() {
        return createDistributionTime;
    }
    public void setCreateDistributionTime(Date createDistributionTime) {
        this.createDistributionTime = createDistributionTime;
    }
    public Date getHandleTime() {
        return handleTime;
    }
    public void setHandleTime(Date handleTime) {
        this.handleTime = handleTime;
    }
    public String getPayTotal() {
        return payTotal;
    }
    public void setPayTotal(String payTotal) {
        this.payTotal = payTotal;
    }
    public Integer getCostTotal() {
        return costTotal;
    }
    public void setCostTotal(Integer costTotal) {
        this.costTotal = costTotal;
    }
    public String getCostNum() {
        return costNum;
    }
    public void setCostNum(String costNum) {
        this.costNum = costNum;
    }
    public String getTimeStart() {
        return timeStart;
    }
    public void setTimeStart(String timeStart) {
        this.timeStart = timeStart;
    }
    public String getTimeEnd() {
        return timeEnd;
    }
    public void setTimeEnd(String timeEnd) {
        this.timeEnd = timeEnd;
    }
    public Integer getVipNum() {
        return vipNum;
    }
    public void setVipNum(Integer vipNum) {
        this.vipNum = vipNum;
    }
    public String getPhoto() {
        return photo;
    }
    public void setPhoto(String photo) {
        this.photo = photo;
    }
    public String getYear() {
        return year;
    }
    public void setYear(String year) {
        this.year = year;
    }
    public boolean isQdSign() {
        return qdSign;
    }
    /**
     * 会员所有的充值卡
     */
    @Expose(serialize = false,deserialize = false)
    private List<MoneyCardUse> cards;
    
    public List<MoneyCardUse> getCards() {
        return cards;
    }
    public void setCards(List<MoneyCardUse> cards) {
        this.cards = cards;
    }
@@ -547,440 +434,8 @@
     * 没签到false
     */
    private boolean qdSign;
    private String name;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public boolean getQdSign() {
        return qdSign;
    }
    public void setQdSign(boolean qdSign) {
        this.qdSign = qdSign;
    }
    public String getUuid() {
        return uuid;
    }
    public void setUuid(String uuid) {
        this.uuid = uuid;
    }
    public String getDisease() {
        return disease;
    }
    public void setDisease(String disease) {
        this.disease = disease;
    }
    public Date getStartTime() {
        return startTime;
    }
    public Integer getRankType() {
        return rankType;
    }
    public void setRankType(Integer rankType) {
        this.rankType = rankType;
    }
    public void setStartTime(Date startTime) {
        this.startTime = startTime;
    }
    public Date getEndTime() {
        return endTime;
    }
    public void setEndTime(Date endTime) {
        this.endTime = endTime;
    }
    public Integer getRanking() {
        return ranking;
    }
    public void setRanking(Integer ranking) {
        this.ranking = ranking;
    }
    public String getEmail() {
        return email;
    }
    public void setEmail(String email) {
        this.email = email;
    }
    public String getShopName() {
        return shopName;
    }
    public String getInDateVo() {
        return inDateVo;
    }
    public void setInDateVo(String inDateVo) {
        this.inDateVo = inDateVo;
    }
    public String getBirthday1Vo() {
        return birthday1Vo;
    }
    public void setBirthday1Vo(String birthday1Vo) {
        this.birthday1Vo = birthday1Vo;
    }
    public void setShopName(String shopName) {
    this.shopName = shopName;
    }
    public Long getShopId() {
        return shopId;
    }
    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }
    public Long getStaffId() {
        return staffId;
    }
    public void setStaffId(Long staffId) {
        this.staffId = staffId;
    }
    public String getStaffName() {
        return staffName;
    }
    public void setStaffName(String staffName) {
        this.staffName = staffName;
    }
    public Long getId() {
        return id;
    }
    public void setId(Long id) {
        this.id = id;
    }
    public String getVipNo() {
        return vipNo;
    }
    public void setVipNo(String vipNo) {
        this.vipNo = vipNo;
    }
    public String getVipName() {
        return vipName;
    }
    public void setVipName(String vipName) {
        this.vipName = vipName;
    }
    public String getZjm() {
        return zjm;
    }
    public void setZjm(String zjm) {
        this.zjm = zjm;
    }
    public String getPhone() {
        return phone;
    }
    public void setPhone(String phone) {
        this.phone = phone;
    }
    public String getSex() {
        return sex;
    }
    public void setSex(String sex) {
        this.sex = sex;
    }
    public Date getBirthday1() {
        return birthday1;
    }
    public void setBirthday1(Date birthday1) {
        this.birthday1 = birthday1;
    }
    public String getAddr() {
        return addr;
    }
    public void setAddr(String addr) {
        this.addr = addr;
    }
    public String getConstell() {
        return constell;
    }
    public void setConstell(String constell) {
        this.constell = constell;
    }
    public String getAnimalSign() {
        return animalSign;
    }
    public void setAnimalSign(String animalSign) {
        this.animalSign = animalSign;
    }
    public String getArrivalWay() {
        return arrivalWay;
    }
    public void setArrivalWay(String arrivalWay) {
        this.arrivalWay = arrivalWay;
    }
    public String getVipType() {
        return vipType;
    }
    public void setVipType(String vipType) {
        this.vipType = vipType;
    }
    public String getVipState() {
        return vipState;
    }
    public void setVipState(String vipState) {
        this.vipState = vipState;
    }
    public String getIsDelete() {
        return isDelete;
    }
    public void setIsDelete(String isDelete) {
        this.isDelete = isDelete;
    }
    public Integer getPointAll() {
        return pointAll;
    }
    public void setPointAll(Integer pointAll) {
        this.pointAll = pointAll;
    }
    public Double getCommissionAll() {
        return commissionAll;
    }
    public void setCommissionAll(Double commissionAll) {
        this.commissionAll = commissionAll;
    }
    public Date getInDate() {
        return inDate;
    }
    public void setInDate(Date inDate) {
        this.inDate = inDate;
    }
    public String getRemark() {
        return remark;
    }
    public void setRemark(String remark) {
        this.remark = remark;
    }
    public String getPassWord() {
        return passWord;
    }
    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }
    public Date getCreateTime() {
        return createTime;
    }
    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }
    public Long getLevelId() {
        return levelId;
    }
    public void setLevelId(Long levelId) {
        this.levelId = levelId;
    }
    public SysVipLevel getVipLevel() {
        return vipLevel;
    }
    public void setVipLevel(SysVipLevel vipLevel) {
        this.vipLevel = vipLevel;
    }
    public String getStatu() {
        return statu;
    }
    public void setStatu(String statu) {
        this.statu = statu;
    }
    public Double getBalance() {
        return balance;
    }
    public void setBalance(Double balance) {
        this.balance = balance;
    }
    public MoneyCardUse getLevelCard() {
        return levelCard;
    }
    public void setLevelCard(MoneyCardUse levelCard) {
        this.levelCard = levelCard;
    }
    public String getBeatuyId() {
        return beatuyId;
    }
    public void setBeatuyId(String beatuyId) {
        this.beatuyId = beatuyId;
    }
    public List<MyBeatician> getBeauticains() {
        return beauticains;
    }
    public void setBeauticains(List<MyBeatician> beauticains) {
        this.beauticains = beauticains;
    }
    public String getBlood() {
        return blood;
    }
    public void setBlood(String blood) {
        this.blood = blood;
    }
    public String getSfCard() {
        return sfCard;
    }
    public void setSfCard(String sfCard) {
        this.sfCard = sfCard;
    }
    public String getLink() {
        return link;
    }
    public void setLink(String link) {
        this.link = link;
    }
    public String getMarry() {
        return marry;
    }
    public void setMarry(String marry) {
        this.marry = marry;
    }
    public String getVocation() {
        return vocation;
    }
    public void setVocation(String vocation) {
        this.vocation = vocation;
    }
    public List<VipAnswer> getVipAnswers() {
        return vipAnswers;
    }
    public void setVipAnswers(List<VipAnswer> vipAnswers) {
        this.vipAnswers = vipAnswers;
    }
    public Integer getBirthdayType() {
        return birthdayType;
    }
    public void setBirthdayType(Integer birthdayType) {
        this.birthdayType = birthdayType;
    }
    @Override
    public String toString() {
        return "SysVipInfo [id=" + id + ", vipNo=" + vipNo + ", vipName="
                + vipName + ", phone=" + phone + ", vipType=" + vipType
                + ", shopName=" + shopName + ", vipState=" + vipState
                + ", passWord=" + passWord + ", beatuyId=" + beatuyId
                + ", sex=" + sex + ", birthday1=" + birthday1 + ", addr="
                + addr + ", constell=" + constell + ", animalSign="
                + animalSign + ", arrivalWay=" + arrivalWay + ", photo="
                + photo + ", pointAll=" + pointAll + ", commissionAll="
                + commissionAll + ", inDate=" + inDate + ", createTime="
                + createTime + ", remark=" + remark + ", staffId=" + staffId
                + ", shopId=" + shopId + ", isDelete=" + isDelete + ", email="
                + email + ", blood=" + blood + ", sfCard=" + sfCard + ", link="
                + link + ", marry=" + marry + ", vocation=" + vocation
                + ", levelId=" + levelId + ", uuid=" + uuid + ", balance="
                + balance + ", levelCard=" + levelCard + ", vipLevel="
                + vipLevel + ", staffName=" + staffName + ", inDateVo="
                + inDateVo + ", birthday1Vo=" + birthday1Vo + ", ranking="
                + ranking + ", startTime=" + startTime + ", endTime=" + endTime
                + ", rankType=" + rankType + ", year=" + year + ", vipNum="
                + vipNum + ", timeStart=" + timeStart + ", timeEnd=" + timeEnd
                + ", payTotal=" + payTotal + ", costTotal=" + costTotal
                + ", costNum=" + costNum + ", openId=" + openId + ", statu="
                + statu + ", beauticains=" + beauticains + ", vipAnswers="
                + vipAnswers + ", cards=" + cards + ", qdSign=" + qdSign + "]";
    }
zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java
@@ -208,4 +208,8 @@
    List<VipInfoListVo> selectVipAddressBookByList(@Param("record") VipInfoListDto vipInfoListDto);
    com.matrix.system.app.vo.VipInfoVo selectVipInfoById(@Param("id") Long id);
    public SysVipInfo findByOpenId(String openId);
    int unbundlingSaleMan(Long userId);
}
zq-erp/src/main/java/com/matrix/system/hive/pojo/MoneyCardUserVo.java
File was deleted
zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java
@@ -196,4 +196,13 @@
        int apiModifyVip(ModifyVipDto modifyVipDto);
        VipInfoDetailVo findVipInfoDetail(Long id);
    /**
     * 设置为推广员
     * @param invitationId
     */
    public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId);
    SysVipInfo findByOpenId(String openId);
}
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java
@@ -372,7 +372,7 @@
            sysOrderFlowDao.deleteByOrderId(id);
            //删除积分
            scoreVipDetailService.removeByBusinessId(null,order.getVipId(), order.getId());
            scoreVipDetailService.removeByBusinessId(order.getVipId(), order.getId());
            // 取消订单
            order.setStatu(Dictionary.ORDER_STATU_YQX);
@@ -617,7 +617,7 @@
        //添加自己的积分
        if(selfScore>0){
                scoreVipDetailService.addScore(null,
                scoreVipDetailService.addScore(
                        vipInfo.getId(),
                        pageOrder.getStaffId(),
                        pageOrder.getShopId(),
@@ -632,7 +632,7 @@
            //推荐注册老带新积分奖励
            SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId());
            if(parentScore>0){
                scoreVipDetailService.addScore(null,
                scoreVipDetailService.addScore(
                        referrerVip.getId(),
                        pageOrder.getStaffId(),
                        pageOrder.getShopId(),
@@ -646,7 +646,7 @@
            if(referrerVip.getRecommendId()!=null){
                SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId());
                if(topParentScore>0){
                    scoreVipDetailService.addScore(null,
                    scoreVipDetailService.addScore(
                            topVipInfo.getId(),
                            pageOrder.getStaffId(),
                            pageOrder.getShopId(),
@@ -1459,7 +1459,7 @@
        //退款退套餐退项目
        refundProjUse(sysOrder);
        //删除积分
        scoreVipDetailService.removeByBusinessId(null,oldOrder.getVipId(), oldOrder.getId());
        scoreVipDetailService.removeByBusinessId(oldOrder.getVipId(), oldOrder.getId());
        // 设置业绩
        achieveNewService.addAchaeveByOrder(sysOrder);
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java
@@ -498,7 +498,7 @@
            sysOutStoreItemDao.deleteByOrderId(sysOutStore.getId());
        }
        //删除积分
        scoreVipDetailService.removeByBusinessId(null,checkProjServices.getVipId(), checkProjServices.getId());
        scoreVipDetailService.removeByBusinessId(checkProjServices.getVipId(), checkProjServices.getId());
        //更新服务单状态
        return sysProjServicesDao.update(checkProjServices);
@@ -698,7 +698,7 @@
        //添加自己的积分
        if (selfScore > 0) {
            scoreVipDetailService.addScore(null,
            scoreVipDetailService.addScore(
                    vipInfo.getId(),
                    projServices.getCreateStaffId(),
                    projServices.getShopId(),
@@ -713,7 +713,7 @@
            //推荐注册老带新积分奖励
            SysVipInfo referrerVip = sysVipInfoDao.selectById(vipInfo.getRecommendId());
            if (parentScore > 0) {
                scoreVipDetailService.addScore(null,
                scoreVipDetailService.addScore(
                        referrerVip.getId(),
                        projServices.getCreateStaffId(),
                        projServices.getShopId(),
@@ -727,7 +727,7 @@
            if (referrerVip.getRecommendId() != null) {
                SysVipInfo topVipInfo = sysVipInfoDao.selectById(referrerVip.getRecommendId());
                if (topParentScore > 0) {
                    scoreVipDetailService.addScore(null,
                    scoreVipDetailService.addScore(
                            topVipInfo.getId(),
                            projServices.getCreateStaffId(),
                            projServices.getShopId(),
zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java
@@ -102,11 +102,11 @@
    @Override
    public int add(SysVipInfo sysVipInfo) {
        SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY);
        if (sysVipInfo.getVipNo() != null && (!sysVipInfo.getVipNo().equals(""))) {
            if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "VIP_NO", sysVipInfo.getVipNo(),
                    "company_id",user.getCompanyId())) {
                    "company_id",sysVipInfo.getCompanyId())) {
                throw new GlobleException("编号已存在!");
            }
        }
@@ -115,25 +115,23 @@
                throw new GlobleException("请输入手机号!");
            }
            if (serviceUtil.addCheckRepeatTowColumn(TableMapping.SYS_VIP_INFO, "PHONE", sysVipInfo.getPhone(),
                    "company_id",user.getCompanyId() )) {
                    "company_id",sysVipInfo.getCompanyId() )) {
                throw new GlobleException("手机已被注册!");
            }
        }
        sysVipInfo.setShopId(user.getShopId());
        sysVipInfo.setCompanyId(user.getCompanyId());
        sysVipInfo.setCreateTime(new Date());
        sysVipInfo.setPointAll(0);
        sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP);
        if(StringUtils.isNotBlank(sysVipInfo.getVipName())){
        sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName()));
        if(sysVipInfo.getSex().equals(Dictionary.SEX_MAN)){
        }
        if(Dictionary.SEX_MAN.equals(sysVipInfo.getSex())){
            sysVipInfo.setPhoto(defaultMan);
        }else{
            sysVipInfo.setPhoto(defaultWoman);
        }
        int i=sysVipInfoDao.insert(sysVipInfo);
        modifyVipWithOtherInfo(sysVipInfo);
        //创建用户默认储值卡
        addVipDefaultCard(sysVipInfo.getId());
        return i;
@@ -267,31 +265,7 @@
        }
        
        
        //如果会员id不为空则表示是修改,删除原有的绑定关系,建立新的关系
         if(vipInfo.getId()!=null && !vipInfo.getId().equals("")){
             MyBeatician query=new MyBeatician();
             query.setVipId(vipInfo.getId());
             List<MyBeatician> listDel= myBeaticianDao.selectByModel(query);
             if(listDel!=null && listDel.size()>0){
             List<Long> delIds=new ArrayList<>();
                 for (int i = 0; i < listDel.size(); i++) {
                    delIds.add(listDel.get(i).getId());
                 }
             myBeaticianDao.deleteByIds(delIds);
             }
         }
         //添加客户的美疗师
         List<MyBeatician> list=vipInfo.getBeauticains();
         if(list!=null && list.size()>0){
             List<MyBeatician> saveList=new ArrayList<>();
             //此处由于前台传递过来list中的下标可能是不连续的。因此要过滤掉空的,即要过滤掉美疗师的id为空的数据
             for (MyBeatician temp:list) {
                 if(temp.getBeauticainId()!=null && !temp.getBeauticainId().equals("")){
                     saveList.add(temp);
                    }
                 }
             myBeaticianDao.insertAll(saveList,vipInfo.getId());
            }
             
    }
    
@@ -546,7 +520,7 @@
            if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue())){
                scoreVipDetailService.addScore(referrerVip.getOpenId(),
                scoreVipDetailService.addScore(
                        referrerVip.getId(),
                        user.getSuId(),
                        vipInfo.getShopId(),
@@ -565,7 +539,7 @@
                if(StringUtils.isNotBlank(referrerScoreSetting.getParamValue1())){
                    scoreVipDetailService.addScore(topVipInfo.getOpenId(),
                    scoreVipDetailService.addScore(
                            topVipInfo.getId(),
                            user.getSuId(),
                            vipInfo.getShopId(),
@@ -670,4 +644,26 @@
        vipInfoDetailVo.setLabels(labels);
        return vipInfoDetailVo;
    }
    @Override
    public SysVipInfo findByOpenId(String openId) {
        return sysVipInfoDao.findByOpenId(openId);
    }
    /**
     * 设置成为推广员
     * @param invitationId
     */
    @Override
    public int setToBeAnSalesman(Long userId,Long invitationId,long gradeId) {
        SysVipInfo sysVipInfo=sysVipInfoDao.selectById(userId);
        sysVipInfo.setIsSales(SysVipInfo.IS_SALES);
        sysVipInfo.setRecommendId(invitationId);
        sysVipInfo.setBindingParentTime(new Date());
        sysVipInfo.setSalesmanGrade(gradeId);
        return sysVipInfoDao.update(sysVipInfo);
    }
}
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsCategoryAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsImageAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsNavigationAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsSkuAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderItemAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java
@@ -34,12 +34,6 @@
    private BusParameterSettingsDao busParameterSettingsDao;
    @GetMapping(value = "/testApi")
    public AjaxResult testApi() {
        scoreRuleSettingService.testMethod();
        return AjaxResult.buildSuccessInstance("success");
    }
    /**
     *查询积分规则配置
     */
zq-erp/src/main/java/com/matrix/system/score/action/ScoreShoppingCarAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreUseRecordAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/action/ScoreVipDetailAction.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsCategoryDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsImageDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsNavigationDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsSkuDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderItemDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreRuleSettingDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreShoppingCarDao.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java
@@ -19,12 +19,12 @@
     * @param vipId
     * @return
     */
    int selectUserTotalScore(@Param("openId") String openId, @Param("vipId")Long vipId);
    int selectUserTotalScore(@Param("vipId")Long vipId);
    /**
     * 查询用户有效的积分,按时间顺序排
     * @param
     * @return
     */
    List<ScoreVipDetail> selectEffectiveScore(@Param("openId") String openId, @Param("vipId")Long vipId);
    List<ScoreVipDetail> selectEffectiveScore(@Param("vipId")Long vipId);
}
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoods.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsCategory.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsImage.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsNavigation.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsSku.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrder.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrderItem.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreRuleSettingEntity.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreShoppingCar.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java
@@ -68,8 +68,6 @@
    /**
     * 操作人ID
     */
    private String  openId;
    private Long vipId;
    private Long shopId;
zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java
@@ -44,10 +44,7 @@
    /**
     * 用户openId
     */
    private String openId;
    /**
     * erp用户Id
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsCategoryService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsImageService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsNavigationService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsSkuService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderItemService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java
@@ -1,6 +1,5 @@
package com.matrix.system.score.service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
@@ -9,9 +8,6 @@
import com.matrix.system.common.bean.SysUsers;
import com.matrix.system.common.dao.BusParameterSettingsDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.score.dao.ScoreRuleSettingDao;
import com.matrix.system.score.entity.ScoreRuleSettingEntity;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -22,18 +18,12 @@
 * @date 2021-02-22
 **/
@Service
public class ScoreRuleSettingService extends ServiceImpl<ScoreRuleSettingDao, ScoreRuleSettingEntity> {
public class ScoreRuleSettingService{
    @Autowired
    private ScoreRuleSettingDao scoreRuleSettingDao;
    @Autowired
    private BusParameterSettingsDao busParameterSettingsDao;
    @Autowired
    private SysVipInfoDao sysVipInfoDao;
    public void testMethod() {
        scoreRuleSettingDao.selectById(1L);
    }
    public AjaxResult updateScoreRuleByCompanyId(List<BusParameterSettings> busParameterSettings) {
        //获取当前登录人员信息
zq-erp/src/main/java/com/matrix/system/score/service/ScoreShoppingCarService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreUseRecordService.java
File was deleted
zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java
@@ -3,7 +3,6 @@
import cn.hutool.core.date.DateTime;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.tools.DateUtil;
@@ -39,7 +38,7 @@
    ScoreUseRecordDao scoreUseRecordDao;
    @Autowired
    BizUserDao bizUserDao;
    SysVipInfoDao sysVipInfoDao;
    @Autowired
    SysVipInfoDao vipInfoDao;
@@ -54,21 +53,15 @@
     * 扣除用户积分
     */
    @Transactional(rollbackFor = Exception.class)
    public void deductionScore(String openId, Long vipId,Long oprationUserId,Long shopId, Integer score, Long businessId, int type,String remark) {
        Long companyId=null;
        if(openId!=null){
            companyId= bizUserDao.findByOpenId(openId).getCompanyId();
        }else if(vipId!=null){
            companyId= vipInfoDao.selectById(vipId).getCompanyId();
        }else{
            throw new IllegalArgumentException("vipId,openId必须有一个");
        }
    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();
        }
        List<ScoreVipDetail> effectiveScoreList = scoreVipDetailDao.selectEffectiveScore(openId,vipId);
        List<ScoreVipDetail> effectiveScoreList = scoreVipDetailDao.selectEffectiveScore(vipId);
        for (ScoreVipDetail scoreVipDetail : effectiveScoreList) {
@@ -109,7 +102,6 @@
            scoreUseRecord.setRecNum(-currentDedution);
            scoreUseRecord.setType(type);
            scoreUseRecord.setShopId(shopId);
            scoreUseRecord.setOpenId(openId);
            scoreUseRecord.setVipId(vipId);
            scoreUseRecord.setRemarks(remark);
            scoreUseRecord.setOprationUserId(oprationUserId);
@@ -128,15 +120,9 @@
     * 新增用户积分
     */
    @Transactional(rollbackFor = Exception.class)
    public void addScore(String openId, Long vipId, Long oprationUserId,Long shopId, Integer score, Long businessId, int type,String remark) {
        Long companyId=null;
        if(openId!=null){
            companyId= bizUserDao.findByOpenId(openId).getCompanyId();
        }else if(vipId!=null){
            companyId= vipInfoDao.selectById(vipId).getCompanyId();
        }else{
            throw new IllegalArgumentException("vipId,openId必须有一个");
        }
    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){
            throw new IllegalArgumentException("score必须有为大于零的数");
        }
@@ -164,7 +150,6 @@
        scoreVipDetail.setUsedScore(0);
        scoreVipDetail.setBusinessId(businessId);
        scoreVipDetail.setValiditeTime(sxys);
        scoreVipDetail.setOpenId(openId);
        scoreVipDetail.setVipId(vipId);
        scoreVipDetail.setGainTime(DateTime.now());
        scoreVipDetail.setAllScore(score);
@@ -185,7 +170,6 @@
        scoreUseRecord.setBusinessId(businessId);
        scoreUseRecord.setRecNum(score);
        scoreUseRecord.setType(type);
        scoreUseRecord.setOpenId(openId);
        scoreUseRecord.setVipId(vipId);
        scoreUseRecord.setShopId(shopId);
        scoreUseRecord.setOprationUserId(oprationUserId);
@@ -198,19 +182,13 @@
    /**
     * 退积分
     */
    public void refundScore(String openId, Long vipId, Integer score, Long oldBusinessId, int type){
        Long companyId=null;
        if(openId!=null){
            companyId= bizUserDao.findByOpenId(openId).getCompanyId();
        }else if(vipId!=null){
            companyId= vipInfoDao.selectById(vipId).getCompanyId();
        }else{
            throw new IllegalArgumentException("vipId,openId必须有一个");
        }
    public void refundScore(Long vipId, Integer score, Long oldBusinessId, int type){
        Long companyId= vipInfoDao.selectById(vipId).getCompanyId();
        if(score<0){
            throw new IllegalArgumentException("score必须有为大于零的数");
        }
        //查询原始使用记录
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("business_id",oldBusinessId);
@@ -233,15 +211,9 @@
        });
    }
    public void removeByBusinessId(String openId, Long vipId,  Long oldBusinessId){
        Long companyId=null;
        if(openId!=null){
            companyId= bizUserDao.findByOpenId(openId).getCompanyId();
        }else if(vipId!=null){
            companyId= vipInfoDao.selectById(vipId).getCompanyId();
        }else{
            throw new IllegalArgumentException("vipId,openId必须有一个");
        }
    public void removeByBusinessId( Long vipId,  Long oldBusinessId){
        Long companyId= vipInfoDao.selectById(vipId).getCompanyId();
        if(oldBusinessId==null){
            throw new IllegalArgumentException("oldBusinessId必须有");
        }
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.action;
import com.matrix.biz.service.BizUserService;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.system.shopXcx.dao.ShopScoreExchangeDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@@ -17,7 +17,7 @@
public class ShopBizUserScoreAction {
    @Autowired
    private BizUserService bizUserService;
    private SysVipInfoService sysVipInfoService;
    @Autowired
    private ShopScoreExchangeDao shopScoreExchangeDao;
zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java
@@ -2,7 +2,6 @@
import com.matrix.component.rabbitmq.RabiitMqTemplate;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxTempLateMsgUtil;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.core.anotations.RemoveRequestToken;
import com.matrix.core.anotations.SaveRequestToken;
@@ -12,7 +11,10 @@
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.*;
import com.matrix.core.tools.LogUtil;
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.common.constance.AppConstance;
import com.matrix.system.hive.action.util.QueryUtil;
@@ -139,9 +141,6 @@
        modifyMap.put("handingTime", new Date());
        int i = shopRefundRecordDao.updateByMap(modifyMap);
        if (i > 0) {
            //同意退款后发送微信提醒填写物流单号
            ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(shopRefundRecord.getId());
            sendRefundLogisticsInfoToUser(fundRecord);
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功", "退款记录表");
        } else {
            throw new GlobleException("操作失败");
@@ -188,8 +187,6 @@
            modifyOrder.put("id", record.getOrderId());
            shopOrderDao.updateByMap(modifyOrder);
        }
        //退款拒绝后发送微信提醒
        sendFailedRefundInfoToUser(record);
        if (i > 0) {
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, "操作成功", "退款记录表");
        } else {
@@ -252,7 +249,7 @@
                    if(flag){
                        //退款成功后发送微信提醒
                        ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(oldShopRefundRecord.getId());
                        sendRefundInfoToUser(fundRecord);
                    }
                }
@@ -276,7 +273,7 @@
                if(flag){
                    //退款成功后发送微信提醒
                    ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(oldShopRefundRecord.getId());
                    sendRefundInfoToUser(fundRecord);
                }
            }
@@ -396,7 +393,7 @@
                    if(flag){
                        //退款成功后发送微信提醒
                        ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(Integer.valueOf(id));
                        sendRefundInfoToUser(fundRecord);
                        refundRecordService.updateGroupBuyStatus(Long.parseLong(id));
                    }
                }
@@ -422,7 +419,7 @@
                if(flag){
                    //退款成功后发送微信提醒
                    ShopRefundRecord fundRecord = shopRefundRecordDao.selectById(Integer.valueOf(id));
                    sendRefundInfoToUser(fundRecord);
                    refundRecordService.updateGroupBuyStatus(Long.parseLong(id));
                }
            }
@@ -494,8 +491,7 @@
                //退款成功后同时把优惠券退回到用户的账号中
                if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) == 0) {
                    ShopCouponRecord shopCouponRecord = new ShopCouponRecord();
                    String userIds = shopRefundRecord.getUserId();
                    shopCouponRecord.setUserId(userIds);
                    shopCouponRecord.setUserId(shopRefundRecord.getUserId());
                    shopCouponRecord.setOrderId(shopOrder.getId());
                    List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord);
                    if (CollectionUtils.isNotEmpty(recordList)) {
@@ -539,73 +535,6 @@
        return flag;
    }
    //退款成功后发送微信提醒
    private int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord) {
        ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId());
        if (order == null) {
            throw new GlobleException("没有找到需要退款的订单信息");
        }
        List<String> msg = new ArrayList<>();
        //退款说明
        String refundExplain = "退款已经原路返回,具体到账时间可能会有1-3天延迟";
        msg.add(order.getOrderNo());
        msg.add(DateUtil.dateToString(shopRefundRecord.getRefundTime(),DateUtil.DATE_FORMAT_SS));
        msg.add(refundExplain);
        msg.add("商品名称");
        String formId = null;
        if(AppConstance.REFUND_GOODS.equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){
            formId = shopRefundRecord.getRefundTransactionNo();
        }else {
            formId = order.getWxOrderNo().split("=")[1];
        }
        String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=1" + "&&inform=1";
        int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(),
                page, WxTempLateMsgUtil.REFUND_SUCCESS, formId);
        return res;
    }
    //退款拒绝后发送微信提醒
    private int sendFailedRefundInfoToUser(ShopRefundRecord shopRefundRecord) {
        ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId());
        if (order == null) {
            throw new GlobleException("没有找到拒绝退款的订单信息");
        }
        List<String> msg = new ArrayList<>();
        //退款说明
        String remarks = "如有疑问请联系客服";
        msg.add(order.getOrderNo());
        msg.add("商品名称");
        msg.add(shopRefundRecord.getRefundRefuseReason());
        msg.add(shopRefundRecord.getRefundCause());
        String formId = null;
        if(AppConstance.REFUND_GOODS .equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){
            formId = shopRefundRecord.getRefundTransactionNo();
        }else {
            formId = order.getWxOrderNo().split("=")[1];
        }
        String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=2" + "&&inform=1";
        int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(),
                page, WxTempLateMsgUtil.REFUND_FAILED, formId);
        return res;
    }
    //同意退款后发送微信提醒填写物流单号
    private int sendRefundLogisticsInfoToUser(ShopRefundRecord shopRefundRecord) {
        ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId());
        if (order == null) {
            throw new GlobleException("没有找到发送微信提醒的订单信息");
        }
        List<String> msg = new ArrayList<>();
        //退款说明
        String remarks = "申请退款已审核通过,请尽快填写退货物流信息";
        msg.add(order.getOrderNo());
        msg.add("商品名称");
        msg.add("待退回");
        msg.add(remarks);
        String formId = order.getWxOrderNo().split("=")[1];
        String page = "pages/refunding/refunding?id=" + shopRefundRecord.getId() + "&&inform=1";
        int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(),
                page, WxTempLateMsgUtil.WRITE_LOGISTICS, formId);
        return res;
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
@@ -8,6 +8,7 @@
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.hive.dao.ShoppingGoodsDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.shopXcx.api.pojo.OrderInfoQueryPOJO;
import com.matrix.system.shopXcx.api.pojo.ShopOrderDto;
import com.matrix.system.shopXcx.api.service.OrderCouponGroupService;
@@ -75,6 +76,9 @@
    @Autowired
    ShopOrderDao shopOrderDao;
    @Autowired
    SysVipInfoDao sysVipInfoDao;
    /**
     * 计算购物车订单价格
     *
@@ -127,12 +131,14 @@
        BigDecimal money = new BigDecimal(shopOrder.getOrderMoney().toString());
        BrandWCPayRequestData payData;
        String productNames = wxShopOrderUtil.getProductNames(shopOrder.getUserId(), shopOrder.getId());
        SysVipInfo vipInfo = sysVipInfoDao.selectById(shopOrder.getUserId());
        if (isDebug) {
            payData = weixinServiceUtil.createOrder("[测试]" + productNames, shopOrder.getOrderNo(),
                    1, shopOrder.getUserId(), String.valueOf(shopOrder.getId()));
                    1, vipInfo.getOpenId(), String.valueOf(shopOrder.getId()));
        } else {
            payData = weixinServiceUtil.createOrder(productNames, shopOrder.getOrderNo(),
                    unit.multiply(money).intValue(), shopOrder.getUserId(), String.valueOf(shopOrder.getId()));
                    unit.multiply(money).intValue(), vipInfo.getOpenId(), String.valueOf(shopOrder.getId()));
        }
        ShopOrder updateParam = new ShopOrder();
        updateParam.setId(shopOrder.getId());
@@ -241,9 +247,9 @@
    @GetMapping(value = "/getOrderStatusCount")
    @ResponseBody
    public AjaxResult getOrderStatusCount() {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        AjaxResult result = AjaxResult.buildSuccessInstance(
                shopOrderDao.selectOrderStatusCount(bizUser.getOpenId()));
                shopOrderDao.selectOrderStatusCount(sysVipInfo.getOpenId()));
        return result;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java
@@ -1,18 +1,16 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.component.rabbitmq.RabiitMqTemplate;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.AES;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.component.tools.AES;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.shopXcx.api.pojo.BindingPhoneNumberPOJO;
import com.matrix.system.shopXcx.api.tools.SMSVerifiTools;
import com.matrix.system.shopXcx.api.vo.DataDecipheringVo;
import com.matrix.system.shopXcx.mqTask.MQTaskRouting;
import org.apache.commons.collections.CollectionUtils;
import org.apache.commons.lang.RandomStringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -22,9 +20,7 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @author jiangyouyao
@@ -38,7 +34,7 @@
    @Autowired
    private SMSVerifiTools sMSVerifiTools;
    @Autowired
    private BizUserDao bizUserDao;
    private SysVipInfoDao sysVipInfoDao;
    @Autowired
    private RedisUserLoginUtils redisUserLoginUtils;
@@ -62,9 +58,9 @@
        if (StringUtils.isBlank(phoneNumber)) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空");
        }
        BizUser bizUser = new BizUser();
        bizUser.setPhoneNumber(phoneNumber);
        List<BizUser> bizUsers = bizUserDao.selectByModel(bizUser);
        SysVipInfo sysVipInfo = new SysVipInfo();
        sysVipInfo.setPhone(phoneNumber);
        List<SysVipInfo> bizUsers = sysVipInfoDao.selectByModel(sysVipInfo);
        if (CollectionUtils.isNotEmpty(bizUsers) && bizUsers.size() > 0) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "该手机号已被绑定");
        }
@@ -102,15 +98,14 @@
            return new AjaxResult(AjaxResult.STATUS_FAIL, "手机号码不能为空");
        }
        //验证通过将手机号加入相应的用户数据中
        BizUser bizUser = new BizUser();
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        bizUser.setUserId(loginUser.getUserId());
        bizUser.setPhoneNumber(bindingPhoneNumber.getPhoneNumber());
        bizUserDao.updateByModel(bizUser);
        //绑定号码后同步到erp
        mqTemplate.sendMsg(MQTaskRouting.CREATE_VIP + evn, loginUser.getOpenId()+","+bindingPhoneNumber.getShopId());
        SysVipInfo sysVipInfo = new SysVipInfo();
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        sysVipInfo.setId(loginUser.getId());
        if(loginUser.getShopId()==null){
            sysVipInfo.setShopId(bindingPhoneNumber.getShopId());
        }
        sysVipInfo.setPhone(bindingPhoneNumber.getPhoneNumber());
        sysVipInfoDao.update(sysVipInfo);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "绑定成功");
    }
@@ -128,7 +123,7 @@
    @RequestMapping(value = "/deciphering")
    public @ResponseBody
    AjaxResult deciphering(@RequestBody DataDecipheringVo dataDecipheringVo) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String session_key = loginUser.getSessionKey();
        LogUtil.debug(dataDecipheringVo.toString());
        String jsonResult = AES.wxDecrypt(dataDecipheringVo.getEncryptedData(), session_key, dataDecipheringVo.getIv());
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java
@@ -1,7 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.shopXcx.bean.ShopCollection;
@@ -35,7 +35,7 @@
    @PostMapping(value = "/saveCollection")
    public @ResponseBody
    AjaxResult saveCollection(@RequestBody ShopCollection collection) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        collection.setCreateBy(loginUser.getOpenId());
        collection.setUpdateBy(loginUser.getOpenId());
        collection.setCollUserid(loginUser.getOpenId());
@@ -72,7 +72,7 @@
    @ResponseBody
    public AjaxResult deleteByProductId(@PathVariable("collProductid") Integer collProductid){
        Map<String, Object> deleteMap = new HashMap<>();
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String collUserid = loginUser.getOpenId();
        deleteMap.put("collProductid", collProductid);
        deleteMap.put("collUserid", collUserid);
@@ -91,7 +91,7 @@
    @PostMapping("/findCollection")
    @ResponseBody
    public AjaxResult getCollectionByUserId(@RequestBody ShopCollection collection) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String userId = loginUser.getOpenId();
        collection.setCollUserid(userId);
        List<ShopCollection> list = collectionDao.selectByUserId(collection);
@@ -107,7 +107,7 @@
    @PostMapping("/findByUserIdAndProid/{collProductid}")
    @ResponseBody
    public AjaxResult findByUserIdAndProid(@PathVariable("collProductid") Integer collProductid) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String userId = loginUser.getOpenId();
        List<ShopCollection> list = collectionDao.selectByUserIdAndProid(collProductid,userId);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size());
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java
@@ -1,38 +1,19 @@
package com.matrix.system.shopXcx.api.action;
import com.alibaba.fastjson.JSONObject;
import com.matrix.biz.bean.BizUser;
import com.matrix.component.redis.RedisClient;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.core.tools.UUIDUtil;
import com.matrix.system.app.authority.AppAuthorityManager;
import com.matrix.system.app.dto.LoginDto;
import com.matrix.system.app.dto.PwdResetDto;
import com.matrix.system.app.dto.SmsCodeDto;
import com.matrix.system.app.dto.UploadPhotoDto;
import com.matrix.system.app.vo.UserInfoVo;
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.service.SysUsersService;
import com.matrix.system.common.tools.PasswordUtil;
import com.matrix.system.hive.bean.AppVersion;
import com.matrix.system.hive.bean.SysOrderFlow;
import com.matrix.system.hive.bean.SysShopInfo;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysOrderDao;
import com.matrix.system.hive.dao.SysOrderFlowDao;
import com.matrix.system.hive.dao.SysOrderItemDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.hive.plugin.util.ImageUtil;
import com.matrix.system.hive.service.SysShopInfoService;
import com.matrix.system.shopXcx.api.dto.ErpOrderListDto;
import com.matrix.system.shopXcx.api.vo.ErpOrderDetailFlowVo;
import com.matrix.system.shopXcx.api.vo.ErpOrderDetailItemVo;
import com.matrix.system.shopXcx.api.vo.ErpOrderDetailVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -44,9 +25,6 @@
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import java.io.File;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.util.ArrayList;
import java.util.List;
@@ -97,18 +75,15 @@
    })
    @PostMapping(value = "/findUserOrderList")
    public AjaxResult findUserOrderList(@RequestBody @Validated ErpOrderListDto erpOrderListDto) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber());
        if(vipInfo!=null){
        SysVipInfo vipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
            erpOrderListDto.setVipId(vipInfo.getId());
            List<ErpOrderDetailVo> rows=sysOrderDao.selectErpOrderList(erpOrderListDto);
            rows.forEach(item->{
                item.setItems(orderItemDao.selectErpOrderItemByOrderId(item.getOrderId()));
            });
            return  AjaxResult.buildSuccessInstance(rows,"查询成功");
        }else{
            return  AjaxResult.buildFailInstance("未查询到相关订单001");
        }
    }
@@ -132,8 +107,6 @@
        result.putInMap("order",order);
        return  result;
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxacodeUtil;
import com.matrix.core.pojo.AjaxResult;
@@ -33,7 +33,7 @@
    @PostMapping("/getWxAcode")
    @ResponseBody
    public AjaxResult getWxAcode(@RequestBody ShopWxAcode wxAcode) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String openId = loginUser.getOpenId();
        try {
            String wxacodeUrl = WxacodeUtil.getWxacode(wxAcode.getScene(), wxAcode.getPage(), wxAcode.getFileName(),
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java
@@ -1,7 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.common.bean.CustomerDataDictionary;
import com.matrix.system.common.dao.CustomerDataDictionaryDao;
import com.matrix.component.redis.RedisUserLoginUtils;
@@ -51,7 +51,7 @@
    @PostMapping(value = "/saveInvoice")
    public @ResponseBody
    AjaxResult saveInvoice(@RequestBody ShopInvoice shopInvoice) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        shopInvoice.setCreateBy(loginUser.getOpenId());
        shopInvoice.setUpdateBy(loginUser.getOpenId());
        shopInvoice.setUserId(loginUser.getOpenId());
@@ -82,7 +82,7 @@
    @PostMapping("/findProductComment")
    @ResponseBody
    public AjaxResult getProductCommentByUserId(@RequestBody ShopInvoice shopInvoice) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String userId = loginUser.getOpenId();
        shopInvoice.setUserId(userId);
        List<ShopInvoice> list = invoiceDao.selectByUserId(shopInvoice);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java
@@ -1,7 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.common.constance.AppConstance;
@@ -58,7 +58,7 @@
    @PostMapping(value = "/saveProductComment")
    public @ResponseBody
    AjaxResult saveProductComment(@RequestBody List<ShopProductComment> commentList) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        int flag = 0;
        if(CollectionUtils.isNotEmpty(commentList)){
            for(ShopProductComment productComment : commentList){
@@ -92,7 +92,7 @@
    @PostMapping("/findProductComment")
    @ResponseBody
    public AjaxResult getProductCommentByUserId(@RequestBody ShopProductComment productComment) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String userId = loginUser.getOpenId();
        productComment.setUserId(userId);
        List<ShopProductComment> list = productCommentDao.selectByUserId(productComment);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java
@@ -2,7 +2,7 @@
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.common.constance.AppConstance;
@@ -37,7 +37,7 @@
    @PostMapping(value = "/saveReceiveAddress")
    public @ResponseBody
    AjaxResult saveReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        receiveAddress.setCreateBy(loginUser.getOpenId());
        receiveAddress.setUpdateBy(loginUser.getOpenId());
        receiveAddress.setAddrUserid(loginUser.getOpenId());
@@ -94,7 +94,7 @@
    @PostMapping("/findReceiveAddress")
    @ResponseBody
    public AjaxResult getByAddrUserId(@RequestBody ShopReceiveAddress receiveAddress) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String userId = loginUser.getOpenId();
        receiveAddress.setAddrUserid(userId);
        List<ShopReceiveAddress> list = shopReceiveAddressDao.selectByModel(receiveAddress);
@@ -110,7 +110,7 @@
    @PostMapping("/findAddrByAddrId/{addrId}")
    @ResponseBody
    public AjaxResult getByAddrId(@PathVariable("addrId") Integer addrId) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String userId = loginUser.getOpenId();
        ShopReceiveAddress params = new ShopReceiveAddress();
        params.setAddrUserid(userId);
@@ -145,7 +145,7 @@
    @PostMapping(value = "/updateReceiveAddress")
    public @ResponseBody
    AjaxResult updateReceiveAddress(@RequestBody ShopReceiveAddress receiveAddress) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        receiveAddress.setCreateBy(loginUser.getOpenId());
        receiveAddress.setUpdateBy(loginUser.getOpenId());
        receiveAddress.setAddrUserid(loginUser.getOpenId());
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxUtils;
import com.matrix.core.pojo.AjaxResult;
@@ -110,10 +110,10 @@
    @PostMapping(value = "/saveRefundRecord")
    public @ResponseBody
    AjaxResult saveRefundRecord(@RequestBody ShopRefundRecord refundRecord) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        refundRecord.setCreateBy(loginUser.getOpenId());
        refundRecord.setUpdateBy(loginUser.getOpenId());
        refundRecord.setUserId(loginUser.getOpenId());
        refundRecord.setUserId(loginUser.getId());
        refundRecord.setCompanyId(loginUser.getCompanyId());
        refundRecord.setAuditStatus(AppConstance.REFUND_NOT_AUDITED);
        refundRecord.setRefundStatus(AppConstance.REFUND_PROCESSING);
@@ -124,7 +124,7 @@
        refundRecord.setApplyTime(new Date());
        ShopRefundRecord record = new ShopRefundRecord();
        record.setUserId(loginUser.getOpenId());
        record.setUserId(loginUser.getId());
        record.setOrderId(refundRecord.getOrderId());
        List<ShopRefundRecord> shopRefundRecords = refundRecordDao.selectByModel(record);
        if(CollectionUtils.isNotEmpty(shopRefundRecords)){
@@ -159,7 +159,6 @@
                    if(flag){
                        ShopRefundRecord fundRecord = refundRecordDao.selectById(shopRecord.getId());
                        refundRecordService.sendRefundInfoToUser(fundRecord);
                        refundRecordService.updateGroupBuyStatus(orderId.longValue());
                        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "退款成功");
                    }
@@ -186,9 +185,8 @@
    @PostMapping("/findRefundRecord")
    @ResponseBody
    public AjaxResult getRefundRecordByUserId(@RequestBody ShopRefundRecord refundRecord) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        String userId = loginUser.getOpenId();
        refundRecord.setUserId(userId);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        refundRecord.setUserId(loginUser.getId());
        List<ShopRefundRecord> list = refundRecordDao.selectByRefundUserId(refundRecord);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, list, list.size());
        return result;
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java
@@ -2,8 +2,8 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
@@ -47,7 +47,7 @@
    private RedisUserLoginUtils redisUserLoginUtils;
    @Autowired
    private BizUserDao bizUserDao;
    private SysVipInfoDao sysVipInfoDao;
    @Autowired
    private ShopSalesmanOrderDao shopSalesmanOrderDao;
@@ -59,13 +59,13 @@
            @ApiResponse(code = 200, message = "ok", response = SalesOrderVo.class)
    })
    AjaxResult getInvitationuserList(@RequestBody @Validated SaleOrderDto saleOrderDto) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        Page<SalesOrderVo> page=new Page<>(saleOrderDto.getPageNum(),saleOrderDto.getPageSize());
        if(StringUtils.isBlank(saleOrderDto.getSort())){
            saleOrderDto.setSort("create_time");
            saleOrderDto.setOrder("desc");
        }
        saleOrderDto.setUserId(loginUser.getOpenId());
        saleOrderDto.setUserId(loginUser.getId());
        IPage<SalesOrderVo> shopSalesmanApplyIPage = shopSalesmanOrderDao.selectSalesManOrder(page,  saleOrderDto);
        AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords());
        return result;
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java
@@ -2,8 +2,8 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
import com.matrix.core.constance.MatrixConstance;
@@ -42,7 +42,7 @@
    private RedisUserLoginUtils redisUserLoginUtils;
    @Autowired
    private BizUserDao bizUserDao;
    private SysVipInfoDao sysVipInfoDao;
    @Autowired
    private ShopRevenueFlowDao revenueFlowDao;
@@ -62,9 +62,9 @@
            @ApiResponse(code = 200, message = "ok", response = ShopRevenueFlow.class)
    })
    AjaxResult getInvitationuserList(@RequestBody @Validated RevenueFlowDto revenueFlowDto) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        Page<ShopRevenueFlow> page=new Page<>(revenueFlowDto.getPageNum(),revenueFlowDto.getPageSize());
        revenueFlowDto.setUserId(loginUser.getOpenId());
        revenueFlowDto.setUserId(loginUser.getId());
        IPage<ShopRevenueFlow> shopSalesmanApplyIPage = revenueFlowDao.selectRevenuFlowList(page,  revenueFlowDto);
        AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords());
        return result;
@@ -78,8 +78,8 @@
    })
    @Transactional
    AjaxResult withdrawalCash(@RequestBody @Validated WithdrawalCashDto withdrawalCashDto) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        loginUser=bizUserDao.selectById(loginUser.getUserId());
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        loginUser=sysVipInfoDao.selectById(loginUser.getId());
        if(withdrawalCashDto.getAmount()<1){
            return AjaxResult.buildFailInstance("最小提现金额为1元");
        }else if(withdrawalCashDto.getAmount()>20000){
@@ -103,12 +103,12 @@
                invitationRevenueFlow.setCreateTime(new Date());
                invitationRevenueFlow.setUpdateTime(new Date());
                invitationRevenueFlow.setAmount(-withdrawalCashDto.getAmount());
                invitationRevenueFlow.setUserId(loginUser.getOpenId());
                invitationRevenueFlow.setUserId(loginUser.getId());
                invitationRevenueFlow.setRevenueContent("提现");
                shopRevenueFlowDao.insert(invitationRevenueFlow);
                //扣除用户剩余提现金额
                loginUser.setWithdrawalCash(loginUser.getWithdrawalCash()-withdrawalCashDto.getAmount());
                bizUserDao.updateByModel(loginUser);
                sysVipInfoDao.update(loginUser);
                redisUserLoginUtils.updateUserInfo(loginUser);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java
@@ -3,8 +3,8 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.ImageUtil;
import com.matrix.component.tools.WxacodeUtil;
@@ -70,7 +70,7 @@
    private RedisUserLoginUtils redisUserLoginUtils;
    @Autowired
    private BizUserDao bizUserDao;
    private SysVipInfoDao sysVipInfoDao;
    @Autowired
    WeChatApiTools weChatApiTools;
@@ -99,9 +99,6 @@
    }
    @ApiOperation(value = "申请成为推广员", notes = "传入参数invitationId 邀请人openId ,非必填 例: {invitationId:openId}")
    @ApiResponses({
            @ApiResponse(code = 200, message = "ok", response = ShopSalesmanApply.class)
@@ -109,20 +106,20 @@
    @PostMapping(value = "/applyToBeAnSalesman")
    @Transactional
    public AjaxResult applyToBeAnSalesman(@RequestBody Map<String,String> param) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        String invitationId = param.get("invitationId");
        if(StringUtils.isNotBlank(invitationId)){
            BizUser invitationUser = bizUserDao.findByOpenId(invitationId);
            if(invitationUser!=null && invitationUser.getOpenId().equals(loginUser.getOpenId())) {
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        Long invitationId=null;
        if(StringUtils.isNotBlank(param.get("invitationId"))){
             invitationId = Long.parseLong(param.get("invitationId"));
            SysVipInfo invitationUser = sysVipInfoDao.selectById(invitationId);
            if (invitationUser != null && invitationUser.getId().equals(loginUser.getId())) {
                return AjaxResult.buildFailInstance("不能邀请自己成为推广员");
            }
        }
        ShopSalesmanApply shopSalesmanApply= shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(),"",invitationId,ShopSalesmanApply.APPLY_WAY_SELF);
        loginUser=bizUserDao.selectById(loginUser.getUserId());
        ShopSalesmanApply shopSalesmanApply = shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, invitationId, ShopSalesmanApply.APPLY_WAY_SELF);
        loginUser = sysVipInfoDao.selectById(loginUser.getId());
        redisUserLoginUtils.updateUserInfo(loginUser);
        return AjaxResult.buildSuccessInstance(shopSalesmanApply);
    }
@@ -134,9 +131,9 @@
    })
    @GetMapping(value = "/queryApplyProgress")
    public AjaxResult queryApplyProgress() {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("user_id",loginUser.getOpenId());
        queryWrapper.eq("user_id", loginUser.getId());
        queryWrapper.eq("apply_status",ShopSalesmanApply.APPLY_STATUS_DSH);
        ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper);
        return AjaxResult.buildSuccessInstance(shopSalesmanApply);
@@ -148,42 +145,39 @@
            @ApiResponse(code = 200, message = "ok", response = Map.class)
    })
    @PostMapping(value = "/bindingParentSalesman")
    public AjaxResult bindingParentSalesman(@RequestBody Map<String,String> param) {
        String invitationId = param.get("invitationId");
    public AjaxResult bindingParentSalesman(@RequestBody Map<String, Long> param) {
        Long invitationId = param.get("invitationId");
        if (StringUtils.isBlank(invitationId)) {
            return AjaxResult.buildFailInstance("请求参数错误");
        }
        BizUser invitationUser = bizUserDao.selectById(Long.parseLong(invitationId));
        SysVipInfo invitationUser = sysVipInfoDao.selectById(invitationId);
        if (invitationUser==null) {
            return AjaxResult.buildFailInstance("请求参数错误");
        }
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        if(invitationId.equals(loginUser.getUserId())){
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        if (invitationId.equals(loginUser.getId())) {
            return AjaxResult.buildSuccessInstance("不能绑定自己");
        }
        loginUser = bizUserDao.selectById(loginUser.getUserId());
        loginUser = sysVipInfoDao.selectById(loginUser.getId());
        if(loginUser.getIsSales()==1){
            return AjaxResult.buildSuccessInstance("只有非分销员才能被绑定成客户");
        }if (StringUtils.isNotBlank(loginUser.getParentOpenId())){
        }
        if (loginUser.getRecommendId()!=null) {
            return AjaxResult.buildSuccessInstance("已经被绑定");
        }else{
            if (StringUtils.isBlank(loginUser.getParentOpenId())) {
            if (loginUser.getRecommendId()==null) {
                Map<String, Object> updateParam = new HashMap<>();
                updateParam.put("userId", loginUser.getUserId());
                updateParam.put("parentOpenId", invitationUser.getOpenId());
                updateParam.put("bindingParentTime",new Date());
                bizUserDao.updateByMap(updateParam);
                updateParam.put("id", loginUser.getId());
                loginUser.setRecommendId(invitationUser.getId());
                loginUser.setBindingParentTime(new Date());
                sysVipInfoDao.update(loginUser);
                return AjaxResult.buildSuccessInstance("绑定成功");
            } else {
                return AjaxResult.buildSuccessInstance("已经存在上级");
            }
        }
    }
@@ -193,7 +187,7 @@
    @PostMapping(value = "/getInvitationPoster")
    AjaxResult getInvitationPoster() {
        try {
            BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
            SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
            String baseSavePath = PropertiesUtil.getString(AppConstance.FILES_TORAGE_PATH);
            // 图片访问URL
@@ -205,7 +199,7 @@
            String urlPath = baseSaveUrl + "/" + "wxacode" + "/" + targetImg;
            String qrcodeSavePath = WxacodeUtil.getWxacode(loginUser.getUserId() + "", "pages/distributorCenter/applyFor/applyFor", MD5Util.strToMD5(loginUser.getOpenId())+"qrcode"
            String qrcodeSavePath = WxacodeUtil.getWxacode(loginUser.getId() + "", "pages/distributorCenter/applyFor/applyFor", MD5Util.strToMD5(loginUser.getOpenId()) + "qrcode"
                    ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId()));
            BufferedImage qrcordImgBuf = ImageIO.read(new File(qrcodeSavePath));
@@ -257,9 +251,9 @@
            @ApiResponse(code = 200, message = "ok", response = SalesmanVo.class)
    })
    AjaxResult getInvitationuserList(@RequestBody BasePageQueryDto pageDto) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        Page<SalesmanVo> page=new Page<>(pageDto.getPageNum(),pageDto.getPageSize());
        IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getOpenId(),pageDto.getKeywords());
        IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getId(), pageDto.getKeywords());
        AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords());
        return result;
    }
@@ -271,8 +265,8 @@
            @ApiResponse(code = 200, message = "ok", response = SalesmanCenterInfo.class)
    })
    AjaxResult getSalesmanCenterInfo() {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SalesmanCenterInfo salesmanCenterInfo= salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getOpenId());
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SalesmanCenterInfo salesmanCenterInfo = salesmanApplyDao.selectSalesmanCenterInfo(loginUser.getId());
        return AjaxResult.buildSuccessInstance(salesmanCenterInfo);
    }
@@ -282,8 +276,8 @@
            @ApiResponse(code = 200, message = "ok", response = SalesmanApplyCondition.class)
    })
    AjaxResult getSalesmanApplyCondition() {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getOpenId(),loginUser.getCompanyId());
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getId(), loginUser.getCompanyId());
        SalesmanApplyCondition applyConditionInfo=new SalesmanApplyCondition();
        applyConditionInfo.setIsAbleApply(ableToBeAnSalesman.isJudgeResult());
        applyConditionInfo.setMsg(ableToBeAnSalesman.getMsg());
@@ -317,12 +311,6 @@
        return AjaxResult.buildSuccessInstance(applyConditionInfo);
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java
@@ -1,7 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxacodeUtil;
import com.matrix.core.pojo.AjaxResult;
@@ -72,7 +72,7 @@
    ShopActivitiesGroupInfoDao shopActivitiesGroupInfoDao;
    @Autowired
    BizUserDao bizUserDao;
    SysVipInfoDao sysVipInfoDao;
    @Autowired
@@ -94,8 +94,8 @@
    @RequestMapping(value = "/getProductShareQrcode")
    public @ResponseBody
    AjaxResult getwxacode1(@RequestBody QrcodeVo qrcodeVo) throws Exception {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        loginUser = bizUserDao.selectById(loginUser.getUserId());
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        loginUser = sysVipInfoDao.selectById(loginUser.getId());
        //活动类型
        ShopActivities activities=null;
        //是否为拼团分享
@@ -166,7 +166,7 @@
     * @param qrcodeVo
     * @return
     */
    private QrcodeImgParam getSeckillQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception {
    private QrcodeImgParam getSeckillQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception {
        ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(qrcodeVo.getSkillId());
@@ -205,7 +205,7 @@
     * @param qrcodeVo
     * @return
     */
    private QrcodeImgParam getGroupQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception {
    private QrcodeImgParam getGroupQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception {
        WxActivitiesGroupBuyVO groupBuyVO = shopActivitiesGroupInfoDao.selectGroupInfoWithPriceByActId(qrcodeVo.getActId());
@@ -238,7 +238,7 @@
    }
    @NotNull
    private QrcodeImgParam getQrcodeImgParam(BizUser loginUser, QrcodeVo qrcodeVo) throws Exception {
    private QrcodeImgParam getQrcodeImgParam(SysVipInfo loginUser, QrcodeVo qrcodeVo) throws Exception {
        ShopProduct shopProduct = shopProductDao.selectById(qrcodeVo.getProductId());
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.common.interceptor.HostInterceptor;
@@ -122,10 +122,10 @@
     */
    @GetMapping(value = "/findOwnerGroupBuyInfo/{actId}")
    public AjaxResult findOwnerGroupBuyInfo(@PathVariable("actId") Long actId) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        // 1、判断该用户在该活动中有没有正在拼团 若有,则返回正在拼团的用户列表,若没有则返回gruoping=1且返回正在拼团的拼团列表, 若加入了团未完成付款,则需要再做设置
        ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, bizUser.getOpenId());
        ShopActivitiesGroupJoin isExsit = shopActivitiesGroupJoinDao.selectIsExistGroupInfoByUserId(actId, sysVipInfo.getOpenId());
        AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null);
        if (isExsit == null) {
            ajaxResult.putInMap("grouping", 2);
@@ -134,7 +134,7 @@
        } else {
            ajaxResult.putInMap("grouping", 1);
            ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfoWithNoPay(isExsit.getId());
            ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(bizUser.getOpenId(), groupJoin.getId());
            ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(sysVipInfo.getOpenId(), groupJoin.getId());
            ShopActivitiesGroupPrice price = shopActivitiesGroupPriceDao.selectById(groupJoin.getGpId());
            int theLast = price.getGpCount() - groupJoin.getJoinUserList().size();
            groupJoin.setTheLast(theLast);
@@ -154,12 +154,12 @@
     */
    @GetMapping(value = "/findGroupJoinInfo/{gjId}")
    public AjaxResult findGroupJoinInfo(@PathVariable Long gjId) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopActivitiesGroupJoin groupJoin = shopActivitiesGroupJoinDao.selectOwnerGroupJoinInfo(gjId);
        int isExist = 2;
        for (ShopActivitiesGroupJoinUser joinUser : groupJoin.getJoinUserList()) {
            if (bizUser.getOpenId().equals(joinUser.getUserId())) {
            if (sysVipInfo.getOpenId().equals(joinUser.getUserId())) {
                isExist = 1;
            }
        }
@@ -198,7 +198,7 @@
    @PostMapping(value = "/calPrice")
    public AjaxResult calPrice(@RequestBody CreateGroupBuyDTO createGroupBuyDTO) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId());
        // 判断参数中gjId是否为空,若为空则为团长开团。再判断团长价是否为空,如果不为空则拥有团长价
        if (createGroupBuyDTO.getGjId() == null) {
@@ -210,7 +210,7 @@
        } else {
            createGroupBuyDTO.setPrice(groupPrice.getGpPrice());
        }
        BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),bizUser.getCompanyId());
        BigDecimal postage = wxShopOrderService.calculationPostage(createGroupBuyDTO.getPrice(),sysVipInfo.getCompanyId());
        BigDecimal payPrice = createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())).add(postage);
        AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null);
        ajaxResult.putInMap("billPrice", createGroupBuyDTO.getPrice().multiply(BigDecimal.valueOf(createGroupBuyDTO.getCount())));
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java
@@ -1,12 +1,12 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
import com.matrix.core.tools.LogUtil;
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.shopXcx.api.vo.SalonVO;
import com.matrix.system.shopXcx.bean.ShopActivities;
@@ -24,7 +24,6 @@
import org.springframework.web.bind.annotation.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;
@@ -82,7 +81,7 @@
     */
    @GetMapping(value = "/findSalonInfoById/{id}")
    public AjaxResult findSalonInfoById(@PathVariable("id") Long id) {
        BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopActivities shopActivities = shopActivitiesDao.selectSalonActivityById(id);
        ShopActivitiesSalonRecord salonRecord = shopActivitiesSalonRecordDao.selectSalonRecordByUserIdAndActId(user.getOpenId(), id);
        AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("获取成功");
@@ -105,7 +104,7 @@
    @PostMapping(value = "/joinSalonActivity")
    @Transactional
    public AjaxResult joinSalonActivity(@RequestBody CreateSalonDTO salonDTO) {
        BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopActivities shopActivities = shopActivitiesDao.selectById(salonDTO.getActId());
        if (shopActivities == null) {
@@ -128,7 +127,7 @@
        ShopActivitiesSalonRecord salonRecord = new ShopActivitiesSalonRecord();
        salonRecord.setActId(salonDTO.getActId());
        salonRecord.setUserId(user.getOpenId());
        salonRecord.setUserId(user.getId());
        salonRecord.setCreateBy(user.getNickName());
        salonRecord.setUpdateBy(user.getNickName());
        salonRecord.setStatus(ShopActivitiesSalonRecord.JOIN_STATUS_ING);
@@ -173,7 +172,7 @@
     */
    @RequestMapping(value = "/findSalonListByUser")
    public AjaxResult findSalonListByUser(@RequestBody SalonVO salonVO) {
        BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        salonVO.setUserId(user.getOpenId());
        List<ShopActivities> list = shopActivitiesDao.selectSalonActivityByUser(salonVO);
        return AjaxResult.buildSuccessInstance(list);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.shopXcx.api.service.WXShopOrderService;
@@ -111,13 +111,13 @@
     */
    @PostMapping(value = "/calSecKillPrice")
    public AjaxResult calSecKillPrice(@RequestBody SecKillVO secKillVO) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillVO.getId());
        if (seckillInfo == null) {
            return AjaxResult.buildFailInstance("参数有误");
        }
        BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),bizUser.getCompanyId());
        BigDecimal postage = wxShopOrderService.calculationPostage(seckillInfo.getSiPrice(),sysVipInfo.getCompanyId());
        BigDecimal payPrice = seckillInfo.getSiPrice().multiply(BigDecimal.valueOf(secKillVO.getCount())).add(postage);
        AjaxResult ajaxResult = new AjaxResult(AjaxResult.STATUS_SUCCESS, null);
        ajaxResult.putInMap("totalPrice", payPrice);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.StringUtils;
@@ -111,7 +111,7 @@
            //查询产品适配的优惠券
            result.putInMap("couponList", shopCouponService.getCouponListByProductId(id));
            //查询产品是否被用户收藏
            result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, redisUserLoginUtils.getLoginUser(BizUser.class).getOpenId())));
            result.putInMap("checkCollect", CollectionUtils.isNotEmpty(collectionDao.selectByUserIdAndProid(id, redisUserLoginUtils.getLoginUser(SysVipInfo.class).getOpenId())));
        } else {
            result.putInMap("checkCollect", false);
        }
@@ -209,13 +209,13 @@
     * @param shopProduct
     */
    private void saveSearchHistroy(@RequestBody ShopProduct shopProduct) {
        BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopSearchRecord searchBean = new ShopSearchRecord();
        if (StringUtils.isNotBlank(shopProduct.getTitle())) {
            searchBean.setSearchType(AppConstance.SEARCH_TYPE);
            searchBean.setSearchContent(shopProduct.getTitle());
        }
        searchBean.setUserId(bigUser.getOpenId());
        searchBean.setUserId(bigUser.getId());
        searchBean.setSearchPriceStart(shopProduct.getStartPrice());
        searchBean.setSearchPriceEnd(shopProduct.getEndPrice());
        searchBean.setSearchDel(AppConstance.DATA_USEABLE);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java
@@ -2,7 +2,7 @@
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.system.score.dao.ScoreUseRecordDao;
@@ -44,9 +44,9 @@
            @ApiResponse(code = 200, message = "ok", response = ScoreUseRecordVo.class)
    })
    AjaxResult getFlowList(@RequestBody @Validated ScoreFlowDto scoreFlowDto) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        Page<ScoreUseRecordVo> page=new Page<>(scoreFlowDto.getPageNum(),scoreFlowDto.getPageSize());
        scoreFlowDto.setUserId(loginUser.getOpenId());
        scoreFlowDto.setVipId(loginUser.getId());
        IPage<ScoreUseRecordVo> shopScoreRecord = scoreUseRecordDao.selectFlowList(page,  scoreFlowDto);
        AjaxResult result=AjaxResult.buildSuccessInstance(shopScoreRecord.getRecords());
        return result;
@@ -58,8 +58,8 @@
            @ApiResponse(code = 200, message = "ok", response = AjaxResult.class)
    })
    AjaxResult getUserScore() {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(loginUser.getOpenId(),null));
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        AjaxResult result=AjaxResult.buildSuccessInstance(scoreVipDetailDao.selectUserTotalScore(loginUser.getId()));
        return result;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.constance.SystemErrorCode;
import com.matrix.core.constance.SystemMessageCode;
@@ -71,9 +71,8 @@
    @PostMapping("/findShoppingCart")
    @ResponseBody
    public AjaxResult getShoppingCartByUserId(@RequestBody ShopShoppingCart shoppingCart) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        String userId = loginUser.getOpenId();
        List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),userId);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        List<ShopShoppingCart> list = shoppingCartDao.selectByCartUserId(shoppingCart.getShopId(),loginUser.getId());
        List<ShopCartVo> shopCartVoList = shoppingCartService.buildShopCart(list);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, shopCartVoList, shopCartVoList.size());
        ShopCartBillVo shopCartBill = shoppingCartService.buildShopCartBillVo(shopCartVoList);
@@ -105,8 +104,8 @@
    public
    @ResponseBody
    AjaxResult getUserCartCount(@PathVariable("shopId") Long shopId) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getOpenId());
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        Integer userCartCount = shoppingCartDao.selectUserCartCount(shopId, loginUser.getId());
        if (userCartCount == null) {
            userCartCount = 0;
        }
@@ -131,10 +130,10 @@
        shoppingCart.setCartProductId(sku.getpId());
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        shoppingCart.setCreateBy(loginUser.getOpenId());
        shoppingCart.setUpdateBy(loginUser.getOpenId());
        shoppingCart.setCartUserId(loginUser.getOpenId());
        shoppingCart.setCartUserId(loginUser.getId());
        shoppingCart.setCompanyId(HostInterceptor.getCompanyId());
        ShopShoppingCart shoppCartLimt = shoppingCartDao.selectBuyLimit(shoppingCart.getCartProductId(),
                shoppingCart.getCartSkuId());
@@ -161,7 +160,7 @@
        ShopShoppingCart shopShoppingCart = new ShopShoppingCart();
        shopShoppingCart.setCartProductId(cartProductId);
        shopShoppingCart.setCartSkuId(cartSkuId);
        shopShoppingCart.setCartUserId(loginUser.getOpenId());
        shopShoppingCart.setCartUserId(loginUser.getId());
        shopShoppingCart.setShopId(shoppingCart.getShopId());
        List<ShopShoppingCart> shopShoppingCarts = shoppingCartDao.selectByModel(shopShoppingCart);
        int i = 0;
@@ -194,7 +193,7 @@
            return new AjaxResult(AjaxResult.STATUS_FAIL, "保存失败");
        }
        int userCartCount = shoppingCartDao.selectUserCartCount(shoppingCart.getShopId(),
                loginUser.getOpenId());
                loginUser.getId());
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, "保存成功");
        result.putInMap("userCartCount", userCartCount);
        return result;
@@ -278,7 +277,7 @@
    @ResponseBody
    public AjaxResult updateCartAllSelected(@PathVariable("isSelected") Integer isSelected,
                                            @PathVariable("shopId") Long shopId) {
        BizUser user = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo user = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        shoppingCartDao.updateAllSelected(user.getOpenId(), shopId, isSelected);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, "修改成功");
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java
@@ -1,6 +1,5 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
@@ -48,12 +47,12 @@
    @RequestMapping(value = "/showSkinList")
    public @ResponseBody AjaxResult showSkinList(@RequestBody SkinCheckDTO skinCheckDTO) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        PaginationVO pageVo = new PaginationVO();
        pageVo.setLimit(skinCheckDTO.getLimit());
        pageVo.setOffset(skinCheckDTO.getOffset());
        SysSkinCheckRecord skinCheckRecord = new SysSkinCheckRecord();
        skinCheckRecord.setTelphone(bizUser.getPhoneNumber());
        skinCheckRecord.setTelphone(sysVipInfo.getPhone());
        List<SysSkinCheckRecord> dataList = sysSkinCheckRecordDao.selectInPage(skinCheckRecord, pageVo);
        AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList,
                sysSkinCheckRecordDao.selectTotalRecord(skinCheckRecord));
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java
@@ -1,8 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.service.BizUserService;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.HttpCurlUtil;
import com.matrix.component.wechat.externalInterface.weixinUtil.WeixinServiceUtil;
@@ -11,14 +10,18 @@
import com.matrix.core.tools.StringUtils;
import com.matrix.core.web.BaseAction;
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.common.interceptor.HostInterceptor;
import com.matrix.system.constance.Dictionary;
import com.matrix.system.fenxiao.constant.FenxiaoSettingConstant;
import com.matrix.system.fenxiao.dao.ShopSalesmanApplyDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanApply;
import com.matrix.system.fenxiao.service.ShopSalesmanApplyService;
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.shopXcx.api.WeChatApiTools;
import com.matrix.system.shopXcx.api.dto.XcxUserSaveUserInfoDto;
import net.sf.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
@@ -26,7 +29,6 @@
import org.springframework.web.bind.annotation.*;
import java.util.Collections;
import java.util.Date;
/**
 * @author jyy
@@ -38,7 +40,10 @@
public class WxUserAction extends BaseAction {
    @Autowired
    private BizUserService bizUserService;
    private SysVipInfoService sysVipInfoService;
    @Autowired
    private SysVipInfoDao sysVipInfoDao;
    @Autowired
    private ShopSalesmanApplyService shopSalesmanApplyService;
@@ -92,32 +97,35 @@
            String sessionKey = json.getString("session_key");
            LogUtil.debug("openId={},sessionKey={}", openId, sessionKey);
            // 查询用户是否存在
            BizUser bizUser = null;
            SysVipInfo sysVipInfo = null;
            synchronized (this) {
                bizUser = bizUserService.findByOpenId(openId);
                if (bizUser == null) {
                sysVipInfo = sysVipInfoService.findByOpenId(openId);
                if (sysVipInfo == null) {
                    // 新增用户
                    bizUser = new BizUser();
                    bizUser.setSessionKey(sessionKey);
                    bizUser.setIsSales(BizUser.NOT_SALES);
                    bizUser.setOpenId(openId);
                    bizUser.setLastLoginTime(new Date());
                    bizUser.setUserType(AppConstance.USER_TYPE_CUSTOMER);
                    bizUser.setCompanyId(HostInterceptor.getCompanyId());
                    bizUserService.add(bizUser);
                    sysVipInfo = new SysVipInfo();
                    sysVipInfo.setIsSales(SysVipInfo.NOT_SALES);
                    sysVipInfo.setOpenId(openId);
                    sysVipInfo.setSessionKey(sessionKey);
                    sysVipInfo.setCompanyId(HostInterceptor.getCompanyId());
                    sysVipInfo.setArrivalWay("微商城");
                    sysVipInfo.setVipState(Dictionary.VIP_STATE_HY);
                    sysVipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD);
                    sysVipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP);
                    sysVipInfo.setVipNo(openId);
                    sysVipInfoService.add(sysVipInfo);
                } else {
                    bizUser.setSessionKey(sessionKey);
                    bizUser.setLastLoginTime(new Date());
                    // 更新用户sessionKey
                    bizUserService.modifyByModel(bizUser);
                    sysVipInfo.setSessionKey(sessionKey);
                    sysVipInfoDao.update(sysVipInfo);
                }
            }
            // 存放redis
            String token = redisUserLoginUtils.saveUserInfo(bizUser);
            sysVipInfo.setLevelCard(null);
            String token = redisUserLoginUtils.saveUserInfo(sysVipInfo);
            LogUtil.info("用户token={}", token);
            res.putInMap("token", token);
            res.putInMap("userInfo", bizUser);
            res.putInMap("userInfo", sysVipInfo);
            res.setStatus(AjaxResult.STATUS_SUCCESS);
        } else {
            res.setStatus(AjaxResult.STATUS_FAIL);
@@ -132,11 +140,11 @@
    @RequestMapping(value = "/findUserInfo")
    public @ResponseBody
    AjaxResult findUserInfo() {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        String openId = loginUser.getOpenId();
        BizUser bizUser = bizUserService.findByOpenId(openId);
        SysVipInfo sysVipInfo = sysVipInfoService.findByOpenId(openId);
        AjaxResult res = new AjaxResult();
        res.putInMap("userInfo", bizUser);
        res.putInMap("userInfo", sysVipInfo);
        res.setStatus(AjaxResult.STATUS_SUCCESS);
        return res;
    }
@@ -147,10 +155,10 @@
    @GetMapping(value = "/findUserInfo/{openId}")
    public @ResponseBody
    AjaxResult findUserInfo(@PathVariable String openId) {
        BizUser bizUser = bizUserService.findByOpenId(openId);
        BizUser bizUserQuery=new BizUser();
        bizUserQuery.setNickName(bizUser.getNickName());
        bizUserQuery.setAvatarUrl(bizUser.getAvatarUrl());
        SysVipInfo sysVipInfo = sysVipInfoService.findByOpenId(openId);
        SysVipInfo bizUserQuery=new SysVipInfo();
        bizUserQuery.setNickName(sysVipInfo.getNickName());
        bizUserQuery.setAvatarUrl(sysVipInfo.getAvatarUrl());
        bizUserQuery.setOpenId(openId);
        return AjaxResult.buildSuccessInstance(bizUserQuery);
    }
@@ -159,39 +167,42 @@
    /**
     * 接收用户信息
     */
    @RequestMapping(value = "/saveUserInfo")
    @PostMapping(value = "/saveUserInfo")
    public @ResponseBody
    AjaxResult saveUserInfo(@RequestBody BizUser bizUser) {
    AjaxResult saveUserInfo(@RequestBody XcxUserSaveUserInfoDto xcxUserSaveUserInfoDto) {
        BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        bizUser.setUserId(loginUser.getUserId());
        // TODO 赋值操作
        int i = bizUserService.saveUserInfo(bizUser);
        SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo sysVipInfo=new SysVipInfo();
        sysVipInfo.setId(loginUser.getId());
        BeanUtil.copyProperties(xcxUserSaveUserInfoDto,sysVipInfo);
        sysVipInfo.setPhone(xcxUserSaveUserInfoDto.getPhoneNumber());
        checkNeedToBeSalesman(bizUser, loginUser);
        int i = sysVipInfoDao.update(sysVipInfo);
        checkNeedToBeSalesman(sysVipInfo, loginUser);
        if (i == 0) {
            return new AjaxResult(AjaxResult.STATUS_FAIL, "更新失败");
        }
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(bizUser));
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, Collections.singletonList(sysVipInfo));
    }
    void checkNeedToBeSalesman(BizUser bizUser, BizUser loginUser) {
    void checkNeedToBeSalesman(SysVipInfo sysVipInfo, SysVipInfo loginUser) {
        //查询是否需要自动成为分销员
        if ((loginUser.getIsSales() == null || loginUser.getIsSales() == 2)
                && StringUtils.isNotBlank(bizUser.getNickName())) {//目前还不是分销员
                && StringUtils.isNotBlank(sysVipInfo.getNickName())) {//目前还不是分销员
            BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId());
            if (fxSwith.getParamValue().equals("1")) {//开启分销
                BusParameterSettings applyWay = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_WAY, loginUser.getCompanyId());
                if (applyWay.getParamValue().equals(FenxiaoSettingConstant.FX_APPLY_WAY_AUTO)) {//自动成为分销员
                    QueryWrapper<ShopSalesmanApply> queryWrapper = new QueryWrapper<>();
                    queryWrapper.eq("user_id", loginUser.getOpenId());
                    queryWrapper.eq("user_id", loginUser.getId());
                    queryWrapper.eq("apply_status", ShopSalesmanApply.APPLY_STATUS_DSH);
                    ShopSalesmanApply shopSalesmanApply = salesmanApplyDao.selectOne(queryWrapper);
                    if (shopSalesmanApply == null) {//没有待审核记录
                        try {
                            shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getOpenId(), null, null, 2);
                            shopSalesmanApplyService.applyToBeAnSalesman(loginUser.getId(), null, null, 2);
                        }catch (Exception e){
                            LogUtil.debug(e.getMessage());
                        }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java
@@ -1,7 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.shopXcx.dao.ShopSearchRecordDao;
@@ -39,7 +39,7 @@
    @RequestMapping(value = "/getSearchRecordList")
    @ResponseBody
    public AjaxResult getSearchRecordList(){
        BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        if(bigUser == null){
            return new AjaxResult(AjaxResult.STATUS_FAIL,"用户未授权");
        }
@@ -54,7 +54,7 @@
    @RequestMapping(value = "/deleteSearchRecord")
    @ResponseBody
    public AjaxResult deleteSearchRecord(){
        BizUser bigUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo bigUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        shopSearchRecordDao.deleteByUserId(bigUser.getOpenId());
        return new AjaxResult(AjaxResult.STATUS_SUCCESS,"删除成功");
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java
@@ -1,7 +1,7 @@
package com.matrix.system.shopXcx.api.action;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
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;
@@ -75,7 +75,7 @@
    SysUsersDao staffInfoDao;
    @Autowired
    BizUserDao bizUserDao;
    SysVipInfoDao sysVipInfoDao;
    @Autowired
    RabiitMqTemplate rabiitMqTemplate;
@@ -260,8 +260,8 @@
    @RequestMapping(value = "/createServiceOrder")
    public @ResponseBody
    AjaxResult createServiceOrder(@RequestBody Onlinebooking onlinebooking) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo vipInfo = vipInfoDao.selectByPhone(bizUser.getPhoneNumber());
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo vipInfo = vipInfoDao.selectByPhone(sysVipInfo.getPhone());
        SysProjUse sysProjUse = projUseDao.selectById(Long.parseLong(onlinebooking.getProductId() + ""));
        Date yyTime = DateUtil.stringToDate(onlinebooking.getTimeStr(), DateUtil.DATE_FORMAT_MM);
        SysProjServices sysProjServices = new SysProjServices();
@@ -347,8 +347,8 @@
    @PostMapping(value = "/getServiceOrderList")
    @ResponseBody
    public AjaxResult findServiceOrderList(@RequestBody @Validated ErpServiceOrderListDto orderListDto) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo vipInfo= vipInfoDao.selectByPhone(bizUser.getPhoneNumber());
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        SysVipInfo vipInfo= vipInfoDao.selectByPhone(sysVipInfo.getPhone());
        orderListDto.setVipId(vipInfo.getId());
        List<ErpServiceOrderListVo> apiServiceOrderListInPage = projServicesDao.findWxServiceOrderList(orderListDto);
        return AjaxResult.buildSuccessInstance(apiServiceOrderListInPage,"查询成功");
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java
@@ -20,7 +20,7 @@
    private Integer  revenueType;
    @ApiModelProperty(hidden = true)
    private String  userId;
    private Long  userId;
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java
@@ -20,7 +20,7 @@
    private Integer  orderStatus;
    @ApiModelProperty(hidden = true)
    private String  userId;
    private Long  userId;
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java
@@ -30,8 +30,6 @@
    @ApiModelProperty(value = "收支类型 不传全部,1,收入,2支出", example = "1")
    private Integer  revenueType;
    @ApiModelProperty(hidden = true)
    private String  userId;
    @ApiModelProperty(value = "会员id", example = "1")
    private Long  vipId;
zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java
New file
@@ -0,0 +1,46 @@
package com.matrix.system.shopXcx.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "XcxUserSaveUserInfoDto", description = "小程序用户授权信息保存接收类")
public class XcxUserSaveUserInfoDto {
    @ApiModelProperty(value = "手机号码" )
    private String phoneNumber;
    @ApiModelProperty(value = "昵称" )
    private String nickName;
    @ApiModelProperty(value = "头像" )
    private String avatarUrl;
    @ApiModelProperty(value = "性别" )
    private Integer gender;
    /**
     * 用户所在国家
     */
    private String  country;
    /**
     * 省
     */
    private String province;
    /**
     * 市
     */
    private String city;
    /**
     * 区
     */
    private String area;
}
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java
@@ -13,12 +13,6 @@
     */
    Boolean refundToUser(String id, ShopRefundRecord shopRefundRecord);
    /**
     * 退款成功后发送微信提醒
     * @param shopRefundRecord
     * @return
     */
    int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord);
    void updateGroupBuyStatus(Long orderId);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java
@@ -3,7 +3,7 @@
import cn.hutool.core.collection.CollUtil;
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.rabbitmq.RabiitMqTemplate;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxUtils;
@@ -18,6 +18,7 @@
import com.matrix.system.common.dao.CustomerDataDictionaryDao;
import com.matrix.system.common.interceptor.HostInterceptor;
import com.matrix.system.hive.dao.ShoppingGoodsDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.score.dao.ScoreVipDetailDao;
import com.matrix.system.shopXcx.api.action.PayThreadPool;
import com.matrix.system.shopXcx.api.pojo.OrderCouponGroup;
@@ -104,6 +105,9 @@
    @Autowired
    private ScoreVipDetailDao scoreVipDetailDao;
    @Autowired
    private SysVipInfoDao sysVipInfoDao;
    @Override
    public BigDecimal calculationPostage(BigDecimal payPrice, Long companyId) {
        BigDecimal postage = BigDecimal.ZERO;
@@ -128,7 +132,7 @@
    @Transactional(rollbackFor = Exception.class)
    @Override
    public AjaxResult createShopOrder(ShopOrderDto shopOrderDto) throws Exception {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        //校验收货地址
@@ -143,14 +147,14 @@
        if(discountExplain.getScorePay()!=null){
            //校验用户积分是否够用
            int score=scoreVipDetailDao.selectUserTotalScore(bizUser.getOpenId(),null);
            int score=scoreVipDetailDao.selectUserTotalScore(sysVipInfo.getId());
            if(score<discountExplain.getScorePay()){
                return  AjaxResult.buildFailInstance("积分不足");
            }
        }
        ShopOrder shopOrder = new ShopOrder();
        shopOrder.setCompanyId(bizUser.getCompanyId());
        shopOrder.setCompanyId(sysVipInfo.getCompanyId());
        shopOrder.setStoreId(Integer.parseInt(shopOrderDto.getShopId().toString()));
        //默认设置为产品类型
        shopOrder.setOrderType(ShopOrder.ORDER_TYPE_GOODS);
@@ -189,11 +193,11 @@
        }
        //校验商品是否限购
        wxShopOrderUtil.verifyProductLimitInfo(details, bizUser.getOpenId());
        wxShopOrderUtil.verifyProductLimitInfo(details, sysVipInfo.getOpenId());
        //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动]
        wxShopOrderUtil.updateProductAndSkuInfo(details);
        //用户openId
        shopOrder.setUserId(bizUser.getOpenId());
        shopOrder.setUserId(sysVipInfo.getId());
        shopOrder.setCreateBy("微信小程序生成");
        shopOrder.setUpdateBy("微信小程序生成");
        shopOrder.setCommodityPrice(discountExplain.getBillPrice());
@@ -277,7 +281,7 @@
        //支付总积分
        Integer scoreCount=0;
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        //计算购物车中物品的优惠信息
        List<OrderItemDto> orderItemDtos = shopOrderDto.getOrderItemList()
@@ -325,7 +329,7 @@
        //满足店铺活动的订单不能使用优惠券
        if (conditionsGroupCount > 0) {
            //计算可用优惠券
            usefulCoupon = wxShopCouponService.getCartVoCouponList(bizUser.getCompanyId(), orderItemDtos);
            usefulCoupon = wxShopCouponService.getCartVoCouponList(sysVipInfo.getCompanyId(), orderItemDtos);
            //获取用户使用的优惠券
            if (shopOrderDto.getCouponReceiveId() == null) {
                //如果用户没有选择优惠券则默认选优惠金额最高的
@@ -397,7 +401,7 @@
        if(shopOrder.getScorePay()!=null){
            //校验用户积分是否够用
            int score=scoreVipDetailDao.selectUserTotalScore(shopOrder.getUserId(),null);
            int score=scoreVipDetailDao.selectUserTotalScore(shopOrder.getUserId());
            if(score<shopOrder.getScorePay()){
                return  AjaxResult.buildFailInstance("积分不足");
            }
@@ -422,13 +426,15 @@
        BigDecimal money = new BigDecimal(shopOrder.getOrderMoney().toString());
        BrandWCPayRequestData payData;
        String productNames = wxShopOrderUtil.getProductNames(shopOrder.getUserId(), shopOrder.getId());
        SysVipInfo vipInfo=sysVipInfoDao.selectById(shopOrder.getUserId());
        LogUtil.debug(String.valueOf(isDebug));
        if (isDebug) {
            payData = weixinServiceUtil.createOrder("[测试]" + productNames, shopOrder.getOrderNo(),
                    1, shopOrder.getUserId(), String.valueOf(shopOrder.getId()));
                    1, vipInfo.getOpenId(), String.valueOf(shopOrder.getId()));
        } else {
            payData = weixinServiceUtil.createOrder(productNames, shopOrder.getOrderNo(),
                    unit.multiply(money).intValue(), shopOrder.getUserId(), String.valueOf(shopOrder.getId()));
                    unit.multiply(money).intValue(),vipInfo.getOpenId(), String.valueOf(shopOrder.getId()));
        }
        ShopOrder updateParam = new ShopOrder();
        updateParam.setId(shopOrder.getId());
@@ -445,12 +451,12 @@
     */
    @Override
    public AjaxResult getMyOrderInfo(OrderInfoQueryPOJO orderInfoQueryPOJO) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        orderInfoQueryPOJO.setSort("update_time");
        if (orderInfoQueryPOJO.getOffset() >= 1) {
            orderInfoQueryPOJO.setOffset((orderInfoQueryPOJO.getOffset() - 1) * orderInfoQueryPOJO.getLimit());
        }
        List<ShopOrder> result = shopOrderDao.selectMyOrderByStatus(bizUser.getOpenId(), orderInfoQueryPOJO);
        List<ShopOrder> result = shopOrderDao.selectMyOrderByStatus(sysVipInfo.getId(), orderInfoQueryPOJO);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, result);
    }
@@ -462,8 +468,8 @@
     */
    @Override
    public AjaxResult getOrderInfoById(Integer orderId) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(bizUser.getOpenId(), orderId);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopOrder shopOrder = shopOrderDao.selectOrderInfoById(sysVipInfo.getId(), orderId);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, Arrays.asList(shopOrder));
    }
@@ -484,8 +490,8 @@
        }
        if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) > 0) {
            ShopCouponRecord shopCouponRecord = new ShopCouponRecord();
            BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
            shopCouponRecord.setUserId(bizUser.getOpenId());
            SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
            shopCouponRecord.setUserId(sysVipInfo.getId());
            shopCouponRecord.setOrderId(orderId);
            List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord);
            if (CollectionUtils.isNotEmpty(recordList)) {
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java
@@ -2,7 +2,6 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.matrix.biz.bean.BizUser;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxUtils;
import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData;
@@ -90,7 +89,7 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public AjaxResult createGroupBuy(CreateGroupBuyDTO createGroupBuyDTO) throws Exception {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopActivitiesGroupPrice groupPrice = shopActivitiesGroupPriceDao.selectById(createGroupBuyDTO.getGpId());
        ShopActivitiesGroupInfo groupInfo = shopActivitiesGroupInfoDao.selectGroupInfoByActId(groupPrice.getActId());
@@ -102,7 +101,7 @@
        // 判断最大开团数量
        if (groupInfo.getGiHeadDiscount() != null && groupInfo.getGiHeadDiscount() != 0) {
            int createCnt = shopActivitiesGroupJoinDao.selectCreateGroupBuyCount(shopActivities.getId(), bizUser.getOpenId());
            int createCnt = shopActivitiesGroupJoinDao.selectCreateGroupBuyCount(shopActivities.getId(), sysVipInfo.getOpenId());
            if (createCnt > groupInfo.getGiHeadDiscount()) {
                return AjaxResult.buildFailInstance("达到最大开团数量");
            }
@@ -113,14 +112,14 @@
                return AjaxResult.buildFailInstance("达到最大限购数量");
            }
            int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), bizUser.getOpenId());
            int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), sysVipInfo.getOpenId());
            if (count + createGroupBuyDTO.getCount() > groupInfo.getGiLimitBuy()) {
                return AjaxResult.buildFailInstance("达到最大限购数量");
            }
        }
        // 判断该用户在这个活动中是否存在拼团,并判断该拼团订单是否已付款
        ShopActivitiesGroupJoin existGroupJoin = shopActivitiesGroupJoinDao.selectExistGroupingJoinByUser(groupPrice.getActId(), bizUser.getOpenId());
        ShopActivitiesGroupJoin existGroupJoin = shopActivitiesGroupJoinDao.selectExistGroupingJoinByUser(groupPrice.getActId(), sysVipInfo.getOpenId());
        if (existGroupJoin != null) {
            if (existGroupJoin.getGjStatus() == ShopActivitiesGroupJoin.ACTIVITIES_JOIN_WAIT_PAY) {
                return new AjaxResult(AjaxResult.STATUS_FAIL, "您该活动有个订单未付款");
@@ -128,7 +127,7 @@
            return new AjaxResult(AjaxResult.STATUS_FAIL, "该活动已存在拼团");
        }
        boolean isOld = isOldUser(bizUser.getPhoneNumber());
        boolean isOld = isOldUser(sysVipInfo.getPhone());
        // 老用户和老带新的开团都必须是老用户
        if (ShopActivitiesGroupInfo.GROUP_TYPE_ALL_OLD == groupInfo.getGiType() || ShopActivitiesGroupInfo.GROUP_TYPE_OLD_AND_NEW == groupInfo.getGiType()) {
            if (!isOld) {
@@ -145,7 +144,7 @@
        createGroupBuyDTO.setPrice(groupPrice.getGpPrice());
        createGroupBuyDTO.setGoodsId(groupInfo.getGoodsId().intValue());
        createGroupBuyDTO.setOpenId(bizUser.getOpenId());
        createGroupBuyDTO.setUserId(sysVipInfo.getId());
        ShopOrder shopOrder = createOrderByGroupBuy(createGroupBuyDTO);
        ShopActivitiesGroupJoin groupJoin = new ShopActivitiesGroupJoin();
@@ -157,19 +156,19 @@
        groupJoin.setGjEndTime(gjEndTime.getTime());
        groupJoin.setGiId(groupInfo.getId());
        groupJoin.setGjStatus(ShopActivitiesGroupJoin.ACTIVITIES_JOIN_WAIT_PAY);
        groupJoin.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName());
        groupJoin.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName());
        groupJoin.setGjHeadId(bizUser.getOpenId());
        groupJoin.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName());
        groupJoin.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName());
        groupJoin.setGjHeadId(sysVipInfo.getId());
        groupJoin.setCompanyId(shopActivities.getCompanyId());
        shopActivitiesGroupJoinDao.insert(groupJoin);
        ShopActivitiesGroupJoinUser joinUser = new ShopActivitiesGroupJoinUser();
        joinUser.setGjId(groupJoin.getId());
        joinUser.setGiId(groupInfo.getId());
        joinUser.setUserId(bizUser.getOpenId());
        joinUser.setUserId(sysVipInfo.getId());
        joinUser.setIsHead(ShopActivitiesGroupJoinUser.USER_IS_HEAD_Y);
        joinUser.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName());
        joinUser.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName());
        joinUser.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName());
        joinUser.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName());
        joinUser.setIsHasPay(ShopActivitiesGroupJoinUser.IS_HAS_PAY_N);
        joinUser.setIsHasCancel(ShopActivitiesGroupJoinUser.IS_HAS_CANCEL_N);
        Calendar payEndTime = Calendar.getInstance();
@@ -192,7 +191,7 @@
    @Transactional(rollbackFor = Exception.class)
    @Override
    public AjaxResult joinGroupBuy(CreateGroupBuyDTO createGroupBuyDTO) throws Exception {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        // TODO 需判断拼团结束时间以及当前拼团是否已满员
@@ -201,7 +200,7 @@
            return AjaxResult.buildFailInstance("该拼团不存在");
        }
        if (groupJoin.getGjHeadId().equals(bizUser.getOpenId())) {
        if (groupJoin.getGjHeadId().equals(sysVipInfo.getOpenId())) {
            return AjaxResult.buildFailInstance("您是拼团团长,无法加入拼团");
        }
@@ -209,7 +208,7 @@
            return AjaxResult.buildFailInstance("该拼团时间已结束");
        }
        ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(bizUser.getOpenId(), groupJoin.getId());
        ShopActivitiesGroupJoinUser groupJoinUser = shopActivitiesGroupJoinUserDao.selectGroupJoinUserByUserIdAndGjId(sysVipInfo.getOpenId(), groupJoin.getId());
        if (groupJoinUser != null) {
            return AjaxResult.buildFailInstance("您已加入了该拼团");
        }
@@ -227,7 +226,7 @@
                return AjaxResult.buildFailInstance("达到最大限购数量");
            }
            int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), bizUser.getOpenId());
            int count = shopActivitiesGroupJoinUserDao.selectCountHasBuy(groupInfo.getId(), sysVipInfo.getOpenId());
            if (count + createGroupBuyDTO.getCount() > groupInfo.getGiLimitBuy()) {
                return AjaxResult.buildFailInstance("达到最大限购数量");
            }
@@ -242,7 +241,7 @@
            return AjaxResult.buildFailInstance("该拼团已满员");
        }
        boolean isOld = isOldUser(bizUser.getPhoneNumber());
        boolean isOld = isOldUser(sysVipInfo.getPhone());
        // 老用户 -- 加入拼团的都必须是老用户
        if (ShopActivitiesGroupInfo.GROUP_TYPE_ALL_OLD == groupInfo.getGiType()) {
            if (!isOld) {
@@ -271,7 +270,7 @@
        createGroupBuyDTO.setPrice(groupPrice.getGpPrice());
        createGroupBuyDTO.setGoodsId(groupInfo.getGoodsId().intValue());
        createGroupBuyDTO.setOpenId(bizUser.getOpenId());
        createGroupBuyDTO.setUserId(sysVipInfo.getId());
        ShopOrder shopOrder = createOrderByGroupBuy(createGroupBuyDTO);
        ShopActivitiesGroupJoinUser joinUser = new ShopActivitiesGroupJoinUser();
@@ -280,12 +279,12 @@
        Calendar calendar = Calendar.getInstance();
        calendar.set(Calendar.MINUTE, Integer.parseInt(payTimeLimit));
        joinUser.setPayEndTime(calendar.getTime());
        joinUser.setUserId(bizUser.getOpenId());
        joinUser.setUserId(sysVipInfo.getId());
        joinUser.setGiId(groupInfo.getId());
        joinUser.setGjId(groupJoin.getId());
        joinUser.setIsHead(ShopActivitiesGroupJoinUser.USER_IS_HEAD_N);
        joinUser.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName());
        joinUser.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName());
        joinUser.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName());
        joinUser.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName());
        joinUser.setIsNewUser(isOld ? 2 : 1);
        joinUser.setIsHasCancel(ShopActivitiesGroupJoinUser.IS_HAS_CANCEL_N);
        joinUser.setCompanyId(groupJoin.getCompanyId());
@@ -317,7 +316,7 @@
        if (shopReceiveAddress == null) {
            throw new GlobleException("请选择正确的收获地址");
        }
        BizUser user=redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo user=redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopOrder shopOrder = new ShopOrder();
        shopOrder.setCompanyId(user.getCompanyId());
        shopOrder.setStoreId(Integer.parseInt(createGroupBuyDTO.getShopId().toString()));
@@ -360,7 +359,7 @@
        //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动]
        wxShopOrderUtil.updateProductAndSkuInfo(details);
        shopOrder.setUserId(createGroupBuyDTO.getOpenId());
        shopOrder.setUserId(createGroupBuyDTO.getUserId());
        shopOrder.setCreateBy("微信小程序生成");
        shopOrder.setUpdateBy("微信小程序生成");
        shopOrder.setCommodityPrice(createGroupBuyDTO.getPrice());
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java
@@ -2,7 +2,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.component.tools.WxUtils;
import com.matrix.component.wechat.externalInterface.protocol.paramProtocol.BrandWCPayRequestData;
@@ -61,7 +61,7 @@
    @Override
    public AjaxResult createSecKillOrder(CreateSecKillDTO secKillDTO) throws Exception {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopActivitiesSeckillInfo seckillInfo = shopActivitiesSeckillInfoDao.selectById(secKillDTO.getId());
        if (seckillInfo == null) {
            return AjaxResult.buildFailInstance("秒杀不存在");
@@ -86,7 +86,7 @@
                return AjaxResult.buildFailInstance("购买数量超过最大限购数量");
            }
            int count = shopActivitiesSeckillRecordDao.selectCountSecKill(seckillInfo.getId(), bizUser.getOpenId());
            int count = shopActivitiesSeckillRecordDao.selectCountSecKill(seckillInfo.getId(), sysVipInfo.getOpenId());
            if (secKillDTO.getCount() + count > seckillInfo.getSiLimitCnt()) {
                return AjaxResult.buildFailInstance("购买数量超过最大限购数量");
            }
@@ -94,15 +94,15 @@
        secKillDTO.setPrice(seckillInfo.getSiPrice());
        secKillDTO.setGoodsId(seckillInfo.getGoodsId().intValue());
        secKillDTO.setOpenId(bizUser.getOpenId());
        secKillDTO.setOpenId(sysVipInfo.getOpenId());
        ShopOrder shopOrder = createOrder(secKillDTO);
        ShopActivitiesSeckillRecord seckillRecord = new ShopActivitiesSeckillRecord();
        seckillRecord.setOrderId(shopOrder.getId().longValue());
        seckillRecord.setSiId(seckillInfo.getId());
        seckillRecord.setUserId(bizUser.getOpenId());
        seckillRecord.setCreateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName());
        seckillRecord.setUpdateBy(bizUser.getNickName() == null ? "游客" : bizUser.getNickName());
        seckillRecord.setUserId(sysVipInfo.getId());
        seckillRecord.setCreateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName());
        seckillRecord.setUpdateBy(sysVipInfo.getNickName() == null ? "游客" : sysVipInfo.getNickName());
        seckillRecord.setCompanyId(seckillInfo.getCompanyId());
        // 同步锁
@@ -126,7 +126,7 @@
    }
    private ShopOrder createOrder(CreateSecKillDTO secKillDTO) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        ShopReceiveAddress shopReceiveAddress = shopReceiveAddressDao.selectById(secKillDTO.getAddressId());
        if (shopReceiveAddress == null) {
            throw new GlobleException("请选择正确的收获地址");
@@ -173,12 +173,12 @@
        //TODO 更新库存和销量 更新库存和销量[考虑和erp库存联动]
        wxShopOrderUtil.updateProductAndSkuInfo(details);
        shopOrder.setUserId(secKillDTO.getOpenId());
        shopOrder.setUserId(secKillDTO.getId());
        shopOrder.setCreateBy("微信小程序生成");
        shopOrder.setUpdateBy("微信小程序生成");
        shopOrder.setCommodityPrice(secKillDTO.getPrice());
        shopOrder.setPurchaseQuantity(1);
        shopOrder.setCompanyId(bizUser.getCompanyId());
        shopOrder.setCompanyId(sysVipInfo.getCompanyId());
        //购买方式
        shopOrder.setShippingMethod(secKillDTO.getShippingMethod());
        //生成订单号
@@ -203,7 +203,7 @@
        shopOrder.setPayResult(ShopOrder.ORDER_WX_STATUS_WAIT_PAY);
        //如果没有提交购买方式或配送方式不是物流
        //获取邮费
        BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getPrice(),bizUser.getCompanyId());
        BigDecimal postPrice = wxShopOrderService.calculationPostage(secKillDTO.getPrice(),sysVipInfo.getCompanyId());
        shopOrder.setPostage(postPrice);
        BigDecimal payPrice = secKillDTO.getPrice().multiply(BigDecimal.valueOf(secKillDTO.getCount())).add(shopOrder.getPostage());
        shopOrder.setOrderMoney(payPrice);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java
@@ -1,6 +1,6 @@
package com.matrix.system.shopXcx.api.service.impl;
import com.matrix.biz.bean.BizUser;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.pojo.PaginationVO;
@@ -61,9 +61,9 @@
        List<CouponReceiveInfoVO> shopCoupons = new ArrayList<>();
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        //1.找到用户所有的优惠券
        List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(companyId, bizUser.getOpenId(), AppConstance.MY_COUPON_NOT_USE,
        List<CouponReceiveInfoVO> userAllCoupon = shopCouponRecordDao.selectMyCouponByStatus(companyId, sysVipInfo.getId(), AppConstance.MY_COUPON_NOT_USE,
                null);
        if (CollectionUtils.isNotEmpty(userAllCoupon)) {
            //根据优惠力度排序,优惠力度大的先参与计算
@@ -150,9 +150,9 @@
     */
    @Override
    public AjaxResult getUsableCoupon(PaginationVO pageVo) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId());
        List<ShopCoupon> list = shopCouponDao.selectUsableCoupon(newPeople, bizUser.getOpenId(), pageVo);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId());
        List<ShopCoupon> list = shopCouponDao.selectUsableCoupon(newPeople, sysVipInfo.getOpenId(), pageVo);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, list);
    }
@@ -166,7 +166,7 @@
    @Override
    public AjaxResult receiveCoupon(Integer couponId) {
        ShopCoupon shopCoupon = shopCouponDao.selectById(couponId);
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        // 如果没有找到该优惠券
        if (shopCoupon == null) {
@@ -178,7 +178,7 @@
            return new AjaxResult(AjaxResult.STATUS_FAIL, "优惠券已领完!");
        }
        boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId());
        boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId());
        // 如果改券是新人专属且当前用户不是新人
        if (AppConstance.COUPON_GET_LIMT_NEW.equals(shopCoupon.getGetLimit()) && !newPeople) {
@@ -186,7 +186,7 @@
        }
        ShopCouponRecord param = new ShopCouponRecord();
        param.setUserId(bizUser.getOpenId());
        param.setUserId(sysVipInfo.getId());
        param.setCId(couponId);
        List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(param);
        // 如果已经领取改优惠券
@@ -197,7 +197,7 @@
        insertRecord.setCreateBy(AppConstance.SYSTEM_USER);
        insertRecord.setUpdateBy(AppConstance.SYSTEM_USER);
        insertRecord.setCId(couponId);
        insertRecord.setUserId(bizUser.getOpenId());
        insertRecord.setUserId(sysVipInfo.getId());
        insertRecord.setIsUsing(2);
        int i = shopCouponRecordDao.insert(insertRecord);
        // 如果插入领取记录表失败
@@ -219,14 +219,14 @@
     */
    @Override
    public AjaxResult getMyCouponInfoByStatus(Long companyId, Integer status, PaginationVO pageVo) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        // 如果查询使用或未使用状态的优惠券列表
        if (AppConstance.MY_COUPON_USE.equals(status) || AppConstance.MY_COUPON_NOT_USE.equals(status)) {
            List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(companyId,bizUser.getOpenId(), status,
            List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyCouponByStatus(companyId,sysVipInfo.getId(), status,
                    pageVo);
            return new AjaxResult(AjaxResult.STATUS_SUCCESS, list);
        }
        List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(companyId,bizUser.getOpenId(), pageVo);
        List<CouponReceiveInfoVO> list = shopCouponRecordDao.selectMyPastCoupon(companyId,sysVipInfo.getId(), pageVo);
        return new AjaxResult(AjaxResult.STATUS_SUCCESS, list);
    }
@@ -256,8 +256,8 @@
                attrIds.addAll(ids);
            }
        }
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        List<ShopCoupon> list = shopCouponDao.selectUsableCouponByProductInfo(bizUser.getOpenId(), productId,
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        List<ShopCoupon> list = shopCouponDao.selectUsableCouponByProductInfo(sysVipInfo.getOpenId(), productId,
                attrIds);
        return list;
    }
@@ -304,9 +304,9 @@
     */
    @Override
    public AjaxResult getCouponListByTag(String tag, Long companyId) {
        BizUser bizUser = redisUserLoginUtils.getLoginUser(BizUser.class);
        boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(bizUser.getOpenId());
        List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, bizUser.getOpenId(), tag,companyId);
        SysVipInfo sysVipInfo = redisUserLoginUtils.getLoginUser(SysVipInfo.class);
        boolean newPeople = wxShopCouponUtil.verifyIsNewPeople(sysVipInfo.getId());
        List<ShopCoupon> couponList = shopCouponDao.selectCouponListByTag(newPeople, sysVipInfo.getOpenId(), tag,companyId);
        AjaxResult res = new AjaxResult(AjaxResult.STATUS_SUCCESS, couponList);
        res.putInMap("isNewPeople", newPeople);
        return res;
zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java
@@ -111,7 +111,7 @@
                //退款成功后同时把优惠券退回到用户的账号中
                if (shopOrder.getDiscountAmount() != null && shopOrder.getDiscountAmount().compareTo(BigDecimal.ZERO) >0) {
                    ShopCouponRecord shopCouponRecord = new ShopCouponRecord();
                    String userIds = shopRefundRecord.getUserId();
                    Long userIds = shopRefundRecord.getUserId();
                    shopCouponRecord.setUserId(userIds);
                    shopCouponRecord.setOrderId(shopOrder.getId());
                    List<ShopCouponRecord> recordList = shopCouponRecordDao.selectByModel(shopCouponRecord);
@@ -156,34 +156,7 @@
        return flag;
    }
    /**
     * 退款成功后发送微信提醒
     * @param shopRefundRecord
     * @return
     */
    @Override
    public int sendRefundInfoToUser(ShopRefundRecord shopRefundRecord) {
        ShopOrder order = shopOrderDao.selectById(shopRefundRecord.getOrderId());
        if (order == null) {
            throw new GlobleException("没有找到需要退款的订单信息");
        }
        List<String> msg = new ArrayList<>();
        //退款说明
        String refundExplain = "退款已经原路返回,具体到账时间可能会有1-3天延迟";
        msg.add(order.getOrderNo());
        msg.add(DateUtil.dateToString(shopRefundRecord.getRefundTime(),DateUtil.DATE_FORMAT_SS));
        msg.add(refundExplain);
        String formId = null;
        if(AppConstance.REFUND_GOODS.equals(shopRefundRecord.getRefundType()) && null != shopRefundRecord.getRefundTransactionNo()){
            formId = shopRefundRecord.getRefundTransactionNo();
        }else {
            formId = order.getWxOrderNo().split("=")[1];
        }
        String page = "pages/refunDetail/refunDetail?id=" + shopRefundRecord.getId() + "&&status=1" + "&&inform=1";
        int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(),
                page, WxTempLateMsgUtil.REFUND_SUCCESS, formId);
        return res;
    }
    @Override
    public void updateGroupBuyStatus(Long orderId) {
zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java
@@ -1,13 +1,11 @@
package com.matrix.system.shopXcx.api.tools;
import com.matrix.component.redis.RedisUserLoginUtils;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.shopXcx.api.service.WxShopMemberDayService;
import com.matrix.system.shopXcx.bean.ShopOrder;
import com.matrix.system.shopXcx.dao.ShopCouponRecordDao;
import com.matrix.system.shopXcx.dao.ShopOrderDao;
import com.matrix.system.shopXcx.dao.ShopSkuDao;
import com.matrix.system.shopXcx.api.service.WxShopMemberDayService;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -39,7 +37,7 @@
     * @param userId 用户ID
     * @return true = 新人
     */
    public boolean verifyIsNewPeople(String userId) {
    public boolean verifyIsNewPeople(Long userId) {
        ShopOrder orderParam = new ShopOrder();
        orderParam.setPayResult(ShopOrder.ORDER_WX_STATUS_PAY_SUCCESS);
        orderParam.setUserId(userId);
zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java
@@ -1,15 +1,14 @@
package com.matrix.system.shopXcx.api.tools;
import com.matrix.system.common.bean.CustomerDataDictionary;
import com.matrix.biz.service.BizUserService;
import com.matrix.component.tools.WxTempLateMsgUtil;
import com.matrix.core.exception.GlobleException;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.common.bean.CustomerDataDictionary;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.shopXcx.api.pojo.ShopOrderDto;
import com.matrix.system.shopXcx.api.pojo.OrderPostageInfoPOJO;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.system.shopXcx.api.pojo.OrderItemDto;
import com.matrix.system.shopXcx.api.pojo.OrderPostageInfoPOJO;
import com.matrix.system.shopXcx.api.pojo.ShopOrderDto;
import com.matrix.system.shopXcx.api.service.WxShopMemberDayService;
import com.matrix.system.shopXcx.bean.*;
import com.matrix.system.shopXcx.dao.*;
@@ -20,7 +19,10 @@
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * @author jyy
@@ -45,7 +47,7 @@
    @Autowired
    private WxShopMemberDayService wxShopMemberDayService;
    @Autowired
    private BizUserService bizUserService;
    private SysVipInfoService sysVipInfoService;
    private SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy年MM月dd日");
@@ -346,53 +348,13 @@
    }
    /**
     * 发货后给客户发送微信提醒
     * @param deliveryInfo
     * @return
     */
    public int deliverSuccessSendWxMsgToUser(ShopDeliveryInfo deliveryInfo) {
        ShopOrder order = shopOrderDao.selectById(deliveryInfo.getOrderId());
        if (order == null) {
            throw new GlobleException("没有找到需要发货的订单信息");
        }
        List<String> msg = new ArrayList<>();
        msg.add(order.getOrderNo());
        //设置商品名称
        msg.add(getProductNames(order.getUserId(), order.getId()));
        msg.add(deliveryInfo.getReceiveAddress());
        msg.add(deliveryInfo.getLogisticsCompany());
        msg.add(deliveryInfo.getWaybillNo());
        String formId = order.getWxOrderNo().split("=")[1];
        String page = "pages/logistics/logistics?inform=1&id=" + order.getId();
        int res = WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(),
                page, WxTempLateMsgUtil.ORDER_DELIVERY, formId);
        return res;
    }
    /**
     * 订单付款成功后给客户发送微信提醒
     * @param order
     * @return
     */
    public int paySuccessSendWxMsgToUser(ShopOrder order) {
        List<String> msg = new ArrayList<>();
        msg.add(order.getOrderNo());
        msg.add(new BigDecimal(order.getOrderMoney().toString()).toString() + "元");
        msg.add(dateFormat.format(order.getOrderTime()));
        msg.add(getProductNames(order.getUserId(), order.getId()));
        String formId = order.getWxOrderNo().split("=")[1];
        String page = "pages/orderDetails/orderDetails?inform=1&id=" + order.getId();
        return WxTempLateMsgUtil.sendWxTemplateMsg(msg, order.getUserId(), page, WxTempLateMsgUtil.ORDER_PAY_SUCCESS, formId);
    }
    /**
     * 根据用户ID和订单ID获取所购买商品名称
     * @param openId 用户openId
     * @param orderId 订单ID
     * @return 所含商品名称(多个以","隔开)
     */
    public String getProductNames(String openId, Integer orderId) {
        ShopOrder orderDetail = shopOrderDao.selectOrderInfoById(openId, orderId);
    public String getProductNames(Long userId, Integer orderId) {
        ShopOrder orderDetail = shopOrderDao.selectOrderInfoById(userId, orderId);
        List<ShopOrderDetails> details = orderDetail.getDetails();
        if (CollectionUtils.isEmpty(details)) {
            return "";
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java
@@ -81,7 +81,7 @@
    /**
     * 团长ID
     */
    private String  gjHeadId;
    private Long  gjHeadId;
    private String headName;
@@ -200,11 +200,11 @@
        this.gjStatus=gjStatus;
    }
    public String getGjHeadId() {
    public Long getGjHeadId() {
        return gjHeadId;
    }
    public void setGjHeadId(String gjHeadId) {
    public void setGjHeadId(Long gjHeadId) {
        this.gjHeadId = gjHeadId;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java
@@ -71,7 +71,7 @@
    /**
     * 用户Id
     */
    private String  userId;
    private Long  userId;
            
    
    /**
@@ -198,11 +198,11 @@
    }
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
    public void setUserId(Long userId) {
        this.userId = userId;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java
@@ -45,7 +45,7 @@
    /**
     * 用户主键
     */
    private String  userId;
    private Long  userId;
            
    
    /**
@@ -102,11 +102,11 @@
        this.actId=actId;
    }
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
    public void setUserId(Long userId) {
        this.userId = userId;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java
@@ -36,7 +36,7 @@
    /**
     * 用户主键
     */
    private String  userId;
    private Long  userId;
    private Long actId;
@@ -94,11 +94,11 @@
        this.orderId=orderId;
    }
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
    public void setUserId(Long userId) {
        this.userId = userId;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java
@@ -24,7 +24,7 @@
    /**
     * 用户ID
     */
    private String  userId;
    private Long  userId;
            
    
    /**
@@ -59,11 +59,11 @@
    }
       
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
       
       public void setUserId(String userId) {
       public void setUserId(Long userId) {
        this.userId=userId;
    }
       
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java
@@ -61,7 +61,7 @@
    /**
     * 用户ID
     */
    private String  userId;
    private Long  userId;
            
    
    /**
@@ -197,15 +197,13 @@
        this.orderId=orderId;
    }
       
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
       
       public void setUserId(String userId) {
    public void setUserId(Long userId) {
        this.userId=userId;
    }
    public String getOrderNo() {
        return orderNo;
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java
@@ -140,7 +140,7 @@
    /**
     * 用户ID
     */
    private String userId;
    private Long userId;
    /**
     * 支付积分
     */
@@ -367,11 +367,11 @@
        this.commodityPrice = commodityPrice;
    }
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
    public void setUserId(String userId) {
    public void setUserId(Long userId) {
        this.userId = userId;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java
@@ -40,7 +40,7 @@
    /**
     * 用户ID
     */
    private String  userId;
    private Long  userId;
            
    
    /**
@@ -301,11 +301,11 @@
    }
       
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
       
       public void setUserId(String userId) {
       public void setUserId(Long userId) {
        this.userId=userId;
    }
       
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java
@@ -22,7 +22,7 @@
    /**
     * 用户id
     */
    private String  userId;
    private Long  userId;
            
    
    /**
@@ -84,11 +84,11 @@
    }
       
    public String getUserId() {
    public Long getUserId() {
        return userId;
    }
       
       public void setUserId(String userId) {
       public void setUserId(Long userId) {
        this.userId=userId;
    }
       
zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java
@@ -35,7 +35,7 @@
    /**
     * 用户ID
     */
    private String  cartUserId;
    private Long  cartUserId;
    /**
@@ -298,11 +298,11 @@
    }
    public String getCartUserId() {
    public Long getCartUserId() {
        return cartUserId;
    }
    public void setCartUserId(String cartUserId) {
    public void setCartUserId(Long cartUserId) {
        this.cartUserId=cartUserId;
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java
@@ -39,13 +39,13 @@
    
    public ShopCouponRecord  selectForUpdate(Integer id);
    List<CouponReceiveInfoVO> selectMyCouponByUserId(@Param("userId") String userId);
    List<CouponReceiveInfoVO> selectMyCouponByUserId(@Param("userId") Long userId);
    CouponReceiveInfoVO selectMyCouponByReceiveId(@Param("receiveId") Integer receiveId);
    List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("companyId") Long shopId, @Param("userId") String userId, @Param("status") Integer status,
    List<CouponReceiveInfoVO> selectMyCouponByStatus(@Param("companyId") Long shopId, @Param("userId") Long userId, @Param("status") Integer status,
                                                     @Param("pageVo") PaginationVO pageVo);
    List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("companyId")Long shopId, @Param("userId") String userId, @Param("pageVo") PaginationVO pageVo);
    List<CouponReceiveInfoVO> selectMyPastCoupon(@Param("companyId")Long shopId, @Param("userId") Long userId, @Param("pageVo") PaginationVO pageVo);
}
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java
@@ -44,9 +44,9 @@
    
    public ShopOrder  selectForUpdate(Integer id);
    List<ShopOrder> selectMyOrderByStatus(@Param("userId") String userId, @Param("params") OrderInfoQueryPOJO orderInfoQueryPOJO);
    List<ShopOrder> selectMyOrderByStatus(@Param("userId") Long userId, @Param("params") OrderInfoQueryPOJO orderInfoQueryPOJO);
    ShopOrder selectOrderInfoById(@Param("userId") String userId, @Param("id") Integer id);
    ShopOrder selectOrderInfoById(@Param("userId") Long userId, @Param("id") Integer id);
    public ShopOrder  selectMyOrderById(Integer id);
@@ -58,12 +58,7 @@
     */
    List<ShopOrder> selectInPageByQueryOfExcel(@Param("record") ShopOrderQueryPOJO orderQuery, @Param("pageVo") PaginationVO pageVo);
    /**
     * 根据用户openID查询消费金额
     * @param userId
     * @return
     */
    Double selectConsumptionSumByUserId(@Param("userId") String userId);
    public List<ShopOrder> selectOrdersByIds(@Param("shopId") Long shopId,@Param("comId") Long comId, @Param("list") List<String> list);
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java
@@ -2,10 +2,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.matrix.system.shopXcx.bean.ShopOrder;
import com.matrix.system.shopXcx.bean.ShopProduct;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
 * @description 订单表
@@ -13,11 +10,11 @@
public interface ShopOrderV2Dao extends BaseMapper<ShopOrder> {
    /** 统计已收货订单数 */
    int selectReceivedOrderCount(String openId);
    int selectReceivedOrderCount(Long userId);
    /** 统计已收货订单金额 */
    Double countOrderAmount(String openId);
    Double countOrderAmount(Long userId);
    /** 统计是否消费过了指定产品 */
    int countBuyZdcp(@Param("openId") String openId, @Param("productIds")String productIds);
    int countBuyZdcp(@Param("userId") Long userId, @Param("productIds")String productIds);
}
zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java
@@ -36,13 +36,13 @@
    
    public ShopShoppingCart  selectById(Integer cartId);
    public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") String cartUserId);
    public List<ShopShoppingCart> selectByCartUserId(@Param("shopId")Long shopId, @Param("cartUserId") Long cartUserId);
    
    public ShopShoppingCart  selectForUpdate(Integer cartId);
    public ShopShoppingCart selectBuyLimit(@Param("cartProductId") Integer cartProductId,@Param("cartSkuId") Integer cartSkuId);
    public Integer selectUserCartCount(@Param("shopId")Long shopId, @Param("openId")String openId);
    public Integer selectUserCartCount(@Param("shopId")Long shopId, @Param("userId")Long userId);
    public int updateAllSelected(@Param("openId") String openId, @Param("shopId") Long shopId,  @Param("isSelected") Integer isSelected);
zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java
@@ -1,7 +1,10 @@
package com.matrix.system.shopXcx.dto;
import lombok.Data;
import java.math.BigDecimal;
@Data
public class CreateGroupBuyDTO {
    /**
@@ -54,111 +57,9 @@
    private BigDecimal price;
    private String openId;
    private Long userId;
    private int goodsId;
    public String getOpenId() {
        return openId;
    }
    public void setOpenId(String openId) {
        this.openId = openId;
    }
    public int getGoodsId() {
        return goodsId;
    }
    public void setGoodsId(int goodsId) {
        this.goodsId = goodsId;
    }
    public BigDecimal getPrice() {
        return price;
    }
    public void setPrice(BigDecimal price) {
        this.price = price;
    }
    public int getJoinType() {
        return joinType;
    }
    public void setJoinType(int joinType) {
        this.joinType = joinType;
    }
    public Long getGpId() {
        return gpId;
    }
    public void setGpId(Long gpId) {
        this.gpId = gpId;
    }
    public Long getActId() {
        return actId;
    }
    public void setActId(Long actId) {
        this.actId = actId;
    }
    public Integer getAddressId() {
        return addressId;
    }
    public void setAddressId(Integer addressId) {
        this.addressId = addressId;
    }
    public Long getShopId() {
        return shopId;
    }
    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }
    public String getShippingMethod() {
        return shippingMethod;
    }
    public void setShippingMethod(String shippingMethod) {
        this.shippingMethod = shippingMethod;
    }
    public Long getGjId() {
        return gjId;
    }
    public void setGjId(Long gjId) {
        this.gjId = gjId;
    }
    public Integer getSkuId() {
        return skuId;
    }
    public void setSkuId(Integer skuId) {
        this.skuId = skuId;
    }
    public Integer getCount() {
        return count;
    }
    public void setCount(Integer count) {
        this.count = count;
    }
    public String getRemarks() {
        return remarks;
    }
    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }
}
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java
@@ -1,9 +1,6 @@
package com.matrix.system.shopXcx.mqTask;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.service.BizUserService;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.common.constance.AppConstance;
@@ -11,13 +8,12 @@
import com.matrix.system.constance.Dictionary;
import com.matrix.system.fenxiao.dao.ShopSalesmanGradeDao;
import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanGrade;
import com.matrix.system.fenxiao.entity.ShopSalesmanOrder;
import com.matrix.system.hive.bean.*;
import com.matrix.system.hive.dao.*;
import com.matrix.system.hive.service.CodeService;
import com.matrix.system.hive.service.ShoppingGoodsService;
import com.matrix.system.hive.service.SysOrderService;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.system.shopXcx.bean.ShopOrder;
import com.matrix.system.shopXcx.bean.ShopOrderDetails;
import com.matrix.system.shopXcx.bean.ShopSku;
@@ -26,7 +22,6 @@
import com.matrix.system.shopXcx.dao.ShopSkuDao;
import com.rabbitmq.client.DeliverCallback;
import com.rabbitmq.client.Delivery;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@@ -48,7 +43,7 @@
    ShopOrderDetailsDao shopOrderDetailsDao;
    @Autowired
    BizUserService bizUserService;
    SysVipInfoService sysVipInfoService;
    @Autowired
@@ -103,10 +98,8 @@
        }
        if(needTb){
            BizUser bizUser = bizUserService.findByOpenId(orderDto.getUserId());
            SysVipInfo vipInfo = sysVipInfoService.findById(orderDto.getUserId());
            SysOrder order = new SysOrder();
            //TODO 根据公司id区分
            SysVipInfo vipInfo = vipDao.selectByPhone(bizUser.getPhoneNumber());
            if(SysVipInfo.UNDEAL_VIP==vipInfo.getIsDeal()){
                //非成交客户下单更新客户为成交客户
                vipInfo.setIsDeal(SysVipInfo.DEAL_VIP);
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java
@@ -56,11 +56,11 @@
        //如果是积分支付则需要返还积分
        if(order.getScorePay()!=null && order.getScorePay()>0){
            LogUtil.debug("处理积分退款={}", orderId);
            scoreVipDetailService.refundScore(order.getUserId(),null,order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH);
            scoreVipDetailService.refundScore(order.getUserId(),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH);
        }
        //消费获得积分返还,如果本订单获得了积分则要扣除获得积分
        scoreVipDetailService.removeByBusinessId(order.getUserId(),null,Long.parseLong(order.getId()+""));
        scoreVipDetailService.removeByBusinessId(order.getUserId(),Long.parseLong(order.getId()+""));
    }
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java
@@ -4,11 +4,8 @@
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.service.BizUserService;
import com.matrix.core.constance.MatrixConstance;
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.fenxiao.constant.FenxiaoSettingConstant;
@@ -16,12 +13,14 @@
import com.matrix.system.fenxiao.dao.ShopSalesmanOrderDao;
import com.matrix.system.fenxiao.entity.ShopSalesmanGrade;
import com.matrix.system.fenxiao.entity.ShopSalesmanOrder;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysOrderDao;
import com.matrix.system.hive.dao.SysOrderItemDao;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.system.hive.service.CodeService;
import com.matrix.system.hive.service.ShoppingGoodsService;
import com.matrix.system.hive.service.SysOrderService;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.system.shopXcx.bean.ShopOrder;
import com.matrix.system.shopXcx.bean.ShopOrderDetails;
import com.matrix.system.shopXcx.bean.ShopProduct;
@@ -52,7 +51,7 @@
    ShopOrderDetailsDao shopOrderDetailsDao;
    @Autowired
    BizUserService bizUserService;
    SysVipInfoService sysVipInfoService;
    @Autowired
@@ -113,8 +112,8 @@
    @Transactional
    void handleExtensionOrder(ShopOrder order) {
        //判读客户是否存在上级,存在则产生上级的收益
        BizUser bizUser = bizUserService.findByOpenId(order.getUserId());
        LogUtil.debug("处理分销订单userOpid={}",bizUser.getOpenId());
        SysVipInfo sysVipInfo = sysVipInfoService.findById(order.getUserId());
        LogUtil.debug("处理分销订单userOpid={}",sysVipInfo.getOpenId());
        //判断是否重复生成
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("order_id",order.getId());
@@ -140,14 +139,14 @@
                }
            }
            //自购返佣
            Integer isSales = bizUser.getIsSales();
            if(BizUser.IS_SALES == isSales){
            Integer isSales = sysVipInfo.getIsSales();
            if(SysVipInfo.IS_SALES == isSales){
                for (ShopOrderDetails item:order.getDetails() ){
                    if(item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){
                        //分销规则是否开启自购返佣
                        BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, bizUser.getCompanyId());
                        BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, sysVipInfo.getCompanyId());
                        //按分销等级计算
                        ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(bizUser.getSalesmanGrade());
                        ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade());
                        if(ObjectUtil.isNotEmpty(zgfy)) {
                            //获取商品的自购返佣价格,如果没有设置,在去获取当前推广人的等级的自购返佣比例
                            if(StrUtil.isNotEmpty(zgfy.getParamValue()) &&
@@ -175,19 +174,19 @@
            }
            //存在上级
            if(StringUtils.isNotBlank(bizUser.getParentOpenId())) {
                BizUser salesMan=bizUserService.findByOpenId(bizUser.getParentOpenId());
            if(sysVipInfo.getRecommendId()!=null) {
                SysVipInfo salesMan=sysVipInfoService.findById(sysVipInfo.getRecommendId());
                Double salesAmount=0D;
                Double invitationAmount=0D;
                BizUser invitationMan=null;
                SysVipInfo invitationMan=null;
                ShopSalesmanOrder invitationOrder=null;
                boolean hasInvitationMan=StringUtils.isNotBlank(salesMan.getParentOpenId());
                boolean hasInvitationMan=salesMan.getRecommendId()!=null;
                //判断推广员是否还存在上级,存在则计算邀请收益
                if(hasInvitationMan){
                    invitationMan=bizUserService.findByOpenId(salesMan.getParentOpenId());
                    invitationMan=sysVipInfoService.findById(salesMan.getRecommendId());
                    invitationOrder=new ShopSalesmanOrder();
                    BeanUtils.copyProperties(salesmanOrder,invitationOrder);
                    invitationOrder.setSalesUserId(invitationMan.getOpenId());
                    invitationOrder.setSalesUserId(invitationMan.getId());
                    invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION);
                }
                //收益计算
@@ -222,7 +221,7 @@
                    zk=order.getOrderMoney().doubleValue()/orderTotal;
                    salesAmount=salesAmount*zk;
                    salesmanOrder.setAmount(salesAmount);
                    salesmanOrder.setSalesUserId(bizUser.getParentOpenId());
                    salesmanOrder.setSalesUserId(sysVipInfo.getRecommendId());
                    shopSalesmanOrderDao.insert(salesmanOrder);
                }
                //邀请提成记录
@@ -233,7 +232,7 @@
                    shopSalesmanOrderDao.insert(invitationOrder);
                } 
            }else{
                LogUtil.debug("不存在父级userOpid={}",bizUser.getOpenId());
                LogUtil.debug("不存在父级userOpid={}",sysVipInfo.getOpenId());
            }
        }else{
            LogUtil.debug("重复订单id={}",order.getId());
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java
@@ -1,8 +1,12 @@
package com.matrix.system.shopXcx.mqTask;
import com.matrix.biz.service.BizUserService;
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.score.constant.ScoreSettingConstant;
import com.matrix.system.score.entity.ScoreVipDetail;
import com.matrix.system.score.service.ScoreVipDetailService;
import com.matrix.system.shopXcx.bean.ShopOrder;
@@ -15,6 +19,7 @@
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
/**
@@ -30,10 +35,15 @@
    ShopOrderDetailsDao shopOrderDetailsDao;
    @Autowired
    BizUserService bizUserService;
    SysVipInfoService sysVipInfoService;
    @Autowired
    ScoreVipDetailService scoreVipDetailService;
    @Autowired
    BusParameterSettingsDao busParameterSettingsDao;
@@ -49,22 +59,30 @@
        order.setDetails(orderDetails);
        //扣除积分
        if(order.getScorePay()!=null&&order.getScorePay()>0){
            scoreVipDetailService.deductionScore(order.getUserId(),null,null,Long.parseLong(order.getStoreId()+""),order.getScorePay(),Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH,"商城积分抵扣");
            scoreVipDetailService.deductionScore(order.getUserId(),null,
                    Long.parseLong(order.getStoreId()+""),order.getScorePay(),
                    Long.parseLong(order.getId()+""), ScoreVipDetail.SCORE_VIP_TYPE_CASH,"商城积分抵扣");
        }else{
            //消费获得积分
            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();
                        }
                    }
                }
            }
            if(addScore>0){
                //插入新的积分
                scoreVipDetailService.addScore(
                        order.getUserId(),null,
                        order.getUserId(),
                        null,
                        Long.parseLong(order.getStoreId()+""),
                        addScore,
zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java
File was deleted
zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java
@@ -1,14 +1,13 @@
package com.matrix.system.shopXcx.quartz;
import com.matrix.component.tools.WxUtils;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.WebUtil;
import com.matrix.system.common.constance.AppConstance;
import com.matrix.system.hive.plugin.util.CollectionUtils;
import com.matrix.system.shopXcx.api.service.WxShopRefundRecordService;
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;
@@ -121,8 +120,8 @@
                if (joinUser.getIsHasPay() == ShopActivitiesGroupJoinUser.IS_HAS_PAY_Y) {
                    LogUtil.info("#已付款退款逻辑#");
                    ShopRefundRecord refundRecord = new ShopRefundRecord();
                    refundRecord.setCreateBy(joinUser.getUserId());
                    refundRecord.setUpdateBy(joinUser.getUserId());
                    refundRecord.setCreateBy(MatrixConstance.SYSTEM_USER);
                    refundRecord.setUpdateBy(MatrixConstance.SYSTEM_USER);
                    refundRecord.setUserId(joinUser.getUserId());
                    refundRecord.setRefundNo(WxUtils.getOrderNum());
                    refundRecord.setOrderId(joinUser.getOrderId().intValue());
zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java
@@ -17,7 +17,7 @@
    @ApiModelProperty(value = "手机号码")
    private String  phoneNumber;
    private String  phone;
    @ApiModelProperty(value = "贡献订单数")
    private String  orderCount;
zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java
@@ -2,8 +2,8 @@
import com.alibaba.fastjson.JSONObject;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.service.BizUserService;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.component.tools.HttpClientUtil;
import com.matrix.core.pojo.AjaxResult;
import com.matrix.core.tools.LogUtil;
zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java
@@ -1,8 +1,8 @@
package com.matrix.system.wechart.templateMsg.Task.messageBulderDemo;
import com.alibaba.fastjson.JSONObject;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.dao.BizUserDao;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.dao.SysVipInfoDao;
import com.matrix.core.tools.DateUtil;
import com.matrix.core.tools.StringUtils;
import com.matrix.system.hive.bean.SysBeauticianState;
zq-erp/src/main/resources/config/db/increment/推广员.sql
@@ -221,3 +221,17 @@
ALTER TABLE `shop_salesman_grade`
DROP COLUMN `self_commission`,
ADD COLUMN `self_commission`  double(20,2) NULL COMMENT '自购返佣比例%' AFTER `company_id`;
ALTER TABLE `sys_vip_info`
    ADD COLUMN `fenxiao_state` int(11) NULL DEFAULT NULL COMMENT '分销审核状态' AFTER `recommend_id`,
ADD COLUMN `withdrawal_cash` double(20, 2) NULL DEFAULT NULL COMMENT '可提现金额' AFTER `fenxiao_state`,
ADD COLUMN `salesman_grade` bigint(20) NULL DEFAULT NULL COMMENT '推广员等级' AFTER `withdrawal_cash`,
ADD COLUMN `is_sales` int(1) NULL DEFAULT NULL AFTER `salesman_grade`,
ADD COLUMN `user_is_authorize` datetime(0) NULL DEFAULT NULL AFTER `is_sales`,
ADD COLUMN `binding_parent_time` datetime(0) NULL DEFAULT NULL AFTER `user_is_authorize`,
ADD COLUMN `country` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `binding_parent_time`,
ADD COLUMN `gender` varchar(2) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `country`,
ADD COLUMN `nick_name` varchar(300) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `gender`,
ADD COLUMN `avatar_url` varchar(500) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL AFTER `nick_name`;
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml
@@ -3,39 +3,6 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.matrix.system.activity.dao.ActivitySignReceiveRecordDao">
    <!-- 定义ActivitySignReceiveRecord 的复杂关联map -->
    <resultMap type="com.matrix.system.activity.entity.ActivitySignReceiveRecord" id="ActivitySignReceiveRecordMap">
        <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="openId" column="open_id" />
            <result property="receiveTime" column="receive_time" />
            <result property="remark" column="remark" />
            <result property="awardId" column="award_id" />
            <result property="state" column="state" />
            <result property="writeOffCode" column="write_off_code" />
            <result property="activityId" column="activity_id" />
            <result property="companyId" column="company_id" />
    </resultMap>
    
    <!-- 定义ActivitySignReceiveRecord 的简单map  ,本map不添加其他的关联属性 -->
    <resultMap type="com.matrix.system.activity.entity.ActivitySignReceiveRecord" id="ActivitySignReceiveRecordSimpleMap">
        <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="openId" column="open_id" />
            <result property="receiveTime" column="receive_time" />
            <result property="remark" column="remark" />
            <result property="awardId" column="award_id" />
            <result property="state" column="state" />
            <result property="writeOffCode" column="write_off_code" />
            <result property="activityId" column="activity_id" />
            <result property="companyId" column="company_id" />
    </resultMap>
</mapper>
zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml
@@ -3,33 +3,6 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.matrix.system.activity.dao.ActivitySignRecordDao">
    <!-- 定义ActivitySignRecord 的复杂关联map -->
    <resultMap type="com.matrix.system.activity.entity.ActivitySignRecord" id="ActivitySignRecordMap">
        <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="openId" column="open_id" />
            <result property="signTime" column="sign_time" />
            <result property="cumulativeDay" column="cumulative_day" />
            <result property="activityId" column="activity_id" />
            <result property="companyId" column="company_id" />
    </resultMap>
    
    <!-- 定义ActivitySignRecord 的简单map  ,本map不添加其他的关联属性 -->
    <resultMap type="com.matrix.system.activity.entity.ActivitySignRecord" id="ActivitySignRecordSimpleMap">
        <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="openId" column="open_id" />
            <result property="signTime" column="sign_time" />
            <result property="cumulativeDay" column="cumulative_day" />
            <result property="activityId" column="activity_id" />
            <result property="companyId" column="company_id" />
    </resultMap>
</mapper>
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml
@@ -38,23 +38,23 @@
        SELECT
            a.nick_name,
            a.avatar_url,
            a.phone_number,
            a.phone,
            (
                SELECT
                    IFNULL(sum(IFNULL( b.amount, 0 )),0)
                FROM
                    shop_salesman_order b
                WHERE
                    b.user_id = a.open_id
                    b.user_id = a.id
                  and order_status=2
                  AND b.sales_user_id = #{openId}
                  AND b.sales_user_id = #{userId}
            ) AS revenueAmount,
            ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.open_id AND c.sales_user_id = #{openId} ) AS orderCount
            ( SELECT count( * ) FROM shop_salesman_order c WHERE c.user_id = a.id AND c.sales_user_id = #{userId} ) AS orderCount
        FROM
            biz_user a
            sys_vip_info a
        WHERE
            a.parent_open_id = #{openId}
            a.recommend_id = #{userId}
          AND a.is_sales = #{isSales}
    </select>
@@ -64,13 +64,13 @@
        a.user_id userId,
        b.avatar_url avatarUrl,
        b.nick_name nickname,
        (SELECT s.nick_name FROM biz_user s
        WHERE s.open_id = a.parent_user_id ) parentUser,
        (SELECT s.nick_name FROM sys_vip_info s
        WHERE s.id = a.parent_user_id ) parentUser,
        c.nick_name parentUserNow,
        ( SELECT COUNT(*) FROM biz_user
        WHERE parent_open_id = a.user_id AND is_sales != 1 ) lowerLevelNum,
        ( SELECT COUNT(*) FROM biz_user
        WHERE parent_open_id = a.user_id AND is_sales = 1 ) invitedNum,
        ( SELECT COUNT(*) FROM sys_vip_info
        WHERE recommend_id = a.user_id AND is_sales != 1 ) lowerLevelNum,
        ( SELECT COUNT(*) FROM sys_vip_info
        WHERE recommend_id = a.user_id AND is_sales = 1 ) invitedNum,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
        WHERE  order_status = 2 AND sales_user_id = a.user_id ) totalRevenue,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
@@ -81,9 +81,9 @@
        a.apply_way applyWay
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON a.user_id = b.open_id
        LEFT JOIN sys_vip_info b ON a.user_id = b.id
        LEFT JOIN shop_salesman_grade g ON a.grade_id = g.id
        LEFT JOIN biz_user c ON c.open_id = b.parent_open_id
        LEFT JOIN sys_vip_info c ON c.id = b.recommend_id
        <where>
             a.company_id=#{record.companyId}
            <if test="record.shenheState != null and record.shenheState != ''">
@@ -107,7 +107,7 @@
        b.nick_name nickName
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON a.user_id = b.user_id
        LEFT JOIN sys_vip_info b ON a.user_id = b.id
        <where>
            a.company_id = #{record.companyId}
            and a.apply_status = #{record.applyStatus}
@@ -122,14 +122,13 @@
    </select>
    <select id="selectBizUserApplyList" resultType="com.matrix.system.fenxiao.vo.ShopSalesmanAppliingVo">
        SELECT
        a.user_id userId,
        a.open_id openId,
        a.id userId,
        a.nick_name nickName,
        a.avatar_url avatarUrl,
        a.create_time createTime,
        a.phone_number phone
        a.phone
        FROM
        biz_user a
        sys_vip_info a
        <where>
            a.company_id = #{record.companyId}
            and a.is_sales != 1
@@ -186,10 +185,10 @@
    ( SELECT count( * ) FROM shop_salesman_order c WHERE  c.sales_user_id = #{openId} and revenue_type =1 ) AS salesorderCount,
    ( SELECT count( * ) FROM shop_salesman_order c WHERE  c.sales_user_id = #{openId} and revenue_type =2 ) AS invitationOrderCount,
    (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=1) as invitationCount,
    (select count(*) from biz_user where parent_open_id=#{openId} and is_sales=2) as customerCount
    from biz_user a where
    a.open_id=#{openId}
    (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=1) as invitationCount,
    (select count(*) from sys_vip_info where recommend_id=#{openId} and is_sales=2) as customerCount
    from sys_vip_info a where
    a.id=#{id}
    </select>
@@ -199,13 +198,13 @@
        b.avatar_url avatarUrl,
        b.nick_name nickname,
        g.NAME grade,
        b.phone_number phone,
        (SELECT s.nick_name FROM biz_user s
        WHERE s.open_id = a.parent_user_id ) parentUser,
        ( SELECT COUNT(*) FROM biz_user
        WHERE parent_open_id = a.user_id AND is_sales != 1 ) lowerLevelNum,
        ( SELECT COUNT(*) FROM biz_user
        WHERE parent_open_id = a.user_id AND is_sales = 1 ) invitedNum,
        b.phone,
        (SELECT s.nick_name FROM sys_vip_info s
        WHERE s.id = a.parent_user_id ) parentUser,
        ( SELECT COUNT(*) FROM sys_vip_info
        WHERE recommend_id = a.user_id AND is_sales != 1 ) lowerLevelNum,
        ( SELECT COUNT(*) FROM sys_vip_info
        WHERE recommend_id = a.user_id AND is_sales = 1 ) invitedNum,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
        WHERE order_status = 2 AND sales_user_id = a.user_id ) totalRevenue,
        ( SELECT IFNULL(sum(IFNULL(amount, 0)), 0) FROM shop_salesman_order
@@ -215,23 +214,23 @@
        a.apply_way applyWay
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON a.user_id = b.open_id
        LEFT JOIN sys_vip_info b ON a.user_id = b.id
        LEFT JOIN shop_salesman_grade g ON a.grade_id = g.id
            where a.id = #{applyId}
    </select>
    <select id="findCustomDetail" resultType="com.matrix.system.fenxiao.vo.ShopCustomDetailVo">
        SELECT
        b.open_id userId,
        b.id userId,
        b.avatar_url avatarUrl,
        b.nick_name nickname,
        b.binding_parent_time createTime,
        (select COUNT(*) from shop_salesman_order c where c.order_status = 1 and c.sales_user_id = b.open_id) doneNum
        FROM biz_user b
        (select COUNT(*) from shop_salesman_order c where c.order_status = 1 and c.sales_user_id = b.id) doneNum
        FROM sys_vip_info b
        <where>
            b.company_id = #{record.companyId}
            AND b.is_sales != 1
            and b.parent_open_id = #{record.userId}
            and b.recommend_id = #{record.userId}
            <if test="record.userName != null and record.userName != ''">
                and b.nick_name like concat('%',#{record.userName},'%')
            </if>
@@ -243,18 +242,18 @@
    </select>
    <select id="findCustomLow" resultType="com.matrix.system.fenxiao.vo.ShopCustomDetailVo">
        SELECT
        b.open_id userId,
        b.id userId,
        b.avatar_url avatarUrl,
        b.nick_name nickname,
        a.create_time createTime,
        a.apply_way applyWay
        FROM
        shop_salesman_apply a
        LEFT JOIN biz_user b ON b.open_id = a.user_id
        LEFT JOIN sys_vip_info b ON b.id = a.user_id
        <where>
            a.company_id = #{record.companyId}
            AND b.is_sales = 1
            and b.parent_open_id = #{record.userId}
            and b.recommend_id = #{record.userId}
            and a.apply_status = 2
            <if test="record.userName != null and record.userName != ''">
                and b.nick_name like concat('%',#{record.userName},'%')
@@ -280,7 +279,7 @@
        c.order_status orderState,
        f.shop_name storeName
        from shop_salesman_order a
        left join biz_user b on b.open_id=a.user_id
        left join sys_vip_info b on b.id=a.user_id
        left join shop_order c on a.order_id=c.id
        LEFT JOIN sys_shop_info f on f.id = c.store_id
        <where>
zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml
@@ -50,7 +50,7 @@
            c.order_no,
            c.order_money
        from shop_salesman_order a
                 left join biz_user b on b.open_id=a.user_id
                 left join sys_vip_info b on b.id=a.user_id
                 left join shop_order c on a.order_id=c.id
        where
            a.sales_user_id=#{record.userId}
@@ -90,7 +90,7 @@
        f.shop_name address,
        d.order_status orderState,
        b.nick_name custom,
        b.open_id customUserId,
        b.id customUserId,
        e.nick_name parentSale,
        a.revenue_type profitType,
        a.amount profitBalance,
@@ -100,10 +100,10 @@
        g.su_name settler
        FROM
        shop_salesman_order a
        LEFT JOIN biz_user b on a.user_id = b.open_id
        LEFT JOIN sys_vip_info b on a.user_id = b.id
        LEFT JOIN shop_saleman_settlement c on a.settlement_id = c.id
        LEFT JOIN shop_order d on d.id = a.order_id
        LEFT JOIN biz_user e on a.sales_user_id = e.open_id
        LEFT JOIN sys_vip_info e on a.sales_user_id = e.id
        LEFT JOIN sys_shop_info f on f.id = d.store_id
        LEFT JOIN sys_users g on c.user_id = g.su_id
        <where>
zq-erp/src/main/resources/mybatis/mapper/hive/OnlinebookingDao.xml
@@ -17,7 +17,7 @@
            <result property="staffId" column="staff_id" />
            <result property="vipName" column="vip_name" />
            <result property="tel" column="tel" />
            <result property="bizUserId" column="biz_user_id" />
            <result property="bizUserId" column="sys_vip_info_id" />
            <result property="formId" column="form_id" />
        <result property="productId" column="product_id" />
@@ -42,7 +42,7 @@
            <result property="staffId" column="staff_id" />
            <result property="vipName" column="vip_name" />
            <result property="tel" column="tel" />
            <result property="bizUserId" column="biz_user_id" />
            <result property="bizUserId" column="sys_vip_info_id" />
            <result property="productId" column="product_id" />
        <result property="orderNo" column="order_no" />
        <result property="formId" column="form_id" />
@@ -66,7 +66,7 @@
            staff_id,
            vip_name,
            tel,
            biz_user_id,
            sys_vip_info_id,
            product_id,
            order_no,
            form_id
@@ -129,7 +129,7 @@
                    tel = #{tel},
                </if>
                <if test="(bizUserId!=null and bizUserId!='') or (bizUserId!='' and bizUserId==0)">
                    biz_user_id = #{bizUserId},
                    sys_vip_info_id = #{bizUserId},
                </if>
                <if test="(productId!=null and productId!='') or (productId!='' and productId==0)">
                    product_id = #{productId},
@@ -199,7 +199,7 @@
        staff_id,
        vip_name,
        tel,
        biz_user_id,
        sys_vip_info_id,
        product_id,
        order_no,
        form_id,
@@ -303,7 +303,7 @@
        staff_id,
        vip_name,
        tel,
        biz_user_id,
        sys_vip_info_id,
        product_id
        from onlinebooking
        where 1=1
@@ -417,7 +417,7 @@
            staff_id,
            vip_name,
            tel,
            biz_user_id,
            sys_vip_info_id,
            product_id,
            order_no
        from onlinebooking
@@ -442,7 +442,7 @@
        staff_id,
        vip_name,
        tel,
        biz_user_id,
        sys_vip_info_id,
        product_id
        from onlinebooking
        where 1=1
@@ -495,7 +495,7 @@
        staff_id,
        vip_name,
        tel,
        biz_user_id,
        sys_vip_info_id,
        product_id,
        order_no
        from onlinebooking
@@ -547,7 +547,7 @@
        staff_id,
        vip_name,
        tel,
        biz_user_id,
        sys_vip_info_id,
        product_id,
        order_no,
        form_id,
@@ -565,7 +565,7 @@
                and vip_Id  = #{record.vipId}
            </if>
            <if test="(record.bizUserId!=null and record.bizUserId!='') or (record.bizUserId!='' and record.bizUserId==0)">
                and biz_user_id  = #{record.bizUserId}
                and sys_vip_info_id  = #{record.bizUserId}
            </if>
            <if test="(record.time!=null and record.time!='') or (record.time!='' and record.time==0)">
                and time  = #{record.time}
@@ -611,7 +611,7 @@
                and vip_Id  = #{record.vipId}
            </if>
            <if test="(record.bizUserId!=null and record.bizUserId!='') or (record.bizUserId!='' and record.bizUserId==0)">
                and biz_user_id  = #{record.bizUserId}
                and sys_vip_info_id  = #{record.bizUserId}
            </if>
            <if test="(record.time!=null and record.time!='') or (record.time!='' and record.time==0)">
                and time  = #{record.time}
zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml
@@ -52,6 +52,15 @@
        <result property="isDeal" column="is_deal"/>
        <result property="createDistributionTime" column="create_distribution_time"/>
        <result property="isSales" column="is_sales" />
        <result property="withdrawalCash" column="withdrawal_cash" />
        <result property="salesmanGrade" column="salesman_grade" />
        <result property="nickName" column="nick_name" />
        <result property="avatarUrl" column="avatar_url" />
        <result property="gender" column="gender" />
        <result property="country" column="country" />
        <result property="sessionKey" column="session_key" />
        <result property="userIsAuthorize" column="user_is_authorize" />
        <!-- 扩展属性 -->
        <result property="staffName" column="STAFF_NAME"/>
@@ -105,6 +114,17 @@
        <result property="createDistributionTime" column="create_distribution_time"/>
        <result property="disease" column="disease"/>
        <result property="companyId" column="company_id"/>
        <result property="isSales" column="is_sales" />
        <result property="withdrawalCash" column="withdrawal_cash" />
        <result property="salesmanGrade" column="salesman_grade" />
        <result property="nickName" column="nick_name" />
        <result property="avatarUrl" column="avatar_url" />
        <result property="gender" column="gender" />
        <result property="country" column="country" />
        <result property="sessionKey" column="session_key" />
        <result property="userIsAuthorize" column="user_is_authorize" />
        <!-- 扩展属性 -->
        <result property="staffName" column="STAFF_NAME"/>
        <result property="shopName" column="SHOP_NAME"/>
@@ -286,7 +306,16 @@
        province,
        city,
        area,
        recommend_id
        recommend_id,
        is_sales,
        withdrawal_cash,
        salesman_grade,
        nick_name,
        avatar_url,
        gender,
        country,
        session_key,
        user_is_authorize
        )
@@ -334,7 +363,16 @@
        #{province},
        #{city},
        #{area},
        #{recommendId}
        #{recommendId},
        #{isSales},
        #{withdrawalCash},
        #{salesmanGrade},
        #{nickName},
        #{avatarUrl},
        #{gender},
        #{country},
        #{sessionKey},
        #{userIsAuthorize}
        )
    </insert>
@@ -473,6 +511,34 @@
            <if test="area != null and area !=''  ">
                area = #{area},
            </if>
            <if test="isSales != null ">
                is_sales  = #{isSales},
            </if>
            <if test="withdrawalCash != null ">
                withdrawal_cash  = #{withdrawalCash},
            </if>
            <if test="salesmanGrade != null ">
                salesman_grade  = #{salesmanGrade},
            </if>
            <if test="gender != null and gender != '' ">
                gender  = #{gender},
            </if>
            <if test="country != null and country != '' ">
                country  = #{country},
            </if>
            <if test="sessionKey != null and sessionKey != '' ">
                session_key  = #{sessionKey},
            </if>
            <if test="userIsAuthorize != null ">
                user_is_authorize  = #{userIsAuthorize},
            </if>
            <if test="nickName != null and nickName != '' ">
                nick_name  = #{nickName},
            </if>
            <if test="avatarUrl != null and avatarUrl != '' ">
                avatar_url  = #{avatarUrl},
            </if>
        </set>
@@ -481,6 +547,10 @@
    <!-- 积分清空 -->
    <update id="pointClose">
        UPDATE sys_vip_info set POINT_ALL = 0
    </update>
    <update id="unbundlingSaleMan">
        UPDATE sys_vip_info set recommend_id = NULL where id=#{userId};
    </update>
    <!-- 批量删除 -->
@@ -538,7 +608,10 @@
        where a.ID=#{id}
    </select>
    <select id="findByOpenId" resultMap="SysVipInfoMap">
        select *
        from sys_vip_info where openid=#{openId}
    </select>
    <!-- 根据手机和密码查询 -->
    <select id="selectVipByPhonePassWord" resultMap="SysVipInfoMap">
@@ -813,6 +886,28 @@
            <if test="(record.companyId!=null and record.companyId!='') ">
                and a.company_id = #{record.companyId}
            </if>
            <if test="(record.nickName!=null and record.nickName!='') or  (record.nickName!='' and record.nickName==0)  ">
                and a.nick_name  like concat('%',#{record.nickName},'%')
            </if>
            <if test="(record.avatarUrl!=null and record.avatarUrl!='') or  (record.avatarUrl!='' and record.avatarUrl==0)  ">
                and a.avatar_url  = #{record.avatarUrl}
            </if>
            <if test="record.isSales != null and record.isSales !='' ">
                and a.is_sales = #{record.isSales}
            </if>
            <if test="record.withdrawalCash != null and record.withdrawalCash !='' ">
                and a.withdrawal_cash = #{record.withdrawalCash}
            </if>
            <if test="record.salesmanGrade != null and record.salesmanGrade !='' ">
                and a.salesman_grade = #{record.salesmanGrade}
            </if>
            <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or  (record.userIsAuthorize!='' and record.userIsAuthorize==0)  ">
                and a.user_is_authorize  = #{record.userIsAuthorize}
            </if>
        </if>
    </sql>
@@ -918,58 +1013,34 @@
            <if test="record.isDeal != null and record.isDeal !='' ">
                and a.is_deal = #{record.isDeal}
            </if>
            <if test="(record.nickName!=null and record.nickName!='') or  (record.nickName!='' and record.nickName==0)  ">
                and a.nick_name  like concat('%',#{record.nickName},'%')
            </if>
            <if test="(record.avatarUrl!=null and record.avatarUrl!='') or  (record.avatarUrl!='' and record.avatarUrl==0)  ">
                and a.avatar_url  = #{record.avatarUrl}
            </if>
            <if test="record.isSales != null and record.isSales !='' ">
                and a.is_sales = #{record.isSales}
            </if>
            <if test="record.withdrawalCash != null and record.withdrawalCash !='' ">
                and a.withdrawal_cash = #{record.withdrawalCash}
            </if>
            <if test="record.salesmanGrade != null and record.salesmanGrade !='' ">
                and a.salesman_grade = #{record.salesmanGrade}
            </if>
            <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or  (record.userIsAuthorize!='' and record.userIsAuthorize==0)  ">
                and a.user_is_authorize  = #{record.userIsAuthorize}
            </if>
        </if>
    </sql>
    <sql id="select">
        select
         a.ID,
        a.VIP_NO,
        a.VIP_NAME,
        a.PHONE,
        a.SEX,
        a.BIRTHDAY1,
        a.photo,
        a.ADDR,
        a.CONSTELL,
        a.ANIMAL_SIGN,
        a.ARRIVAL_WAY,
        a.VIP_TYPE,
        a.VIP_STATE,
        a.POINT_ALL,
        a.COMMISSION_ALL,
        a.IN_DATE,
        a.REMARK,
        a.SHOP_ID,
        a.IS_DELETE,
        a.EMAIL,
        a.STAFF_ID,
        a.CREATE_TIME,
        a.LEVEL_ID,
        a.UUID,
        a.BALANCE,
        a.BEATUY_ID,
        a.PASSWORD,
         a.*,
        c.su_name as STAFF_NAME,
        d.SHOP_NAME,
        a.blood,
               a.company_id,
        a.sfCard,
        a.link,
        a.marry,
        a.vocation,
        a.handle_time,
        a.statu,
        a.openid,
        a.parent_id,
        a.create_distribution_time,
        a.birthdayType,
        a.disease,
        a.is_deal,
        a.province,
        a.city,
        a.area,
        a.recommend_id,
        e.level_name levelName,
        e.vip_level vipLevel
    </sql>
@@ -1206,7 +1277,22 @@
        create_distribution_time,
        birthdayType,
        disease,
        is_deal
        is_deal,
        zjm,
        company_id,
        province,
        city,
        area,
        recommend_id,
        is_sales,
        withdrawal_cash,
        salesman_grade,
        nick_name,
        avatar_url,
        gender,
        country,
        session_key,
        user_is_authorize
        )
        VALUES
        <foreach collection="list" item="item" index="index" separator=",">(
@@ -1247,7 +1333,22 @@
            #{item.createDistributionTime},
            #{item.birthdayType},
            #{item.disease},
            #{item.isDeal}
            #{item.isDeal},
            #{zjm},
            #{companyId},
            #{province},
            #{city},
            #{area},
            #{recommendId},
            #{isSales},
            #{withdrawalCash},
            #{salesmanGrade},
            #{nickName},
            #{avatarUrl},
            #{gender},
            #{country},
            #{sessionKey},
            #{userIsAuthorize}
            )</foreach>
    </insert>
@@ -1367,5 +1468,11 @@
        left join sys_shop_info e on a.SHOP_ID=e.ID
        where a.ID=#{id}
    </select>
</mapper>
    
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsCategoryDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsImageDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsNavigationDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsSkuDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderItemDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreRuleSettingDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreShoppingCarDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml
@@ -15,15 +15,7 @@
        left join sys_users c on a.opration_user_id=c.su_id
        <where>
            <if test="(record.userId!=null and record.userId!='') and (record.vipId!=null and record.vipId!='')">
                and (a.open_id=#{record.userId} or a.vip_id=#{record.vipId})
            </if>
            <if test="(record.userId!=null and record.userId!='') and record.vipId==null">
                and a.open_id=#{record.userId}
            </if>
            <if test="(record.vipId!=null and record.vipId!='') and record.userId==null">
            <if test="(record.vipId!=null and record.vipId!='')">
                and a.vip_id=#{record.vipId}
            </if>
zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml
@@ -6,25 +6,15 @@
    <select id="selectUserTotalScore" resultType="java.lang.Integer">
        select IFNULL(sum(IFNULL( remain_score, 0 )),0) from score_vip_detail
        <where>
        and state=1
            <if test="openId !=null">
                and open_id=#{openId}
            </if>
            <if test="vipId !=null">
                and vip_id=#{vipId}
            </if>
        </where>
        where  state=1 and vip_id=#{vipId}
    </select>
    <select id="selectEffectiveScore" resultType="com.matrix.system.score.entity.ScoreVipDetail">
        select  *  from score_vip_detail where state=1
            <if test="openId !=null">
            and open_id=#{openId}
        </if>
            <if test="vipId !=null">
                and vip_id=#{vipId}
            </if>
        select *
        from score_vip_detail
        where state = 1  and vip_id = #{vipId}
        order by create_time
    </select>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml
File was deleted
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml
@@ -247,7 +247,7 @@
            t3.nick_name headName
        from shop_activities_group_join t1
        inner join shop_activities_group_price t2 on t1.gp_id=t2.id
        inner join biz_user t3 on t1.gj_head_id=t3.open_id
        inner join sys_vip_info t3 on t1.gj_head_id=t3.id
        where t1.act_id  = #{record.actId}
        <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
            <if test="pageVo.sort !=null  and pageVo.order !=null">
@@ -310,7 +310,7 @@
            t3.avatar_url avatarUrl
        from shop_activities_group_join t1
        inner join shop_activities_group_join_user t2 on t1.id=t2.gj_id and t2.is_has_cancel=2 and t2.is_has_pay=1
        left join biz_user t3 on t2.user_id=t3.open_id
        left join sys_vip_info t3 on t2.user_id=t3.id
        where t1.id=#{gjId}
    </select>
@@ -327,7 +327,7 @@
            t3.avatar_url avatarUrl
        from shop_activities_group_join t1
        inner join shop_activities_group_join_user t2 on t1.id=t2.gj_id and t2.is_has_cancel=2
        left join biz_user t3 on t2.user_id=t3.open_id
        left join sys_vip_info t3 on t2.user_id=t3.id
        where t1.id=#{gjId}
    </select>
@@ -350,7 +350,7 @@
            t3.avatar_url
        from shop_activities_group_join t1
        inner join shop_activities_group_price t2 on t1.gp_id=t2.id
        left join biz_user t3 on t1.gj_head_id=t3.open_id
        left join sys_vip_info t3 on t1.gj_head_id=t3.id
        where t1.act_id=#{actId} and t1.gj_status=3
    </select>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml
@@ -317,7 +317,7 @@
           t3.nick_name
        from shop_activities_group_join_user t1
        inner join shop_order t2 on t1.order_id=t2.id
        inner join biz_user t3 on t1.user_id=t3.open_id
        inner join sys_vip_info t3 on t1.user_id=t3.id
        where t1.gj_id=#{gjId}
    </select>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml
@@ -16,7 +16,7 @@
        <result property="status" column="status" />
        <result property="nickName" column="nick_name" />
        <result property="shopName" column="shop_short_name" />
        <result property="phone" column="phone_number" />
        <result property="phone" column="phone" />
        <collection property="salonAttr" ofType="com.matrix.system.shopXcx.bean.ShopActivitiesSalonAttrRecord">
            <id property="id" column="asd_id" />
            <result property="attrName" column="attr_name" />
@@ -184,10 +184,10 @@
    
    <!-- 分页查询 -->
    <select id="selectInPage" resultMap="ShopActivitiesSalonRecordMap">
        select t1.*, t3.nick_name, t3.phone_number, t4.shop_short_name, t2.id asd_id, t2.attr_name, t2.attr_value, t2.asr_id
        select t1.*, t3.nick_name, t3.phone, t4.shop_short_name, t2.id asd_id, t2.attr_name, t2.attr_value, t2.asr_id
        from shop_activities_salon_record t1
        inner join shop_activities_salon_attr_record t2 on t1.id=t2.asr_id
        left join biz_user t3 on t1.user_id=open_id
        left join sys_vip_info t3 on t1.user_id=id
        left join sys_shop_info t4 on t1.shop_id=t4.id
        <where>
          <include refid="where_sql"></include>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml
@@ -181,12 +181,12 @@
            t3.purchase_quantity,
            t4.shop_short_name,
            t5.nick_name userName,
            t5.phone_number phone
            t5.phone
        from shop_activities_seckill_record t1
        inner join shop_activities_seckill_info t2 on t1.si_id=t2.id
        inner join shop_order t3 on t1.order_id=t3.id
        left join sys_shop_info t4 on t3.store_id=t4.id
        left join biz_user t5 on t1.user_id=t5.open_id
        left join sys_vip_info t5 on t1.user_id=t5.id
        left join shop_product t6 on t2.goods_id=t6.id
        where t2.act_id=#{record.actId}
        <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 -->
@@ -208,7 +208,7 @@
        inner join shop_activities_seckill_info t2 on t1.si_id=t2.id
        inner join shop_order t3 on t1.order_id=t3.id
        left join sys_shop_info t4 on t3.store_id=t4.id
        left join biz_user t5 on t1.user_id=t5.open_id
        left join sys_vip_info t5 on t1.user_id=t5.id
        left join shop_product t6 on t2.goods_id=t6.id
        where t2.act_id=#{record.actId}
    </select>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml
@@ -32,7 +32,7 @@
            <result property="delFlag" column="del_flag" />
            <result property="userName" column="user_name" />
            <result property="nickName" column="nick_name" />
            <result property="phoneNumber" column="phone_number" />
            <result property="phoneNumber" column="phone" />
        <result property="companyId" column="company_id" />
    </resultMap>
    
@@ -215,10 +215,10 @@
        c.coll_productid,
        u.user_name,
        u.nick_name,
        u.phone_number,
        u.phone,
        p.title
        from shop_collection c
        LEFT JOIN biz_user u ON c.coll_userid = u.open_id
        LEFT JOIN sys_vip_info u ON c.coll_userid = u.id
        LEFT JOIN shop_product p ON c.coll_productid = p.id
        <where>
          <include refid="where_sql"></include>
@@ -236,7 +236,7 @@
    <select id="selectTotalRecord" parameterType="long"   resultType="java.lang.Integer">
    select count(*)
    from shop_collection c
        LEFT JOIN biz_user u ON c.coll_userid = u.open_id
        LEFT JOIN sys_vip_info u ON c.coll_userid = u.id
        LEFT JOIN shop_product p ON c.coll_productid = p.id
        <where>
           <include refid="where_sql"></include>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml
@@ -366,7 +366,7 @@
        FROM
        shop_invoice i
        LEFT JOIN shop_order o ON i.order_id = o.id
        LEFT JOIN biz_user b on i.user_id = b.open_id
        LEFT JOIN sys_vip_info b on i.user_id = b.id
        <where>
          <include refid="where_sql"></include>
         </where>
@@ -385,7 +385,7 @@
        FROM
        shop_invoice i
        LEFT JOIN shop_order o ON i.order_id = o.id
        LEFT JOIN biz_user b on i.user_id = b.open_id
        LEFT JOIN sys_vip_info b on i.user_id = b.id
        <where>
           <include refid="where_sql"></include>
        </where>
@@ -419,7 +419,7 @@
        FROM
        shop_invoice i
        LEFT JOIN shop_order o ON i.order_id = o.id
        LEFT JOIN biz_user b on i.user_id = b.open_id
        LEFT JOIN sys_vip_info b on i.user_id = b.id
        where  invo_id=#{invoId} 
    </select>    
    
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml
@@ -95,13 +95,13 @@
        select
        so.order_no,so.order_status,sp.title pro_name,spa.attr_name pro_type,sp.attrs_values pro_attrs,sku.`NAME` pro_specification,sod.count 'count',sod.price*sod.count order_money,bu.nick_name nick_name,so.order_time
        from
        shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,biz_user bu,shop_sku sku
        shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,sys_vip_info bu,shop_sku sku
        where
        so.del_flag = 2
        and sod.p_id = sp.id
        and sp.category_id = spa.attr_id
        and sod.order_id = so.id
        and bu.open_id = so.user_id
        and bu.id = so.user_id
        and sku.p_id = sod.p_id
        and so.company_id=#{record.companyId}
        <if test="record != null">
@@ -152,13 +152,13 @@
    <select id="selectTotalRecordByQuery" resultType="java.lang.Integer">
        select count(*)
        from
        shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,biz_user bu,shop_sku sku
        shop_order_details sod,shop_product sp,shop_product_attribute spa,shop_order so,sys_vip_info bu,shop_sku sku
        where
        so.del_flag = 2
        and sod.p_id = sp.id
        and sp.category_id = spa.attr_id
        and sod.order_id = so.id
        and bu.open_id = so.user_id
        and bu.id = so.user_id
        and sku.p_id = sod.p_id
        and so.company_id=#{record.companyId}
        <if test="record != null">
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml
@@ -5,17 +5,17 @@
<mapper namespace="com.matrix.system.shopXcx.dao.ShopOrderV2Dao">
    <select id="selectReceivedOrderCount" resultType="java.lang.Integer">
        select count(*)  from shop_order where user_id = #{openId} and order_status in (4,5)
        select count(*)  from shop_order where user_id = #{userId} and order_status in (4,5)
    </select>
    <select id="countOrderAmount" resultType="java.lang.Double">
        select IFNULL(sum(IFNULL( order_money, 0 )),0)  from shop_order where user_id = #{openId} and order_status in (4,5)
        select IFNULL(sum(IFNULL( order_money, 0 )),0)  from shop_order where user_id = #{userId} and order_status in (4,5)
    </select>
    <select id="countBuyZdcp" resultType="java.lang.Integer">
        select count(*) from shop_order a
                          left join shop_order_details b on a.id=b.order_id
        where a.user_id=#{openId}
        where a.user_id=#{userId}
          and  order_status in (4,5)
          and find_in_set(b.p_id,#{productIds})
    </select>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml
@@ -318,7 +318,7 @@
        shop_product_comment c
        LEFT JOIN shop_product p ON c.product_id = p.id
        LEFT JOIN shop_order o ON c.order_id = o.id
        LEFT JOIN biz_user b ON c.user_id = b.open_id
        LEFT JOIN sys_vip_info b ON c.user_id = b.id
        <where>
          <include refid="where_sql"></include>
         </where>
@@ -338,7 +338,7 @@
        shop_product_comment c
        LEFT JOIN shop_product p ON c.product_id = p.id
        LEFT JOIN shop_order o ON c.order_id = o.id
        LEFT JOIN biz_user b ON c.user_id = b.open_id
        LEFT JOIN sys_vip_info b ON c.user_id = b.id
        <where>
           <include refid="where_sql"></include>
        </where>
@@ -379,7 +379,7 @@
            shop_product_comment c
            LEFT JOIN shop_product p ON c.product_id = p.id
            LEFT JOIN shop_order o ON c.order_id = o.id
            LEFT JOIN biz_user b ON c.user_id = b.open_id
            LEFT JOIN sys_vip_info b ON c.user_id = b.id
        <where>
            <if test="record!=null">
                <if test="(record.userId!=null and record.userId!='') or  (record.userId!='' and record.userId==0)  ">
@@ -425,7 +425,7 @@
            shop_product_comment c
            LEFT JOIN shop_product p ON c.product_id = p.id
            LEFT JOIN shop_order o ON c.order_id = o.id
            LEFT JOIN biz_user b ON c.user_id = b.open_id
            LEFT JOIN sys_vip_info b ON c.user_id = b.id
        <where>
            and c.product_id = #{record.productId}
            AND p.del_flag = 2
@@ -448,7 +448,7 @@
        shop_product_comment c
        LEFT JOIN shop_product p ON c.product_id = p.id
        LEFT JOIN shop_order o ON c.order_id = o.id
        LEFT JOIN biz_user b ON c.user_id = b.open_id
        LEFT JOIN sys_vip_info b ON c.user_id = b.id
        <where>
            <if test="record!=null">
                <if test="(record.productId!=null and record.productId!='') or  (record.productId!='' and record.productId==0)  ">
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml
@@ -465,7 +465,7 @@
        u.nick_name
        from shop_refund_record r
        left join shop_order o on r.order_id = o.id
        LEFT JOIN biz_user u ON r.user_id = u.open_id
        LEFT JOIN sys_vip_info u ON r.user_id = u.id
        <where>
          <include refid="where_sql"></include>
         </where>
@@ -483,7 +483,7 @@
    select count(*)
        from shop_refund_record r
        left join shop_order o on r.order_id = o.id
        LEFT JOIN biz_user u ON r.user_id = u.open_id
        LEFT JOIN sys_vip_info u ON r.user_id = u.id
        <where>
           <include refid="where_sql"></include>
        </where>
@@ -520,7 +520,7 @@
        u.nick_name
        from shop_refund_record r
        left join shop_order o on r.order_id = o.id
        LEFT JOIN biz_user u ON r.user_id = u.open_id
        LEFT JOIN sys_vip_info u ON r.user_id = u.id
        where  r.id=#{id}
    </select>
zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml
@@ -281,7 +281,7 @@
        from shop_shopping_cart c
        LEFT JOIN shop_product p ON c.cart_product_id = p.id
        LEFT JOIN shop_sku s ON c.cart_sku_id = s.id
        LEFT JOIN biz_user u ON c.cart_user_id = u.open_id
        LEFT JOIN sys_vip_info u ON c.cart_user_id = u.id
        <where>
          <include refid="where_sql"></include>
         </where>
@@ -300,7 +300,7 @@
    from shop_shopping_cart c
        LEFT JOIN shop_product p ON c.cart_product_id = p.id
        LEFT JOIN shop_sku s ON c.cart_sku_id = s.id
        LEFT JOIN biz_user u ON c.cart_user_id = u.open_id
        LEFT JOIN sys_vip_info u ON c.cart_user_id = u.id
        <where>
           <include refid="where_sql"></include>
        </where>
@@ -361,9 +361,9 @@
    <!-- 统计用户购物车数量 -->
    <select id="selectUserCartCount" resultType="java.lang.Integer" >
        select sum(cart_number) from shop_shopping_cart  c
        select ifnull(sum(cart_number),0) from shop_shopping_cart  c
LEFT JOIN shop_product p on p.id = c.cart_product_id
where c.shop_Id=#{shopId} and  p.del_flag = 2 and cart_user_id=#{openId}
where c.shop_Id=#{shopId} and  p.del_flag = 2 and cart_user_id=#{userId}
    </select>
    <!-- 根据id 锁表查询-->
zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html
@@ -145,7 +145,7 @@
        MTools.ininDatetimepicker(".datetimepicker");
        var delUrl="";
        myGrid=MGrid.initGrid({
            url:basePath+"/admin/bizUser/showList",
            url:basePath+"/admin/sysVipInfo/showList",
            delUrl:delUrl,
        });
zq-erp/src/test/java/com/matrix/JyyTests.java
@@ -1,11 +1,9 @@
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;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
@@ -40,35 +38,6 @@
    @Test
    public void scoreVipDetailService() throws InterruptedException {
        scoreVipDetailService.addScore("oJkRK4yelehsY4S7I6Ee1ydWtQMI",null,null,null,15,1L,1,"测试");
    }
    /**
     *
     */
    @Test
    public void scoreVipDetailDao() throws InterruptedException {
        System.out.println( scoreVipDetailDao.selectUserTotalScore("oJkRK4yelehsY4S7I6Ee1ydWtQMI",null));
    }
    @Test
    public void testSelectReceivedOrderCount() throws InterruptedException {
        System.out.println( shopOrderV2Dao.selectReceivedOrderCount("oJkRK4yelehsY4S7I6Ee1ydWtQMI"));
    }
    @Test
    public void testCountOrderAmount() throws InterruptedException {
        System.out.println( shopOrderV2Dao.countOrderAmount("oJkRK4yelehsY4S7I6Ee1ydWtQMI"));
    }
    @Test
    public void countBuyZdcp() throws InterruptedException {
        System.out.println( shopOrderV2Dao.countBuyZdcp("oJkRK4yelehsY4S7I6Ee1ydWtQMI","1167,1263,1262"));
    }
}
zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java
@@ -3,8 +3,8 @@
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.StrUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.matrix.biz.bean.BizUser;
import com.matrix.biz.service.BizUserService;
import com.matrix.system.hive.bean.SysVipInfo;
import com.matrix.system.hive.service.SysVipInfoService;
import com.matrix.core.constance.MatrixConstance;
import com.matrix.core.tools.LogUtil;
import com.matrix.core.tools.StringUtils;
@@ -53,7 +53,7 @@
    ShopOrderDetailsDao shopOrderDetailsDao;
    @Autowired
    BizUserService bizUserService;
    SysVipInfoService sysVipInfoService;
    @Autowired
@@ -97,7 +97,7 @@
    @Test
    public void handleExtensionOrder() {
        ShopOrder order = new ShopOrder();
        order.setUserId("oJkRK4_pWN2kjp75B_G6oGSWawj0");
        order.setId(1190);
        order.setCompanyId(36L);
        
@@ -118,8 +118,8 @@
        order.setDetails(details);
        order.setOrderMoney(new BigDecimal(0.01));
        //判读客户是否存在上级,存在则产生上级的收益
        BizUser bizUser = bizUserService.findByOpenId(order.getUserId());
        LogUtil.debug("处理分销订单userOpid={}",bizUser.getOpenId());
        SysVipInfo sysVipInfo = sysVipInfoService.findById(order.getUserId());
        LogUtil.debug("处理分销订单userOpid={}",sysVipInfo.getId());
        //判断是否重复生成
        QueryWrapper queryWrapper=new QueryWrapper();
        queryWrapper.eq("order_id",order.getId());
@@ -150,9 +150,9 @@
                if(StringUtils.isNotBlank(item.getShopProduct().getAttrValues())
                        && item.getShopProduct().getAbleSales()==ShopProduct.ABLE_SALES){
                    //分销规则是否开启自购返佣
                    BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, bizUser.getCompanyId());
                    BusParameterSettings zgfy = parameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_ZGFY, sysVipInfo.getCompanyId());
                    //按分销等级计算
                    ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(bizUser.getSalesmanGrade());
                    ShopSalesmanGrade shopSalesmanGrade = shopSalesmanGradeDao.selectById(sysVipInfo.getSalesmanGrade());
                    if(ObjectUtil.isNotEmpty(zgfy)) {
                        //获取商品的自购返佣价格,如果没有设置,在去获取当前推广人的等级的自购返佣比例
                        if(StrUtil.isNotEmpty(zgfy.getParamValue()) && 
@@ -178,19 +178,19 @@
                shopSalesmanOrderDao.insert(salesmanOrder);
            }
            //存在上级
            if(StringUtils.isNotBlank(bizUser.getParentOpenId())) {
                BizUser salesMan=bizUserService.findByOpenId(bizUser.getParentOpenId());
            if(sysVipInfo.getRecommendId()!=null) {
                SysVipInfo salesMan=sysVipInfoService.findById(sysVipInfo.getRecommendId());
                Double salesAmount=0D;
                Double invitationAmount=0D;
                BizUser invitationMan=null;
                SysVipInfo invitationMan=null;
                ShopSalesmanOrder invitationOrder=null;
                boolean hasInvitationMan=StringUtils.isNotBlank(salesMan.getParentOpenId());
                boolean hasInvitationMan=salesMan.getRecommendId()!=null;
                //判断推广员是否还存在上级,存在则计算邀请收益
                if(hasInvitationMan){
                    invitationMan=bizUserService.findByOpenId(salesMan.getParentOpenId());
                    invitationMan=sysVipInfoService.findById(salesMan.getRecommendId());
                    invitationOrder=new ShopSalesmanOrder();
                    BeanUtils.copyProperties(salesmanOrder,invitationOrder);
                    invitationOrder.setSalesUserId(invitationMan.getOpenId());
                    invitationOrder.setSalesUserId(invitationMan.getId());
                    invitationOrder.setRevenueType(ShopSalesmanOrder.REVENUE_TYPE_INVITATION);
                }
                //收益计算
@@ -226,7 +226,7 @@
                    zk=order.getOrderMoney().doubleValue()/orderTotal;
                    salesAmount=salesAmount*zk;
                    salesmanOrder.setAmount(salesAmount);
                    salesmanOrder.setSalesUserId(bizUser.getParentOpenId());
                    salesmanOrder.setSalesUserId(sysVipInfo.getRecommendId());
                    shopSalesmanOrderDao.insert(salesmanOrder);
                }
                //邀请提成记录
@@ -237,7 +237,7 @@
                    shopSalesmanOrderDao.insert(invitationOrder);
                } 
            }else{
                LogUtil.debug("不存在父级userOpid={}",bizUser.getOpenId());
                LogUtil.debug("不存在父级userOpid={}",sysVipInfo.getId());
            }
        }else{
            LogUtil.debug("重复订单id={}",order.getId());
zq-erp/src/test/java/com/matrix/SourceFlowTests.java
@@ -203,10 +203,6 @@
    @Autowired
    private ShopSalesmanApplyDao salesmanApplyDao;
    @Test
    public void inPageTest() {
        Page<SalesmanVo> page = new Page<>(1, 10);
        salesmanApplyDao.selectInvitationuserInPage(page, "oLdgp47g7SXJnmti1iDzQaJpXNz4");
    }
}