Merge remote-tracking branch 'origin/master'
| | |
| | | @ApiModelProperty(value = "用户id") |
| | | @TableField("app_user_id") |
| | | private Long appUserId; |
| | | |
| | | @ApiModelProperty(value = "当前vip") |
| | | @TableField("vip_id") |
| | | private Integer vipId; |
| | | |
| | | @ApiModelProperty(value = "申请类型 对应vip_id") |
| | | @TableField("application_vip_id") |
| | |
| | | |
| | | @TableField(exist = false) |
| | | private String idStr; |
| | | @TableField(exist = false) |
| | | private Integer vipId; |
| | | |
| | | |
| | | } |
| | |
| | | private LocalDateTime authTime; |
| | | |
| | | @ApiModelProperty(value = "平台收货时间") |
| | | @TableField("receive_time") |
| | | private LocalDateTime receiveTime; |
| | | |
| | | @ApiModelProperty(value = "后台审核备注") |
| | |
| | | public R<SeckillActivityInfo> getSeckillActivityInfoById(Integer id) { |
| | | return R.fail("根据id获取秒杀活动失败:" + cause.getMessage()); |
| | | } |
| | | |
| | | @Override |
| | | public R<SeckillActivityInfo> getSeckillActivityInfoByGoodsId(Integer goodsId) { |
| | | return R.fail(); |
| | | } |
| | | }; |
| | | } |
| | | } |
| | |
| | | import com.ruoyi.other.api.factory.SeckillActivityInfoClientFallbackFactory; |
| | | import com.ruoyi.other.api.vo.GetSeckillActivityInfo; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | |
| | | */ |
| | | @PostMapping("/seckill-activity-info/getSeckillActivityInfoById") |
| | | R<SeckillActivityInfo> getSeckillActivityInfoById(@RequestParam("id") Integer id); |
| | | |
| | | @GetMapping("/seckill-activity-info/getSeckillActivityInfoByGoodsId") |
| | | public R<SeckillActivityInfo> getSeckillActivityInfoByGoodsId(@RequestParam("goodsId") Integer goodsId); |
| | | } |
| | |
| | | </properties> |
| | | |
| | | <dependencies> |
| | | |
| | | <dependency> |
| | | <groupId>com.ruoyi</groupId> |
| | | <artifactId>ruoyi-api-other</artifactId> |
| | | </dependency> |
| | | <!-- SpringCloud Alibaba Nacos --> |
| | | <dependency> |
| | | <groupId>com.alibaba.cloud</groupId> |
| | |
| | | package com.ruoyi.auth.service; |
| | | |
| | | import com.ruoyi.other.api.domain.Shop; |
| | | import com.ruoyi.other.api.feignClient.ShopClient; |
| | | import com.ruoyi.system.api.RemoteUserService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | |
| | | |
| | | @Resource |
| | | private RedisService redisService; |
| | | |
| | | @Resource |
| | | private ShopClient shopClient; |
| | | /** |
| | | * 登录 |
| | | */ |
| | |
| | | if (UserStatus.DISABLE.getCode().equals(user.getStatus())) { |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_FAIL_STATUS, "用户已停用,请联系管理员"); |
| | | // throw new ServiceException("对不起,您的账号:" + username + " 已停用"); |
| | | throw new ServiceException("您的账号已被禁用,请联系平台"); |
| | | throw new ServiceException("您所属门店已被冻结,请联系平台"); |
| | | } |
| | | if (user.getRoleType()==2){ |
| | | Shop data = shopClient.getShopById(user.getObjectId()).getData(); |
| | | if (data==null){ |
| | | throw new ServiceException("门店不存在"); |
| | | }else{ |
| | | if (data.getStatus()==2){ |
| | | throw new ServiceException("您所属门店已被冻结,请联系平台"); |
| | | } |
| | | } |
| | | } |
| | | passwordService.validate(user, password, request); |
| | | recordLogService.recordLogininfor(request, user.getUserId().intValue(), username, Constants.LOGIN_SUCCESS_STATUS, "登录成功"); |
| | |
| | | server: |
| | | port: 9100 |
| | | tomcat: |
| | | basedir: /data/tomcat |
| | | basedir: /mnt/tomcat |
| | | # Spring |
| | | spring: |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | # active: prod |
| | | # active: dev |
| | | active: prod |
| | | application: |
| | | # 应用名称 |
| | | name: ruoyi-auth |
| | |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | --- |
| | | seata: |
| | | enabled: true |
| | | application-id: ${spring.application.name} |
| | | tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 |
| | | enable-auto-data-source-proxy: false #关闭数据库代理 |
| | | service: |
| | | vgroup-mapping: |
| | | seata_tx_group: default |
| | | data-source-proxy-mode: AT |
| | | config: |
| | | type: nacos |
| | | nacos: |
| | | # 开发环境 |
| | | server-addr: 192.168.110.169:8848 |
| | | namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 |
| | | group: DEFAULT_GROUP |
| | | data-id: seata-server.properties |
| | | username: nacos |
| | | password: nacos |
| | | # 生产环境 |
| | | # server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | # group: DEFAULT_GROUP |
| | | # data-id: seata-server.properties |
| | | # username: nacos |
| | | # password: nacos |
| | | registry: |
| | | type: nacos |
| | | nacos: |
| | | application: seata-server |
| | | # 开发环境 |
| | | server-addr: 192.168.110.169:8848 |
| | | namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 |
| | | group: DEFAULT_GROUP |
| | | username: nacos |
| | | password: nacos |
| | | # 生产环境 |
| | | # server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | # group: DEFAULT_GROUP |
| | | # username: nacos |
| | | # password: nacos |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | # 开发环境 |
| | | server-addr: 192.168.110.169:8848 # nacos注册中心地址 |
| | | namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 # 命名空间 |
| | | group: DEFAULT_GROUP |
| | | application: seata-server #Nacos 中 Seata 名称 |
| | | username: nacos |
| | | password: nacos |
| | | # 生产环境 |
| | | # server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | # group: DEFAULT_GROUP |
| | | # application: seata-server #Nacos 中 Seata 名称 |
| | | # username: nacos |
| | | # password: nacos |
| | | sentinel: |
| | | transport: |
| | | dashboard: 127.0.0.1:8080 # Sentinel控制台地址 |
| | | eager: true |
| | | --- |
| | | spring: |
| | | config: |
| | | activate: |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | server-addr: 127.0.0.1:8848 |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | group: DEFAULT_GROUP |
| | |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | - application.${spring.cloud.nacos.config.file-extension} |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="logs/ruoyi-auth" /> |
| | | <property name="log.path" value="/mnt/app/ruoyi-auth" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | server: |
| | | port: 9000 |
| | | tomcat: |
| | | basedir: /data/tomcat |
| | | basedir: /mnt/tomcat |
| | | max-swallow-size: 100MB |
| | | # Spring |
| | | spring: |
| | |
| | | allow-bean-definition-overriding: true |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | # active: prod |
| | | # active: dev |
| | | active: prod |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | server-addr: 127.0.0.1:8848 |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | group: DEFAULT_GROUP |
| | |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | - application.${spring.cloud.nacos.config.file-extension} |
| | | sentinel: |
| | | # 取消控制台懒加载 |
| | | eager: true |
| | |
| | | datasource: |
| | | ds1: |
| | | nacos: |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | dataId: sentinel-ruoyi-gateway |
| | | groupId: DEFAULT_GROUP |
| | | username: nacos |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="logs/ruoyi-gateway" /> |
| | | <property name="log.path" value="/mnt/app/ruoyi-gateway" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.ArrayList; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | |
| | | .ne(SysRole::getRoleId, 2) |
| | | .eq(SysRole::getDelFlag, 0) |
| | | .eq(SysRole::getStatus, 0); |
| | | if(sysUser.getRoleType() == 2){ |
| | | if (sysUser.getRoleType() == 2) { |
| | | wrapper.eq(SysRole::getShopId, sysUser.getObjectId()); |
| | | }else { |
| | | wrapper.isNull(SysRole::getShopId); |
| | | } |
| | | List<SysRole> list = roleService.list(wrapper); |
| | | return AjaxResult.success(list); |
| | |
| | | SysRole role = new SysRole(); |
| | | role.setRoleName(dto.getRoleName()); |
| | | LambdaQueryWrapper<SysRole> wrapper = Wrappers.lambdaQuery(SysRole.class) |
| | | .eq(SysRole::getRoleName, dto.getRoleName()); |
| | | .eq(SysRole::getRoleName, dto.getRoleName()).eq(SysRole::getDelFlag, 0); |
| | | Long userid = tokenService.getLoginUser().getUserid(); |
| | | SysUser sysUser = sysUserService.getById(userid); |
| | | if(sysUser.getRoleType() == 2){ |
| | |
| | | server: |
| | | port: 9800 |
| | | tomcat: |
| | | basedir: /data/tomcat |
| | | basedir: /mnt/tomcat |
| | | # Spring |
| | | spring: |
| | | application: |
| | |
| | | allow-bean-definition-overriding: true |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | # active: prod |
| | | # active: dev |
| | | active: prod |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | --- |
| | | seata: |
| | | enabled: true |
| | | application-id: ${spring.application.name} |
| | | tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 |
| | | enable-auto-data-source-proxy: false |
| | | service: |
| | | vgroup-mapping: |
| | | seata_tx_group: default |
| | | data-source-proxy-mode: AT |
| | | config: |
| | | type: nacos |
| | | nacos: |
| | | # 开发环境 |
| | | server-addr: 192.168.110.169:8848 |
| | | namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 |
| | | group: DEFAULT_GROUP |
| | | data-id: seata-server.properties |
| | | username: nacos |
| | | password: nacos |
| | | # 生产环境 |
| | | # server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | # group: DEFAULT_GROUP |
| | | # data-id: seata-server.properties |
| | | # username: nacos |
| | | # password: nacos |
| | | registry: |
| | | type: nacos |
| | | nacos: |
| | | application: seata-server |
| | | # 开发环境 |
| | | server-addr: 192.168.110.169:8848 |
| | | namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 |
| | | group: DEFAULT_GROUP |
| | | username: nacos |
| | | password: nacos |
| | | # 生产环境 |
| | | # server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | # group: DEFAULT_GROUP |
| | | # username: nacos |
| | | # password: nacos |
| | | cloud: |
| | | nacos: |
| | | discovery: |
| | | # 开发环境 |
| | | server-addr: 192.168.110.169:8848 # nacos注册中心地址 |
| | | namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 # 命名空间 |
| | | group: DEFAULT_GROUP |
| | | application: seata-server #Nacos 中 Seata 名称 |
| | | username: nacos |
| | | password: nacos |
| | | # 生产环境 |
| | | # server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | # namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | # group: DEFAULT_GROUP |
| | | # application: seata-server #Nacos 中 Seata 名称 |
| | | # username: nacos |
| | | # password: nacos |
| | | sentinel: |
| | | transport: |
| | | dashboard: 127.0.0.1:8080 # Sentinel控制台地址 |
| | | eager: true |
| | | --- |
| | | spring: |
| | | config: |
| | | activate: |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | server-addr: 127.0.0.1:8848 |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | group: DEFAULT_GROUP |
| | |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | - application.${spring.cloud.nacos.config.file-extension} |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="logs/ruoyi-system" /> |
| | | <property name="log.path" value="/mnt/app/ruoyi-system" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | private BaseSettingClient baseSettingClient; |
| | | @Resource |
| | | private VipCenterService vipCenterService; |
| | | @Resource |
| | | private VipSettingClient vipSettingClient; |
| | | @Resource |
| | | private UserChangeLogService userChangeLogService; |
| | | |
| | | @PostMapping("/apply") |
| | | @ApiOperation(value = "会员申请", tags = {"会员中心-小程序"}) |
| | |
| | | @ApiOperation(value = "会员申请列表", tags = {"后台"}) |
| | | public R<IPage<AgentApplication>> page(@RequestBody AgentQuery agentQuery) { |
| | | IPage<AgentApplication> agentApplicationIPage = agentApplicationService.pageList(agentQuery); |
| | | for (AgentApplication record : agentApplicationIPage.getRecords()) { |
| | | AppUser byId = appUserService.getById(record.getAppUserId()); |
| | | if (byId!=null){ |
| | | record.setVipId(byId.getVipId()); |
| | | } |
| | | } |
| | | return R.ok(agentApplicationIPage); |
| | | } |
| | | @Resource |
| | | private VipSettingClient vipSettingClient; |
| | | |
| | | @GetMapping("/detail") |
| | | @ApiOperation(value = "会员申请详情", tags = {"会员中心-小程序"}) |
| | | public R<AgentApplication> detail(@RequestParam Long id) { |
| | |
| | | VipSettingDto vipSettingDto = new VipSettingDto(); |
| | | BeanUtils.copyProperties(vipSetting.getData(),vipSettingDto); |
| | | agentApplication.setVipSettingDto(vipSettingDto); |
| | | // List<AppUser> appUserList = appUserService.list(new LambdaQueryWrapper<AppUser>() |
| | | // .ne(AppUser::getStatus, 3) |
| | | // .eq(AppUser::getDelFlag, 0)); |
| | | // ArrayList<Long> userIds = new ArrayList<>(); |
| | | // userIds.add(appUser.getId()); |
| | | // getUserAncestorList(appUser,userIds,new ArrayList<>(),appUserList); |
| | | agentApplication.setVipId(agentApplication.getApplicationVipId()); |
| | | agentApplication.setVipId(agentApplication.getVipId()); |
| | | return R.ok(agentApplication); |
| | | } |
| | | public void getUserAncestorList(AppUser user,List<Long> userIds, List<AppUser> children,List<AppUser> list) { |
| | | children = list.stream().filter(u -> userIds.contains(u.getInviteUserId()) || userIds.contains(u.getTopInviteId())).collect(Collectors.toList()); |
| | | if(!CollectionUtils.isEmpty(children)){ |
| | | user.setCount1((user.getCount1() == null ? 0L : user.getCount1()) + children.stream().filter(e->e.getVipId() == 1).count()); |
| | | user.setCount2((user.getCount2() == null ? 0L : user.getCount2()) + children.stream().filter(e->e.getVipId() == 2).count()); |
| | | user.setCount3((user.getCount3() == null ? 0L : user.getCount3()) + children.stream().filter(e->e.getVipId() == 3).count()); |
| | | user.setCount4((user.getCount4() == null ? 0L : user.getCount4()) + children.stream().filter(e->e.getVipId() == 4).count()); |
| | | user.setCount5((user.getCount5() == null ? 0L : user.getCount5()) + children.stream().filter(e->e.getVipId() == 5).count()); |
| | | user.setCount6((user.getCount6() == null ? 0L : user.getCount6()) + children.stream().filter(e->e.getVipId() == 6).count()); |
| | | user.setCount7((user.getCount7() == null ? 0L : user.getCount7()) + children.stream().filter(e->e.getVipId() == 7).count()); |
| | | List<Long> userIdList = children.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | getUserAncestorList(user,userIdList, children,list); |
| | | } |
| | | } |
| | | @Resource |
| | | private UserChangeLogService userChangeLogService; |
| | | |
| | | |
| | | |
| | | @GetMapping("/auth") |
| | | @ApiOperation(value = "会员申请审核", tags = {"会员中心-小程序"}) |
| | |
| | | byId.setStatus(status); |
| | | byId.setRemark(remark); |
| | | agentApplicationService.updateById(byId); |
| | | AppUser byId1 = appUserService.getById(byId.getAppUserId()); |
| | | //插入等级变化数据 |
| | | UserChangeLog userChangeLog = new UserChangeLog(); |
| | | userChangeLog.setCreateTime(LocalDateTime.now()); |
| | | userChangeLog.setAppUserId(byId.getAppUserId()); |
| | | userChangeLog.setBeforeVipId(byId1.getVipId()); |
| | | userChangeLog.setAfterVipId(byId.getApplicationVipId()); |
| | | if (userChangeLog.getBeforeVipId()>userChangeLog.getAfterVipId()) { |
| | | userChangeLog.setChangeType(0); |
| | | }else { |
| | | userChangeLog.setChangeType(1); |
| | | } |
| | | userChangeLogService.save(userChangeLog); |
| | | //变更会员等级 |
| | | byId1.setVipId(byId.getApplicationVipId()); |
| | | |
| | | // 当用户为合伙人时,计算合伙人积分和培育积分 |
| | | Integer vipId = byId1.getVipId(); |
| | | if (vipId == 7){ |
| | | R<BaseSetting> baseSetting = baseSettingClient.getBaseSetting(1); |
| | | BaseSetting data = baseSetting.getData(); |
| | | int basePoint = Integer.parseInt(data.getContent()); |
| | | // 当前用户计算合伙人积分 |
| | | R<VipSetting> vipSetting = vipSettingClient.getVipSetting(vipId); |
| | | Integer point = getPoint(vipSetting, byId1, basePoint); |
| | | byId1.setPartPoint(point); |
| | | // 上级计算培育积分 |
| | | R<BaseSetting> baseSetting2 = baseSettingClient.getBaseSetting(1); |
| | | BaseSetting data2 = baseSetting2.getData(); |
| | | int basePoint2 = Integer.parseInt(data2.getContent()); |
| | | Long inviteUserId = byId1.getInviteUserId(); |
| | | AppUser byId2 = appUserService.getById(inviteUserId); |
| | | if (byId2 != null){ |
| | | Integer point1 = getPoint(vipSetting, byId2, basePoint2); |
| | | byId2.setPartGrowPoint(point1); |
| | | if(2 == status){ |
| | | AppUser byId1 = appUserService.getById(byId.getAppUserId()); |
| | | //插入等级变化数据 |
| | | UserChangeLog userChangeLog = new UserChangeLog(); |
| | | userChangeLog.setCreateTime(LocalDateTime.now()); |
| | | userChangeLog.setAppUserId(byId.getAppUserId()); |
| | | userChangeLog.setBeforeVipId(byId1.getVipId()); |
| | | userChangeLog.setAfterVipId(byId.getApplicationVipId()); |
| | | if (userChangeLog.getBeforeVipId()>userChangeLog.getAfterVipId()) { |
| | | userChangeLog.setChangeType(0); |
| | | }else { |
| | | userChangeLog.setChangeType(1); |
| | | } |
| | | userChangeLogService.save(userChangeLog); |
| | | //变更会员等级 |
| | | byId1.setVipId(byId.getApplicationVipId()); |
| | | |
| | | // 当用户为合伙人时,计算合伙人积分和培育积分 |
| | | Integer vipId = byId1.getVipId(); |
| | | if (vipId == 7){ |
| | | R<BaseSetting> baseSetting = baseSettingClient.getBaseSetting(1); |
| | | BaseSetting data = baseSetting.getData(); |
| | | int basePoint = Integer.parseInt(data.getContent()); |
| | | // 当前用户计算合伙人积分 |
| | | R<VipSetting> vipSetting = vipSettingClient.getVipSetting(vipId); |
| | | Integer point = getPoint(vipSetting, byId1, basePoint); |
| | | byId1.setPartPoint(point); |
| | | // 上级计算培育积分 |
| | | R<BaseSetting> baseSetting2 = baseSettingClient.getBaseSetting(2); |
| | | BaseSetting data2 = baseSetting2.getData(); |
| | | int basePoint2 = Integer.parseInt(data2.getContent()); |
| | | Long inviteUserId = byId1.getInviteUserId(); |
| | | AppUser byId2 = appUserService.getById(inviteUserId); |
| | | if (byId2 != null){ |
| | | Integer point1 = getPoint(vipSetting, byId1, basePoint2); |
| | | byId2.setPartGrowPoint(point1); |
| | | appUserService.updateById(byId2); |
| | | } |
| | | } |
| | | |
| | | appUserService.updateById(byId1); |
| | | } |
| | | |
| | | appUserService.updateById(byId1); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | |
| | | DangerInfoDto dangerInfoDto = new DangerInfoDto(); |
| | | BeanUtils.copyProperties(data, dangerInfoDto); |
| | | List<UserPoint> list1 = userPointService.lambdaQuery().eq(UserPoint::getAppUserId,id).eq(UserPoint::getType, 1).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list(); |
| | | List<UserPoint> list2 = userPointService.lambdaQuery().eq(UserPoint::getAppUserId,id).eq(UserPoint::getType, 9).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list(); |
| | | List<UserPoint> list2 = userPointService.lambdaQuery().eq(UserPoint::getAppUserId,id).eq(UserPoint::getType, 2).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list(); |
| | | List<UserPoint> list3 = userPointService.lambdaQuery().eq(UserPoint::getAppUserId,id).eq(UserPoint::getType, 8).ge(UserPoint::getCreateTime, now.minusDays(data.getKeepBuyDay())).list(); |
| | | Integer userKeepBuyPoint = 0; |
| | | for (UserPoint userPoint : list1) { |
| | |
| | | userChangeLog.setChangeType(0); |
| | | userChangeLogService.save(userChangeLog); |
| | | appUser.setVipId(appUser.getVipId() - 1); |
| | | appUser.setIsDanger(0); |
| | | //检查是否达标,不达标继续标红 |
| | | VipSetting vipSetting = vipSettingClient.getVipSetting(appUser.getVipId()).getData(); |
| | | //消费积分 |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) >= create_time")); |
| | | int sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepBuyPoint()){ |
| | | appUser.setIsDanger(1); |
| | | } |
| | | //返佣积分 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepSharePoint()){ |
| | | appUser.setIsDanger(1); |
| | | } |
| | | //门店业绩 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepShopPoint()){ |
| | | appUser.setIsDanger(1); |
| | | } |
| | | appUserService.updateById(appUser); |
| | | return R.ok(); |
| | | } |
| | |
| | | }); |
| | | |
| | | |
| | | R<Map<String, BigDecimal>> shopStatistics = shopClient.getShopStatistics(); |
| | | Map<String, BigDecimal> data = shopStatistics.getData(); |
| | | BigDecimal totalServiceFee = BigDecimal.ZERO; |
| | | BigDecimal totalUserCommission = BigDecimal.ZERO; |
| | | if (data != null){ |
| | | totalServiceFee = data.get("serverGiveawayMoney"); |
| | | totalUserCommission = data.get("giveawayMoney"); |
| | | } |
| | | |
| | | BigDecimal totalCommission = BigDecimal.ZERO; |
| | | BigDecimal totalNormalCommission = BigDecimal.ZERO; |
| | | |
| | |
| | | |
| | | BigDecimal totalPartnerCommission = BigDecimal.ZERO; |
| | | |
| | | List<AppUser> allAppUserList = appUserService.list(); |
| | | for (AppUser appUser : allAppUserList) { |
| | | BigDecimal totalDistributionAmount = appUser.getTotalDistributionAmount(); |
| | | totalCommission = totalCommission.add(totalDistributionAmount); |
| | | if (appUser.getVipId() == 1){ |
| | | totalNormalCommission = totalNormalCommission.add(totalDistributionAmount); |
| | | } |
| | | if (appUser.getVipId() == 2){ |
| | | totalGoldCommission = totalGoldCommission.add(totalDistributionAmount); |
| | | } |
| | | if (appUser.getVipId() == 3){ |
| | | totalDiamondCommission = totalDiamondCommission.add(totalDistributionAmount); |
| | | } |
| | | if (appUser.getVipId() == 4){ |
| | | totalAgentCommission = totalAgentCommission.add(totalDistributionAmount); |
| | | } |
| | | if (appUser.getVipId() == 5){ |
| | | totalSuperAgentCommission = totalSuperAgentCommission.add(totalDistributionAmount); |
| | | } |
| | | if (appUser.getVipId() == 6){ |
| | | totalTopAgentCommission = totalTopAgentCommission.add(totalDistributionAmount); |
| | | } |
| | | if (appUser.getVipId() == 7){ |
| | | totalPartnerCommission = totalPartnerCommission.add(totalDistributionAmount); |
| | | } |
| | | Set<String> keySet = dailyVipCommissions.keySet(); |
| | | List<CommissionDate> commissionDateList = new ArrayList<>(); |
| | | for (String key : keySet) { |
| | | CommissionDate commissionDate = new CommissionDate(); |
| | | commissionDate.setDate(key); |
| | | Map<Integer, BigDecimal> dailyCommissions = dailyVipCommissions.get(key); |
| | | commissionDate.setNormalCommission(dailyCommissions.getOrDefault(1, BigDecimal.ZERO)); |
| | | totalNormalCommission = totalNormalCommission.add(dailyCommissions.getOrDefault(1, BigDecimal.ZERO)); |
| | | |
| | | commissionDate.setGoldCommission(dailyCommissions.getOrDefault(2, BigDecimal.ZERO)); |
| | | totalGoldCommission = totalGoldCommission.add(dailyCommissions.getOrDefault(2, BigDecimal.ZERO)); |
| | | |
| | | commissionDate.setDiamondCommission(dailyCommissions.getOrDefault(3, BigDecimal.ZERO)); |
| | | totalDiamondCommission = totalDiamondCommission.add(dailyCommissions.getOrDefault(3, BigDecimal.ZERO)); |
| | | |
| | | commissionDate.setAgentCommission(dailyCommissions.getOrDefault(4, BigDecimal.ZERO)); |
| | | totalAgentCommission = totalAgentCommission.add(dailyCommissions.getOrDefault(4, BigDecimal.ZERO)); |
| | | |
| | | commissionDate.setSuperAgentCommission(dailyCommissions.getOrDefault(5, BigDecimal.ZERO)); |
| | | totalSuperAgentCommission = totalSuperAgentCommission.add(dailyCommissions.getOrDefault(5, BigDecimal.ZERO)); |
| | | |
| | | commissionDate.setTopAgentCommission(dailyCommissions.getOrDefault(6, BigDecimal.ZERO)); |
| | | totalTopAgentCommission = totalTopAgentCommission.add(dailyCommissions.getOrDefault(6, BigDecimal.ZERO)); |
| | | |
| | | commissionDate.setPartnerCommission(dailyCommissions.getOrDefault(7, BigDecimal.ZERO)); |
| | | totalPartnerCommission = totalPartnerCommission.add(dailyCommissions.getOrDefault(7, BigDecimal.ZERO)); |
| | | |
| | | // 用户分销总金额 |
| | | |
| | | BigDecimal add = commissionDate.getNormalCommission().add(commissionDate.getGoldCommission()).add(commissionDate.getDiamondCommission()).add(commissionDate.getAgentCommission()) |
| | | .add(commissionDate.getSuperAgentCommission()).add(commissionDate.getTopAgentCommission()).add(commissionDate.getPartnerCommission()); |
| | | commissionDate.setTotalCommission(add); |
| | | |
| | | commissionDate.setServiceChargeCommission(dailyCommissions.getOrDefault(10, BigDecimal.ZERO)); |
| | | commissionDate.setAssociatedUserCommission(dailyCommissions.getOrDefault(8, BigDecimal.ZERO)); |
| | | commissionDate.setBindLowerLevelStoresCommission(dailyCommissions.getOrDefault(9, BigDecimal.ZERO)); |
| | | commissionDateList.add(commissionDate); |
| | | } |
| | | |
| | | R<Map<String, BigDecimal>> shopStatistics = shopClient.getShopStatistics(); |
| | | Map<String, BigDecimal> data = shopStatistics.getData(); |
| | | BigDecimal totalServiceFee = BigDecimal.ZERO; |
| | | BigDecimal totalUserCommission = BigDecimal.ZERO; |
| | | if (data != null){ |
| | | totalServiceFee = data.get("serverGiveawayMoney"); |
| | | totalUserCommission = data.get("lowerLevelGiveawayMoney"); |
| | | } |
| | | |
| | | |
| | | CommissionDetail commissionDetail = new CommissionDetail(); |
| | | commissionDetail.setTotalCommission(totalCommission); |
| | | commissionDetail.setTotalServiceFee(totalServiceFee); |
| | | commissionDetail.setTotalUserCommission(totalUserCommission); |
| | | |
| | | commissionDetail.setTotalNormalCommission(totalNormalCommission); |
| | | commissionDetail.setTotalGoldCommission(totalGoldCommission); |
| | | commissionDetail.setTotalDiamondCommission(totalDiamondCommission); |
| | |
| | | commissionDetail.setTotalSuperAgentCommission(totalSuperAgentCommission); |
| | | commissionDetail.setTotalTopAgentCommission(totalTopAgentCommission); |
| | | commissionDetail.setTotalPartnerCommission(totalPartnerCommission); |
| | | |
| | | |
| | | List<CommissionDate> commissionDateList = dailyVipCommissions.entrySet().stream() |
| | | .map(entry -> { |
| | | CommissionDate commissionDate = new CommissionDate(); |
| | | commissionDate.setDate(entry.getKey()); |
| | | Map<Integer, BigDecimal> dailyCommissions = entry.getValue(); |
| | | commissionDate.setNormalCommission(dailyCommissions.getOrDefault(1, BigDecimal.ZERO)); |
| | | commissionDate.setGoldCommission(dailyCommissions.getOrDefault(2, BigDecimal.ZERO)); |
| | | commissionDate.setDiamondCommission(dailyCommissions.getOrDefault(3, BigDecimal.ZERO)); |
| | | commissionDate.setAgentCommission(dailyCommissions.getOrDefault(4, BigDecimal.ZERO)); |
| | | commissionDate.setSuperAgentCommission(dailyCommissions.getOrDefault(5, BigDecimal.ZERO)); |
| | | commissionDate.setTopAgentCommission(dailyCommissions.getOrDefault(6, BigDecimal.ZERO)); |
| | | commissionDate.setPartnerCommission(dailyCommissions.getOrDefault(7, BigDecimal.ZERO)); |
| | | BigDecimal add = commissionDate.getNormalCommission().add(commissionDate.getGoldCommission()).add(commissionDate.getDiamondCommission()).add(commissionDate.getAgentCommission()) |
| | | .add(commissionDate.getSuperAgentCommission()).add(commissionDate.getTopAgentCommission()).add(commissionDate.getPartnerCommission()); |
| | | commissionDate.setTotalCommission(add); |
| | | |
| | | commissionDate.setServiceChargeCommission(dailyCommissions.getOrDefault(10, BigDecimal.ZERO)); |
| | | commissionDate.setAssociatedUserCommission(dailyCommissions.getOrDefault(8, BigDecimal.ZERO)); |
| | | commissionDate.setBindLowerLevelStoresCommission(dailyCommissions.getOrDefault(9, BigDecimal.ZERO)); |
| | | return commissionDate; |
| | | }) |
| | | .collect(Collectors.toList()); |
| | | |
| | | totalCommission = totalNormalCommission.add(totalGoldCommission).add(totalDiamondCommission).add(totalAgentCommission) |
| | | .add(totalSuperAgentCommission).add(totalTopAgentCommission).add(totalPartnerCommission); |
| | | commissionDetail.setTotalCommission(totalCommission); |
| | | commissionDetail.setCommissionDateList(commissionDateList); |
| | | |
| | | return R.ok(commissionDetail); |
| | |
| | | |
| | | |
| | | |
| | | @GetMapping("/saveAppUserShare") |
| | | @ApiOperation(value = "操作分享调用接口", tags = {"小程序-推广中心"}) |
| | | public R saveAppUserShare(){ |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | AppUserShare appUserShare = appUserShareService.getOne(new LambdaQueryWrapper<AppUserShare>().eq(AppUserShare::getAppUserId, userid) |
| | | .last(" and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(create_time, '%Y-%m-%d')")); |
| | | if(null == appUserShare){ |
| | | appUserShare = new AppUserShare(); |
| | | appUserShare.setAppUserId(userid); |
| | | appUserShare.setCreateTime(LocalDateTime.now()); |
| | | appUserShareService.save(appUserShare); |
| | | |
| | | //添加用户分佣积分 |
| | | AppUser appUser = appUserService.getById(userid); |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | if(null != pointSetting){ |
| | | Integer everySharePoint = pointSetting.getEverySharePoint(); |
| | | Integer everySharePoint1 = 0; |
| | | if(1 == pointSetting.getWorkPointOpen()){ |
| | | everySharePoint1 = new BigDecimal(everySharePoint).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + everySharePoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + everySharePoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + everySharePoint1); |
| | | appUser.setTotalAvailablePoint(appUser.getTotalAvailablePoint() + everySharePoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getWorkPointGift()){ |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + everySharePoint1); |
| | | } |
| | | appUser.setTotalSharePoint(appUser.getTotalSharePoint() + everySharePoint); |
| | | appUserService.updateById(appUser); |
| | | //添加积分变动记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(6); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(everySharePoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointService.save(userPoint); |
| | | //变更等级 |
| | | appUserService.vipUpgrade(appUser.getId()); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | // @GetMapping("/saveAppUserShare") |
| | | // @ApiOperation(value = "操作分享调用接口", tags = {"小程序-推广中心"}) |
| | | // public R saveAppUserShare(){ |
| | | // Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | // AppUserShare appUserShare = appUserShareService.getOne(new LambdaQueryWrapper<AppUserShare>().eq(AppUserShare::getAppUserId, userid) |
| | | // .last(" and DATE_FORMAT(now(), '%Y-%m-%d') = DATE_FORMAT(create_time, '%Y-%m-%d')")); |
| | | // if(null == appUserShare){ |
| | | // appUserShare = new AppUserShare(); |
| | | // appUserShare.setAppUserId(userid); |
| | | // appUserShare.setCreateTime(LocalDateTime.now()); |
| | | // appUserShareService.save(appUserShare); |
| | | // |
| | | // //添加用户分佣积分 |
| | | // AppUser appUser = appUserService.getById(userid); |
| | | // PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | // if(null != pointSetting){ |
| | | // Integer everySharePoint = pointSetting.getEverySharePoint(); |
| | | // Integer everySharePoint1 = 0; |
| | | // if(1 == pointSetting.getWorkPointOpen()){ |
| | | // everySharePoint1 = new BigDecimal(everySharePoint).multiply(pointSetting.getWorkPoint().divide(new BigDecimal(100))).intValue(); |
| | | // } |
| | | // Integer lavePoint = appUser.getLavePoint(); |
| | | // appUser.setTotalPoint(appUser.getTotalPoint() + everySharePoint); |
| | | // appUser.setLavePoint(appUser.getLavePoint() + everySharePoint); |
| | | // appUser.setAvailablePoint(appUser.getAvailablePoint() + everySharePoint1); |
| | | // appUser.setTotalAvailablePoint(appUser.getTotalAvailablePoint() + everySharePoint1); |
| | | // if(null != pointSetting && 1 == pointSetting.getWorkPointGift()){ |
| | | // appUser.setTransferablePoint(appUser.getTransferablePoint() + everySharePoint1); |
| | | // } |
| | | // appUser.setTotalSharePoint(appUser.getTotalSharePoint() + everySharePoint); |
| | | // appUserService.updateById(appUser); |
| | | // //添加积分变动记录 |
| | | // if(everySharePoint > 0){ |
| | | // UserPoint userPoint = new UserPoint(); |
| | | // userPoint.setType(4); |
| | | // userPoint.setHistoricalPoint(lavePoint); |
| | | // userPoint.setVariablePoint(everySharePoint); |
| | | // userPoint.setBalance(appUser.getLavePoint()); |
| | | // userPoint.setCreateTime(LocalDateTime.now()); |
| | | // userPoint.setAppUserId(appUser.getId()); |
| | | // userPointService.save(userPoint); |
| | | // } |
| | | // //变更等级 |
| | | // appUserService.vipUpgrade(appUser.getId()); |
| | | // } |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | } |
| | |
| | | byId.setLavePoint(byId.getLavePoint() - point); |
| | | appUserService.updateById(byId); |
| | | |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(15); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(byId.getLavePoint()); |
| | | userPoint.setAppUserId(userid); |
| | | userPoint.setObjectId(Long.valueOf(data.getId())); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPointService.save(userPoint); |
| | | if(point > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(15); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(byId.getLavePoint()); |
| | | userPoint.setAppUserId(userid); |
| | | userPoint.setObjectId(Long.valueOf(data.getId())); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPointService.save(userPoint); |
| | | } |
| | | } |
| | | //增加优惠券记录,根据时间类型设置开始结束时间 |
| | | UserCoupon userCoupon = new UserCoupon(); |
| | |
| | | } |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + signPoint); |
| | | appUser.setTotalSignPoint(appUser.getTotalSignPoint() + signPoint); |
| | | appUser.setLavePoint(appUser.getLavePoint() + signPoint); |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() + signPoint1); |
| | | appUser.setTotalAvailablePoint(appUser.getTotalAvailablePoint() + signPoint1); |
| | |
| | | appUserService.updateById(appUser); |
| | | |
| | | //添加积分变动记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(5); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(signPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointService.save(userPoint); |
| | | if(signPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(5); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(signPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointService.save(userPoint); |
| | | } |
| | | //变更等级 |
| | | appUserService.vipUpgrade(appUser.getId()); |
| | | } |
| | |
| | | |
| | | |
| | | List<BalanceChangeRecord> selectBalanceChangeRecordList(@Param("changeRecord") BalanceChangeRecord balanceChangeRecord); |
| | | |
| | | |
| | | List<BalanceChangeRecord> selectBalanceChangeRecordList1(@Param("changeRecord") BalanceChangeRecord balanceChangeRecord); |
| | | |
| | | IPage<BalanceChangeRecord> queryCommissionStatistics(@Param("page") Page<BalanceChangeRecord> page, |
| | | @Param("changeRecord") BalanceChangeRecord changeRecord); |
| | |
| | | throw new RuntimeException("已发起申请,请等待平台工作人员与您联系"); |
| | | } |
| | | agentApplication.setAppUserId(loginUserApplet.getUserid()); |
| | | agentApplication.setVipId(appUser.getVipId()); |
| | | agentApplication.setStatus(1); |
| | | agentApplication.setApplicationTime(LocalDateTime.now()); |
| | | agentApplication.setShopPoint(appUser.getShopPoint()); |
| | |
| | | |
| | | //获取微信推广二维码 |
| | | String fileName = UUID.randomUUID() + ".jpg"; |
| | | weChatUtil.getwxacodeunlimit("pages/login/login", "id=" + appUser.getId(), EnvVersion.TRIAL, filePath + fileName); |
| | | appUser.setQrCode(accessPath + fileName); |
| | | String getwxacodeunlimit = weChatUtil.getwxacodeunlimit("pages/login/login", "id=" + appUser.getId(), EnvVersion.RELEASE, filePath + fileName); |
| | | appUser.setQrCode(getwxacodeunlimit); |
| | | this.updateById(appUser); |
| | | |
| | | } |
| | |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | Object cacheObject = redisService.getCacheObject("ONLINE_" + userid); |
| | | if(null == cacheObject){ |
| | | redisService.setCacheObject("ONLINE_" + userid, 0, 15L, TimeUnit.MINUTES); |
| | | JSONObject jsonObject = new JSONObject(); |
| | | jsonObject.put("time", System.currentTimeMillis()); |
| | | jsonObject.put("online", 0); |
| | | redisService.setCacheObject("ONLINE_" + userid, jsonObject, 1L, TimeUnit.HOURS); |
| | | }else{ |
| | | Integer duration = (Integer) cacheObject; |
| | | duration += 10; |
| | | JSONObject jsonObject = (JSONObject) cacheObject; |
| | | long time = System.currentTimeMillis() - jsonObject.getInteger("time"); |
| | | Integer online = jsonObject.getInteger("online"); |
| | | online += 10; |
| | | //满足一个小时,开始发放积分,计时归0 |
| | | if(60 >= duration){ |
| | | redisService.setCacheObject("ONLINE_" + userid, 0, 15L, TimeUnit.MINUTES); |
| | | if(time >= 3600000L && 60 <= online){ |
| | | jsonObject.put("time", System.currentTimeMillis()); |
| | | jsonObject.put("online", 0); |
| | | redisService.setCacheObject("ONLINE_" + userid, jsonObject, 1L, TimeUnit.HOURS); |
| | | AppUser appUser = this.getById(userid); |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | if(null != pointSetting){ |
| | |
| | | appUser.setTotalHourPoint(appUser.getTotalHourPoint() + hourPoint); |
| | | this.updateById(appUser); |
| | | //添加积分变动记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(6); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(hourPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointService.save(userPoint); |
| | | if(hourPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(6); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(hourPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointService.save(userPoint); |
| | | } |
| | | //变更等级 |
| | | vipUpgrade(appUser.getId()); |
| | | } |
| | | }else{ |
| | | redisService.setCacheObject("ONLINE_" + userid, duration, 15L, TimeUnit.MINUTES); |
| | | jsonObject.put("online", online); |
| | | redisService.setCacheObject("ONLINE_" + userid, jsonObject, 1L, TimeUnit.HOURS); |
| | | } |
| | | } |
| | | } |
| | |
| | | public void demotionDetection() { |
| | | //代理 |
| | | List<AppUser> appUserList = new ArrayList<>(); |
| | | VipSetting vipSetting = vipSettingClient.getVipSetting(5).getData(); |
| | | List<AppUser> list = this.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getVipId, 5).eq(AppUser::getStatus, 1).eq(AppUser::getDelFlag, 0).eq(AppUser::getIsDanger, 0)); |
| | | for (AppUser appUser : list) { |
| | | //消费积分 |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) >= create_time")); |
| | | int sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepBuyPoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | continue; |
| | | } |
| | | //返佣积分 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepSharePoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | continue; |
| | | } |
| | | //门店业绩 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepShopPoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | } |
| | | } |
| | | if(appUserList.size() > 0){ |
| | | this.updateBatchById(appUserList); |
| | | } |
| | | |
| | | //总代 |
| | | appUserList = new ArrayList<>(); |
| | | vipSetting = vipSettingClient.getVipSetting(6).getData(); |
| | | list = this.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getVipId, 6).eq(AppUser::getStatus, 1).eq(AppUser::getDelFlag, 0).eq(AppUser::getIsDanger, 0)); |
| | | for (AppUser appUser : list) { |
| | | //消费积分 |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) >= create_time")); |
| | | int sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepBuyPoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | continue; |
| | | } |
| | | //返佣积分 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepSharePoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | continue; |
| | | } |
| | | //门店业绩 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepShopPoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | } |
| | | } |
| | | if(appUserList.size() > 0){ |
| | | this.updateBatchById(appUserList); |
| | | } |
| | | |
| | | //合伙人 |
| | | appUserList = new ArrayList<>(); |
| | | vipSetting = vipSettingClient.getVipSetting(7).getData(); |
| | | list = this.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getVipId, 7).eq(AppUser::getStatus, 1).eq(AppUser::getDelFlag, 0).eq(AppUser::getIsDanger, 0)); |
| | | for (AppUser appUser : list) { |
| | | //消费积分 |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) >= create_time")); |
| | | int sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepBuyPoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | continue; |
| | | } |
| | | //返佣积分 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepSharePoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | continue; |
| | | } |
| | | //门店业绩 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepShopPoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | for (int i = 5; i < 8; i++) { |
| | | VipSetting vipSetting = vipSettingClient.getVipSetting(i).getData(); |
| | | List<AppUser> list = this.list(new LambdaQueryWrapper<AppUser>().eq(AppUser::getVipId, i).eq(AppUser::getStatus, 1).eq(AppUser::getDelFlag, 0).eq(AppUser::getIsDanger, 0)); |
| | | for (AppUser appUser : list) { |
| | | //消费积分 |
| | | List<UserPoint> list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 1).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepBuyDay() + " DAY) >= create_time")); |
| | | int sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepBuyPoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | continue; |
| | | } |
| | | //返佣积分 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 2).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShareDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepSharePoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | continue; |
| | | } |
| | | //门店业绩 |
| | | list1 = userPointService.list(new LambdaQueryWrapper<UserPoint>().eq(UserPoint::getAppUserId, appUser.getId()).eq(UserPoint::getType, 8).last(" and SUBDATE(now(), INTERVAL " + vipSetting.getKeepShopDay() + " DAY) >= create_time")); |
| | | sum = list1.stream().mapToInt(UserPoint::getVariablePoint).sum(); |
| | | if(sum < vipSetting.getKeepShopPoint()){ |
| | | appUser.setIsDanger(1); |
| | | appUserList.add(appUser); |
| | | } |
| | | } |
| | | } |
| | | if(appUserList.size() > 0){ |
| | |
| | | |
| | | @Override |
| | | public CommissionStatistics commissionStatistics(Page<BalanceChangeRecord> page, BalanceChangeRecord balanceChangeRecord) { |
| | | balanceChangeRecord.setChangeType(4); |
| | | List<BalanceChangeRecord> balanceChangeRecordList = this.baseMapper.selectBalanceChangeRecordList(balanceChangeRecord); |
| | | |
| | | BigDecimal totalCommission = balanceChangeRecordList.stream() |
| | |
| | | ShopBalanceStatement shopBalanceStatement = new ShopBalanceStatement(); |
| | | shopBalanceStatement.setType(1); |
| | | |
| | | List<BalanceChangeRecord> balanceChangeRecordList = this.baseMapper.selectBalanceChangeRecordList(balanceChangeRecord); |
| | | List<BalanceChangeRecord> balanceChangeRecordList = this.baseMapper.selectBalanceChangeRecordList1(balanceChangeRecord); |
| | | List<WalletStatisticsDetail> walletStatisticsDetailList = new ArrayList<>(); |
| | | for (BalanceChangeRecord changeRecord : balanceChangeRecordList) { |
| | | WalletStatisticsDetail walletStatisticsDetail = new WalletStatisticsDetail(); |
| | | BeanUtils.copyBeanProp(walletStatisticsDetail, changeRecord); |
| | | walletStatisticsDetailList.add(walletStatisticsDetail); |
| | | } |
| | | |
| | | |
| | | // 按时间排序(倒序) |
| | | walletStatisticsDetailList.sort(Comparator.comparing(WalletStatisticsDetail::getCreateTime).reversed()); |
| | | |
| | | long current = page.getCurrent(); |
| | | long size = page.getSize(); |
| | | if (current < 1) { |
| | |
| | | if (CollectionUtil.isNotEmpty(page.getRecords())) { |
| | | List<UserPointDetailVO> collect = page.getRecords().stream().map(p -> { |
| | | UserPointDetailVO userPointDetailVO = new UserPointDetailVO(); |
| | | if (p.getType() != null && (p.getType().equals(12) || p.getType().equals(13))){ |
| | | Long appUserId = p.getAppUserId(); |
| | | AppUser appUser = appUserService.getById(appUserId); |
| | | userPointDetailVO.setName(appUser.getName()); |
| | | } |
| | | userPointDetailVO.setType(p.getType()); |
| | | userPointDetailVO.setVariablePoint(p.getVariablePoint()); |
| | | String format = p.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss")); |
| | |
| | | appUserForPhoe.setTotalAvailablePoint(appUserForPhoe.getTotalAvailablePoint() + point); |
| | | appUserService.updateById(appUserForPhoe); |
| | | //构建积分流水记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(12); |
| | | userPoint.setHistoricalPoint(lavePoint1); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(appUserForPhoe.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUserForPhoe.getId()); |
| | | userPointService.save(userPoint); |
| | | if(point > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(12); |
| | | userPoint.setHistoricalPoint(lavePoint1); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(appUserForPhoe.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUserForPhoe.getId()); |
| | | userPointService.save(userPoint); |
| | | } |
| | | |
| | | Integer lavePoint = appUser.getLavePoint(); |
| | | appUser.setLavePoint(appUser.getLavePoint() - point); |
| | |
| | | appUser.setAvailablePoint(appUser.getAvailablePoint() - point); |
| | | appUserService.updateById(appUser); |
| | | //构建积分流水记录 |
| | | userPoint = new UserPoint(); |
| | | userPoint.setType(13); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointService.save(userPoint); |
| | | if(point > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(13); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(point); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointService.save(userPoint); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | @Override |
| | | public void withdrawalApply(WithdrawalRequestsDTO params) { |
| | | BigDecimal withdrawalAmount = params.getWithdrawalAmount(); |
| | | if (withdrawalAmount.compareTo(MAX_WITHDRAWAL_AMOUNT) > 0) { |
| | | if (withdrawalAmount.compareTo(MAX_WITHDRAWAL_AMOUNT) > 0 && params.getWithdrawalMethod().equals(1)) { |
| | | throw new ServiceException("提现失败,单次提现金额不能超过200元!"); |
| | | } |
| | | |
| | |
| | | /** |
| | | * 支付回调地址 |
| | | */ |
| | | private static final String callbackUrl = "http://221.182.45.100:9000"; |
| | | private static final String callbackUrl = "https://www.qijisheng.top"; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 支付回调地址 |
| | | */ |
| | | private static final String callbackUrl = "http://221.182.45.100:9000"; |
| | | private static final String callbackUrl = "https://www.qijisheng.top"; |
| | | |
| | | |
| | | /** |
| | |
| | | import cn.hutool.http.HttpUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.ruoyi.account.util.ObsUploadUtil; |
| | | import com.ruoyi.common.redis.service.RedisService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.codec.binary.Base64; |
| | |
| | | */ |
| | | public String getwxacodeunlimit(String page, String scene, EnvVersion env_version, String filePath){ |
| | | InputStream getwxacodeunlimit = getwxacodeunlimit(page, scene, env_version); |
| | | File file = FileUtil.writeFromStream(getwxacodeunlimit, new File(filePath)); |
| | | return file.getPath(); |
| | | // File file = FileUtil.writeFromStream(getwxacodeunlimit, new File(filePath)); |
| | | // return file.getPath(); |
| | | return ObsUploadUtil.obsUpload("png", getwxacodeunlimit); |
| | | } |
| | | } |
| | |
| | | @ApiModel("UserPointDetail对象") |
| | | public class UserPointDetailVO { |
| | | |
| | | @ApiModelProperty(value = "变动类型(1=消费积分,2=返佣积分,3=拉新人积分,4=兑换商品 5 = 门店业绩积分 6 =门店返佣积分7=技师业绩积分8 =转赠积分 9 =做工积分 10 =注册积分)") |
| | | @ApiModelProperty(value = "变动类型(1-消费,2-返佣,3-拉新,4-每日分享,5-每日签到,6-使用时长, 7-注册积分, 8-门店业绩,\" +\n" + |
| | | " \"9-门店返佣,14-下级门店返佣,10-技师业绩,11-兑换商品,12-他人赠送,13-赠与他人,15-兑换券)") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "变动金额") |
| | |
| | | |
| | | @ApiModelProperty(value = "增或减标识: 1-增 2-减") |
| | | private Integer flag; |
| | | |
| | | private String name; |
| | | } |
| | |
| | | server: |
| | | port: 9200 |
| | | tomcat: |
| | | basedir: /data/tomcat |
| | | basedir: /mnt/tomcat |
| | | # Spring |
| | | spring: |
| | | application: |
| | |
| | | allow-circular-references: true |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | # active: prod |
| | | # active: dev |
| | | active: prod |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | server-addr: 127.0.0.1:8848 |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | group: DEFAULT_GROUP |
| | |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | - application.${spring.cloud.nacos.config.file-extension} |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="logs/ruoyi-account" /> |
| | | <property name="log.path" value="/mnt/app/ruoyi-account" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | and t1.status = #{agentQuery.status} |
| | | </if> |
| | | </where> |
| | | order by t1.status asc |
| | | order by |
| | | t1.STATUS ASC, |
| | | t1.application_time ASC, |
| | | t1.create_time desc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | t_balance_change_record tbcr |
| | | LEFT JOIN t_app_user tau ON tbcr.app_user_id = tau.id |
| | | <where> |
| | | and tbcr.change_type = 4 |
| | | <if test="changeRecord.changeType == null"> |
| | | and tbcr.change_type = #{changeRecord.changeType} |
| | | </if> |
| | | <if test="changeRecord.userName != null and changeRecord.userName != ''"> |
| | | and tau.name like concat('%',#{changeRecord.userName},'%') |
| | | </if> |
| | |
| | | <select id="selectBalanceChangeRecordList" resultType="com.ruoyi.account.api.model.BalanceChangeRecord"> |
| | | <include refid="balanceChangeRecordList"/> |
| | | </select> |
| | | |
| | | <select id="selectBalanceChangeRecordList1" resultType="com.ruoyi.account.api.model.BalanceChangeRecord"> |
| | | SELECT |
| | | tau.`name` userName, |
| | | tau.phone userPhone, |
| | | tbcr.change_type, |
| | | tbcr.create_time, |
| | | tbcr.change_amount, |
| | | tbcr.before_amount, |
| | | tbcr.after_amount |
| | | FROM |
| | | t_balance_change_record tbcr |
| | | LEFT JOIN t_app_user tau ON tbcr.app_user_id = tau.id |
| | | <where> |
| | | <if test="changeRecord.userName != null and changeRecord.userName != ''"> |
| | | and tau.name like concat('%',#{changeRecord.userName},'%') |
| | | </if> |
| | | <if test="changeRecord.userPhone != null and changeRecord.userPhone != ''"> |
| | | and tau.phone like concat('%',#{changeRecord.userPhone},'%') |
| | | </if> |
| | | <if test="changeRecord.startTime != null and changeRecord.endTime != null"> |
| | | and (tbcr.create_time between #{changeRecord.startTime} and #{changeRecord.endTime}) |
| | | </if> |
| | | <if test="changeRecord.changeType != null"> |
| | | and tbcr.change_type = #{changeRecord.changeType} |
| | | </if> |
| | | </where> |
| | | </select> |
| | | |
| | | <select id="queryCommissionStatistics" resultType="com.ruoyi.account.api.model.BalanceChangeRecord"> |
| | | <include refid="balanceChangeRecordList"/> |
| | | </select> |
| | |
| | | AND tup.create_time BETWEEN #{userPoint.startTime} AND #{userPoint.endTime} |
| | | </if> |
| | | </where> |
| | | order tup.create_time desc |
| | | </sql> |
| | | |
| | | <select id="queryUserPointPage" resultType="com.ruoyi.account.api.model.UserPoint"> |
| | |
| | | if(!order.getAppUserId().equals(userid)){ |
| | | return R.fail("权限不足"); |
| | | } |
| | | if(Arrays.asList(2, 3).contains(refundPass.getStatus())){ |
| | | if(refundPass.getStatus().equals(2)){ |
| | | return R.fail("售后取消失败"); |
| | | } |
| | | refundPass.setDelFlag(1); |
| | |
| | | Technician technician = technicianClient.shopdetail(order.getTechnicianId()).getData(); |
| | | if(null != technician){ |
| | | AppUser technicianAppUser = appUserClient.getAppUserById(technician.getAppUserId()); |
| | | Integer lavePoint = technicianAppUser.getLavePoint(); |
| | | if(js_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getPersonPointOpen()){ |
| | | earnPoint1 = new BigDecimal(js_point).multiply(pointSetting.getPersonPoint().divide(new BigDecimal(100))).intValue(); |
| | | if(null != technicianAppUser){ |
| | | Integer lavePoint = technicianAppUser.getLavePoint(); |
| | | if(js_point > 0){ |
| | | PointSetting pointSetting = pointSettingClient.getPointSetting(appUser.getVipId()).getData(); |
| | | int earnPoint1 = 0; |
| | | //计算可用积分比例 |
| | | if(null != pointSetting && 1 == pointSetting.getPersonPointOpen()){ |
| | | earnPoint1 = new BigDecimal(js_point).multiply(pointSetting.getPersonPoint().divide(new BigDecimal(100))).intValue(); |
| | | } |
| | | technicianAppUser.setLavePoint(technicianAppUser.getLavePoint() + js_point); |
| | | technicianAppUser.setAvailablePoint(technicianAppUser.getAvailablePoint() + earnPoint1); |
| | | technicianAppUser.setTotalAvailablePoint(technicianAppUser.getTotalAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getPersonPointGift()){ |
| | | technicianAppUser.setTransferablePoint(technicianAppUser.getTransferablePoint() + earnPoint1); |
| | | } |
| | | technicianAppUser.setTotalPoint(technicianAppUser.getTotalPoint() + js_point); |
| | | technicianAppUser.setTotalPerformancePoint(technicianAppUser.getTotalPerformancePoint() + js_point); |
| | | } |
| | | technicianAppUser.setLavePoint(technicianAppUser.getLavePoint() + js_point); |
| | | technicianAppUser.setAvailablePoint(technicianAppUser.getAvailablePoint() + earnPoint1); |
| | | technicianAppUser.setTotalAvailablePoint(technicianAppUser.getTotalAvailablePoint() + earnPoint1); |
| | | if(null != pointSetting && 1 == pointSetting.getPersonPointGift()){ |
| | | technicianAppUser.setTransferablePoint(technicianAppUser.getTransferablePoint() + earnPoint1); |
| | | appUserClient.editAppUserById(technicianAppUser); |
| | | //添加积分明细 |
| | | if(!technicianAppUser.getLavePoint().equals(lavePoint)){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(10); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(js_point); |
| | | userPoint.setBalance(technicianAppUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(technicianAppUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(order.getOrderNumber()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | //变更等级 |
| | | appUserClient.vipUpgrade(technicianAppUser.getId()); |
| | | } |
| | | technicianAppUser.setTotalPoint(technicianAppUser.getTotalPoint() + js_point); |
| | | technicianAppUser.setTotalPerformancePoint(technicianAppUser.getTotalPerformancePoint() + js_point); |
| | | } |
| | | appUserClient.editAppUserById(technicianAppUser); |
| | | //添加积分明细 |
| | | if(!technicianAppUser.getLavePoint().equals(lavePoint)){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(10); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(js_point); |
| | | userPoint.setBalance(technicianAppUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(technicianAppUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(order.getOrderNumber()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | //变更等级 |
| | | appUserClient.vipUpgrade(technicianAppUser.getId()); |
| | | } |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | BigDecimal balance = appUser.getBalance(); |
| | | if(null != orderBalancePayment){ |
| | | appUser.setTotalRedPacketAmount(appUser.getTotalRedPacketAmount().add(orderBalancePayment.getRedPacketAmount()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | appUser.setTotalDistributionAmount(appUser.getTotalDistributionAmount().add(orderBalancePayment.getDistributionAmount()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | // appUser.setTotalDistributionAmount(appUser.getTotalDistributionAmount().add(orderBalancePayment.getDistributionAmount()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | } |
| | | appUser.setBalance(balance.add(paymentAmount).setScale(2, RoundingMode.HALF_EVEN)); |
| | | appUser.setShopAmount(appUser.getShopAmount().subtract(paymentAmount).setScale(2, RoundingMode.HALF_EVEN)); |
| | |
| | | appUser.setTotalPoint(appUser.getTotalPoint() - shopPoint); |
| | | |
| | | //构建积分流水明细 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(shopPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(shopPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(shopPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | appUserClient.editAppUserById(appUser); |
| | | |
| | | //降级检测 |
| | |
| | | BigDecimal balance = appUser.getBalance(); |
| | | if(null != orderBalancePayment){ |
| | | appUser.setTotalRedPacketAmount(appUser.getTotalRedPacketAmount().add(orderBalancePayment.getRedPacketAmount()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | appUser.setTotalDistributionAmount(appUser.getTotalDistributionAmount().add(orderBalancePayment.getDistributionAmount()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | // appUser.setTotalDistributionAmount(appUser.getTotalDistributionAmount().add(orderBalancePayment.getDistributionAmount()).setScale(2, RoundingMode.HALF_EVEN)); |
| | | } |
| | | appUser.setBalance(balance.add(expressAmount).setScale(2, RoundingMode.HALF_EVEN)); |
| | | //构建账户余额流水明细 |
| | |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + transferablePoint); |
| | | |
| | | //构建积分流水明细 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(order.getPoint()); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(order.getPoint() > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(order.getPoint()); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | appUserClient.editAppUserById(appUser); |
| | | } |
| | | |
| | |
| | | appUser.setTotalPoint(appUser.getTotalPoint() - shopPoint); |
| | | |
| | | //构建积分流水明细 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(shopPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(shopPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(shopPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | appUserClient.editAppUserById(appUser); |
| | | |
| | | //降级检测 |
| | |
| | | appUser.setTransferablePoint(appUser.getTransferablePoint() + transferablePoint); |
| | | |
| | | //构建积分流水明细 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(order.getPoint()); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(order.getPoint() > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(order.getPoint()); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(order.getAppUserId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | } |
| | | List<OrderGood> orderGoods = orderGoodMapper.selectList(new LambdaQueryWrapper<OrderGood>().eq(OrderGood::getOrderId, orderId).eq(OrderGood::getDelFlag, 0)); |
| | | int sum = orderGoods.stream().mapToInt(OrderGood::getNum).sum(); |
| | | System.out.println("111111111111222"); |
| | | orderInfo.setGoodsNum(sum); |
| | | List<Object> goodsJson = new ArrayList<>(); |
| | | for (OrderGood orderGood : orderGoods) { |
| | |
| | | import com.ruoyi.system.api.feignClient.SysUserClient; |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.time.LocalDateTime; |
| | |
| | | shopId = sysUser.getObjectId(); |
| | | } |
| | | List<Long> appUserIds = new ArrayList<>(); |
| | | //搜索条件,用户姓名 |
| | | if(StringUtils.isNotEmpty(refundPassListVo.getUserName())){ |
| | | //搜索条件,用户姓名和电话 |
| | | if(StringUtils.isNotEmpty(refundPassListVo.getUserName()) || StringUtils.isNotEmpty(refundPassListVo.getPhone())){ |
| | | List<AppUser> data = appUserClient.getAppUserByName(refundPassListVo.getUserName()).getData(); |
| | | List<Long> collect = data.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | appUserIds.add(-1L); |
| | | } |
| | | appUserIds.addAll(collect); |
| | | } |
| | | //搜索条件,用户电话 |
| | | if(StringUtils.isNotEmpty(refundPassListVo.getPhone())){ |
| | | List<AppUser> data = appUserClient.getAppUserByPhone(refundPassListVo.getPhone()).getData(); |
| | | List<Long> collect = data.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | if (collect.isEmpty()){ |
| | | |
| | | List<AppUser> data2 = appUserClient.getAppUserByPhone(refundPassListVo.getPhone()).getData(); |
| | | List<Long> collect2 = data2.stream().map(AppUser::getId).collect(Collectors.toList()); |
| | | if (!CollectionUtils.isEmpty(data)){ |
| | | for (AppUser datum : data) { |
| | | for (AppUser appUser : data2) { |
| | | if (!datum.getId().equals(appUser.getId())){ |
| | | collect2.remove(appUser.getId()); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | if (collect2.isEmpty()){ |
| | | appUserIds.add(-1L); |
| | | } |
| | | appUserIds.addAll(collect); |
| | | appUserIds.addAll(collect2); |
| | | } |
| | | |
| | | PageInfo<OrderRefundPassList> pageInfo = new PageInfo(refundPassListVo.getPageCurr(), refundPassListVo.getPageSize()); |
| | |
| | | .eq(ShoppingCart::getAppUserId, userid)); |
| | | goodsSaleNum += count; |
| | | Goods goods = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData(); |
| | | if(null != goods.getPurchaseLimit() && -1 != goods.getPurchaseLimit() && (goodsSaleNum + shoppingCart.getNumber()) > goods.getPurchaseLimit()){ |
| | | |
| | | Integer maxNum = 0; |
| | | if(shoppingCart.getType() == 2){ |
| | | R<SeckillActivityInfo> r = seckillActivityInfoClient.getSeckillActivityInfoByGoodsId(shoppingCart.getGoodsId()); |
| | | if (R.isError(r)){ |
| | | throw new ServiceException("获取秒杀商品失败!"); |
| | | } |
| | | SeckillActivityInfo seckillActivityInfo = r.getData(); |
| | | maxNum = seckillActivityInfo.getMaxNum(); |
| | | }else { |
| | | maxNum = goods.getPurchaseLimit(); |
| | | } |
| | | |
| | | if(null != goods.getPurchaseLimit() && -1 != maxNum && (goodsSaleNum + shoppingCart.getNumber()) > maxNum){ |
| | | throw new ServiceException("超出购买数量限制"); |
| | | } |
| | | ShoppingCart one = this.getOne(new LambdaQueryWrapper<ShoppingCart>().eq(ShoppingCart::getAppUserId, userid) |
| | |
| | | if(null != shoppingCart){ |
| | | |
| | | Goods goods1 = goodsClient.getGoodsById(shoppingCart.getGoodsId()).getData(); |
| | | if(null != goods1.getPurchaseLimit() && -1 != goods1.getPurchaseLimit() && goods1.getPurchaseLimit() < setGoodsNumber.getNumber()){ |
| | | if(null != goods1.getPurchaseLimit() && -1 != goods1.getPurchaseLimit() |
| | | && goods1.getPurchaseLimit() < setGoodsNumber.getNumber() |
| | | && setGoodsNumber.getNumber() >= shoppingCart.getNumber()){ |
| | | return R.fail("修改数量不能大于限购数量"); |
| | | } |
| | | |
| | |
| | | jsonObject.put("transferablePoint", earnPoint1); |
| | | } |
| | | |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(earnPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(jsonObject.toJSONString()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(earnPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(earnPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(jsonObject.toJSONString()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | } |
| | | appUser.setShopAmount(appUser.getShopAmount().add(paymentMoney).setScale(2, RoundingMode.HALF_EVEN)); |
| | | appUser.setLastShopTime(LocalDateTime.now()); |
| | |
| | | totalDistributionAmount = totalDistributionAmount.subtract(paymentMoney1); |
| | | balance = balance.subtract(paymentMoney1); |
| | | appUser.setTotalRedPacketAmount(totalRedPacketAmount); |
| | | appUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | // appUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | appUser.setBalance(balance); |
| | | distributionAmount = paymentMoney1; |
| | | }else{ |
| | |
| | | totalDistributionAmount = BigDecimal.ZERO; |
| | | balance = balance.subtract(paymentMoney1); |
| | | appUser.setTotalRedPacketAmount(totalRedPacketAmount); |
| | | appUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | // appUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | appUser.setBalance(balance); |
| | | distributionAmount = totalDistributionAmount; |
| | | } |
| | |
| | | } |
| | | |
| | | //构建积分流水记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(orderPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention((tra >= 0 ? orderPoint : transferablePoint) + ""); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(orderPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(orderPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention((tra >= 0 ? orderPoint : transferablePoint) + ""); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | |
| | | appUser.setLastShopTime(LocalDateTime.now()); |
| | | appUserClient.editAppUserById(appUser); |
| | |
| | | totalDistributionAmount = totalDistributionAmount.subtract(expressFee1); |
| | | balance = balance.subtract(expressFee1); |
| | | appUser.setTotalRedPacketAmount(totalRedPacketAmount); |
| | | appUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | // appUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | appUser.setBalance(balance); |
| | | distributionAmount = expressFee1; |
| | | }else{ |
| | |
| | | totalDistributionAmount = BigDecimal.ZERO; |
| | | balance = balance.subtract(expressFee1); |
| | | appUser.setTotalRedPacketAmount(totalRedPacketAmount); |
| | | appUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | // appUser.setTotalDistributionAmount(totalDistributionAmount); |
| | | appUser.setBalance(balance); |
| | | distributionAmount = totalDistributionAmount; |
| | | } |
| | |
| | | jsonObject.put("transferablePoint", earnPoint1); |
| | | } |
| | | |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(earnPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(jsonObject.toJSONString()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(earnPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(1); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(earnPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention(jsonObject.toJSONString()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | } |
| | | appUser.setShopAmount(appUser.getShopAmount().add(paymentMoney).setScale(2, RoundingMode.HALF_EVEN)); |
| | | appUser.setLastShopTime(LocalDateTime.now()); |
| | |
| | | } |
| | | |
| | | //构建积分流水记录 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(orderPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention((tra >= 0 ? orderPoint : transferablePoint) + ""); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(orderPoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setType(11); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(orderPoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPoint.setObjectId(order.getId()); |
| | | userPoint.setExtention((tra >= 0 ? orderPoint : transferablePoint) + ""); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | |
| | | //积分支付不反积分 |
| | | |
| | |
| | | /** |
| | | * 支付回调地址 |
| | | */ |
| | | private static final String callbackUrl = "http://221.182.45.100:9000"; |
| | | private static final String callbackUrl = "https://www.qijisheng.top"; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 支付回调地址 |
| | | */ |
| | | private static final String callbackUrl = "http://221.182.45.100:9000"; |
| | | private static final String callbackUrl = "https://www.qijisheng.top"; |
| | | |
| | | |
| | | /** |
| | |
| | | server: |
| | | port: 9400 |
| | | tomcat: |
| | | basedir: /data/tomcat |
| | | basedir: /mnt/tomcat |
| | | # Spring |
| | | spring: |
| | | application: |
| | |
| | | allow-circular-references: true |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | # active: prod |
| | | # active: dev |
| | | active: prod |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | server-addr: 127.0.0.1:8848 |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | group: DEFAULT_GROUP |
| | |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | - application.${spring.cloud.nacos.config.file-extension} |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="logs/ruoyi-order" /> |
| | | <property name="log.path" value="/mnt/app/ruoyi-order" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | if(0 < count){ |
| | | return R.fail("商品已被会员配置使用,不能删除"); |
| | | } |
| | | goodsService.removeById(goodsId); |
| | | Goods goods = goodsService.getById(goodsId); |
| | | goods.setDelFlag(1); |
| | | goodsService.updateById(goods); |
| | | return R.ok(); |
| | | } |
| | | |
| | |
| | | .between(OrderActivityInfo::getEndTime, orderActivityInfo.getStartTime(), orderActivityInfo.getEndTime()) |
| | | .list(); |
| | | // 遍历集合 通过startTime和endTime 判断是否与当前活动时间重叠 |
| | | |
| | | if (!list.isEmpty()){ |
| | | for (OrderActivityInfo activityInfo : list) { |
| | | if(activityInfo.getId().equals(orderActivityInfo.getId())){ |
| | | continue; |
| | | } |
| | | List<String> vips = Arrays.asList(activityInfo.getVipIds().split(",")); |
| | | if (!vipIds.isEmpty()){ |
| | | StringBuilder message = new StringBuilder(); |
| | |
| | | import com.ruoyi.common.core.domain.R; |
| | | import com.ruoyi.common.core.web.controller.BaseController; |
| | | import com.ruoyi.common.core.web.page.TableDataInfo; |
| | | import com.ruoyi.order.feignClient.OrderClient; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.api.domain.GoodsSeckill; |
| | | import com.ruoyi.other.api.domain.SeckillActivityInfo; |
| | |
| | | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | @Resource |
| | | private OrderClient orderClient; |
| | | |
| | | |
| | | |
| | |
| | | }else { |
| | | record.setStatus(1); // 未开始 |
| | | } |
| | | Integer saleNum = orderClient.getGoodsSaleNum(record.getGoodsId(), 2).getData(); |
| | | record.setSaleNum(saleNum); |
| | | } |
| | | return R.ok(IPage); |
| | | } |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/getSeckillActivityInfoByGoodsId") |
| | | public R<SeckillActivityInfo> getSeckillActivityInfoByGoodsId(@RequestParam("goodsId") Integer goodsId){ |
| | | SeckillActivityInfo seckillActivityInfo = seckillActivityInfoService.getOne(new LambdaQueryWrapper<SeckillActivityInfo>() |
| | | .eq(SeckillActivityInfo::getGoodId, goodsId) |
| | | .eq(SeckillActivityInfo::getDelFlag, 0) |
| | | .eq(SeckillActivityInfo::getIsShelves, 1) |
| | | .last(" and now() between start_time and end_time")); |
| | | return R.ok(seckillActivityInfo); |
| | | } |
| | | |
| | | /** |
| | | * 修改秒杀活动 |
| | | */ |
| | |
| | | .eq(Share::getObjectId, objectId) |
| | | .eq(Share::getDelFlag, 0).or() |
| | | .eq(Share::getAddType, 1) |
| | | .eq(Share::getDelFlag, 0)); |
| | | .eq(Share::getDelFlag, 0).orderByDesc(Share::getCreateTime)); |
| | | return R.ok(list); |
| | | } |
| | | |
| | |
| | | public R<List<Share>> recommandlist() { |
| | | Long userid = tokenService.getLoginUserApplet().getUserid(); |
| | | return R.ok(shareService.list(new LambdaQueryWrapper<Share>().eq(Share::getAddType, 2) |
| | | .eq(Share::getObjectId, userid).or().eq(Share::getAddType, 1).eq(Share::getAuditStatus, 1).eq(Share::getDelFlag, 0))); |
| | | .eq(Share::getObjectId, userid).or().eq(Share::getAddType, 1).eq(Share::getAuditStatus, 1) |
| | | .eq(Share::getDelFlag, 0).orderByDesc(Share::getCreateTime))); |
| | | } |
| | | |
| | | |
| | |
| | | if(sysUser.getRoleType() == 2){ |
| | | share.setObjectId(sysUser.getObjectId().longValue()); |
| | | } |
| | | // if (sysUser.getRoleType() == 1){ |
| | | // share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode()); |
| | | // }else{ |
| | | // share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); |
| | | // } |
| | | share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); |
| | | if (sysUser.getRoleType() == 1){ |
| | | share.setAuditStatus(ShareAuditStatus.SUCCESS.getCode()); |
| | | }else{ |
| | | share.setAuditStatus(ShareAuditStatus.WAIT.getCode()); |
| | | } |
| | | share.setDelFlag(0); |
| | | shareService.save(share); |
| | | return R.ok(); |
| | |
| | | @ApiOperation(value = "获取小程序分享数据", tags = {"小程序-分享"}) |
| | | @GetMapping("/auth/getAppletShare") |
| | | public R<Share> getAppletShare(){ |
| | | Share one = shareService.getOne(new LambdaQueryWrapper<Share>().eq(Share::getDelFlag, 0).eq(Share::getAppletShare, 1).eq(Share::getAuditStatus, 1).last(" limit 0, 1")); |
| | | Share one = shareService.getOne(new LambdaQueryWrapper<Share>().eq(Share::getDelFlag, 0).eq(Share::getAppletShare, 1) |
| | | .eq(Share::getAuditStatus, 1).last(" limit 0, 1")); |
| | | //添加每日分享积分 |
| | | String token = SecurityUtils.getToken(ServletUtils.getRequest()); |
| | | if(StringUtils.isNotEmpty(token)){ |
| | |
| | | appUser.setTotalPoint(appUser.getTotalPoint() + everySharePoint); |
| | | appUserClient.editAppUserById(appUser); |
| | | //添加积分流水 |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setAppUserId(userid); |
| | | userPoint.setType(4); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(everySharePoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | if(everySharePoint > 0){ |
| | | UserPoint userPoint = new UserPoint(); |
| | | userPoint.setAppUserId(userid); |
| | | userPoint.setType(4); |
| | | userPoint.setHistoricalPoint(lavePoint); |
| | | userPoint.setVariablePoint(everySharePoint); |
| | | userPoint.setBalance(appUser.getLavePoint()); |
| | | userPoint.setCreateTime(LocalDateTime.now()); |
| | | userPoint.setAppUserId(appUser.getId()); |
| | | userPointClient.saveUserPoint(userPoint); |
| | | } |
| | | } |
| | | |
| | | } |
| | |
| | | public R<Map<String, BigDecimal> > getShopStatistics(){ |
| | | List<Shop> shopList = shopService.list(); |
| | | BigDecimal serverGiveawayMoney = BigDecimal.ZERO; |
| | | BigDecimal lowerLevelGiveawayMoney = BigDecimal.ZERO; |
| | | BigDecimal giveawayMoney = BigDecimal.ZERO; |
| | | for (Shop shop : shopList) { |
| | | serverGiveawayMoney = serverGiveawayMoney.add(shop.getServerGiveawayMoney()); |
| | | lowerLevelGiveawayMoney = lowerLevelGiveawayMoney.add(shop.getLowerLevelGiveawayMoney()); |
| | | giveawayMoney = giveawayMoney.add(shop.getGiveawayMoney()); |
| | | } |
| | | Map<String, BigDecimal> map = new HashMap<>(); |
| | | map.put("serverGiveawayMoney", serverGiveawayMoney); |
| | | map.put("lowerLevelGiveawayMoney", lowerLevelGiveawayMoney); |
| | | map.put("giveawayMoney", giveawayMoney); |
| | | return R.ok(map); |
| | | } |
| | | |
| | |
| | | @GetMapping("/statistics/list") |
| | | @ApiOperation(value = "门店积分明细必传门店id", tags = {"后台"}) |
| | | public R<Page<ShopPoint>> statisticslist(ShopPoint shopPoint,Integer pageNum,Integer pageSize) { |
| | | Page<ShopPoint> page = shopPointService.lambdaQuery().eq(ShopPoint::getShopId, shopPoint.getShopId()).eq(shopPoint.getType()!=null,ShopPoint::getType, shopPoint.getType()) |
| | | Page<ShopPoint> page = shopPointService.lambdaQuery() |
| | | .eq(ShopPoint::getShopId, shopPoint.getShopId()) |
| | | .eq(shopPoint.getType()!=null && shopPoint.getType()!=0,ShopPoint::getType, shopPoint.getType()) |
| | | .like(shopPoint.getOrderNum()!=null,ShopPoint::getOrderNum, shopPoint.getOrderNum()) |
| | | .orderByDesc(ShopPoint::getCreateTime) |
| | | .page(Page.of(pageNum, pageSize)); |
| | |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | import com.ruoyi.other.api.domain.Goods; |
| | | import com.ruoyi.other.mapper.CouponInfoMapper; |
| | | import com.ruoyi.other.api.domain.CouponInfo; |
| | | import com.ruoyi.other.service.CouponInfoService; |
| | | import com.ruoyi.other.service.GoodsService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.stream.Collectors; |
| | | |
| | | /** |
| | | * <p> |
| | |
| | | */ |
| | | @Service |
| | | public class CouponInfoServiceImpl extends ServiceImpl<CouponInfoMapper, CouponInfo> implements CouponInfoService { |
| | | |
| | | @Resource |
| | | private GoodsService goodsService; |
| | | |
| | | |
| | | @Override |
| | | public IPage<CouponInfo> queryCouponInfoPage(IPage<CouponInfo> page, CouponInfo couponInfo) { |
| | | return this.baseMapper.queryCouponInfoPage(page, couponInfo); |
| | | IPage<CouponInfo> couponInfoIPage = this.baseMapper.queryCouponInfoPage(page, couponInfo); |
| | | for (CouponInfo record : couponInfoIPage.getRecords()) { |
| | | if(record.getCouponType() == 4){ |
| | | String[] split = record.getForGoodIds().split(","); |
| | | List<String> collect = goodsService.listByIds(Arrays.asList(split)).stream().map(Goods::getName).collect(Collectors.toList()); |
| | | record.setGoodsNameList(collect); |
| | | } |
| | | } |
| | | return couponInfoIPage; |
| | | } |
| | | } |
| | |
| | | LocalDateTime endTime = seckillActivityVO.getEndTime(); |
| | | if (endTime.isBefore(now)){ |
| | | seckillActivityVO.setStatus(3); //已结束 |
| | | }else if (startTime.isBefore(now)){ |
| | | }else if (startTime.isBefore(now) && endTime.isAfter(now)){ |
| | | seckillActivityVO.setStatus(2); // 已开始 |
| | | }else { |
| | | seckillActivityVO.setStatus(1); // 未开始 |
| | |
| | | } |
| | | |
| | | private Comparator<SeckillActivityVO> getComparator(String orderByColumn, String isAsc) { |
| | | if (StringUtils.isEmpty(orderByColumn)){ |
| | | return Comparator.comparing(SeckillActivityVO::getId); |
| | | } |
| | | Comparator<SeckillActivityVO> comparator; |
| | | |
| | | switch (orderByColumn) { |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void saveSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo) { |
| | | Integer goodId = seckillActivityInfo.getGoodId(); |
| | | LocalDateTime startTime = seckillActivityInfo.getStartTime(); |
| | | LocalDateTime endTime = seckillActivityInfo.getEndTime(); |
| | | long count = this.count(new LambdaQueryWrapper<SeckillActivityInfo>().eq(SeckillActivityInfo::getGoodId, goodId).eq(SeckillActivityInfo::getDelFlag, 0) |
| | | .eq(SeckillActivityInfo::getIsShelves, 1).last(" and now() between start_time and end_time")); |
| | | .eq(SeckillActivityInfo::getIsShelves, 1).last(" and (" + startTime + " between start_time and end_time or " + endTime + " between start_time and end_time)")); |
| | | if(0 < count){ |
| | | throw new RuntimeException("该秒杀商品已在其他秒杀活动中存在"); |
| | | } |
| | |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void updateSeckillActivityInfo(SeckillActivityInfo seckillActivityInfo) { |
| | | Integer goodId = seckillActivityInfo.getGoodId(); |
| | | LocalDateTime startTime = seckillActivityInfo.getStartTime(); |
| | | LocalDateTime endTime = seckillActivityInfo.getEndTime(); |
| | | long count = this.count(new LambdaQueryWrapper<SeckillActivityInfo>().eq(SeckillActivityInfo::getGoodId, goodId).eq(SeckillActivityInfo::getDelFlag, 0) |
| | | .eq(SeckillActivityInfo::getIsShelves, 1).last(" and now() between start_time and end_time")); |
| | | .eq(SeckillActivityInfo::getIsShelves, 1).last(" and (" + startTime + " between start_time and end_time or " + endTime + " between start_time and end_time)")); |
| | | if(1 < count){ |
| | | throw new RuntimeException("该秒杀商品已在其他秒杀活动中存在"); |
| | | } |
| | |
| | | |
| | | //服务积分 |
| | | List<ShopPoint> collect1 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 4).collect(Collectors.toList()); |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 1).collect(Collectors.toList()); |
| | | map.put("fwjf", collect1.stream().mapToInt(ShopPoint::getVariablePoint).sum()); |
| | | //绑定下级门店返佣积分 |
| | | List<ShopPoint> collect2 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | |
| | | |
| | | //服务积分 |
| | | List<ShopPoint> collect1 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 4).collect(Collectors.toList()); |
| | | .equals(finalStartTime.format(DateTimeFormatter.ofPattern("yyyy-MM-dd"))) && s.getType() == 1).collect(Collectors.toList()); |
| | | map.put("fwjf", collect1.stream().mapToInt(ShopPoint::getVariablePoint).sum()); |
| | | //绑定下级门店返佣积分 |
| | | List<ShopPoint> collect2 = list.stream().filter(s -> s.getCreateTime().format(DateTimeFormatter.ofPattern("yyyy-MM-dd")) |
| | |
| | | /** |
| | | * 支付回调地址 |
| | | */ |
| | | private static final String callbackUrl = "http://221.182.45.100:9000"; |
| | | private static final String callbackUrl = "https://www.qijisheng.top"; |
| | | |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 支付回调地址 |
| | | */ |
| | | private static final String callbackUrl = "http://221.182.45.100:9000"; |
| | | private static final String callbackUrl = "https://www.qijisheng.top"; |
| | | |
| | | |
| | | /** |
| | |
| | | server: |
| | | port: 9600 |
| | | tomcat: |
| | | basedir: /data/tomcat |
| | | basedir: /mnt/tomcat |
| | | # Spring |
| | | spring: |
| | | application: |
| | |
| | | allow-circular-references: true |
| | | profiles: |
| | | # 环境配置 |
| | | active: dev |
| | | # active: prod |
| | | # active: dev |
| | | active: prod |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | --- |
| | | #seata: |
| | | # enabled: true |
| | | # application-id: ${spring.application.name} |
| | | # tx-service-group: seata_tx_group #此处配置自定义的seata事务分组名称 |
| | | # enable-auto-data-source-proxy: false #关闭数据库代理 |
| | | # service: |
| | | # vgroup-mapping: |
| | | # seata_tx_group: default |
| | | # data-source-proxy-mode: AT |
| | | # config: |
| | | # type: nacos |
| | | # nacos: |
| | | # # 开发环境 |
| | | # server-addr: 127.0.0.1:8848 |
| | | # namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 |
| | | # group: DEFAULT_GROUP |
| | | # data-id: seata-server.properties |
| | | # username: nacos |
| | | # password: nacos |
| | | # # 生产环境 |
| | | ## server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | ## namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | ## group: DEFAULT_GROUP |
| | | ## data-id: seata-server.properties |
| | | ## username: nacos |
| | | ## password: nacos |
| | | # registry: |
| | | # type: nacos |
| | | # nacos: |
| | | # application: seata-server |
| | | # # 开发环境 |
| | | # server-addr: 127.0.0.1:8848 |
| | | # namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 |
| | | # group: DEFAULT_GROUP |
| | | # username: nacos |
| | | # password: nacos |
| | | # # 生产环境 |
| | | ## server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | ## namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | ## group: DEFAULT_GROUP |
| | | ## username: nacos |
| | | ## password: nacos |
| | | # cloud: |
| | | # nacos: |
| | | # discovery: |
| | | # # 开发环境 |
| | | # server-addr: 127.0.0.1:8848 # nacos注册中心地址 |
| | | # namespace: cdf47c5f-2bf9-4dec-a616-a8dc653aceb9 # 命名空间 |
| | | # group: DEFAULT_GROUP |
| | | # application: seata-server #Nacos 中 Seata 名称 |
| | | # username: nacos |
| | | # password: nacos |
| | | # # 生产环境 |
| | | ## server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | ## namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | ## group: DEFAULT_GROUP |
| | | ## application: seata-server #Nacos 中 Seata 名称 |
| | | ## username: nacos |
| | | ## password: nacos |
| | | # sentinel: |
| | | # transport: |
| | | # dashboard: 127.0.0.1:8080 # Sentinel控制台地址 |
| | | # eager: true |
| | | --- |
| | | spring: |
| | | config: |
| | | activate: |
| | |
| | | nacos: |
| | | discovery: |
| | | # 服务注册地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | server-addr: 127.0.0.1:8848 |
| | | service: ${spring.application.name} |
| | | group: DEFAULT_GROUP |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | config: |
| | | # 配置中心地址 |
| | | server-addr: 192.168.0.137:8848,192.168.0.123:8848 |
| | | namespace: c6cf40b5-44e8-43f9-be61-8d10fa830e2a |
| | | server-addr: 127.0.0.1:8848 |
| | | namespace: 20c168da-8cf1-4fff-bc38-bc62df656b6a |
| | | username: nacos |
| | | password: nacos |
| | | group: DEFAULT_GROUP |
| | |
| | | file-extension: yml |
| | | # 共享配置 |
| | | shared-configs: |
| | | - application-${spring.profiles.active}.${spring.cloud.nacos.config.file-extension} |
| | | - application.${spring.cloud.nacos.config.file-extension} |
| | | --- |
| | | spring: |
| | | config: |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <configuration scan="true" scanPeriod="60 seconds" debug="false"> |
| | | <!-- 日志存放路径 --> |
| | | <property name="log.path" value="logs/ruoyi-other" /> |
| | | <property name="log.path" value="/mnt/app/ruoyi-other" /> |
| | | <!-- 日志输出格式 --> |
| | | <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> |
| | | |
| | |
| | | tci.need_point, |
| | | tci.person_type, |
| | | tci.person_ids, |
| | | tci.shelf_status |
| | | tci.shelf_status, |
| | | tci.goods_name_json |
| | | FROM |
| | | t_coupon_info tci |
| | | <where> |
| | |
| | | <select id="querySeckillActivity" resultType="com.ruoyi.other.vo.SeckillActivityVO"> |
| | | SELECT |
| | | tsai.id, |
| | | tg.id goodsId, |
| | | tg.`name` goodsName, |
| | | tg.introduction, |
| | | tgc.`name` goodsCategoryName, |
| | |
| | | tsai.max_num maxNum, |
| | | tg.home_page_picture, |
| | | tg.original_price, |
| | | tg.sale_num, |
| | | tg.`type` goodsType, |
| | | tsai.start_time, |
| | | tsai.end_time, |
| | |
| | | t_shop_balance_statement tsbs |
| | | INNER JOIN t_shop ts ON ts.id = tsbs.shop_id |
| | | <where> |
| | | tsbs.type != 4 |
| | | <if test="bs.shopName != null and bs.shopName != ''"> |
| | | AND ts.`name` like concat('%', #{bs.shopName}, '%') |
| | | </if> |
| | |
| | | CASE |
| | | WHEN tts.subscribe_time <![CDATA[<]]> NOW() THEN 3 |
| | | ELSE tts.status |
| | | END AS status |
| | | END AS status, |
| | | tts.create_time |
| | | FROM |
| | | t_technician_subscribe tts |
| | | LEFT JOIN t_technician tt ON tts.technician_id = tt.id |
| | |
| | | o.status = #{status} |
| | | </if> |
| | | </where> |
| | | ORDER BY |
| | | create_time DESC |
| | | |
| | | </select> |
| | | </mapper> |