From 241a49f9653aa83d1dcd9bf646208da3157df35a Mon Sep 17 00:00:00 2001 From: 935090232@qq.com <ak473600000> Date: Mon, 05 Apr 2021 22:48:14 +0800 Subject: [PATCH] 合并BizUser表与SysVipInfo表 大部分逻辑已经修正 可能存在问题的 1、拼团秒杀 2、分享图 3、分销结算 --- zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java | 6 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml | 6 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java | 89 - zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml | 10 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml | 8 zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java | 13 zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java | 2 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java | 132 - zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java | 6 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java | 6 zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java | 8 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java | 6 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml | 6 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java | 6 zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java | 2 zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java | 9 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java | 16 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java | 16 zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java | 4 zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java | 2 zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java | 5 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java | 5 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java | 46 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java | 10 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java | 21 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java | 4 zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java | 10 zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml | 36 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java | 4 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml | 2 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java | 8 zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java | 58 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java | 11 zq-erp/src/test/java/com/matrix/SourceFlowTests.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java | 31 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java | 9 zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java | 2 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java | 8 zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java | 12 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java | 14 zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java | 60 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java | 10 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java | 35 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java | 18 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java | 10 zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java | 16 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java | 13 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml | 6 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml | 8 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml | 8 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java | 22 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java | 6 zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml | 207 ++ zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java | 36 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml | 8 zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java | 35 zq-erp/src/main/resources/config/db/increment/推广员.sql | 16 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java | 65 zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java | 107 - zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java | 10 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java | 12 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml | 10 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java | 39 zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java | 8 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java | 11 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java | 47 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java | 6 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml | 8 zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java | 68 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java | 6 zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml | 35 zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml | 6 zq-erp/src/main/resources/mybatis/mapper/hive/OnlinebookingDao.xml | 24 zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java | 32 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java | 6 zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java | 160 + zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java | 6 zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java | 14 zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html | 2 zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java | 3 zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java | 701 +--------- zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java | 95 zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java | 276 ++-- zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java | 2 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java | 16 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java | 8 zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java | 13 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java | 26 zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java | 7 zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml | 29 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java | 142 - zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java | 4 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java | 6 zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java | 8 zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java | 40 zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java | 9 /dev/null | 559 -------- zq-erp/src/test/java/com/matrix/JyyTests.java | 31 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java | 6 zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java | 4 zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java | 6 zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml | 77 121 files changed, 1,325 insertions(+), 2,678 deletions(-) diff --git a/zq-erp/src/main/java/com/matrix/biz/action/1.sql b/zq-erp/src/main/java/com/matrix/biz/action/1.sql deleted file mode 100644 index 9f5ebb3..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/action/1.sql +++ /dev/null @@ -1,129 +0,0 @@ -INSERT INTO `sys_data_dictionary` (`ID`,value, `type_NAME` ) -VALUES - (4, '优惠券', '礼遇类型 '), - (5, '是否', '礼遇类型 '), - (6, '会员转介', '到店途径'), - (7, '瑜珈转介', '到店途径'), - (8, '员工转介', '到店途径'), - (9, '赠送', '业务类型'), - (10, '购买', '业务类型'), - (11, '消耗', '业务类型'), - (12, '充值', '业务类型'), - (13, '补交', '业务类型'), - (14, '办卡', '业务类型'), - (15, '咨询', '业务类型'), - (17, '白羊座', '星座'), - (18, '金牛座', '星座'), - (19, '双子座', '星座'), - (20, '巨蟹座', '星座'), - (21, '狮子座', '星座'), - (22, '处女座', '星座'), - (23, '天秤座', '星座'), - (24, '天蝎座', '星座'), - (25, '射手座', '星座'), - (26, '摩羯座', '星座'), - (27, '水瓶座', '星座'), - (28, '双鱼座', '星座'), - (29, '鼠', '生肖'), - (30, '牛', '生肖'), - (31, '虎', '生肖'), - (32, '兔', '生肖'), - (33, '龙', '生肖'), - (34, '蛇', '生肖'), - (35, '马', '生肖'), - (36, '羊', '生肖'), - (37, '猴', '生肖'), - (38, '鸡', '生肖'), - (39, '狗', '生肖'), - (40, '猪', '生肖'), - (41, '活跃', '会员状态'), - (42, '不活跃', '会员状态'), - (43, '休眠', '会员状态'), - (44, '死客', '会员状态'), - (45, '有卡会员', '会员类型'), - (46, '无卡会员', '会员类型'), - (47, '线上会员', '会员类型'), - (49, '活跃', '会员活跃度'), - (50, '不活跃', '会员活跃度'), - (51, '休眠', '会员活跃度'), - (53, '消耗产品', '产品用途'), - (54, '家居产品', '产品用途'), - (55, '家居产品或消耗产品', '产品用途'), - (58, '上架', '产品状态'), - (59, '下架', '产品状态'), - (60, '张', '存货单位'), - (61, '套', '存货单位'), - (62, '瓶', '存货单位'), - (63, '盒', '存货单位'), - (64, '失败', '商机处理结果'), - (65, '成功', '商机处理结果'), - (66, '待处理', '商机处理结果'), - (67, '上架', '套餐状态'), - (68, '下架', '套餐状态'), - (69, '上架', '项目状态'), - (70, '下架', '项目状态'), - (71, '未审核', '审核状态'), - (72, '通过', '审核状态'), - (73, '未通过', '审核状态'), - (74, 'ml', '计量单位'), - (75, 'g', '计量单位'), - (77, '自然进店', '到店途径'), - (79, '花茶', '粥品名称'), - (80, '面膜', '易耗品名称'), - (81, '升', '存货单位'), - (82, '次', '计量单位'), - (83, '瓶', '计量单位'), - (84, '套', '计量单位'), - (86, '片', '计量单位'), - (87, '片', '存货单位'), - (88, '支', '存货单位'), - (89, '包', '存货单位'), - (90, '支', '计量单位'), - (91, '包', '计量单位'), - (92, '1', '积分签到赠送额'), - (94, '美肤', '微信项目分类'), - (95, '抗衰', '微信项目分类'), - (96, '微整', '微信项目分类'), - (97, '纤体', '微信项目分类'), - (98, '祛痘', '微信项目分类'), - (99, '祛斑', '微信项目分类'), - (100, '眉眼', '微信项目分类'), - (101, '美胸', '微信项目分类'), - (102, '舒缓', '微信项目分类'), - (103, '脱毛', '微信项目分类'), - (104, '私密', '微信项目分类'), - (105, '测试', '会员卡等级大类'), - (106, '折扣', '礼遇类型 '), - (109, '肌肤年轻化检测', '问卷分类'), - (110, '全面健康化检测', '问卷分类'), - (113, 'fdsfs', '粥品名称'), - (115, '户外广告', '到店途径'), - (116, '网络团购', '到店途径'), - (117, '市场-友阿体验', '到店途径'), - (118, '市场-艾特花嫁', '到店途径'), - (119, '市场-云水润心', '到店途径'), - (120, '市场-其它', '到店途径'), - (121, '2019年4月精选长沙', '到店途径'), - (122, '公司赠送-云水润心', '到店途径'), - (123, '市场-通联支付', '到店途径'), - (124, '市场-平安银行', '到店途径'), - (125, '单选', '问卷类型'), - (126, '多选', '问卷类型'), - (127, '文本', '问卷类型'), - (128, '长文本', '问卷类型'), - (131, '奈嘉洛眼龄健康管理', '问卷分类'), - (132, '标题', '问卷类型'), - (133, '台', '计量单位'), - (134, '台', '存货单位'), - (135, '只', '存货单位'), - (136, '只', '计量单位'), - (137, '盒', '计量单位'), - (138, '2018步步高母亲节活动卡', '到店途径'), - (139, '2018珠江物业母亲节活动', '到店途径'), - (140, '2018学乐教育母亲节活动', '到店途径'), - (141, '2019第一季度邮政银行客户', '到店途径'), - (142, '2019年3月商家联盟拓客活动', '到店途径'), - (143, '201903珠江花园画册拓客', '到店途径'), - (144, '沉睡', '会员活跃度'), - (145, '2019年4月精选长沙', '礼遇类型 '), - (146, '广发银行线上商城合作', '到店途径'); diff --git a/zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java b/zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java deleted file mode 100644 index 5b07806..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/action/BizUserAction.java +++ /dev/null @@ -1,48 +0,0 @@ -package com.matrix.biz.action; - - -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.dao.BizUserDao; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.hive.action.util.QueryUtil; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Controller; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; - -import java.util.List; - -/** - * @description 会员查询 - * @author pengliang - * @date 2019-06-19 - */ - -@Controller -@RequestMapping(value = "/admin/bizUser") -public class BizUserAction { - - @Autowired - private BizUserDao bizUserDao; - - /** - * 列表显示 - */ - @RequestMapping(value = "/showList") - public @ResponseBody - AjaxResult showList(BizUser bizUser, PaginationVO pageVo) { - - pageVo.setSort("createTime"); - pageVo.setOrder("desc"); - QueryUtil.setQueryLimitCom(bizUser); - List<BizUser> dataList = bizUserDao.selectInPage(bizUser, pageVo); - AjaxResult result = new AjaxResult(AjaxResult.STATUS_SUCCESS, dataList, - bizUserDao.selectTotalRecord(bizUser)); - return result; - } - - - - -} diff --git a/zq-erp/src/main/java/com/matrix/biz/action/MultipleFileUploadAction.java b/zq-erp/src/main/java/com/matrix/biz/action/MultipleFileUploadAction.java deleted file mode 100644 index 9107992..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/action/MultipleFileUploadAction.java +++ /dev/null @@ -1,170 +0,0 @@ -package com.matrix.biz.action; - -import com.alibaba.fastjson.JSONObject; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.StringUtils; -import com.matrix.core.tools.UUIDUtil; -import com.matrix.system.common.constance.AppConstance; -import org.apache.commons.fileupload.FileUploadException; -import org.apache.log4j.Logger; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Controller; -import org.springframework.util.FileCopyUtils; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.ResponseBody; -import org.springframework.web.multipart.MultipartFile; -import org.springframework.web.multipart.MultipartHttpServletRequest; - -import javax.servlet.http.HttpServletResponse; -import java.io.File; -import java.io.IOException; -import java.text.SimpleDateFormat; -import java.util.Date; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * 多文件上传控制器 - * - * @author jiangyouyao - * @email 512061637@qq.com - * @date 2019年2月25日 - */ -@Controller -@RequestMapping(value = "admin/multipleUploadFile") -public class MultipleFileUploadAction { - Logger log = Logger.getLogger(MultipleFileUploadAction.class); - - @Value("${file_storage_path}") - private String fileStoragePath; - @Value("${static_resource_url}") - private String nginxUrl; - - /** - * 最大值 - */ - private Long maxSize = 1024*1024*100L; - - /** - * 多文件上传方法 - * - * @author jiangyouyao - * @email 512061637@qq.com - * @date 2019年2月25日 - * @param response - * @param request - * @return - * @throws IOException - * @throws FileUploadException - */ - @RequestMapping(value = "/doUpload") - public @ResponseBody JSONObject doFileUpload(HttpServletResponse response, MultipartHttpServletRequest request, Integer data) - throws IOException, FileUploadException { - // 文件保存目录路径 - String savePath = fileStoragePath; - // 文件保存目录URL - String saveUrl = nginxUrl; - // String msgPag = "common/fileUploadResult"; - JSONObject object = new JSONObject(); - response.setContentType("text/html; charset=UTF-8"); - request.setCharacterEncoding("UTF-8"); - - // 保存和访问路径检查 - if (StringUtils.isBlank(saveUrl) || StringUtils.isBlank(savePath)) { - object.put("status", "err"); - object.put("msg", "文件上传失败错误代码:001"); - return object; - } - // 检查目录 - File uploadDir = new File(savePath); - if (!uploadDir.isDirectory()) { - uploadDir.mkdir(); - } - // 检查目录写权限 -// if (!uploadDir.canWrite()) { -// object.put("status", "err"); -// object.put("msg", "上传目录没有写权限"); -// return object; -// } - - Map<String, MultipartFile> fileMaps = request.getFileMap(); - for (String key : fileMaps.keySet()) { - MultipartFile file = fileMaps.get(key); - - SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); - String ymd = sdf.format(new Date()); - savePath += ymd + "/"; - saveUrl += ymd + "/"; - File dirFile = new File(savePath); - if (!dirFile.exists()) { - dirFile.mkdirs(); - } - log.info("上传文件名:" + file.getOriginalFilename()); - log.info("上传文件大小:" + file.getBytes().length); - log.info("上传文件大小限制:" + maxSize); - log.info("上传文件大小是否超过限制:" + (file.getBytes().length > maxSize)); - if (file.getBytes().length > maxSize) { - object.put("status", "err"); - object.put("msg", "上传文件大小超过限制"); - return object; - } - String fileName = file.getOriginalFilename(); - String fileExt = fileName.substring(fileName.lastIndexOf(".") + 1).toLowerCase(); - - fileName = fileName.replace("." + fileExt, ""); - fileName = getSensitive(fileName); - String newFileName = UUIDUtil.getRandomID() + UUIDUtil.getRandomID() + "." + fileExt; - File uploadedFile = new File(savePath, newFileName); - try { - FileCopyUtils.copy(file.getBytes(), uploadedFile); - } catch (Exception e) { - object.put("status", "err"); - object.put("msg", "上传文件失败 "+e.getMessage()); - return object; - } - log.info("saveUrl:" + saveUrl); - String visitPath = saveUrl + newFileName; - log.info("上传一个文件:" + newFileName); - log.info("访问路径:" + visitPath); - // 获取回调函数 - /* - * String callBack = request.getParameter("callBack"); String inputId = - * request.getParameter("inputId"); request.setAttribute("status", "200"); - * request.setAttribute("callBack", callBack); request.setAttribute("inputId", - * inputId); request.setAttribute("url", visitPath); - */ - object.put("path", visitPath); - object.put("fileName", fileName); - object.put("status", 200); - if (data != null) { - object.put("index", data); - } - } - return object; - } - - /** - * 检查文件名,过滤特殊字符 - * - * @author jiangyouyao - * @email 512061637@qq.com - * @date 2019年2月25日 - * @param globWords - * @return - */ - public String getSensitive(String globWords) { - - String sensitive = ""; - Pattern pattern = Pattern.compile(AppConstance.SPECIAL_CHARACTERS); - Matcher matcher = pattern.matcher(globWords); - while (matcher.find()) { - sensitive += matcher.group(); - } - /* - * if(sensitive=="" || sensitive.length()<3 ){ - * sensitive=StringUtils.getRandomString(8); } - */ - return sensitive; - } -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/biz/action/SynQueryDemo.java b/zq-erp/src/main/java/com/matrix/biz/action/SynQueryDemo.java deleted file mode 100644 index 6178cb5..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/action/SynQueryDemo.java +++ /dev/null @@ -1,177 +0,0 @@ -package com.matrix.biz.action; -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.HttpURLConnection; -import java.net.URL; -import java.net.URLEncoder; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.util.HashMap; -import java.util.Map; - - -/** - * 实时查询请求Demo - * @author Administrator - * - */ -public class SynQueryDemo { - - public static void main(String[] args) { - String key = "RFGYfbVI747"; //贵司的授权key - String customer = "244D09E91F5500D0AB888299959835A2"; //贵司的查询公司编号 - String com = "shunfeng"; //快递公司编码 - String num = "232581179302"; //快递单号 - String phone = ""; //手机号码后四位 - String from = ""; //出发地 - String to = ""; //目的地 - int resultv2 = 0; //开启行政规划解析 - - SynQueryDemo demo = new SynQueryDemo(key, customer); - String result = demo.synQueryData(com, num, phone, from, to, resultv2); - System.out.println(result); - } - - /** - * 实时查询请求地址 - */ - private static final String SYNQUERY_URL = "http://poll.kuaidi100.com/poll/query.do"; - - private String key; //授权key - private String customer; //实时查询公司编号 - - public SynQueryDemo(String key, String customer) { - this.key = key; - this.customer = customer; - } - - /** - * 实时查询快递单号 - * @param com 快递公司编码 - * @param num 快递单号 - * @param phone 手机号 - * @param from 出发地城市 - * @param to 目的地城市 - * @param resultv2 开通区域解析功能:0-关闭;1-开通 - * @return - */ - public String synQueryData(String com, String num, String phone, String from, String to, int resultv2) { - - StringBuilder param = new StringBuilder("{"); - param.append("\"com\":\"").append(com).append("\""); - param.append(",\"num\":\"").append(num).append("\""); - param.append(",\"phone\":\"").append(phone).append("\""); - param.append(",\"from\":\"").append(from).append("\""); - param.append(",\"to\":\"").append(to).append("\""); - if(1 == resultv2) { - param.append(",\"resultv2\":1"); - } else { - param.append(",\"resultv2\":0"); - } - param.append("}"); - - Map<String, String> params = new HashMap<String, String>(); - params.put("customer", this.customer); - String sign = MD5Utils.encode(param + this.key + this.customer); - params.put("sign", sign); - params.put("param", param.toString()); - - return this.post(params); - } - - /** - * 发送post请求 - */ - public String post(Map<String, String> params) { - StringBuffer response = new StringBuffer(""); - - BufferedReader reader = null; - try { - StringBuilder builder = new StringBuilder(); - for (Map.Entry<String, String> param : params.entrySet()) { - if (builder.length() > 0) { - builder.append('&'); - } - builder.append(URLEncoder.encode(param.getKey(), "UTF-8")); - builder.append('='); - builder.append(URLEncoder.encode(String.valueOf(param.getValue()), "UTF-8")); - } - byte[] bytes = builder.toString().getBytes("UTF-8"); - - URL url = new URL(SYNQUERY_URL); - HttpURLConnection conn = (HttpURLConnection) url.openConnection(); - conn.setConnectTimeout(3000); - conn.setReadTimeout(3000); - conn.setRequestMethod("POST"); - conn.setRequestProperty("accept", "*/*"); - conn.setRequestProperty("connection", "Keep-Alive"); - conn.setRequestProperty("Content-Type", "application/x-www-form-urlencoded"); - conn.setRequestProperty("Content-Length", String.valueOf(bytes.length)); - conn.setDoOutput(true); - conn.getOutputStream().write(bytes); - - reader = new BufferedReader(new InputStreamReader(conn.getInputStream(), "UTF-8")); - - String line = ""; - while ((line = reader.readLine()) != null) { - response.append(line); - } - } catch (Exception e) { - e.printStackTrace(); - } finally { - try { - if (null != reader) { - reader.close(); - } - } catch (IOException e) { - e.printStackTrace(); - } - } - - return response.toString(); - } -} - -/** - * md5加密 - */ -class MD5Utils { - private static MessageDigest mdigest = null; - private static char digits[] = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; - - private static MessageDigest getMdInst() { - if (null == mdigest) { - try { - mdigest = MessageDigest.getInstance("MD5"); - } catch (NoSuchAlgorithmException e) { - e.printStackTrace(); - } - } - return mdigest; - } - - public static String encode(String s) { - if(null == s) { - return ""; - } - - try { - byte[] bytes = s.getBytes(); - getMdInst().update(bytes); - byte[] md = getMdInst().digest(); - int j = md.length; - char str[] = new char[j * 2]; - int k = 0; - for (int i = 0; i < j; i++) { - byte byte0 = md[i]; - str[k++] = digits[byte0 >>> 4 & 0xf]; - str[k++] = digits[byte0 & 0xf]; - } - return new String(str); - } catch (Exception e) { - e.printStackTrace(); - return null; - } - } -} diff --git a/zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java b/zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java deleted file mode 100644 index 8107216..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/bean/BizUser.java +++ /dev/null @@ -1,515 +0,0 @@ -package com.matrix.biz.bean; - -import com.matrix.core.anotations.Extend; -import com.matrix.core.pojo.EntityDTO; - -import java.util.Date; - -/** - * @description 用户表 - * @author jyy - */ -public class BizUser extends EntityDTO{ - @Extend - private static final long serialVersionUID = 1L; - - /** - * 是销售员 - */ - public static final int IS_SALES = 1; - /** - * 不是销售员 - */ - public static final int NOT_SALES = 2; - - - - /** - * 主键 - */ - private Long userId; - - - /** - * 真实姓名 - */ - private String userName; - - /** - * 可提现金额 - */ - private Double withdrawalCash; - - /** - *推广员等级 - */ - private Long salesmanGrade; - - - /** - * 密码 - */ - private String userPassword; - - - /** - * 用户昵称 - */ - private String nickName; - - - /** - * 头像 - */ - private String avatarUrl; - - - /** - * 微信openid用户唯一标识 - */ - private String openId; - - - /** - * 用户在开发平台的唯一标识符 - */ - private String unionId; - - - /** - * 性别 1、男 2、女 0、未知 - */ - private String gender; - - - /** - * 手机号码 - */ - private String phoneNumber; - - - /** - * 用户所在地 - */ - private String area; - - - /** - * 用户所在城市 - */ - private String city; - - - /** - * 用户所在省份 - */ - private String province; - - - /** - * 用户所在国家 - */ - private String country; - - - /** - * 会话密匙 - */ - private String sessionKey; - - - /** - * 最后登录时间 - */ - private Date lastLoginTime; - - - /** - * 用户状态 - */ - private Integer userStatus; - - - /** - * vip等级 - */ - private Integer userVip; - - - /** - * 到期时间 - */ - private Date userExpiryTime; - - - /** - * 认证信息 - */ - private String userAuthentication; - - - /** - * 用户是否授权 1、是 2、否 - */ - private Integer userIsAuthorize; - - - /** - * 用户临时名称 - */ - private String userTempName; - - - /** - * 用户临时头像 - */ - private String userTempAvatarUrl; - - - /** - * 用户类型 1、普通用户 2、会员 3、游客 - */ - private Integer userType; - - - - - /** - * 用户当前积分 - */ - private Integer currentScore; - - - /** - * 上级用户openId - */ - private String parentOpenId; - - - /** - * 绑定上级用户时间 - */ - private Date bindingParentTime; - - - /** - * 是否是销售员(1=是,2=否) - */ - private Integer isSales; - - /** - * 用户类型 1、待审核 2、审核通过 0、审核未通过 - */ - private Integer fenxiaoState; - - - /** - * 开始时间 - */ - @Extend - private String startTime; - - /** - * 结束时间 - */ - @Extend - private String endTime; - /** - * token - */ - @Extend - private String token; - public String getToken() { - return token; - } - - private Long companyId; - public Long getCompanyId() { - return companyId; - } - - public void setCompanyId(Long companyId) { - this.companyId = companyId; - } - - - - public Long getUserId() { - return userId; - } - - public void setUserId(Long userId) { - this.userId=userId; - } - - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName=userName; - } - - public Double getWithdrawalCash() { - return withdrawalCash; - } - - public void setWithdrawalCash(Double withdrawalCash) { - this.withdrawalCash = withdrawalCash; - } - - public Long getSalesmanGrade() { - return salesmanGrade; - } - - public void setSalesmanGrade(Long salesmanGrade) { - this.salesmanGrade = salesmanGrade; - } - - public String getUserPassword() { - return userPassword; - } - - public void setUserPassword(String userPassword) { - this.userPassword=userPassword; - } - - - public String getNickName() { - return nickName; - } - - public void setNickName(String nickName) { - this.nickName=nickName; - } - - - public String getAvatarUrl() { - return avatarUrl; - } - - public void setAvatarUrl(String avatarUrl) { - this.avatarUrl=avatarUrl; - } - - - public String getOpenId() { - return openId; - } - - public void setOpenId(String openId) { - this.openId=openId; - } - - - public String getUnionId() { - return unionId; - } - - public void setUnionId(String unionId) { - this.unionId=unionId; - } - - - public String getGender() { - return gender; - } - - public void setGender(String gender) { - this.gender=gender; - } - - - public String getPhoneNumber() { - return phoneNumber; - } - - public void setPhoneNumber(String phoneNumber) { - this.phoneNumber=phoneNumber; - } - - - public String getArea() { - return area; - } - - public void setArea(String area) { - this.area=area; - } - - - public String getCity() { - return city; - } - - public void setCity(String city) { - this.city=city; - } - - - public String getProvince() { - return province; - } - - public void setProvince(String province) { - this.province=province; - } - - - public String getCountry() { - return country; - } - - public void setCountry(String country) { - this.country=country; - } - - - public String getSessionKey() { - return sessionKey; - } - - public void setSessionKey(String sessionKey) { - this.sessionKey=sessionKey; - } - - - public Date getLastLoginTime() { - return lastLoginTime; - } - - public void setLastLoginTime(Date lastLoginTime) { - this.lastLoginTime=lastLoginTime; - } - - - public Integer getUserStatus() { - return userStatus; - } - - public void setUserStatus(Integer userStatus) { - this.userStatus=userStatus; - } - - - public Integer getUserVip() { - return userVip; - } - - public void setUserVip(Integer userVip) { - this.userVip=userVip; - } - - - public Date getUserExpiryTime() { - return userExpiryTime; - } - - public void setUserExpiryTime(Date userExpiryTime) { - this.userExpiryTime=userExpiryTime; - } - - - public String getUserAuthentication() { - return userAuthentication; - } - - public void setUserAuthentication(String userAuthentication) { - this.userAuthentication=userAuthentication; - } - - - public Integer getUserIsAuthorize() { - return userIsAuthorize; - } - - public void setUserIsAuthorize(Integer userIsAuthorize) { - this.userIsAuthorize=userIsAuthorize; - } - - - public String getUserTempName() { - return userTempName; - } - - public void setUserTempName(String userTempName) { - this.userTempName=userTempName; - } - - - public String getUserTempAvatarUrl() { - return userTempAvatarUrl; - } - - public void setUserTempAvatarUrl(String userTempAvatarUrl) { - this.userTempAvatarUrl=userTempAvatarUrl; - } - - - public Integer getUserType() { - return userType; - } - - public void setUserType(Integer userType) { - this.userType=userType; - } - - public String getStartTime() { - return startTime; - } - - public void setStartTime(String startTime) { - this.startTime = startTime; - } - - public String getEndTime() { - return endTime; - } - - public void setEndTime(String endTime) { - this.endTime = endTime; - } - - - - public Integer getCurrentScore() { - return currentScore; - } - - public void setCurrentScore(Integer currentScore) { - this.currentScore = currentScore; - } - - public String getParentOpenId() { - return parentOpenId; - } - - public void setParentOpenId(String parentOpenId) { - this.parentOpenId = parentOpenId; - } - - public Date getBindingParentTime() { - return bindingParentTime; - } - - public void setBindingParentTime(Date bindingParentTime) { - this.bindingParentTime = bindingParentTime; - } - - public Integer getIsSales() { - return isSales; - } - - public void setIsSales(Integer isSales) { - this.isSales = isSales; - } - - public Integer getFenxiaoState() { - return fenxiaoState; - } - - public void setFenxiaoState(Integer fenxiaoState) { - this.fenxiaoState = fenxiaoState; - } -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java b/zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java deleted file mode 100644 index 40eeda0..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/dao/BizUserDao.java +++ /dev/null @@ -1,45 +0,0 @@ -package com.matrix.biz.dao; - -import com.matrix.biz.bean.BizUser; -import com.matrix.core.pojo.PaginationVO; -import org.apache.ibatis.annotations.Param; - -import java.util.List; -import java.util.Map; - -/** - * @description 用户表 - * @author jyy - * @date 2019-05-31 10:03 - */ -public interface BizUserDao { - - public int insert(@Param("item") BizUser bizUser); - - public int batchInsert(@Param("list") List<BizUser> bizUserList); - - public int updateByMap(Map<String, Object> modifyMap); - - public int updateByModel(@Param("record") BizUser bizUser); - - public int deleteByIds(@Param("list") List<Long> list); - - public int deleteById(Long userId); - - public int deleteByModel(@Param("record") BizUser bizUser); - - public List<BizUser> selectInPage(@Param("record") BizUser bizUser, @Param("pageVo") PaginationVO pageVo); - - public List<BizUser> selectByModel(@Param("record") BizUser bizUser); - - public int selectTotalRecord(@Param("record") BizUser bizUser); - - public BizUser selectById(Long userId); - - public BizUser selectForUpdate(Long userId); - - public BizUser findByOpenId(@Param("openId") String openId); - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java b/zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java deleted file mode 100644 index be36239..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/service/BizUserService.java +++ /dev/null @@ -1,82 +0,0 @@ -package com.matrix.biz.service; - -import com.matrix.biz.bean.BizUser; -import com.matrix.core.pojo.PaginationVO; - -import java.util.List; - -/** - * @description service接口类 (用户表) - * @author jyy - * @date 2019-05-31 10:03 - */ -public interface BizUserService { - - /** - * 新增 - */ - public int add(BizUser bizUser); - - /** - * 批量新增 - */ - public int batchAdd(List<BizUser> bizUserList); - - /** - * 根据map键值对 更新 - */ - public int modifyByMap(BizUser oldBizUser, BizUser newBizUser); - - /** - * 根据对象 更新 - */ - public int modifyByModel(BizUser bizUser); - - - - /** - * 根据id删除 - */ - public int removeById(Long userId); - - /** - * 根据对象删除 - */ - public int removeByModel(BizUser bizUser); - - /** - * 分页查询 - */ - public List<BizUser> findInPage(BizUser bizUser, PaginationVO pageVo); - - /** - * 根据对象查询 - */ - public List<BizUser> findByModel(BizUser bizUser); - - /** - * 统计记录数 - */ - public int findTotal(BizUser bizUser); - - public int remove(List<Long> list); - - - /** - * 根据openId更新 - */ - - public BizUser findByOpenId(String openId); - - public BizUser findById(Long userId); - /** - * 保存用户信息 - */ - public int saveUserInfo(BizUser bizUser); - - /** - * 设置为推广员 - * @param invitationId - */ - public int setToBeAnSalesman(String openId,String invitationId,long gradeId); -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java b/zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java deleted file mode 100644 index 7e24950..0000000 --- a/zq-erp/src/main/java/com/matrix/biz/service/impl/BizUserServiceImpl.java +++ /dev/null @@ -1,168 +0,0 @@ -package com.matrix.biz.service.impl; - -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.constance.SystemErrorCode; -import com.matrix.core.exception.GlobleException; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.core.tools.ModelUtils; -import com.matrix.system.common.constance.AppConstance; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Service; - -import java.util.Date; -import java.util.List; -import java.util.Map; - -/** - * @description service接口实现类(用户表) - * @author jyy - * @date 2019-05-31 10:03 - */ -@Service -public class BizUserServiceImpl implements BizUserService { - - - @Autowired - private BizUserDao bizUserDao; - - - @Override - public int add(BizUser bizUser){ - // 设置基本字段信息,临时字段 - bizUser.setUserIsAuthorize(AppConstance.IS_NOT_AUTHORIZE); - bizUser.setCreateBy(AppConstance.USER_TYPE_ADMIN); - bizUser.setUpdateBy(AppConstance.USER_TYPE_ADMIN); - return bizUserDao.insert(bizUser); - - } - - @Override - public int batchAdd(List<BizUser> bizUserList) { - //这里没有做基本字段的设置,如有需要请自己实现 - int num = 0; - int c = 10000; - int size = bizUserList.size()/c + 1; - for(int i=0; i<size; i++) { - int begin = i*c; - int end = (i+1)*c; - end = end >= bizUserList.size() ? bizUserList.size() : end; - List<BizUser> insertList = bizUserList.subList(begin, end); - num += bizUserDao.batchInsert(insertList); - } - return num; - - } - - - - @Override - public int modifyByMap(BizUser oldBizUser - ,BizUser newBizUser){ - - Map<String, Object> modifyMap = null; - try { - if (!ModelUtils.isModified(oldBizUser, newBizUser)) { - return MatrixConstance.DML_SUCCESSS; - } - modifyMap = ModelUtils.comparePojo2Map(oldBizUser, newBizUser); - } catch (Exception e) { - throw new GlobleException(SystemErrorCode.DATA_UPDATE_FAIL, e, newBizUser); - } - if (modifyMap.size() > 0) { - modifyMap.put("userId", oldBizUser.getUserId()); - bizUserDao.updateByMap(modifyMap); - } - return MatrixConstance.DML_SUCCESSS; - } - - @Override - public int modifyByModel(BizUser bizUser){ - - return bizUserDao.updateByModel(bizUser); - - } - - - - @Override - public int remove(List<Long> list){ - - return bizUserDao.deleteByIds(list); - - } - - @Override - public int removeById(Long userId){ - - return bizUserDao.deleteById(userId); - - } - - @Override - public int removeByModel(BizUser bizUser){ - - return bizUserDao.deleteByModel(bizUser); - - } - - - @Override - public List<BizUser> findInPage(BizUser bizUser, PaginationVO pageVo){ - - return bizUserDao.selectInPage(bizUser , pageVo); - - } - - @Override - public List<BizUser> findByModel(BizUser bizUser){ - - return bizUserDao.selectByModel(bizUser); - - } - - @Override - public int findTotal(BizUser bizUser){ - - return bizUserDao.selectTotalRecord(bizUser); - - } - - @Override - public BizUser findById(Long userId){ - - return bizUserDao.selectById(userId); - - } - - - @Override - public BizUser findByOpenId(String openId) { - return bizUserDao.findByOpenId(openId); - } - - /** - * 保存用户信息 - */ - @Override - public int saveUserInfo(BizUser bizUser) { - - return bizUserDao.updateByModel(bizUser); - } - - /** - * 设置成为推广员 - * @param invitationId - */ - @Override - public int setToBeAnSalesman(String openId,String invitationId,long gradeId) { - BizUser bizUser=bizUserDao.findByOpenId(openId); - bizUser.setIsSales(BizUser.IS_SALES); - bizUser.setParentOpenId(invitationId); - bizUser.setBindingParentTime(new Date()); - bizUser.setSalesmanGrade(gradeId); - return bizUserDao.updateByModel(bizUser); - } -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java b/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java index 0993a3f..1d25a09 100644 --- a/zq-erp/src/main/java/com/matrix/config/RabbitMqConfig.java +++ b/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())); diff --git a/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java index e27543d..ab1b4be 100644 --- a/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignReceiveRecord.java +++ b/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; /** * 领取时间 diff --git a/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java b/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java index 9f00d8f..437d938 100644 --- a/zq-erp/src/main/java/com/matrix/system/activity/entity/ActivitySignRecord.java +++ b/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; /** * 签到时间 diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java index 1252651..1b2bc12 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoSettingAction.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java index 5ba6f89..1bff040 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/action/FenXiaoUserAction.java +++ b/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)) { - return AjaxResult.buildFailInstance("请选择分销等级"); - } - - //设置用户公司ID - QueryUtil.setQueryLimitCom(addSaleManApplyDto); - shopSalesmanApplyService.addSaleManApply(addSaleManApplyDto.getOpenId(),gradeId); + if(addSaleManApplyDto.getGradeId()==null) { + return AjaxResult.buildFailInstance("请选择分销等级"); + } + + 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("当前记录有误"); } diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java index e881f7a..b8f81ed 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dao/ShopSalesmanApplyDao.java +++ b/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, diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java index 881a1d2..ad76f7f 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/AddSaleManApplyDto.java +++ b/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; - - @ApiModelProperty(value = "申请用户openId") - private String openId; + private Long userId; + @ApiModelProperty(value ="等级ID") - private String gradeId; + private Long gradeId; @ApiModelProperty(hidden = true) private Long companyId; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java index b302d34..92c66de 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ChangeSaleManGradeDto.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java index 0431d94..2fb799c 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/DelSaleManGradeApplyDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java index fb5da49..e389f85 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ExamineSaleManApplyDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java index 36a5df2..73c6ff9 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/FyfaManageDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java index 2255170..ecbb93e 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingBasicDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java index 65c479b..50cfac5 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/LoadParamSettingDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java index a16bfa5..4fda140 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/ShopSalesmanDetailDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java index da71cea..6ab0ba2 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/dto/UnbundlingSaleManDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java index fd8d9b2..2a2130b 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopRevenueFlow.java +++ b/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; /** * 收益说明 diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java index b60f3de..80bb8a8 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanApply.java +++ b/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未通过") diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java index 761dd2a..1e19521 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/entity/ShopSalesmanOrder.java +++ b/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邀请收益 diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java index cd840dc..617db32 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanApplyService.java +++ b/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("操作成功"); diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java index 256be95..55c708d 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/service/ShopSalesmanOrderService.java +++ b/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); } } } diff --git a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java b/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java index 5f11a89..c2ebdf0 100644 --- a/zq-erp/src/main/java/com/matrix/system/fenxiao/vo/ShopSalesmanAppliingVo.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java b/zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java index d5729d1..b4f3e25 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/ErpShopScoreAction.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java b/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java index 350d982..4eb94d9 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/action/VipInfoController.java +++ b/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, "会员信息注册成功"); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java index 5c37494..c530480 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java +++ b/zq-erp/src/main/java/com/matrix/system/hive/bean/MoneyCardUse.java @@ -3,25 +3,49 @@ 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,12 +58,7 @@ private Integer useTotal; - /** - * 剩余次数 - */ - - private Integer lastCount; - + /** * 本金 @@ -59,10 +78,7 @@ private String status; - /** - * 来源,购买,转让,赠送 - */ - private String source; + /** @@ -71,7 +87,8 @@ @JsonFormat(pattern = DateUtil.DATE_FORMAT_DD, timezone = "GMT+8") @DateTimeFormat(pattern= DateUtil.DATE_FORMAT_DD) private Date failTime; - + + /** * 充值卡的id @@ -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,117 +229,110 @@ this.changeRemark = changeRemark; } - public String getIsVipCar() { - return isVipCar; - } - - public void setIsVipCar(String isVipCar) { - this.isVipCar = isVipCar; - } public Long getId() { return id; } - + public void setId(Long id) { this.id=id; } - + public Long getOrderItemId() { return orderItemId; } - + public void setOrderItemId(Long orderItemId) { this.orderItemId=orderItemId; } - + public Integer getUseTotal() { return useTotal; } - + public void setUseTotal(Integer useTotal) { this.useTotal=useTotal; } - + public Integer getLastCount() { return lastCount; } - + public void setLastCount(Integer lastCount) { this.lastCount=lastCount; } - + public Double getRealMoney() { return realMoney; } - + public void setRealMoney(Double realMoney) { this.realMoney=realMoney; } - + public Double getGiftMoney() { return giftMoney; } - + public void setGiftMoney(Double giftMoney) { this.giftMoney=giftMoney; } - + public String getStatus() { return status; } - + public void setStatus(String status) { this.status=status; } - + public String getSource() { return source; } - + public void setSource(String source) { this.source=source; } - + public Date getFailTime() { return failTime; } - + public void setFailTime(Date failTime) { this.failTime=failTime; } - + public Long getGoodsId() { return goodsId; } - + public void setGoodsId(Long goodsId) { this.goodsId=goodsId; } - + public Long getVipId() { return vipId; } - + public void setVipId(Long vipId) { this.vipId=vipId; } - + public String getIsOver() { return isOver; } - + public void setIsOver(String isOver) { this.isOver=isOver; } @@ -295,6 +351,6 @@ return MoneyUtil.add(realMoney,giftMoney); } - - + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java b/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java index 63c91e7..3a4f2bf 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/bean/SysVipInfo.java +++ b/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 + "]"; - } diff --git a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java b/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java index 853b5c5..52e9ac0 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/dao/SysVipInfoDao.java +++ b/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); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/pojo/MoneyCardUserVo.java b/zq-erp/src/main/java/com/matrix/system/hive/pojo/MoneyCardUserVo.java deleted file mode 100644 index 524857c..0000000 --- a/zq-erp/src/main/java/com/matrix/system/hive/pojo/MoneyCardUserVo.java +++ /dev/null @@ -1,102 +0,0 @@ -package com.matrix.system.hive.pojo; - - -import com.matrix.system.constance.Dictionary; - -public class MoneyCardUserVo{ - - /** - * - */ - private static final long serialVersionUID = 1L; - /*vo对象************/ - /** - * 剩余次数 - */ - String lastCountName; - /** - * 数据来源 - */ - String sourceName; - - /*vo对象************/ - - /** - * 剩余次数 - */ - - private Integer lastCount; - - /** - * 来源,购买,转让,赠送 - */ - private String source; - /** - * 是会籍卡? Y 是,N否 - */ - private String isVipCar; - - /** - * 当大于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 Integer getLastCount() { - return lastCount; - } - - public void setLastCount(Integer lastCount) { - this.lastCount = lastCount; - } - - public String getSource() { - return source; - } - - public void setSource(String source) { - this.source = source; - } - - public String getIsVipCar() { - return isVipCar; - } - - public void setIsVipCar(String isVipCar) { - this.isVipCar = isVipCar; - } - - - - -} diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java b/zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java index 0d5f436..dd21bc1 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/SysVipInfoService.java +++ b/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); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java index c0feb9d..f91cbfd 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysOrderServiceImpl.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java index a1f0b08..d9831f9 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysProjServicesServiceImpl.java +++ b/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(), diff --git a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java index 5a0def9..4232a60 100644 --- a/zq-erp/src/main/java/com/matrix/system/hive/service/imp/SysVipInfoServiceImpl.java +++ b/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); - sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName())); - if(sysVipInfo.getSex().equals(Dictionary.SEX_MAN)){ + if(StringUtils.isNotBlank(sysVipInfo.getVipName())){ + sysVipInfo.setZjm(StringUtils.toHanyuPinyin(sysVipInfo.getVipName())+","+StringUtils.toHeadWordHanyuPinyin(sysVipInfo.getVipName())); + } + 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); + } + + + } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsAction.java deleted file mode 100644 index df8dbff..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreGoodsService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 商品表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreGoods") -public class ScoreGoodsAction { - - @Autowired - private ScoreGoodsService scoreGoodsService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsCategoryAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsCategoryAction.java deleted file mode 100644 index a3873f1..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsCategoryAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreGoodsCategoryService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 商品分类表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreGoodsCategory") -public class ScoreGoodsCategoryAction { - - @Autowired - private ScoreGoodsCategoryService scoreGoodsCategoryService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsImageAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsImageAction.java deleted file mode 100644 index 6b8bff1..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsImageAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreGoodsImageService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 商品图片表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreGoodsImage") -public class ScoreGoodsImageAction { - - @Autowired - private ScoreGoodsImageService scoreGoodsImageService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsNavigationAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsNavigationAction.java deleted file mode 100644 index 5afc7de..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsNavigationAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreGoodsNavigationService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 商品栏目表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreGoodsNavigation") -public class ScoreGoodsNavigationAction { - - @Autowired - private ScoreGoodsNavigationService scoreGoodsNavigationService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsSkuAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsSkuAction.java deleted file mode 100644 index 4e43ee7..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreGoodsSkuAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreGoodsSkuService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 商品规格表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreGoodsSku") -public class ScoreGoodsSkuAction { - - @Autowired - private ScoreGoodsSkuService scoreGoodsSkuService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderAction.java deleted file mode 100644 index 8598609..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreOrderService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 订单表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreOrder") -public class ScoreOrderAction { - - @Autowired - private ScoreOrderService scoreOrderService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderItemAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderItemAction.java deleted file mode 100644 index fd2a113..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreOrderItemAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreOrderItemService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 订单详情表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreOrderItem") -public class ScoreOrderItemAction { - - @Autowired - private ScoreOrderItemService scoreOrderItemService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java index 9cb88db..ef1b141 100644 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java +++ b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreRuleSettingAction.java @@ -1,141 +1,135 @@ -package com.matrix.system.score.action; - -import com.matrix.core.constance.MatrixConstance; -import com.matrix.core.pojo.AjaxResult; -import com.matrix.core.tools.WebUtil; -import com.matrix.system.common.bean.BusParameterSettings; -import com.matrix.system.common.bean.SysUsers; -import com.matrix.system.common.dao.BusParameterSettingsDao; -import com.matrix.system.score.constant.ScoreSettingConstant; -import com.matrix.system.score.service.ScoreRuleSettingService; -import com.matrix.system.score.vo.ScoreRuleSettingsVo; - -import cn.hutool.core.util.StrUtil; - -import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.*; - -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; - -/** - * @author wzy - * @date 2021-02-22 - **/ -@RestController -@RequestMapping(value = "/score/ruleSetting") -public class ScoreRuleSettingAction { - - @Autowired - private ScoreRuleSettingService scoreRuleSettingService; - @Autowired - private BusParameterSettingsDao busParameterSettingsDao; - - - @GetMapping(value = "/testApi") - public AjaxResult testApi() { - scoreRuleSettingService.testMethod(); - return AjaxResult.buildSuccessInstance("success"); - } - - /** - *查询积分规则配置 - */ - @RequestMapping(value = "/selectScoreRule") - public AjaxResult selectScoreRule() { - - AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); - SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); - Long companyId = user.getCompanyId(); - - //积分有效期 - String[] jfyxqArrayCode={ScoreSettingConstant.VALID_PERIOD_POINTS}; - String[] jfyxqArrayName={"积分有效期:从获得开始 到"}; - List<ScoreRuleSettingsVo> jfyxqRuleSettingsVo = getRuleSettingsVo(jfyxqArrayCode,jfyxqArrayName,companyId); - result.putInMap("jfyxq", jfyxqRuleSettingsVo); - //积分抵扣现金 - String[] jfdxjArrayCode={ScoreSettingConstant.CREDIT_POINTS_CASH}; - String[] jfdxjArrayName={"积分抵扣现金"}; - List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(jfdxjArrayCode), companyId); - List<ScoreRuleSettingsVo> jfdxjRuleSettingsVo=new ArrayList<ScoreRuleSettingsVo>(); - int index=0; - for (BusParameterSettings item:dataList){ - ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo(); - BeanUtils.copyProperties(item,paramVo); - paramVo.setParamName(jfdxjArrayName[index]); - String paramValue = paramVo.getParamValue(); - if(StrUtil.isNotEmpty(paramValue)) { - paramVo.setParamSwitch(Boolean.TRUE); - }else { - paramVo.setParamSwitch(Boolean.FALSE); - } - jfdxjRuleSettingsVo.add(paramVo); - index++; - } - result.putInMap("jfdxj", jfdxjRuleSettingsVo); - //门店积分规则 - String[] mdjfArrayCode={ - ScoreSettingConstant.CASH_CONSUMPTION, - ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, - ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, - ScoreSettingConstant.PRINCIPAL_CONSUMPTION, - ScoreSettingConstant.GIVE_CONSUMPTION, - ScoreSettingConstant.REFERRALS_CONSUMPTION}; - String[] mdjfArrayName={ - "现金消费", - "本金余额消费", - "赠金余额消费", - "本金消耗", - "赠送消耗", - "转介客户"}; - List<ScoreRuleSettingsVo> mdjfRuleSettingsVo = getRuleSettingsVo(mdjfArrayCode,mdjfArrayName,companyId); - result.putInMap("mdjf", mdjfRuleSettingsVo); - //商城积分规则 - String[] scjfArrayCode={ - ScoreSettingConstant.CASH_CONSUMPTION_SHOP, - ScoreSettingConstant.RESERVATION_SERVICE_SHOP, - ScoreSettingConstant.EVALUATUIN_ORDER_SHOP, - ScoreSettingConstant.SIGN_SHOP}; - String[] scjfArrayName={ - "现金消费", - "预约服务", - "评价订单", - "签到"}; - List<ScoreRuleSettingsVo> scjfRuleSettingsVo =getRuleSettingsVo(scjfArrayCode,scjfArrayName,companyId); - result.putInMap("scjf", scjfRuleSettingsVo); - return result; - } - - /** - *获取对应的积分规则设置数据 - * @param ArrayCode - * @param ArrayName - * @param companyId - * @return - */ - private List<ScoreRuleSettingsVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ - List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); - List<ScoreRuleSettingsVo> scoreRuleSettingsVos=new ArrayList<ScoreRuleSettingsVo>(); - int index=0; - for (BusParameterSettings item:dataList){ - ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo(); - BeanUtils.copyProperties(item,paramVo); - paramVo.setParamName(ArrayName[index]); - scoreRuleSettingsVos.add(paramVo); - index++; - } - return scoreRuleSettingsVos; - } - - /** - * 修改公司维度的积分规则 - */ - @PostMapping(value = "/updateScoreRule") - public @ResponseBody - AjaxResult updateScoreRule(@RequestBody List<BusParameterSettings> busParameterSettings) { - return scoreRuleSettingService.updateScoreRuleByCompanyId(busParameterSettings); - } - -} +package com.matrix.system.score.action; + +import com.matrix.core.constance.MatrixConstance; +import com.matrix.core.pojo.AjaxResult; +import com.matrix.core.tools.WebUtil; +import com.matrix.system.common.bean.BusParameterSettings; +import com.matrix.system.common.bean.SysUsers; +import com.matrix.system.common.dao.BusParameterSettingsDao; +import com.matrix.system.score.constant.ScoreSettingConstant; +import com.matrix.system.score.service.ScoreRuleSettingService; +import com.matrix.system.score.vo.ScoreRuleSettingsVo; + +import cn.hutool.core.util.StrUtil; + +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** + * @author wzy + * @date 2021-02-22 + **/ +@RestController +@RequestMapping(value = "/score/ruleSetting") +public class ScoreRuleSettingAction { + + @Autowired + private ScoreRuleSettingService scoreRuleSettingService; + @Autowired + private BusParameterSettingsDao busParameterSettingsDao; + + + /** + *查询积分规则配置 + */ + @RequestMapping(value = "/selectScoreRule") + public AjaxResult selectScoreRule() { + + AjaxResult result= AjaxResult.buildSuccessInstance("查询成功"); + SysUsers user = WebUtil.getSessionAttribute(MatrixConstance.LOGIN_KEY); + Long companyId = user.getCompanyId(); + + //积分有效期 + String[] jfyxqArrayCode={ScoreSettingConstant.VALID_PERIOD_POINTS}; + String[] jfyxqArrayName={"积分有效期:从获得开始 到"}; + List<ScoreRuleSettingsVo> jfyxqRuleSettingsVo = getRuleSettingsVo(jfyxqArrayCode,jfyxqArrayName,companyId); + result.putInMap("jfyxq", jfyxqRuleSettingsVo); + //积分抵扣现金 + String[] jfdxjArrayCode={ScoreSettingConstant.CREDIT_POINTS_CASH}; + String[] jfdxjArrayName={"积分抵扣现金"}; + List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(jfdxjArrayCode), companyId); + List<ScoreRuleSettingsVo> jfdxjRuleSettingsVo=new ArrayList<ScoreRuleSettingsVo>(); + int index=0; + for (BusParameterSettings item:dataList){ + ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo(); + BeanUtils.copyProperties(item,paramVo); + paramVo.setParamName(jfdxjArrayName[index]); + String paramValue = paramVo.getParamValue(); + if(StrUtil.isNotEmpty(paramValue)) { + paramVo.setParamSwitch(Boolean.TRUE); + }else { + paramVo.setParamSwitch(Boolean.FALSE); + } + jfdxjRuleSettingsVo.add(paramVo); + index++; + } + result.putInMap("jfdxj", jfdxjRuleSettingsVo); + //门店积分规则 + String[] mdjfArrayCode={ + ScoreSettingConstant.CASH_CONSUMPTION, + ScoreSettingConstant.PRINCIPAL_BALANCE_CONSUMPTION, + ScoreSettingConstant.BONUS_BALANCE_CONSUMPTION, + ScoreSettingConstant.PRINCIPAL_CONSUMPTION, + ScoreSettingConstant.GIVE_CONSUMPTION, + ScoreSettingConstant.REFERRALS_CONSUMPTION}; + String[] mdjfArrayName={ + "现金消费", + "本金余额消费", + "赠金余额消费", + "本金消耗", + "赠送消耗", + "转介客户"}; + List<ScoreRuleSettingsVo> mdjfRuleSettingsVo = getRuleSettingsVo(mdjfArrayCode,mdjfArrayName,companyId); + result.putInMap("mdjf", mdjfRuleSettingsVo); + //商城积分规则 + String[] scjfArrayCode={ + ScoreSettingConstant.CASH_CONSUMPTION_SHOP, + ScoreSettingConstant.RESERVATION_SERVICE_SHOP, + ScoreSettingConstant.EVALUATUIN_ORDER_SHOP, + ScoreSettingConstant.SIGN_SHOP}; + String[] scjfArrayName={ + "现金消费", + "预约服务", + "评价订单", + "签到"}; + List<ScoreRuleSettingsVo> scjfRuleSettingsVo =getRuleSettingsVo(scjfArrayCode,scjfArrayName,companyId); + result.putInMap("scjf", scjfRuleSettingsVo); + return result; + } + + /** + *获取对应的积分规则设置数据 + * @param ArrayCode + * @param ArrayName + * @param companyId + * @return + */ + private List<ScoreRuleSettingsVo> getRuleSettingsVo(String[] ArrayCode,String[] ArrayName,Long companyId){ + List<BusParameterSettings> dataList = busParameterSettingsDao.selectByCodesAndCompanyId(Arrays.asList(ArrayCode), companyId); + List<ScoreRuleSettingsVo> scoreRuleSettingsVos=new ArrayList<ScoreRuleSettingsVo>(); + int index=0; + for (BusParameterSettings item:dataList){ + ScoreRuleSettingsVo paramVo=new ScoreRuleSettingsVo(); + BeanUtils.copyProperties(item,paramVo); + paramVo.setParamName(ArrayName[index]); + scoreRuleSettingsVos.add(paramVo); + index++; + } + return scoreRuleSettingsVos; + } + + /** + * 修改公司维度的积分规则 + */ + @PostMapping(value = "/updateScoreRule") + public @ResponseBody + AjaxResult updateScoreRule(@RequestBody List<BusParameterSettings> busParameterSettings) { + return scoreRuleSettingService.updateScoreRuleByCompanyId(busParameterSettings); + } + +} diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreShoppingCarAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreShoppingCarAction.java deleted file mode 100644 index 0dc30e3..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreShoppingCarAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreShoppingCarService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 购物车 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreShoppingCar") -public class ScoreShoppingCarAction { - - @Autowired - private ScoreShoppingCarService scoreShoppingCarService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreUseRecordAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreUseRecordAction.java deleted file mode 100644 index b7664be..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreUseRecordAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreUseRecordService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 积分记录表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreUseRecord") -public class ScoreUseRecordAction { - - @Autowired - private ScoreUseRecordService scoreUseRecordService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreVipDetailAction.java b/zq-erp/src/main/java/com/matrix/system/score/action/ScoreVipDetailAction.java deleted file mode 100644 index 29550c4..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/action/ScoreVipDetailAction.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.action; - -import com.matrix.system.score.service.ScoreVipDetailService; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RestController; - -/** - * @description 客户积分余额 - * @author jyy - * @date 2021-02-26 15:26 - */ -@RestController -@RequestMapping(value = "admin/scoreVipDetail") -public class ScoreVipDetailAction { - - @Autowired - private ScoreVipDetailService scoreVipDetailService; - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsCategoryDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsCategoryDao.java deleted file mode 100644 index 43b8124..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsCategoryDao.java +++ /dev/null @@ -1,13 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.matrix.system.score.entity.ScoreGoodsCategory; - -/** - * @description 商品分类表 - * @author jyy - * @date 2021-02-26 15:26 - */ -public interface ScoreGoodsCategoryDao extends BaseMapper<ScoreGoodsCategory> { - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsDao.java deleted file mode 100644 index 38f0712..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.score.entity.ScoreGoods; - -/** - * @description 商品表 - * @author jyy - * @date 2021-02-26 15:26 - */ -public interface ScoreGoodsDao extends BaseMapper<ScoreGoods> { - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsImageDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsImageDao.java deleted file mode 100644 index f0e3bf7..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsImageDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.score.entity.ScoreGoodsImage; - -/** - * @description 商品图片表 - * @author jyy - * @date 2021-02-26 15:26 - */ -public interface ScoreGoodsImageDao extends BaseMapper<ScoreGoodsImage> { - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsNavigationDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsNavigationDao.java deleted file mode 100644 index a30d9e6..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsNavigationDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.score.entity.ScoreGoodsNavigation; - -/** - * @description 商品栏目表 - * @author jyy - * @date 2021-02-26 15:26 - */ -public interface ScoreGoodsNavigationDao extends BaseMapper<ScoreGoodsNavigation> { - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsSkuDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsSkuDao.java deleted file mode 100644 index 7a1a30f..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreGoodsSkuDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.score.entity.ScoreGoodsSku; - -/** - * @description 商品规格表 - * @author jyy - * @date 2021-02-26 15:26 - */ -public interface ScoreGoodsSkuDao extends BaseMapper<ScoreGoodsSku> { - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderDao.java deleted file mode 100644 index 447f7ab..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.score.entity.ScoreOrder; - -/** - * @description 订单表 - * @author jyy - * @date 2021-02-26 15:26 - */ -public interface ScoreOrderDao extends BaseMapper<ScoreOrder> { - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderItemDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderItemDao.java deleted file mode 100644 index 0ed7675..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreOrderItemDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.score.entity.ScoreOrderItem; - -/** - * @description 订单详情表 - * @author jyy - * @date 2021-02-26 15:26 - */ -public interface ScoreOrderItemDao extends BaseMapper<ScoreOrderItem> { - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreRuleSettingDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreRuleSettingDao.java deleted file mode 100644 index 9bfc095..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreRuleSettingDao.java +++ /dev/null @@ -1,11 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import com.matrix.system.score.entity.ScoreRuleSettingEntity; - -/** - * @author wzy - * @date 2021-02-22 - **/ -public interface ScoreRuleSettingDao extends BaseMapper<ScoreRuleSettingEntity> { -} diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreShoppingCarDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreShoppingCarDao.java deleted file mode 100644 index 03ccc9d..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreShoppingCarDao.java +++ /dev/null @@ -1,17 +0,0 @@ -package com.matrix.system.score.dao; - -import com.baomidou.mybatisplus.core.mapper.BaseMapper; -import org.apache.ibatis.annotations.Param; -import java.util.List; -import java.util.Map; -import com.matrix.core.pojo.PaginationVO; -import com.matrix.system.score.entity.ScoreShoppingCar; - -/** - * @description 购物车 - * @author jyy - * @date 2021-02-26 15:26 - */ -public interface ScoreShoppingCarDao extends BaseMapper<ScoreShoppingCar> { - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java b/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java index de52cc4..95e8d33 100644 --- a/zq-erp/src/main/java/com/matrix/system/score/dao/ScoreVipDetailDao.java +++ b/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); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoods.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoods.java deleted file mode 100644 index d2c6b58..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoods.java +++ /dev/null @@ -1,103 +0,0 @@ -package com.matrix.system.score.entity; - -import com.matrix.core.anotations.Extend; -import com.baomidou.mybatisplus.annotation.TableName; - -import lombok.Data; - -/** - * @description 商品表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Data -@TableName("score_goods") -public class ScoreGoods extends BaseEntity{ - @Extend - private static final long serialVersionUID = 1L; - - - - - - /** - * 商品名称 - */ - - - private String goodsName; - - /** - * 商品编码 - */ - - - private String goodsCode; - - /** - * 商品分类ID - */ - - - private Long categoryId; - - /** - * 上架状态(1:不上架 2:上架) - */ - - - private Integer state; - - /** - * 限购数量(设置为限购数量 不设置则表示不限购) - */ - - - private Integer limitedNum; - - /** - * 所需积分(单价) - */ - - - private Integer scorePrice; - - /** - * 市场价 - */ - - - private String markPrice; - - /** - * 商品详情 - */ - - - private String details; - - /** - * 推荐到栏目 - */ - - - private Long navigationId; - - /** - * 备注 - */ - - - private String remarks; - - /** - * 所属公司ID - */ - - - private Long companyId; - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsCategory.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsCategory.java deleted file mode 100644 index f58ca14..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsCategory.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.matrix.system.score.entity; - -import com.matrix.core.anotations.Extend; -import com.baomidou.mybatisplus.annotation.TableName; - -import lombok.Data; - -/** - * @description 商品分类表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Data -@TableName("score_goods_category") -public class ScoreGoodsCategory extends BaseEntity{ - @Extend - private static final long serialVersionUID = 1L; - - - - - - /** - * 父级id - */ - - - private Long parentId; - - /** - * 名称 - */ - - - private String cateName; - - /** - * 编码 - */ - - - private String cateCode; - - /** - * 所属公司_id - */ - - - private Long companyId; - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsImage.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsImage.java deleted file mode 100644 index ceb7546..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsImage.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.matrix.system.score.entity; - -import com.matrix.core.anotations.Extend; -import com.baomidou.mybatisplus.annotation.TableName; - -import lombok.Data; - -/** - * @description 商品图片表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Data -@TableName("score_goods_image") -public class ScoreGoodsImage extends BaseEntity{ - @Extend - private static final long serialVersionUID = 1L; - - - - - - /** - * 地址 - */ - - - private String imgPath; - - /** - * 缩略图显示图片(1:缩略图图片) - */ - - - private Integer imgMain; - - /** - * 排序 - */ - - - private Integer imgSort; - - /** - * 商品ID - */ - - - private Long goodsId; - - /** - * 所属公司_id - */ - - - private Long companyId; - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsNavigation.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsNavigation.java deleted file mode 100644 index 9ab24c0..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsNavigation.java +++ /dev/null @@ -1,47 +0,0 @@ -package com.matrix.system.score.entity; - -import com.matrix.core.anotations.Extend; -import com.baomidou.mybatisplus.annotation.TableName; - -import lombok.Data; - -/** - * @description 商品栏目表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Data -@TableName("score_goods_navigation") -public class ScoreGoodsNavigation extends BaseEntity{ - @Extend - private static final long serialVersionUID = 1L; - - - - - - /** - * 名称 - */ - - - private String naviName; - - /** - * 编码 - */ - - - private String naviCode; - - /** - * 所属公司_id - */ - - - private Long companyId; - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsSku.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsSku.java deleted file mode 100644 index 294bb83..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreGoodsSku.java +++ /dev/null @@ -1,79 +0,0 @@ -package com.matrix.system.score.entity; - -import com.matrix.core.anotations.Extend; -import com.baomidou.mybatisplus.annotation.TableName; - -import lombok.Data; - -/** - * @description 商品规格表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Data -@TableName("score_goods_sku") -public class ScoreGoodsSku extends BaseEntity{ - @Extend - private static final long serialVersionUID = 1L; - - - /** - * 名称 - */ - - - private String skuName; - - /** - * 图片 - */ - - - private Long imgPath; - - /** - * 抵扣所需积分 - */ - - - private Integer scorePrice; - - /** - * 库存 - */ - - - private Integer reserve; - - /** - * 排序 - */ - - - private Integer skuSort; - - /** - * 商品ID - */ - - - private Long goodsId; - - /** - * 关联ERP产品code - */ - - - private String skuErpCode; - - /** - * 所属公司_id - */ - - - private Long companyId; - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrder.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrder.java deleted file mode 100644 index 04d3fc7..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrder.java +++ /dev/null @@ -1,126 +0,0 @@ -package com.matrix.system.score.entity; - -import com.matrix.core.anotations.Extend; -import com.baomidou.mybatisplus.annotation.TableName; - -import lombok.Data; - -import java.util.Date; - -/** - * @description 订单表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Data -@TableName("score_goods_order") -public class ScoreOrder extends BaseEntity{ - @Extend - private static final long serialVersionUID = 1L; - - - - - - /** - * 订单编号 - */ - - - private String orderCode; - - /** - * 会员ID(openID) - */ - - - private String memberId; - - /** - * 联系方式 - */ - - - private String memberPhone; - - /** - * 支付总积分 - */ - - - private Integer payTotalScore; - - /** - * 订单状态(1:待支付2:待配送3:待收货4:已收货) - */ - - - private Integer orderState; - - /** - * 下单时间 - */ - - - private Date orderTime; - - /** - * 支付时间 - */ - - - private Date payTime; - - /** - * 收货方式(1物流2自提) - */ - - - private Integer receiveWay; - - /** - * 收货地址ID - */ - - - private Long addressId; - - /** - * 自提门店地址 - */ - - - private String selfAddress; - - /** - * 自提时间 - */ - - - private Date selfTime; - - /** - * 物流ID - */ - - - private Long logisticsId; - - /** - * 备注 - */ - - - private String remarks; - - /** - * 所属公司_ID - */ - - - private Long companyId; - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrderItem.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrderItem.java deleted file mode 100644 index dc5ca2f..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreOrderItem.java +++ /dev/null @@ -1,75 +0,0 @@ -package com.matrix.system.score.entity; - -import com.matrix.core.anotations.Extend; -import com.baomidou.mybatisplus.annotation.TableName; - -import lombok.Data; - -/** - * @description 订单详情表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Data -@TableName("score_order_item") -public class ScoreOrderItem extends BaseEntity{ - @Extend - private static final long serialVersionUID = 1L; - - - - - - /** - * 商品id - */ - - - private Long goodsId; - - /** - * 商品名称 - */ - - - private String goodsName; - - /** - * 商品编码 - */ - - - private String goodsCode; - - /** - * 数量 - */ - - - private Integer goodsNum; - - /** - * 支付积分 - */ - - - private Integer payScore; - - /** - * 订单ID - */ - - - private Long orderId; - - /** - * 所属公司_id - */ - - - private Long companyId; - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreRuleSettingEntity.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreRuleSettingEntity.java deleted file mode 100644 index 5ba55b1..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreRuleSettingEntity.java +++ /dev/null @@ -1,21 +0,0 @@ -package com.matrix.system.score.entity; - -import com.baomidou.mybatisplus.annotation.TableName; - -/** - * @author wzy - * @date 2021-02-22 - **/ -@TableName("score_order") -public class ScoreRuleSettingEntity extends BaseEntity { - - private String orderNo; - - public String getOrderNo() { - return orderNo; - } - - public void setOrderNo(String orderNo) { - this.orderNo = orderNo; - } -} diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreShoppingCar.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreShoppingCar.java deleted file mode 100644 index 4e098b9..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreShoppingCar.java +++ /dev/null @@ -1,54 +0,0 @@ -package com.matrix.system.score.entity; - -import com.matrix.core.anotations.Extend; -import com.baomidou.mybatisplus.annotation.TableName; - -import lombok.Data; - -/** - * @description 购物车 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Data -@TableName("score_shopping_car") -public class ScoreShoppingCar extends BaseEntity{ - @Extend - private static final long serialVersionUID = 1L; - - - - - - /** - * 会员ID(openID) - */ - - - private String userId; - - /** - * 商品id - */ - - - private Long goodsId; - - /** - * 数量 - */ - - - private Integer count; - - /** - * 所属公司_id - */ - - - private Long companyId; - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java index 41cc47b..075e21c 100644 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreUseRecord.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java index 25123d2..947e243 100644 --- a/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java +++ b/zq-erp/src/main/java/com/matrix/system/score/entity/ScoreVipDetail.java @@ -44,10 +44,7 @@ - /** - * 用户openId - */ - private String openId; + /** * erp用户Id diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsCategoryService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsCategoryService.java deleted file mode 100644 index 6132c60..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsCategoryService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreGoodsCategoryDao; -import com.matrix.system.score.entity.ScoreGoodsCategory; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 商品分类表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreGoodsCategoryService extends ServiceImpl<ScoreGoodsCategoryDao, ScoreGoodsCategory>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsImageService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsImageService.java deleted file mode 100644 index 333f719..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsImageService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreGoodsImageDao; -import com.matrix.system.score.entity.ScoreGoodsImage; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 商品图片表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreGoodsImageService extends ServiceImpl<ScoreGoodsImageDao, ScoreGoodsImage>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsNavigationService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsNavigationService.java deleted file mode 100644 index d1bc4ea..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsNavigationService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreGoodsNavigationDao; -import com.matrix.system.score.entity.ScoreGoodsNavigation; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 商品栏目表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreGoodsNavigationService extends ServiceImpl<ScoreGoodsNavigationDao, ScoreGoodsNavigation>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsService.java deleted file mode 100644 index 24f39ed..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreGoodsDao; -import com.matrix.system.score.entity.ScoreGoods; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 商品表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreGoodsService extends ServiceImpl<ScoreGoodsDao, ScoreGoods>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsSkuService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsSkuService.java deleted file mode 100644 index dc60614..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreGoodsSkuService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreGoodsSkuDao; -import com.matrix.system.score.entity.ScoreGoodsSku; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 商品规格表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreGoodsSkuService extends ServiceImpl<ScoreGoodsSkuDao, ScoreGoodsSku>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderItemService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderItemService.java deleted file mode 100644 index c4e4a92..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderItemService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreOrderItemDao; -import com.matrix.system.score.entity.ScoreOrderItem; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 订单详情表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreOrderItemService extends ServiceImpl<ScoreOrderItemDao, ScoreOrderItem>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderService.java deleted file mode 100644 index d45ff36..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreOrderService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreOrderDao; -import com.matrix.system.score.entity.ScoreOrder; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 订单表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreOrderService extends ServiceImpl<ScoreOrderDao, ScoreOrder>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java index b2a65ff..4e91105 100644 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreRuleSettingService.java +++ b/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) { //获取当前登录人员信息 diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreShoppingCarService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreShoppingCarService.java deleted file mode 100644 index bec88a3..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreShoppingCarService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreShoppingCarDao; -import com.matrix.system.score.entity.ScoreShoppingCar; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 购物车 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreShoppingCarService extends ServiceImpl<ScoreShoppingCarDao, ScoreShoppingCar>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreUseRecordService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreUseRecordService.java deleted file mode 100644 index 06687d3..0000000 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreUseRecordService.java +++ /dev/null @@ -1,20 +0,0 @@ -package com.matrix.system.score.service; - -import com.matrix.system.score.dao.ScoreUseRecordDao; -import com.matrix.system.score.entity.ScoreUseRecord; -import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; -import org.springframework.stereotype.Service; - -/** - * @description 积分记录表 - * @author jyy - * @date 2021-02-26 15:26 - */ -@Service -public class ScoreUseRecordService extends ServiceImpl<ScoreUseRecordDao, ScoreUseRecord>{ - - - - - -} \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java b/zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java index 569cd35..1c36562 100644 --- a/zq-erp/src/main/java/com/matrix/system/score/service/ScoreVipDetailService.java +++ b/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必须有"); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java index 3480da7..9e074ae 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopBizUserScoreAction.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java index 69fbbab..dded875 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/action/ShopRefundRecordAction.java +++ b/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; - } } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java index f1e3fe5..658a70d 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WXShopOrderAction.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java index 6b21617..ba4c3ec 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxBindingPhoneNumber.java +++ b/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()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java index fdbdbf6..2000ceb 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxCollectionAction.java +++ b/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()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java index 9a3f9f4..bfe16d7 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxErpOrderAction.java +++ b/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; @@ -91,49 +69,44 @@ @Value("${static_resource_url}") private String nginxUrl; - @ApiOperation(value = "查询用户所有在ERP中产生的订单" ) + @ApiOperation(value = "查询用户所有在ERP中产生的订单") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) + @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) }) @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){ - 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"); - } + 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, "查询成功"); + } - @ApiOperation(value = "查询用户在ERP中的订单详情" ) + @ApiOperation(value = "查询用户在ERP中的订单详情") @ApiResponses({ - @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) + @ApiResponse(code = 200, message = "OK", response = ErpOrderListDto.class) }) @GetMapping(value = "/findUserOrderById/{orderId}") public AjaxResult findUserOrderList(@PathVariable Long orderId) { - ErpOrderDetailVo order=sysOrderDao.findUserOrderById(orderId); + ErpOrderDetailVo order = sysOrderDao.findUserOrderById(orderId); order.setItems(orderItemDao.selectErpOrderItemByOrderId(order.getOrderId())); List<SysOrderFlow> sysOrderFlows = orderFlowDao.selectPayMethodsAmountByOrderId(orderId); - List<ErpOrderDetailFlowVo> flowVos=new ArrayList<>(); - sysOrderFlows.forEach(item->{ + List<ErpOrderDetailFlowVo> flowVos = new ArrayList<>(); + sysOrderFlows.forEach(item -> { ErpOrderDetailFlowVo erpOrderDetailFlowVo = new ErpOrderDetailFlowVo(); - BeanUtils.copyProperties(item,erpOrderDetailFlowVo); + BeanUtils.copyProperties(item, erpOrderDetailFlowVo); flowVos.add(erpOrderDetailFlowVo); }); order.setFlow(flowVos); AjaxResult result = AjaxResult.buildSuccessInstance("查询成功"); - result.putInMap("order",order); - return result; + result.putInMap("order", order); + return result; } - - } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java index 23451d2..d04b001 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxGetAcodeAction.java +++ b/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(), diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java index 89e9cf1..2bd8b97 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxInvoiceAction.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java index 9a13860..b34cdd5 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxProductCommentAction.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java index be633d2..ba7563a 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxReceiveAddressAction.java +++ b/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()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java index 66b4c64..daf749a 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxRefundRecordAction.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java index 87649b1..ca54c0f 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesOrderAction.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java index 817d16c..b60d8e3 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesWithdrawalAction.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java index 4f0b0d9..7e39d58 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSalesmanAction.java +++ b/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; @@ -93,13 +93,10 @@ BusParameterSettings fxSwith = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_SWITCH, HostInterceptor.getCompanyId()); BusParameterSettings fxModel = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_MODEL, HostInterceptor.getCompanyId()); AjaxResult ajaxResult = AjaxResult.buildSuccessInstance("查询成功"); - ajaxResult.putInMap("fxSwith",fxSwith.getParamValue()); - ajaxResult.putInMap("fxModel",fxModel.getParamValue()); + ajaxResult.putInMap("fxSwith", fxSwith.getParamValue()); + ajaxResult.putInMap("fxModel", fxModel.getParamValue()); return ajaxResult; } - - - @ApiOperation(value = "申请成为推广员", notes = "传入参数invitationId 邀请人openId ,非必填 例: {invitationId:openId}") @@ -108,21 +105,21 @@ }) @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())) { + public AjaxResult applyToBeAnSalesman(@RequestBody Map<String, String> param) { + 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,10 +131,10 @@ }) @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("apply_status",ShopSalesmanApply.APPLY_STATUS_DSH); + 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)); - if (invitationUser==null) { + + 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()); - if(loginUser.getIsSales()==1){ + 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())) { + } else { + 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,32 +187,32 @@ @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 String baseSaveUrl = PropertiesUtil.getString(AppConstance.NGINX_URL); //目标海报物理存储路径 - String targetImg=MD5Util.strToMD5(loginUser.getOpenId()) +"haibao.png"; - String targetImgPath=baseSavePath+"wxacode" + File.separatorChar+targetImg ; + String targetImg = MD5Util.strToMD5(loginUser.getOpenId()) + "haibao.png"; + String targetImgPath = baseSavePath + "wxacode" + File.separatorChar + targetImg; String urlPath = baseSaveUrl + "/" + "wxacode" + "/" + targetImg; - String qrcodeSavePath = WxacodeUtil.getWxacode(loginUser.getUserId() + "", "pages/distributorCenter/applyFor/applyFor", MD5Util.strToMD5(loginUser.getOpenId())+"qrcode" - ,weChatApiTools.getAppid(loginUser.getCompanyId()),weChatApiTools.getSecret(loginUser.getCompanyId())); + 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)); //获取海报 BusParameterSettings posterSetting = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_TG_POSTER, loginUser.getCompanyId()); - String posterPath=baseSavePath+"wxacode" + File.separatorChar+MD5Util.strToMD5(loginUser.getOpenId())+"poster.png"; - ImageUtil.downloadPicture(posterSetting.getParamValue(),posterPath); + String posterPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "poster.png"; + ImageUtil.downloadPicture(posterSetting.getParamValue(), posterPath); BufferedImage posterImgBuf = ImageIO.read(new File(posterPath)); //获取用户头像 - String userPhotoPath=baseSavePath+"wxacode" + File.separatorChar+MD5Util.strToMD5(loginUser.getOpenId())+"userPhoto.png"; - ImageUtil.downloadPicture(loginUser.getAvatarUrl(),userPhotoPath); + String userPhotoPath = baseSavePath + "wxacode" + File.separatorChar + MD5Util.strToMD5(loginUser.getOpenId()) + "userPhoto.png"; + ImageUtil.downloadPicture(loginUser.getAvatarUrl(), userPhotoPath); BufferedImage userPhotoImgBuf = ImageIO.read(new File(userPhotoPath)); @@ -226,18 +220,18 @@ //绘制背景+产品 Graphics2D g = backgroundImgBuf.createGraphics(); g.setColor(Color.WHITE); - g.fillRect(0,0,700,900); - g.drawImage(posterImgBuf,0,0,700, 700,null); + g.fillRect(0, 0, 700, 900); + g.drawImage(posterImgBuf, 0, 0, 700, 700, null); - g.drawImage(userPhotoImgBuf,20,720,80,80,null); + g.drawImage(userPhotoImgBuf, 20, 720, 80, 80, null); - g.drawImage(qrcordImgBuf,500,720,150,150,null); + g.drawImage(qrcordImgBuf, 500, 720, 150, 150, null); - g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); + g.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_LCD_HRGB); g.setFont(new Font("WenQuanYi Micro Hei", Font.BOLD, 24)); g.setColor(Color.BLACK); - g.drawString(loginUser.getNickName()+"邀请你一起推广赚佣金",120,750); + g.drawString(loginUser.getNickName() + "邀请你一起推广赚佣金", 120, 750); g.dispose(); ImageIO.write(backgroundImgBuf, "png", new File(targetImgPath)); @@ -245,7 +239,7 @@ return AjaxResult.buildSuccessInstance(urlPath); } catch (Exception e) { LogUtil.error("推广二维码生成错误:{}", e, ""); - return AjaxResult.buildFailInstance("二维码生成失败"); + return AjaxResult.buildFailInstance("二维码生成失败"); } } @@ -257,10 +251,10 @@ @ApiResponse(code = 200, message = "ok", response = SalesmanVo.class) }) AjaxResult getInvitationuserList(@RequestBody BasePageQueryDto pageDto) { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - Page<SalesmanVo> page=new Page<>(pageDto.getPageNum(),pageDto.getPageSize()); - IPage<SalesmanVo> shopSalesmanApplyIPage = salesmanApplyDao.selectInvitationuserInPage(page, loginUser.getOpenId(),pageDto.getKeywords()); - AjaxResult result=AjaxResult.buildSuccessInstance(shopSalesmanApplyIPage.getRecords()); + SysVipInfo loginUser = redisUserLoginUtils.getLoginUser(SysVipInfo.class); + Page<SalesmanVo> page = new Page<>(pageDto.getPageNum(), pageDto.getPageSize()); + 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,15 +276,15 @@ @ApiResponse(code = 200, message = "ok", response = SalesmanApplyCondition.class) }) AjaxResult getSalesmanApplyCondition() { - BizUser loginUser = redisUserLoginUtils.getLoginUser(BizUser.class); - VerificationResult ableToBeAnSalesman = shopSalesmanApplyService.isAbleToBeAnSalesman(loginUser.getOpenId(),loginUser.getCompanyId()); - SalesmanApplyCondition applyConditionInfo=new SalesmanApplyCondition(); + 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()); //申请条件 BusParameterSettings applyCondition = busParameterSettingsDao.selectCompanyParamByCode(FenxiaoSettingConstant.FX_APPLY_CONDITION, loginUser.getCompanyId()); - switch (applyCondition.getParamValue()){ + switch (applyCondition.getParamValue()) { case FenxiaoSettingConstant.FX_APPLY_CONDITION_WTJ: applyConditionInfo.setCondition("您已满足申请条件"); break; @@ -298,9 +292,9 @@ applyConditionInfo.setCondition("消费指定产品并确认收货"); List<String> strings = StringUtils.strToColl(applyCondition.getParamValue1(), ","); List<Integer> ids = strings.stream().filter(i -> StringUtils.isNotBlank(i)).map(i -> Integer.parseInt(i + "")).distinct().collect(Collectors.toList()); - if(CollectionUtils.isNotEmpty(ids)){ + if (CollectionUtils.isNotEmpty(ids)) { applyConditionInfo.setProductList(shopProductDao.selectByIds(ids)); - }else{ + } else { return AjaxResult.buildFailInstance("未配置消费产品,请联系管理员"); } @@ -310,19 +304,13 @@ applyConditionInfo.setCondition("消费任意产品并确认收货"); break; case FenxiaoSettingConstant.FX_APPLY_CONDITION_XCZDJE: - Double zdje=Double.parseDouble(applyCondition.getParamValue2()); - applyConditionInfo.setCondition("消费满"+zdje+"元确认收货"); + Double zdje = Double.parseDouble(applyCondition.getParamValue2()); + applyConditionInfo.setCondition("消费满" + zdje + "元确认收货"); applyConditionInfo.setMinAmount(zdje); } return AjaxResult.buildSuccessInstance(applyConditionInfo); } - - - - - - } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java index 3aad1e8..696e9aa 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShareProductAction.java +++ b/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()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java index 6054384..4fb5a76 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesGroupBuyController.java +++ b/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()))); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java index ae9288b..d7a2403 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSalonAction.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java index d931daf..e42af89 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopActivitiesSecKillAction.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java index 8b408f8..ac983d3 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopProduct.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java index 9dc6cea..7ceed5e 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShopScoreAction.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java index 4508e1c..3b17f08 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxShoppingCartAction.java +++ b/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, "修改成功"); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java index 2730fb1..8779cd3 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxSkinCheckAction.java +++ b/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)); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java index e34da97..4ccb773 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserAction.java +++ b/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); - } else { - bizUser.setSessionKey(sessionKey); - bizUser.setLastLoginTime(new Date()); - // 更新用户sessionKey - bizUserService.modifyByModel(bizUser); + sysVipInfo.setVipNo(openId); + sysVipInfoService.add(sysVipInfo); + + }else{ + 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()); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java index 84aedfb..e56f7ea 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/WxUserSearchRecord.java +++ b/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,"删除成功"); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java index abc7fbd..ec10347 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/action/YuyueAction.java +++ b/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,"查询成功"); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java index 6d81221..7b21018 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/RevenueFlowDto.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java index 65b23ef..d8593f4 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/SaleOrderDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java index b6c8eb1..ed2d87b 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/ScoreFlowDto.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java new file mode 100644 index 0000000..c870683 --- /dev/null +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/dto/XcxUserSaveUserInfoDto.java @@ -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; + +} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java index d473bbf..916994d 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/WxShopRefundRecordService.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java index 70bb8d6..e702535 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WXShopOrderServiceImpl.java +++ b/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)) { diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java index 0e06b76..aefbb92 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesGroupServiceImpl.java +++ b/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()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java index b79a20b..ab875e9 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopActivitiesSecKillServiceImpl.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java index 088d320..4c5f062 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopCouponServiceImpl.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java index 2895e24..984fefa 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/service/impl/WxShopRefundRecordServiceImpl.java +++ b/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) { diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java index 99cacaa..e7fc64a 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopCouponUtil.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java index 283da6a..f1694d6 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/api/tools/WxShopOrderUtil.java +++ b/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 ""; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java index bbaeb9f..071cf97 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoin.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java index 54a5b95..a6ab143 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesGroupJoinUser.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java index 13a92b3..055fbe9 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSalonRecord.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java index 597c73d..9d8a9e0 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopActivitiesSeckillRecord.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java index ff51f0e..33ed315 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopCouponRecord.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java index 75f2487..5bd8247 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java +++ b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopDeliveryInfo.java @@ -61,7 +61,7 @@ /** * 用户ID */ - private String userId; + private Long userId; /** @@ -196,16 +196,14 @@ public void setOrderId(Integer orderId) { this.orderId=orderId; } - - public String getUserId() { + public Long getUserId() { return userId; } - - public void setUserId(String userId) { - this.userId=userId; + + public void setUserId(Long userId) { + this.userId = userId; } - public String getOrderNo() { return orderNo; diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java index 4ae3a9a..e3003fe 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopOrder.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java index 60bb61e..b557b04 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopRefundRecord.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java index d9a1283..a3196af 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopSearchRecord.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java index e39c2d4..4f27e07 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/bean/ShopShoppingCart.java +++ b/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; } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java index 55c2850..fd8cce2 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopCouponRecordDao.java +++ b/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); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java index 5a9729d..8688651 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderDao.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java index bf44438..b49ab03 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopOrderV2Dao.java +++ b/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); } \ No newline at end of file diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java index c568f5b..b31b054 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dao/ShopShoppingCartDao.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java index 3f5f706..b0c67a9 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/dto/CreateGroupBuyDTO.java +++ b/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; - } } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java index 0e20288..a8bb1a0 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/OrderTask.java +++ b/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); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java index 4a51238..d7eab53 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderRefundTask.java +++ b/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()+"")); } diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java index 43ec960..26957ad 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/SalesOrderTask.java +++ b/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()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java index f83901f..3b7c40e 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/ScoreOrderTask.java +++ b/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, diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java deleted file mode 100644 index 67b5bbb..0000000 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/mqTask/VipCreateTask.java +++ /dev/null @@ -1,81 +0,0 @@ -package com.matrix.system.shopXcx.mqTask; - - -import com.matrix.biz.bean.BizUser; -import com.matrix.biz.service.BizUserService; -import com.matrix.component.rabbitmq.MqTask; -import com.matrix.core.tools.LogUtil; -import com.matrix.core.tools.StringUtils; -import com.matrix.system.constance.Dictionary; -import com.matrix.system.hive.bean.SysShopInfo; -import com.matrix.system.hive.bean.SysVipInfo; -import com.matrix.system.hive.dao.SysShopInfoDao; -import com.matrix.system.hive.dao.SysVipInfoDao; -import com.matrix.system.hive.plugin.util.CollectionUtils; -import com.rabbitmq.client.DeliverCallback; -import com.rabbitmq.client.Delivery; -import org.springframework.beans.factory.annotation.Autowired; - -import java.io.IOException; -import java.util.List; - -public class VipCreateTask implements DeliverCallback { - - @Autowired - BizUserService bizUserService; - - @Autowired - SysShopInfoDao shopInfoDao; - - @Autowired - private SysVipInfoDao vipDap; - - //TODO 用户可以都归属一个电商店铺,发货的时候指定仓库出货,微商城的产品可以绑定仓库库存 - - @Override - public void handle(String consumerTag, Delivery message) throws IOException { - try { - String messages = new String(message.getBody(), "UTF-8"); - - String userId=messages.split(",")[0]; - Long shopId=Long.parseLong(messages.split(",")[1]); - - BizUser userInfo = bizUserService.findByOpenId(userId); - - // TODO 校验用户是否已存在 , 公司id不能写死 - SysVipInfo vip = vipDap.selectByPhone(userInfo.getPhoneNumber()); - if (vip != null) { - LogUtil.warn("会员{}已经存在", userInfo.getPhoneNumber()); - //更新信息 - vip.setOpenId(userInfo.getOpenId()); - if(StringUtils.isBlank(vip.getPhoto())){ - vip.setPhoto(userInfo.getAvatarUrl()); - } - vipDap.update(vip); - } else { - SysVipInfo vipInfo = new SysVipInfo(); - //在备注记下微商城的用户id - vipInfo.setOpenId(userInfo.getOpenId()); - vipInfo.setAddr(userInfo.getProvince() + " " + userInfo.getCity()); - vipInfo.setPhone(userInfo.getPhoneNumber()); - if(StringUtils.isBlank(vipInfo.getPhoto())){ - vipInfo.setPhoto(userInfo.getAvatarUrl()); - } - if (userInfo.getGender() != null) { - vipInfo.setSex(userInfo.getGender().equals("1") ? "男" : "女"); - } - vipInfo.setVipName(userInfo.getNickName()); - vipInfo.setCompanyId(userInfo.getCompanyId()); - vipInfo.setShopId(shopId); - vipInfo.setArrivalWay("微商城"); - vipInfo.setVipState(Dictionary.VIP_STATE_HY); - vipInfo.setVipType(Dictionary.VIP_TYPE_NOCARD); - vipInfo.setIsDeal(SysVipInfo.UNDEAL_VIP); - vipDap.insert(vipInfo); - } - } catch (Exception e) { - LogUtil.error("消费者执行异常", e); - } - - } -} diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java index ae48bc2..8f1d146 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/quartz/ShopActivityTimeOutQuartz.java +++ b/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()); diff --git a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java b/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java index e85f7ca..02d7fbb 100644 --- a/zq-erp/src/main/java/com/matrix/system/shopXcx/vo/SalesmanVo.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java index 7196340..01a5eca 100644 --- a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/UniformMsgSentTask.java +++ b/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; diff --git a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java b/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java index d917a1e..acc9a64 100644 --- a/zq-erp/src/main/java/com/matrix/system/wechart/templateMsg/Task/messageBulderDemo/DefaultTemplateMessageBulder.java +++ b/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; diff --git "a/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql" "b/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql" index f725cae..a4ff4a9 100644 --- "a/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql" +++ "b/zq-erp/src/main/resources/config/db/increment/\346\216\250\345\271\277\345\221\230.sql" @@ -220,4 +220,18 @@ ALTER TABLE `shop_salesman_grade` DROP COLUMN `self_commission`, -ADD COLUMN `self_commission` double(20,2) NULL COMMENT '自购返佣比例%' AFTER `company_id`; \ No newline at end of file +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`; diff --git a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml index 10b0853..d0c549b 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignReceiveRecordDao.xml +++ b/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> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml index 9d51d49..4b5d11a 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/activity/ActivitySignRecordDao.xml +++ b/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> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml index a4123a9..1d001af 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanApplyDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml index 2dd7257..a594e68 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/fenxiao/ShopSalesmanOrderDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/OnlinebookingDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/OnlinebookingDao.xml index 4bb2b75..a60b9d8 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/OnlinebookingDao.xml +++ b/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} diff --git a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml b/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml index 02ebd34..9437453 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/hive/SysVipInfoDao.xml +++ b/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> @@ -482,6 +548,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> <!-- 批量删除 --> <delete id="deleteByIds" parameterType="java.util.List"> @@ -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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsCategoryDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsCategoryDao.xml deleted file mode 100644 index 9b12242..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsCategoryDao.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.score.dao.ScoreGoodsCategoryDao"> - <!-- 定义ScoreGoodsCategory 的复杂关联map --> - <resultMap type="com.matrix.system.score.entity.ScoreGoodsCategory" id="ScoreGoodsCategoryMap"> - <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="parentId" column="parent_id" /> - <result property="cateName" column="cate_name" /> - <result property="cateCode" column="cate_code" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义ScoreGoodsCategory 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.score.entity.ScoreGoodsCategory" id="ScoreGoodsCategorySimpleMap"> - <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="parentId" column="parent_id" /> - <result property="cateName" column="cate_name" /> - <result property="cateCode" column="cate_code" /> - <result property="companyId" column="company_id" /> - </resultMap> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsDao.xml deleted file mode 100644 index 7084899..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsDao.xml +++ /dev/null @@ -1,47 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.score.dao.ScoreGoodsDao"> - <!-- 定义ScoreGoods 的复杂关联map --> - <resultMap type="com.matrix.system.score.entity.ScoreGoods" id="ScoreGoodsMap"> - <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="goodsName" column="goods_name" /> - <result property="goodsCode" column="goods_code" /> - <result property="categoryId" column="category_id" /> - <result property="state" column="state" /> - <result property="limitedNum" column="limited_num" /> - <result property="scorePrice" column="score_price" /> - <result property="markPrice" column="mark_price" /> - <result property="details" column="details" /> - <result property="navigationId" column="navigation_id" /> - <result property="remarks" column="remarks" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义ScoreGoods 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.score.entity.ScoreGoods" id="ScoreGoodsSimpleMap"> - <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="goodsName" column="goods_name" /> - <result property="goodsCode" column="goods_code" /> - <result property="categoryId" column="category_id" /> - <result property="state" column="state" /> - <result property="limitedNum" column="limited_num" /> - <result property="scorePrice" column="score_price" /> - <result property="markPrice" column="mark_price" /> - <result property="details" column="details" /> - <result property="navigationId" column="navigation_id" /> - <result property="remarks" column="remarks" /> - <result property="companyId" column="company_id" /> - </resultMap> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsImageDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsImageDao.xml deleted file mode 100644 index 63a26d2..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsImageDao.xml +++ /dev/null @@ -1,35 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.score.dao.ScoreGoodsImageDao"> - <!-- 定义ScoreGoodsImage 的复杂关联map --> - <resultMap type="com.matrix.system.score.entity.ScoreGoodsImage" id="ScoreGoodsImageMap"> - <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="imgPath" column="img_path" /> - <result property="imgMain" column="img_main" /> - <result property="imgSort" column="img_sort" /> - <result property="goodsId" column="goods_id" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义ScoreGoodsImage 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.score.entity.ScoreGoodsImage" id="ScoreGoodsImageSimpleMap"> - <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="imgPath" column="img_path" /> - <result property="imgMain" column="img_main" /> - <result property="imgSort" column="img_sort" /> - <result property="goodsId" column="goods_id" /> - <result property="companyId" column="company_id" /> - </resultMap> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsNavigationDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsNavigationDao.xml deleted file mode 100644 index 4062055..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsNavigationDao.xml +++ /dev/null @@ -1,31 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.score.dao.ScoreGoodsNavigationDao"> - <!-- 定义ScoreGoodsNavigation 的复杂关联map --> - <resultMap type="com.matrix.system.score.entity.ScoreGoodsNavigation" id="ScoreGoodsNavigationMap"> - <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="naviName" column="navi_name" /> - <result property="naviCode" column="navi_code" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义ScoreGoodsNavigation 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.score.entity.ScoreGoodsNavigation" id="ScoreGoodsNavigationSimpleMap"> - <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="naviName" column="navi_name" /> - <result property="naviCode" column="navi_code" /> - <result property="companyId" column="company_id" /> - </resultMap> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsSkuDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsSkuDao.xml deleted file mode 100644 index e690eac..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreGoodsSkuDao.xml +++ /dev/null @@ -1,41 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.score.dao.ScoreGoodsSkuDao"> - <!-- 定义ScoreGoodsSku 的复杂关联map --> - <resultMap type="com.matrix.system.score.entity.ScoreGoodsSku" id="ScoreGoodsSkuMap"> - <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="skuName" column="sku_name" /> - <result property="imgPath" column="img_path" /> - <result property="scorePrice" column="score_price" /> - <result property="reserve" column="reserve" /> - <result property="skuSort" column="sku_sort" /> - <result property="goodsId" column="goods_id" /> - <result property="skuErpCode" column="sku_erp_code" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义ScoreGoodsSku 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.score.entity.ScoreGoodsSku" id="ScoreGoodsSkuSimpleMap"> - <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="skuName" column="sku_name" /> - <result property="imgPath" column="img_path" /> - <result property="scorePrice" column="score_price" /> - <result property="reserve" column="reserve" /> - <result property="skuSort" column="sku_sort" /> - <result property="goodsId" column="goods_id" /> - <result property="skuErpCode" column="sku_erp_code" /> - <result property="companyId" column="company_id" /> - </resultMap> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderDao.xml deleted file mode 100644 index 7990b58..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderDao.xml +++ /dev/null @@ -1,53 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.score.dao.ScoreOrderDao"> - <!-- 定义ScoreOrder 的复杂关联map --> - <resultMap type="com.matrix.system.score.entity.ScoreOrder" id="ScoreOrderMap"> - <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="orderCode" column="order_code" /> - <result property="memberId" column="member_id" /> - <result property="memberPhone" column="member_phone" /> - <result property="payTotalScore" column="pay_total_score" /> - <result property="orderState" column="order_state" /> - <result property="orderTime" column="order_time" /> - <result property="payTime" column="pay_time" /> - <result property="receiveWay" column="receive_way" /> - <result property="addressId" column="address_id" /> - <result property="selfAddress" column="self_address" /> - <result property="selfTime" column="self_time" /> - <result property="logisticsId" column="logistics_id" /> - <result property="remarks" column="remarks" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义ScoreOrder 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.score.entity.ScoreOrder" id="ScoreOrderSimpleMap"> - <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="orderCode" column="order_code" /> - <result property="memberId" column="member_id" /> - <result property="memberPhone" column="member_phone" /> - <result property="payTotalScore" column="pay_total_score" /> - <result property="orderState" column="order_state" /> - <result property="orderTime" column="order_time" /> - <result property="payTime" column="pay_time" /> - <result property="receiveWay" column="receive_way" /> - <result property="addressId" column="address_id" /> - <result property="selfAddress" column="self_address" /> - <result property="selfTime" column="self_time" /> - <result property="logisticsId" column="logistics_id" /> - <result property="remarks" column="remarks" /> - <result property="companyId" column="company_id" /> - </resultMap> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderItemDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderItemDao.xml deleted file mode 100644 index e89de39..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreOrderItemDao.xml +++ /dev/null @@ -1,39 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.score.dao.ScoreOrderItemDao"> - <!-- 定义ScoreOrderItem 的复杂关联map --> - <resultMap type="com.matrix.system.score.entity.ScoreOrderItem" id="ScoreOrderItemMap"> - <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="goodsId" column="goods_id" /> - <result property="goodsName" column="goods_name" /> - <result property="goodsCode" column="goods_code" /> - <result property="goodsNum" column="goods_num" /> - <result property="payScore" column="pay_score" /> - <result property="orderId" column="order_id" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义ScoreOrderItem 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.score.entity.ScoreOrderItem" id="ScoreOrderItemSimpleMap"> - <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="goodsId" column="goods_id" /> - <result property="goodsName" column="goods_name" /> - <result property="goodsCode" column="goods_code" /> - <result property="goodsNum" column="goods_num" /> - <result property="payScore" column="pay_score" /> - <result property="orderId" column="order_id" /> - <result property="companyId" column="company_id" /> - </resultMap> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreRuleSettingDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreRuleSettingDao.xml deleted file mode 100644 index a0678f4..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreRuleSettingDao.xml +++ /dev/null @@ -1,5 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> -<mapper namespace="com.matrix.system.score.dao.ScoreRuleSettingDao"> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreShoppingCarDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreShoppingCarDao.xml deleted file mode 100644 index 61630b8..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreShoppingCarDao.xml +++ /dev/null @@ -1,33 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.system.score.dao.ScoreShoppingCarDao"> - <!-- 定义ScoreShoppingCar 的复杂关联map --> - <resultMap type="com.matrix.system.score.entity.ScoreShoppingCar" id="ScoreShoppingCarMap"> - <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="userId" column="user_id" /> - <result property="goodsId" column="goods_id" /> - <result property="count" column="count" /> - <result property="companyId" column="company_id" /> - </resultMap> - - - <!-- 定义ScoreShoppingCar 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.system.score.entity.ScoreShoppingCar" id="ScoreShoppingCarSimpleMap"> - <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="userId" column="user_id" /> - <result property="goodsId" column="goods_id" /> - <result property="count" column="count" /> - <result property="companyId" column="company_id" /> - </resultMap> - -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml index 876d0a9..b8a1a41 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreUseRecordDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml index 7c7cfea..47664d6 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml +++ b/zq-erp/src/main/resources/mybatis/mapper/score/ScoreVipDetailDao.xml @@ -1,32 +1,22 @@ <?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> +<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <mapper namespace="com.matrix.system.score.dao.ScoreVipDetailDao"> <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> - </select> + select IFNULL(sum(IFNULL( remain_score, 0 )),0) from score_vip_detail + where state=1 and vip_id=#{vipId} - <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> - order by create_time - </select> + </select> + + <select id="selectEffectiveScore" resultType="com.matrix.system.score.entity.ScoreVipDetail"> + select * + from score_vip_detail + where state = 1 and vip_id = #{vipId} + order by create_time + + </select> </mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml deleted file mode 100644 index 9c5f32b..0000000 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/BizUserDao.xml +++ /dev/null @@ -1,559 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" -"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - -<mapper namespace="com.matrix.biz.dao.BizUserDao"> - <!-- 定义BizUser 的复杂关联map --> - <resultMap type="com.matrix.biz.bean.BizUser" id="BizUserMap"> - <id property="userId" column="user_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="userName" column="user_name" /> - <result property="userPassword" column="user_password" /> - <result property="nickName" column="nick_name" /> - <result property="avatarUrl" column="avatar_url" /> - <result property="openId" column="open_id" /> - <result property="unionId" column="union_id" /> - <result property="gender" column="gender" /> - <result property="phoneNumber" column="phone_number" /> - <result property="area" column="area" /> - <result property="city" column="city" /> - <result property="province" column="province" /> - <result property="country" column="country" /> - <result property="sessionKey" column="session_key" /> - <result property="lastLoginTime" column="last_login_time" /> - <result property="userStatus" column="user_status" /> - <result property="userVip" column="user_vip" /> - <result property="userExpiryTime" column="user_expiry_time" /> - <result property="userAuthentication" column="user_authentication" /> - <result property="userIsAuthorize" column="user_is_authorize" /> - <result property="userTempName" column="user_temp_name" /> - <result property="userTempAvatarUrl" column="user_temp_avatar_url" /> - <result property="userType" column="user_type" /> - <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="parentOpenId" column="parent_open_id" /> - </resultMap> - - - <!-- 定义BizUser 的简单map ,本map不添加其他的关联属性 --> - <resultMap type="com.matrix.biz.bean.BizUser" id="BizUserSimpleMap"> - <id property="userId" column="user_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="userName" column="user_name" /> - <result property="userPassword" column="user_password" /> - <result property="nickName" column="nick_name" /> - <result property="avatarUrl" column="avatar_url" /> - <result property="openId" column="open_id" /> - <result property="unionId" column="union_id" /> - <result property="gender" column="gender" /> - <result property="phoneNumber" column="phone_number" /> - <result property="area" column="area" /> - <result property="city" column="city" /> - <result property="province" column="province" /> - <result property="country" column="country" /> - <result property="sessionKey" column="session_key" /> - <result property="lastLoginTime" column="last_login_time" /> - <result property="userStatus" column="user_status" /> - <result property="userVip" column="user_vip" /> - <result property="userExpiryTime" column="user_expiry_time" /> - <result property="userAuthentication" column="user_authentication" /> - <result property="userIsAuthorize" column="user_is_authorize" /> - <result property="userTempName" column="user_temp_name" /> - <result property="userTempAvatarUrl" column="user_temp_avatar_url" /> - <result property="userType" column="user_type" /> - <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="parentOpenId" column="parent_open_id" /> - </resultMap> - - <!-- 字段sql --> - <sql id="columns"> - create_by, - create_time, - update_by, - update_time, - user_id, - user_name, - user_password, - nick_name, - avatar_url, - open_id, - union_id, - gender, - phone_number, - area, - city, - province, - country, - session_key, - last_login_time, - user_status, - user_vip, - user_expiry_time, - user_authentication, - user_is_authorize, - user_temp_name, - user_temp_avatar_url, - user_type, - company_id, - is_sales, - withdrawal_cash, - salesman_grade, - parent_open_id - - </sql> - - <!-- 属性sql --> - <sql id="propertys"> - #{item.createBy}, - now(), - #{item.updateBy}, - now(), - #{item.userId}, - #{item.userName}, - #{item.userPassword}, - #{item.nickName}, - #{item.avatarUrl}, - #{item.openId}, - #{item.unionId}, - #{item.gender}, - #{item.phoneNumber}, - #{item.area}, - #{item.city}, - #{item.province}, - #{item.country}, - #{item.sessionKey}, - #{item.lastLoginTime}, - #{item.userStatus}, - #{item.userVip}, - #{item.userExpiryTime}, - #{item.userAuthentication}, - #{item.userIsAuthorize}, - #{item.userTempName}, - #{item.userTempAvatarUrl}, - #{item.userType}, - #{item.companyId}, - #{item.isSales}, - #{item.withdrawalCash}, - #{item.salesmanGrade}, - #{item.parentOpenId} - - - </sql> - - <!-- where sql --> - <sql id="where_sql"> - - <if test="record!=null"> - <if test="(record.userId!=null and record.userId!='') or (record.userId!='' and record.userId==0) "> - and user_id = #{record.userId} - </if> - <if test="(record.userName!=null and record.userName!='') or (record.userName!='' and record.userName==0) "> - and user_name = #{record.userName} - </if> - <if test="(record.userPassword!=null and record.userPassword!='') or (record.userPassword!='' and record.userPassword==0) "> - and user_password = #{record.userPassword} - </if> - <if test="(record.nickName!=null and record.nickName!='') or (record.nickName!='' and record.nickName==0) "> - and nick_name like concat('%',#{record.nickName},'%') - </if> - <if test="(record.avatarUrl!=null and record.avatarUrl!='') or (record.avatarUrl!='' and record.avatarUrl==0) "> - and avatar_url = #{record.avatarUrl} - </if> - <if test="(record.openId!=null and record.openId!='') or (record.openId!='' and record.openId==0) "> - and open_id = #{record.openId} - </if> - <if test="(record.unionId!=null and record.unionId!='') or (record.unionId!='' and record.unionId==0) "> - and union_id = #{record.unionId} - </if> - <if test="(record.gender!=null and record.gender!='') or (record.gender!='' and record.gender==0) "> - and gender = #{record.gender} - <if test="record.gender==0"> - or gender is null - </if> - </if> - <if test="(record.phoneNumber!=null and record.phoneNumber!='') or (record.phoneNumber!='' and record.phoneNumber==0) "> - and phone_number = #{record.phoneNumber} - </if> - <if test="(record.area!=null and record.area!='') or (record.area!='' and record.area==0) "> - and area = #{record.area} - </if> - <if test="(record.city!=null and record.city!='') or (record.city!='' and record.city==0) "> - and city = #{record.city} - </if> - <if test="(record.province!=null and record.province!='') or (record.province!='' and record.province==0) "> - and province = #{record.province} - </if> - <if test="(record.country!=null and record.country!='') or (record.country!='' and record.country==0) "> - and country = #{record.country} - </if> - <if test="(record.sessionKey!=null and record.sessionKey!='') or (record.sessionKey!='' and record.sessionKey==0) "> - and session_key = #{record.sessionKey} - </if> - <if test="(record.lastLoginTime!=null and record.lastLoginTime!='') or (record.lastLoginTime!='' and record.lastLoginTime==0) "> - and last_login_time = #{record.lastLoginTime} - </if> - <if test="(record.userStatus!=null and record.userStatus!='') or (record.userStatus!='' and record.userStatus==0) "> - and user_status = #{record.userStatus} - </if> - <if test="(record.userVip!=null and record.userVip!='') or (record.userVip!='' and record.userVip==0) "> - and user_vip = #{record.userVip} - </if> - <if test="(record.userExpiryTime!=null and record.userExpiryTime!='') or (record.userExpiryTime!='' and record.userExpiryTime==0) "> - and user_expiry_time = #{record.userExpiryTime} - </if> - <if test="(record.userAuthentication!=null and record.userAuthentication!='') or (record.userAuthentication!='' and record.userAuthentication==0) "> - and user_authentication = #{record.userAuthentication} - </if> - <if test="(record.userIsAuthorize!=null and record.userIsAuthorize!='') or (record.userIsAuthorize!='' and record.userIsAuthorize==0) "> - and user_is_authorize = #{record.userIsAuthorize} - </if> - <if test="(record.userTempName!=null and record.userTempName!='') or (record.userTempName!='' and record.userTempName==0) "> - and user_temp_name = #{record.userTempName} - </if> - <if test="(record.userTempAvatarUrl!=null and record.userTempAvatarUrl!='') or (record.userTempAvatarUrl!='' and record.userTempAvatarUrl==0) "> - and user_temp_avatar_url = #{record.userTempAvatarUrl} - </if> - <if test="(record.userType!=null and record.userType!='') or (record.userType!='' and record.userType==0) "> - and user_type = #{record.userType} - </if> - - <if test="record.companyId != null and record.companyId !='' "> - and company_id = #{record.companyId} - </if> - - <if test="record.isSales != null and record.isSales !='' "> - and is_sales = #{record.isSales} - </if> - - <if test="record.withdrawalCash != null and record.withdrawalCash !='' "> - and withdrawal_cash = #{record.withdrawalCash} - </if> - - <if test="record.salesmanGrade != null and record.salesmanGrade !='' "> - and salesman_grade = #{record.salesmanGrade} - </if> - <if test="record.parentOpenId != null and record.parentOpenId !='' "> - and parent_open_id = #{record.parentOpenId} - </if> - - <if test="(record.startTime!=null and record.startTime!='') or (record.startTime!='' and record.startTime==0) "> - and date_format(create_time,'%Y-%m-%d') >= #{record.startTime} - </if> - <if test="(record.endTime!=null and record.endTime!='') or (record.endTime!='' and record.endTime==0) "> - and date_format(create_time,'%Y-%m-%d') <= #{record.endTime} - </if> - </if> - - </sql> - - <!-- 插入方法 --> - <insert id="insert" parameterType="com.matrix.biz.bean.BizUser" - useGeneratedKeys="true" keyProperty="item.userId"> - INSERT INTO biz_user ( - <include refid="columns"></include> - ) - VALUES ( - <include refid="propertys"></include> - ) - </insert> - - - - <!-- 批量插入 --> - <insert id="batchInsert" parameterType="java.util.List"> - INSERT INTO biz_user ( - <include refid="columns"></include> - ) - VALUES - <foreach collection="list" item="item" index="index" separator=",">( - <include refid="propertys"></include> - )</foreach> - </insert> - - - - - - <!-- 根据Map更新 部分更新 --> - <update id="updateByMap" parameterType="java.util.HashMap" > - UPDATE biz_user - <set> - <if test="_parameter.containsKey('userName')"> - user_name = #{userName}, - </if> - <if test="_parameter.containsKey('userPassword')"> - user_password = #{userPassword}, - </if> - <if test="_parameter.containsKey('nickName')"> - nick_name = #{nickName}, - </if> - <if test="_parameter.containsKey('avatarUrl')"> - avatar_url = #{avatarUrl}, - </if> - <if test="_parameter.containsKey('openId')"> - open_id = #{openId}, - </if> - <if test="_parameter.containsKey('unionId')"> - union_id = #{unionId}, - </if> - <if test="_parameter.containsKey('gender')"> - gender = #{gender}, - </if> - <if test="_parameter.containsKey('phoneNumber')"> - phone_number = #{phoneNumber}, - </if> - <if test="_parameter.containsKey('area')"> - area = #{area}, - </if> - <if test="_parameter.containsKey('city')"> - city = #{city}, - </if> - <if test="_parameter.containsKey('province')"> - province = #{province}, - </if> - <if test="_parameter.containsKey('country')"> - country = #{country}, - </if> - <if test="_parameter.containsKey('sessionKey')"> - session_key = #{sessionKey}, - </if> - <if test="_parameter.containsKey('lastLoginTime')"> - last_login_time = #{lastLoginTime}, - </if> - <if test="_parameter.containsKey('userStatus')"> - user_status = #{userStatus}, - </if> - <if test="_parameter.containsKey('userVip')"> - user_vip = #{userVip}, - </if> - <if test="_parameter.containsKey('userExpiryTime')"> - user_expiry_time = #{userExpiryTime}, - </if> - <if test="_parameter.containsKey('userAuthentication')"> - user_authentication = #{userAuthentication}, - </if> - <if test="_parameter.containsKey('userIsAuthorize')"> - user_is_authorize = #{userIsAuthorize}, - </if> - <if test="_parameter.containsKey('userTempName')"> - user_temp_name = #{userTempName}, - </if> - <if test="_parameter.containsKey('userTempAvatarUrl')"> - user_temp_avatar_url = #{userTempAvatarUrl}, - </if> - - - <if test="_parameter.containsKey('userType')"> - user_type = #{userType}, - </if> - - <if test="_parameter.containsKey('isSales')"> - is_sales = #{isSales}, - </if> - - <if test="_parameter.containsKey('withdrawalCash')"> - withdrawal_cash = #{withdrawalCash}, - </if> - <if test="_parameter.containsKey('salesmanGrade')"> - salesman_grade = #{salesmanGrade}, - </if> - <if test="_parameter.containsKey('parentOpenId')"> - parent_open_id = #{parentOpenId}, - </if> - - - - </set> - WHERE user_id=#{userId} - </update> - - - <!-- 根据对象更新 部分更新 --> - <update id="updateByModel" parameterType="String"> - UPDATE biz_user - <set> - <if test="record.userName != null and record.userName != '' "> - user_name = #{record.userName}, - </if> - <if test="record.userPassword != null and record.userPassword != '' "> - user_password = #{record.userPassword}, - </if> - <if test="record.nickName != null and record.nickName != '' "> - nick_name = #{record.nickName}, - </if> - <if test="record.avatarUrl != null and record.avatarUrl != '' "> - avatar_url = #{record.avatarUrl}, - </if> - <if test="record.openId != null and record.openId != '' "> - open_id = #{record.openId}, - </if> - <if test="record.unionId != null and record.unionId != '' "> - union_id = #{record.unionId}, - </if> - <if test="record.gender != null and record.gender != '' "> - gender = #{record.gender}, - </if> - <if test="record.phoneNumber != null and record.phoneNumber != '' "> - phone_number = #{record.phoneNumber}, - </if> - <if test="record.area != null and record.area != '' "> - area = #{record.area}, - </if> - <if test="record.city != null and record.city != '' "> - city = #{record.city}, - </if> - <if test="record.province != null and record.province != '' "> - province = #{record.province}, - </if> - <if test="record.country != null and record.country != '' "> - country = #{record.country}, - </if> - <if test="record.sessionKey != null and record.sessionKey != '' "> - session_key = #{record.sessionKey}, - </if> - <if test="record.lastLoginTime != null "> - last_login_time = #{record.lastLoginTime}, - </if> - <if test="record.userStatus != null "> - user_status = #{record.userStatus}, - </if> - <if test="record.userVip != null "> - user_vip = #{record.userVip}, - </if> - <if test="record.userExpiryTime != null "> - user_expiry_time = #{record.userExpiryTime}, - </if> - <if test="record.userAuthentication != null and record.userAuthentication != '' "> - user_authentication = #{record.userAuthentication}, - </if> - <if test="record.userIsAuthorize != null "> - user_is_authorize = #{record.userIsAuthorize}, - </if> - <if test="record.userTempName != null and record.userTempName != '' "> - user_temp_name = #{record.userTempName}, - </if> - <if test="record.userTempAvatarUrl != null and record.userTempAvatarUrl != '' "> - user_temp_avatar_url = #{record.userTempAvatarUrl}, - </if> - <if test="record.userType != null "> - user_type = #{record.userType}, - </if> - <if test="record.isSales != null "> - is_sales = #{record.isSales}, - </if> - <if test="record.withdrawalCash != null "> - withdrawal_cash = #{record.withdrawalCash}, - </if> - <if test="record.salesmanGrade != null "> - salesman_grade = #{record.salesmanGrade}, - </if> - <if test="record.parentOpenId != null "> - parent_open_id = #{record.parentOpenId}, - </if> - - </set> - WHERE user_id=#{record.userId} - </update> - - <!-- 批量删除 --> - <delete id="deleteByIds" parameterType="java.util.List"> - delete from biz_user where user_id in - <foreach collection="list" index="index" item="item" open="(" - separator="," close=")"> - #{item} - </foreach> - </delete> - - <!-- 根据id删除--> - <delete id="deleteById" parameterType="String"> - DELETE FROM biz_user - where user_id=#{userId} - </delete> - - <!-- 根据对象删除--> - <delete id="deleteByModel" parameterType="com.matrix.biz.bean.BizUser"> - DELETE FROM biz_user - <where> - <include refid="where_sql" ></include> - </where> - </delete> - - - - <!-- 分页查询 --> - <select id="selectInPage" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user - <where> - <include refid="where_sql"></include> - </where> - <if test="pageVo !=null"><!-- 判断pageVo对象是否为空 --> - <if test="pageVo.sort !=null and pageVo.order !=null"> - order by - ${pageVo.sort} ${pageVo.order} - </if> - <if test="pageVo.offset >=0 and pageVo.limit >0"> - limit - #{pageVo.offset},#{pageVo.limit} - </if> - </if> - </select> - - <!-- 查询总条数 --> - <select id="selectTotalRecord" parameterType="long" resultType="java.lang.Integer"> - select count(*) - from biz_user - <where> - <include refid="where_sql"></include> - </where> - </select> - - <!-- 根据id查询--> - <select id="selectById" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user - where user_id=#{userId} - </select> - - - <!-- 根据id 锁表查询--> - <select id="selectForUpdate" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user - where user_id=#{user_id} - for update - </select> - - - - <!-- 根据对象查询--> - <select id="selectByModel" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user - <where> - <include refid="where_sql"></include> - </where> - </select> - - - <select id="findByOpenId" resultMap="BizUserMap"> - select - <include refid="columns" ></include> - from biz_user where open_id=#{openId} - </select> -</mapper> \ No newline at end of file diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml index f429e8c..2e74316 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml index c98ffff..0ed3811 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesGroupJoinUserDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml index da0bb54..a759d6f 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSalonRecordDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml index b577b01..0a420e7 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopActivitiesSeckillRecordDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml index 1ed2da7..e55332e 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopCollectionDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml index 15b7e08..fadeb51 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopInvoiceDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml index 6404029..9c86499 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderSearchDao.xml +++ b/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"> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml index dc2fe96..a282ab6 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopOrderV2Dao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml index 9935dd4..fe87fd2 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopProductCommentDao.xml +++ b/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) "> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml index 374a982..75e8591 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopRefundRecordDao.xml +++ b/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> diff --git a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml b/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml index 4cf0397..5f88fc6 100644 --- a/zq-erp/src/main/resources/mybatis/mapper/xcxShop/ShopShoppingCartDao.xml +++ b/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 锁表查询--> diff --git a/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html b/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html index b0d1f09..3678ccb 100644 --- a/zq-erp/src/main/resources/templates/views/admin/shop/shopUser-list.html +++ b/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, }); diff --git a/zq-erp/src/test/java/com/matrix/JyyTests.java b/zq-erp/src/test/java/com/matrix/JyyTests.java index 00e55c5..7dec718 100644 --- a/zq-erp/src/test/java/com/matrix/JyyTests.java +++ b/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")); - } } diff --git a/zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java b/zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java index 1469566..196c2c1 100644 --- a/zq-erp/src/test/java/com/matrix/SalesOrderTaskTest.java +++ b/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()); diff --git a/zq-erp/src/test/java/com/matrix/SourceFlowTests.java b/zq-erp/src/test/java/com/matrix/SourceFlowTests.java index 11b72f6..8f30c3b 100644 --- a/zq-erp/src/test/java/com/matrix/SourceFlowTests.java +++ b/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"); - } + } -- Gitblit v1.9.1