Merge remote-tracking branch 'origin/master'
| | |
| | | SysUser data = sysUserClient.getSysUser(userid).getData(); |
| | | Integer shopId = null; |
| | | Set<Long> userId = null; |
| | | Set<Long> userIdT = null; |
| | | if(data.getRoleType() == 2){ |
| | | shopId = data.getObjectId(); |
| | | userId = orderClient.getAppUserByShoppingShop(shopId).getData(); |
| | | } |
| | | UserStatistics userStatistics = appUserMapper.getUserStatistics(shopId, userId); |
| | | UserStatistics userStatistics1 = appUserMapper.getUserStatistics(shopId, userIdT); |
| | | userStatistics.setShopUser(userStatistics1.getShopUser()); |
| | | return R.ok(userStatistics); |
| | | } |
| | | |
| | |
| | | @ApiOperation(value = "积分管理-用户积分明细(必传用户id)", tags = "后台") |
| | | public R<Page<UserPoint>> userlist(UserPoint userPoint) { |
| | | Page<UserPoint> page = userPointService.lambdaQuery() |
| | | .eq(UserPoint::getType, userPoint.getType()) |
| | | .eq(userPoint.getType()!=null,UserPoint::getType, userPoint.getType()) |
| | | .eq(UserPoint::getAppUserId, userPoint.getAppUserId()) |
| | | .orderByDesc(UserPoint::getCreateTime) |
| | | .page(Page.of(userPoint.getPageNum(), userPoint.getPageSize())); |
| | |
| | | t_app_user tau |
| | | <where> |
| | | <if test="null != shopId"> |
| | | tau.shop_id = #{shopId} or tau.id in |
| | | <foreach collection="userId" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | tau.shop_id = #{shopId} |
| | | <if test="null != userId"> |
| | | or tau.id in |
| | | <foreach collection="userId" item="item" index="index" open="(" separator="," close=")"> |
| | | #{item} |
| | | </foreach> |
| | | </if> |
| | | </if> |
| | | and tau.del_flag = 0 |
| | | and tau.`status` !=3 |
| | |
| | | if (order.getOrderType().equals(1)) { |
| | | serviceTotal++; |
| | | serviceTotalMoney = serviceTotalMoney.add(order.getPaymentAmount()); |
| | | }else if (order.getOrderType().equals(2)){ |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | }else if (order.getOrderType().equals(2) && 1 == order.getDistributionMode()){ |
| | | singleTotal++; |
| | | singleTotalMoney = singleTotalMoney.add(order.getPaymentAmount()); |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | } |
| | | total++; |
| | | totalMoney = totalMoney.add(order.getPaymentAmount()); |
| | | } |
| | | orderStatisticsDetail.setDate(key); |
| | | orderStatisticsDetail.setServiceTotal(serviceTotal); |
| | |
| | | </select> |
| | | <select id="getOrderStatistics" resultType="com.ruoyi.order.vo.OrderStatistics"> |
| | | SELECT |
| | | count(*) as total, |
| | | SUM( CASE WHEN tor.order_type = 2 and distribution_mode = 2 THEN 0 ELSE 1 END ) as total, |
| | | SUM( CASE WHEN tor.order_type = 1 THEN 1 ELSE 0 END ) as serviceTotal, |
| | | SUM( CASE WHEN tor.order_type = 2 and distribution_mode = 1 THEN 1 ELSE 0 END ) as singleTotal, |
| | | SUM( tor.total_amount ) as totalMoney, |
| | |
| | | if(sysUser.getRoleType() == 2){ |
| | | share.setObjectId(sysUser.getObjectId().longValue()); |
| | | } |
| | | share.setAuditStatus(0); |
| | | share.setDelFlag(0); |
| | | shareService.save(share); |
| | | return R.ok(); |
| | |
| | | @ApiOperation(value = "广告管理-分享管理-编辑", tags = {"管理后台"}) |
| | | @PostMapping("/manage/edit") |
| | | public R<Void> manageedit(@RequestBody Share share) { |
| | | if (share.getAuditStatus()==2){ |
| | | if (null == share.getAuditStatus() || share.getAuditStatus()==2){ |
| | | share.setAuditStatus(0); |
| | | } |
| | | shareService.updateById(share); |
| | |
| | | } |
| | | shop.setStatus(status); |
| | | shopService.updateById(shop); |
| | | //处理员工等数据 |
| | | UserShop userSh = new UserShop(); |
| | | userSh.setShopId(id); |
| | | List<UserShop> data = userShopClient.getUserShop(userSh).getData(); |
| | | for (UserShop datum : data) { |
| | | UserShop userShop = new UserShop(); |
| | | userShop.setUserId(datum.getUserId()); |
| | | List<UserShop> data1 = userShopClient.getUserShop(userShop).getData(); |
| | | long count = data1.stream().filter(s -> !s.getShopId().equals(id)).count(); |
| | | if(0 == count){ |
| | | SysUser sysUser = sysUserClient.getSysUser(datum.getUserId()).getData(); |
| | | sysUser.setStatus(status == 1 ? "0" : "1"); |
| | | sysUserClient.updateUser(sysUser); |
| | | } |
| | | } |
| | | return R.ok(); |
| | | } |
| | | |