Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
cf68964a0d
35 files changed
+347
-348
No files matched your search
@@ -375,6 +375,7 @@ CREATE TABLE hard_appt
|
||||
title varchar(64) NOT NULL COMMENT '标题',
|
||||
start_time time DEFAULT NULL COMMENT '开始时间',
|
||||
end_time time DEFAULT NULL COMMENT '结束时间',
|
||||
hour_type varchar(32) NOT NULL COMMENT '唯一标识',
|
||||
sort int DEFAULT 0 NOT NULL COMMENT '排序',
|
||||
status varchar(32) NOT NULL COMMENT '状态',
|
||||
remark varchar(256) DEFAULT NULL COMMENT '备注',
|
||||
|
||||
+23
-23
@@ -99,30 +99,30 @@ public class CanteenDailyMenuServiceImpl extends ServiceImpl<CanteenDailyMenuMap
|
||||
@Override
|
||||
@Transactional
|
||||
public void saveToday(CanteenDailyMenuEntity canteenDailyMenu) {
|
||||
List<Long> spuIds = Optional.ofNullable(canteenDailyMenu.getSpuIds()).orElse(Collections.emptyList());
|
||||
if (spuIds.isEmpty()) return;
|
||||
List<Long> spuIds = Optional.ofNullable(canteenDailyMenu.getSpuIds()).orElse(Collections.emptyList());
|
||||
if (spuIds.isEmpty()) return;
|
||||
|
||||
LambdaQueryWrapper<CanteenDailyMenuEntity> queryWrapper = new LambdaQueryWrapper<CanteenDailyMenuEntity>()
|
||||
.eq(CanteenDailyMenuEntity::getMerchantId, canteenDailyMenu.getMerchantId())
|
||||
.eq(CanteenDailyMenuEntity::getStartTime, canteenDailyMenu.getStartTime())
|
||||
.eq(CanteenDailyMenuEntity::getHourType, canteenDailyMenu.getHourType())
|
||||
.select(CanteenDailyMenuEntity::getSpuId); // 仅查询必要字段
|
||||
LambdaQueryWrapper<CanteenDailyMenuEntity> queryWrapper = new LambdaQueryWrapper<CanteenDailyMenuEntity>()
|
||||
.eq(CanteenDailyMenuEntity::getMerchantId, canteenDailyMenu.getMerchantId())
|
||||
.eq(CanteenDailyMenuEntity::getStartTime, canteenDailyMenu.getStartTime())
|
||||
.eq(CanteenDailyMenuEntity::getHourType, canteenDailyMenu.getHourType())
|
||||
.select(CanteenDailyMenuEntity::getSpuId); // 仅查询必要字段
|
||||
|
||||
List<Long> existSpuIds = baseMapper.selectList(queryWrapper)
|
||||
.stream()
|
||||
.map(CanteenDailyMenuEntity::getSpuId)
|
||||
.collect(Collectors.toList());
|
||||
List<Long> existSpuIds = baseMapper.selectList(queryWrapper)
|
||||
.stream()
|
||||
.map(CanteenDailyMenuEntity::getSpuId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
List<CanteenDailyMenuEntity> insertList = spuIds.stream()
|
||||
.filter(id -> !existSpuIds.contains(id))
|
||||
.map(id -> {
|
||||
CanteenDailyMenuEntity entity = new CanteenDailyMenuEntity();
|
||||
BeanUtils.copyProperties(canteenDailyMenu, entity);
|
||||
entity.setSpuId(id);
|
||||
return entity;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
saveBatch(insertList);
|
||||
List<CanteenDailyMenuEntity> insertList = spuIds.stream()
|
||||
.filter(id -> !existSpuIds.contains(id))
|
||||
.map(id -> {
|
||||
CanteenDailyMenuEntity entity = new CanteenDailyMenuEntity();
|
||||
BeanUtils.copyProperties(canteenDailyMenu, entity);
|
||||
entity.setSpuId(id);
|
||||
return entity;
|
||||
})
|
||||
.collect(Collectors.toList());
|
||||
saveBatch(insertList);
|
||||
|
||||
// 发送mq消息
|
||||
sendMqttMsg(canteenDailyMenu.getMerchantId());
|
||||
@@ -197,8 +197,8 @@ public class CanteenDailyMenuServiceImpl extends ServiceImpl<CanteenDailyMenuMap
|
||||
// ));
|
||||
// pageData.setRecords(dailyMenuVOList);
|
||||
|
||||
Page<DailyMenuAppVO> pageData=baseMapper.selectTimeFoodPage(page,dailyMenuDTO);
|
||||
return pageData;
|
||||
Page<DailyMenuAppVO> pageData = baseMapper.selectTimeFoodPage(page, dailyMenuDTO);
|
||||
return pageData;
|
||||
// }
|
||||
|
||||
// return null;
|
||||
|
||||
+10
-9
@@ -54,15 +54,16 @@
|
||||
</select>
|
||||
<select id="getCanteenMenuList" resultMap="adCanteenDailyMenuListVO">
|
||||
SELECT
|
||||
sp.id as spu_id,
|
||||
t.id,
|
||||
sp.name,
|
||||
sp.pic_url,
|
||||
t.hour_type,
|
||||
sp.price,
|
||||
sp.stock,
|
||||
sp.category_id,
|
||||
t.dept_id
|
||||
sp.id as spu_id,
|
||||
t.id,
|
||||
sp.name,
|
||||
sp.pic_url,
|
||||
t.hour_type,
|
||||
sp.price,
|
||||
sp.stock,
|
||||
sp.category_id,
|
||||
t.dept_id,
|
||||
t.create_by
|
||||
FROM canteen_daily_menu t
|
||||
LEFT JOIN canteen_spu sp
|
||||
on t.spu_id=sp.id
|
||||
|
||||
+3
@@ -45,4 +45,7 @@ public class HardAppCreateOrderDto {
|
||||
// 饭卡id
|
||||
private Long walletId;
|
||||
|
||||
// 预约id
|
||||
private Long apptId;
|
||||
|
||||
}
|
||||
+6
@@ -46,6 +46,12 @@ public class HardApptEntity extends Model<HardApptEntity> {
|
||||
@Schema(description = "结束时间")
|
||||
private LocalTime endTime;
|
||||
|
||||
/**
|
||||
* 预约时间段
|
||||
*/
|
||||
@Schema(description = "预约时间段")
|
||||
private String hourType;
|
||||
|
||||
/**
|
||||
* 排序
|
||||
*/
|
||||
|
||||
+6
@@ -123,6 +123,12 @@ public class HardOrderEntity extends Model<HardOrderEntity> {
|
||||
@Schema(description = "用餐类型")
|
||||
private String hourType;
|
||||
|
||||
/**
|
||||
* 预约时间段id
|
||||
*/
|
||||
@Schema(description = "预约时间段id")
|
||||
private Long apptId;
|
||||
|
||||
/**
|
||||
* 订单设备类型
|
||||
*/
|
||||
|
||||
+1
-1
@@ -55,7 +55,7 @@ public class HardManagerController {
|
||||
|
||||
@Operation(summary = "分页复杂查询", description = "分页复杂查询")
|
||||
@GetMapping("/page-join")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardInvoice_view')")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardManager_view')")
|
||||
public R pageJoin(@ParameterObject Page page, @ParameterObject HardManagerDto dto) {
|
||||
return R.ok(hardManagerService.scopePageList(page, dto));
|
||||
}
|
||||
|
||||
+3
-30
@@ -3,7 +3,6 @@ package com.bsd.pjcloud.hard.controller.order;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
@@ -20,7 +19,6 @@ import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScope;
|
||||
import com.bsd.pjcloud.common.data.datascope.DataScopeFuncEnum;
|
||||
import com.bsd.pjcloud.common.idempotent.annotation.Idempotent;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
import com.bsd.pjcloud.common.security.annotation.Inner;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
@@ -44,7 +42,6 @@ import com.bsd.pjcloud.wallet.api.feign.RemoteMchService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.MchManageVo;
|
||||
import jakarta.servlet.http.HttpServletResponse;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import io.swagger.v3.oas.annotations.security.SecurityRequirement;
|
||||
import org.springdoc.core.annotations.ParameterObject;
|
||||
import org.springframework.http.HttpHeaders;
|
||||
@@ -139,7 +136,7 @@ public class HardOrderController {
|
||||
dto.setIsFindCarList(false);
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
// 查询用户部门
|
||||
UserInfo userInfo = userService.getByUserId(user.getId()).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(user.getId()).getData();
|
||||
// 判断是否为合作超市管理员工
|
||||
if (!hardManagerService.isSuperMarketAdmin(user)) return R.ok(new Page());
|
||||
// 查询用户属于的商户
|
||||
@@ -164,9 +161,9 @@ public class HardOrderController {
|
||||
@Operation(summary = "app创建订单", description = "app创建订单")
|
||||
@GetMapping("/app/create-order")
|
||||
@Idempotent(expireTime = 10, info = "正在创建订单中,请勿重复操作")
|
||||
public R appCreateOrder(@RequestParam Long carParentId, @RequestParam HardTypeEnum hardType) {
|
||||
public R appCreateOrder(@RequestParam Long carParentId, @RequestParam Long apptId, @RequestParam HardTypeEnum hardType) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
HardAppCreateOrderDto dto = HardAppCreateOrderDto.builder().carParentId(carParentId).walletType(WalletTypeEnum.EAT).hardType(hardType).userId(user.getId()).orderType(HardOrderTypeEnum.RESERVE).payType(HardPayTypeEnum.WALLET_DEFAULT).build();
|
||||
HardAppCreateOrderDto dto = HardAppCreateOrderDto.builder().carParentId(carParentId).walletType(WalletTypeEnum.EAT).hardType(hardType).userId(user.getId()).orderType(HardOrderTypeEnum.RESERVE).payType(HardPayTypeEnum.WALLET_DEFAULT).apptId(apptId).build();
|
||||
return R.ok(hardwareOrderService.appCreateOrder(dto));
|
||||
}
|
||||
|
||||
@@ -230,30 +227,6 @@ public class HardOrderController {
|
||||
return R.ok(hardwareOrderService.join(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "新增订单表", description = "新增订单表")
|
||||
@SysLog("新增订单表")
|
||||
@PostMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_add')")
|
||||
public R save(@RequestBody HardOrderEntity hardwareOrder) {
|
||||
return R.ok(hardwareOrderService.save(hardwareOrder));
|
||||
}
|
||||
|
||||
@Operation(summary = "修改订单表", description = "修改订单表")
|
||||
@SysLog("修改订单表")
|
||||
@PutMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_edit')")
|
||||
public R updateById(@RequestBody HardOrderEntity hardwareOrder) {
|
||||
return R.ok(hardwareOrderService.updateById(hardwareOrder));
|
||||
}
|
||||
|
||||
@Operation(summary = "通过id删除订单表", description = "通过id删除订单表")
|
||||
@SysLog("通过id删除订单表")
|
||||
@DeleteMapping
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_del')")
|
||||
public R removeById(@RequestBody Long[] ids) {
|
||||
return R.ok(hardwareOrderService.removeBatchByIds(CollUtil.toList(ids)));
|
||||
}
|
||||
|
||||
@GetMapping("/export")
|
||||
@PreAuthorize("@pms.hasPermission('hard_hardwareOrder_export')")
|
||||
public void export(HttpServletResponse response, HardOrderDto dto) throws IOException {
|
||||
|
||||
+2
-2
@@ -69,7 +69,7 @@ public class HardOrderTotalController {
|
||||
public R appMchWaterDay(@ParameterObject Page page, @ParameterObject HardOrderDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
// 查询用户部门
|
||||
UserInfo userInfo = userService.getByUserId(user.getId()).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(user.getId()).getData();
|
||||
dto.setIsFindCarList(false);
|
||||
// 判断是否为合作超市管理员工
|
||||
if (!hardManagerService.isSuperMarketAdmin(user)) return R.ok(new Page());
|
||||
@@ -91,7 +91,7 @@ public class HardOrderTotalController {
|
||||
public R appMchWaterTotal(@ParameterObject HardOrderDto dto) {
|
||||
PjcloudUser user = SecurityUtils.getUser();
|
||||
// 查询用户部门
|
||||
UserInfo userInfo = userService.getByUserId(user.getId()).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(user.getId()).getData();
|
||||
dto.setIsFindCarList(false);
|
||||
// 判断是否为合作超市管理员工
|
||||
if (!hardManagerService.isSuperMarketAdmin(user)) return R.ok(new Page());
|
||||
|
||||
+2
-2
@@ -28,7 +28,7 @@ public class HardApiServiceImpl implements HardApiService {
|
||||
public HardAdUserVo getUserById(Long userId, HardTypeEnum type) {
|
||||
HardAdUserVo result = new HardAdUserVo();
|
||||
// 查询用户
|
||||
UserInfo user = userService.getByUserId(userId).getData();
|
||||
UserInfo user = userService.getInnerByUserId(userId).getData();
|
||||
if (ObjectUtil.isEmpty(user)) return null;
|
||||
// 查询钱包
|
||||
// WalletTypeEnum walletType = ObjectUtil.equals(HardTypeEnum.CANTEEN, type) ? WalletTypeEnum.EAT : WalletTypeEnum.PAY;
|
||||
@@ -59,7 +59,7 @@ public class HardApiServiceImpl implements HardApiService {
|
||||
WalletManageEntity wallet = remoteWalletService.getWalletByCardNumber(card).getData();
|
||||
if (ObjectUtil.isEmpty(wallet)) return null;
|
||||
// 查询用户
|
||||
UserInfo user = userService.getByUserId(wallet.getUserId()).getData();
|
||||
UserInfo user = userService.getInnerByUserId(wallet.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(user)) return null;
|
||||
SysUser sysUser = user.getSysUser();
|
||||
result.setUserId(sysUser.getUserId());
|
||||
|
||||
+1
-1
@@ -129,7 +129,7 @@ public class HardInvoiceServiceImpl extends ServiceImpl<HardInvoiceMapper, HardI
|
||||
.eq(HardCarEntity::getParentCarId, order.getParentCarId())
|
||||
);
|
||||
// 查询用户
|
||||
UserInfo user = Optional.of(userService.getByUserId(order.getUserId())).map(R::getData).orElseThrow(() -> new RuntimeException("用户不存在"));
|
||||
UserInfo user = Optional.of(userService.getInnerByUserId(order.getUserId())).map(R::getData).orElseThrow(() -> new RuntimeException("用户不存在"));
|
||||
SysUser sysUser = user.getSysUser();
|
||||
// 查询商户
|
||||
MchManageVo mch = Optional.of(remoteMchService.getById(order.getMerchantId())).map(R::getData).orElseThrow(() -> new RuntimeException("商户不存在"));
|
||||
|
||||
+3
-3
@@ -67,13 +67,13 @@ public class HardThirdSelfZyServiceImpl implements HardThirdSelfZyService {
|
||||
public HardCallbackPayVo pay(HardCallbackPayDto dto) {
|
||||
try {
|
||||
// 查询用户
|
||||
UserInfo userDetail = remoteUserService.getByUserId(dto.getUserId()).getData();
|
||||
UserInfo userDetail = remoteUserService.getInnerByUserId(dto.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userDetail)) throw new RuntimeException("用户不存在不存在");
|
||||
// 钱包
|
||||
WalletManageEntity wallet = remoteWalletService.getWallet(dto.getUserId(), WalletTypeEnum.EAT).getData();
|
||||
if (ObjectUtil.isEmpty(wallet)) throw new RuntimeException("用户钱包不存在");
|
||||
// 用户
|
||||
UserInfo user = remoteUserService.getByUserId(wallet.getUserId()).getData();
|
||||
UserInfo user = remoteUserService.getInnerByUserId(wallet.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(user)) throw new RuntimeException("用户不存在");
|
||||
// 查询正元默认商户
|
||||
MchManageVo zyDefaultMch = getZyDefaultMch();
|
||||
@@ -136,7 +136,7 @@ public class HardThirdSelfZyServiceImpl implements HardThirdSelfZyService {
|
||||
// 校验订单是否可以退款
|
||||
HardOrderVo order = hardAfterSaleService.validateOrderCanRefund(dto.getOrderId());
|
||||
// 用户
|
||||
UserInfo user = remoteUserService.getByUserId(order.getUserId()).getData();
|
||||
UserInfo user = remoteUserService.getInnerByUserId(order.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(user)) throw new RuntimeException("用户不存在");
|
||||
// 添加售后订单
|
||||
HardAfterSaleEntity saveObj = BeanUtils.toBean(dto, HardAfterSaleEntity.class);
|
||||
|
||||
+3
-3
@@ -216,7 +216,7 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
CurrentUserHardTypeInfoDto result = new CurrentUserHardTypeInfoDto();
|
||||
Long userId = user.getId();
|
||||
if (ObjectUtil.isEmpty(userId)) return result;
|
||||
UserInfo userInfo = userService.getByUserId(userId).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(userId).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) return result;
|
||||
String[] roles = userInfo.getRoleCodes();
|
||||
if (roles.length == 0) return result;
|
||||
@@ -238,7 +238,7 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
@Override
|
||||
public List<Long> getCurrentUserMchInfo(PjcloudUser user, List<Long> mchIds) {
|
||||
if (ObjectUtil.isEmpty(mchIds)) mchIds = new ArrayList<>();
|
||||
UserInfo userInfo = userService.getByUserId(user.getId()).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(user.getId()).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) return mchIds;
|
||||
String[] roles = userInfo.getRoleCodes();
|
||||
if (roles.length == 0) return mchIds;
|
||||
@@ -258,7 +258,7 @@ public class HardManagerServiceImpl extends ServiceImpl<HardManagerMapper, HardM
|
||||
|
||||
@Override
|
||||
public boolean isSuperMarketAdmin(PjcloudUser user) {
|
||||
UserInfo userInfo = userService.getByUserId(user.getId()).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(user.getId()).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) return false;
|
||||
String[] roles = userInfo.getRoleCodes();
|
||||
if (roles.length == 0) return false;
|
||||
|
||||
+1
-3
@@ -44,7 +44,6 @@ import com.bsd.pjcloud.wallet.api.feign.RemoteWalletRechargeService;
|
||||
import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeVo;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.seata.spring.annotation.GlobalTransactional;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -53,7 +52,6 @@ import java.time.LocalDateTime;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
* 售后订单
|
||||
@@ -183,7 +181,7 @@ public class HardAfterSaleServiceImpl extends ServiceImpl<HardAfterSaleMapper, H
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
// 用户
|
||||
if (ObjectUtil.isNotEmpty(detail.getUserId())) {
|
||||
R<UserInfo> user = userService.getByUserId(detail.getUserId());
|
||||
R<UserInfo> user = userService.getInnerByUserId(detail.getUserId());
|
||||
if (ObjectUtil.isNotEmpty(user.getData())) {
|
||||
DataUtil.convertUser(detail, user.getData().getSysUser());
|
||||
}
|
||||
|
||||
+28
-5
@@ -4,6 +4,7 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import cn.hutool.json.JSONUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
@@ -32,6 +33,7 @@ import com.bsd.pjcloud.hard.api.dto.order.HardCreateCarDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.HardOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.order.app.HardAppCreateOrderDto;
|
||||
import com.bsd.pjcloud.hard.api.dto.spu.DeductionSpuStockDto;
|
||||
import com.bsd.pjcloud.hard.api.entity.HardApptEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.manager.HardManagerEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardCarEntity;
|
||||
import com.bsd.pjcloud.hard.api.entity.order.HardOrderEntity;
|
||||
@@ -98,6 +100,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
private final HardDoorFlowService hardDoorFlowService;
|
||||
private final HardBroadcastService hardBroadcastService;
|
||||
private final HardSpuService hardSpuService;
|
||||
private final HardApptService hardApptService;
|
||||
|
||||
private final RemoteMchService remoteMchService;
|
||||
private final RemoteCodeUseService remoteCodeUseService;
|
||||
@@ -184,7 +187,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
// 用户
|
||||
if (ObjectUtil.isNotEmpty(detail.getUserId())) {
|
||||
R<UserInfo> user = userService.getByUserId(detail.getUserId());
|
||||
R<UserInfo> user = userService.getInnerByUserId(detail.getUserId());
|
||||
if (ObjectUtil.isNotEmpty(user.getData())) {
|
||||
DataUtil.convertUser(detail, user.getData().getSysUser());
|
||||
}
|
||||
@@ -223,7 +226,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
MchManageVo mch = validateCreateOrderDto(dto);
|
||||
if (ObjectUtil.isEmpty(mch)) throw new RuntimeException("机器绑定的商户不存在");
|
||||
// 查询用户
|
||||
UserInfo userDetail = userService.getByUserId(dto.getUserId()).getData();
|
||||
UserInfo userDetail = userService.getInnerByUserId(dto.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userDetail)) throw new RuntimeException("用户不存在不存在");
|
||||
// 是否需要支付
|
||||
boolean isPay = isPay(dto.getOrderType(), dto.getOrderPayType());
|
||||
@@ -296,8 +299,11 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long appCreateOrder(@Valid HardAppCreateOrderDto dto) {
|
||||
// 查询用户
|
||||
UserInfo userDetail = userService.getByUserId(dto.getUserId()).getData();
|
||||
UserInfo userDetail = userService.getInnerByUserId(dto.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userDetail)) throw new RuntimeException("用户不存在不存在");
|
||||
// 判断是否有重复的预约订单
|
||||
Long reserveCount = isHaveCanteenReserve(dto.getUserId());
|
||||
if (reserveCount > 0) throw new RuntimeException("您有" + reserveCount + "笔未核销的预约订单,请先核销");
|
||||
// 钱包
|
||||
WalletManageEntity wallet = remoteWalletService.getWallet(dto.getUserId(), dto.getWalletType()).getData();
|
||||
if (ObjectUtil.isEmpty(wallet)) throw new RuntimeException("用户钱包不存在");
|
||||
@@ -347,6 +353,13 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
.isOfflineOrder(YesNoEnum.NO.getCode())
|
||||
.productDesc(subject)
|
||||
.build();
|
||||
if (ObjectUtil.equals(dto.getOrderType(), HardOrderTypeEnum.RESERVE)) {
|
||||
// 查询时间段
|
||||
HardApptEntity hardAppt = hardApptService.getById(dto.getApptId());
|
||||
if (ObjectUtil.isEmpty(hardAppt)) throw new RuntimeException("预约时间段不存在");
|
||||
orderObj.setHourType(hardAppt.getHourType());
|
||||
orderObj.setApptId(hardAppt.getId());
|
||||
}
|
||||
if (isPay) orderObj.setWalletId(wallet.getId());
|
||||
baseMapper.insert(orderObj);
|
||||
// 钱包扣款
|
||||
@@ -367,7 +380,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
MchManageVo mch = remoteMchService.getById(dto.getMerchantId()).getData();
|
||||
if (ObjectUtil.isEmpty(mch)) throw new RuntimeException("商户不存在");
|
||||
// 查询用户
|
||||
UserInfo userDetail = userService.getByUserId(dto.getUserId()).getData();
|
||||
UserInfo userDetail = userService.getInnerByUserId(dto.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userDetail)) throw new RuntimeException("用户不存在不存在");
|
||||
// 钱包
|
||||
WalletManageEntity wallet = remoteWalletService.getWalletById(dto.getWalletId()).getData();
|
||||
@@ -414,7 +427,7 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
@Override
|
||||
public Long createHardDoorOrder(Long userId, Long hardId) {
|
||||
// 查询用户
|
||||
UserInfo userDetail = userService.getByUserId(userId).getData();
|
||||
UserInfo userDetail = userService.getInnerByUserId(userId).getData();
|
||||
if (ObjectUtil.isEmpty(userDetail)) throw new RuntimeException("创建智能柜订单失败,用户不存在");
|
||||
// 查询设备
|
||||
HardManagerVo hard = hardManagerService.getByHardId(hardId);
|
||||
@@ -814,6 +827,16 @@ public class HardOrderServiceImpl extends ServiceImpl<HardOrderMapper, HardOrder
|
||||
return HardTypeEnum.isReserve(hardTypeEnum);
|
||||
}
|
||||
|
||||
// 用户是否有正在进行中的订餐
|
||||
private Long isHaveCanteenReserve(Long userId) {
|
||||
return baseMapper.selectCount(new LambdaQueryWrapper<HardOrderEntity>()
|
||||
.eq(HardOrderEntity::getUserId, userId)
|
||||
.eq(HardOrderEntity::getSysType, HardTypeEnum.CANTEEN.getType())
|
||||
.eq(HardOrderEntity::getOrderType, HardOrderTypeEnum.RESERVE.getType())
|
||||
.ne(HardOrderEntity::getOrderStatus, HardOrderStatusEnum.CANCEL.getType())
|
||||
);
|
||||
}
|
||||
|
||||
/* ************************************* end 支付相关 end ************************************* */
|
||||
|
||||
private HardOrderServiceImpl getSelf() {
|
||||
|
||||
+169
-175
@@ -249,7 +249,6 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
*/
|
||||
@Override
|
||||
public HardOrderCsVo mchWaterTotal(HardOrderDto dto, PjcloudUser user) {
|
||||
HardOrderCsVo result = new HardOrderCsVo();
|
||||
// 查询总流水
|
||||
CompletableFuture<HardOrderCsVo> totalFuture = CompletableFuture.supplyAsync(() -> {
|
||||
HardOrderDto totalDto = BeanUtil.toBean(dto, HardOrderDto.class);
|
||||
@@ -274,7 +273,7 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
HardOrderCsVo refundList = refundFuture.join();
|
||||
HardOrderCsVo profitList = profitFuture.join();
|
||||
// 聚合一下数据
|
||||
if (ObjectUtil.isEmpty(totalList)) return result;
|
||||
if (ObjectUtil.isEmpty(totalList)) return new HardOrderCsVo();
|
||||
if (ObjectUtil.isNotEmpty(refundList)) {
|
||||
if (ObjectUtil.isNotEmpty(refundList.getTotalPayPrice())) {
|
||||
totalList.setTotalRefundPrice(refundList.getTotalPayPrice());
|
||||
@@ -294,9 +293,9 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
// 商户
|
||||
MchManageVo mchDetail = remoteMchService.getById(totalList.getMerchantId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(mchDetail)) {
|
||||
WalletDataUtil.convertMch(result, mchDetail);
|
||||
WalletDataUtil.convertMch(totalList, mchDetail);
|
||||
}
|
||||
return result;
|
||||
return totalList;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -305,182 +304,177 @@ public class HardOrderTotalServiceImpl implements HardOrderTotalService {
|
||||
@Override
|
||||
public List<HardDeptTotalVo> pageListDept(HardDeptTotalDto dto) {
|
||||
// 查询部门
|
||||
CompletableFuture<List<SysDept>> deptFuture = CompletableFuture.supplyAsync(() -> {
|
||||
DeptAllListDto deptDto = new DeptAllListDto();
|
||||
deptDto.setIsInclude(dto.getIsInclude());
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
deptDto.setDeptId(dto.getDeptId());
|
||||
DeptAllListDto deptDto = new DeptAllListDto();
|
||||
deptDto.setIsInclude(dto.getIsInclude());
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptId())) {
|
||||
deptDto.setDeptId(dto.getDeptId());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
deptDto.setDeptId(null);
|
||||
deptDto.setDeptIds(dto.getDeptIds());
|
||||
}
|
||||
List<SysDept> deptList = remoteDeptService.getInnerAllDept(deptDto).getData();
|
||||
if (ObjectUtil.isEmpty(deptList)) return null;
|
||||
List<Long> deptIds = deptList.stream().map(SysDept::getDeptId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
List<HardDeptTotalVo> resultList = deptList.stream().map(v -> {
|
||||
HardDeptTotalVo item = new HardDeptTotalVo();
|
||||
item.setDeptId(v.getDeptId());
|
||||
item.setDeptName(v.getName());
|
||||
return item;
|
||||
}).toList();
|
||||
// 查询钱包批量充值流水
|
||||
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletBatchFuture = CompletableFuture.supplyAsync(() -> {
|
||||
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
|
||||
walletDto.setDeptIds(deptIds);
|
||||
walletDto.setBizTypes(List.of(WalletBizEnum.BATCH.getCode()));
|
||||
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_INCOME);
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
walletDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getDeptIds())) {
|
||||
deptDto.setDeptId(null);
|
||||
deptDto.setDeptIds(dto.getDeptIds());
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
walletDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return remoteDeptService.getInnerAllDept(deptDto).getData();
|
||||
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
|
||||
});
|
||||
CompletableFuture<List<HardDeptTotalVo>> resultListFuture = deptFuture.thenApply(deptList -> {
|
||||
if (ObjectUtil.isEmpty(deptList)) return null;
|
||||
List<Long> deptIds = deptList.stream().map(SysDept::getDeptId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
List<HardDeptTotalVo> resultList = deptList.stream().map(v -> {
|
||||
HardDeptTotalVo item = new HardDeptTotalVo();
|
||||
item.setDeptId(v.getDeptId());
|
||||
item.setDeptName(v.getName());
|
||||
return item;
|
||||
}).toList();
|
||||
// 查询钱包批量充值流水
|
||||
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletBatchFuture = CompletableFuture.supplyAsync(() -> {
|
||||
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
|
||||
walletDto.setDeptIds(deptIds);
|
||||
walletDto.setBizTypes(List.of(WalletBizEnum.BATCH.getCode()));
|
||||
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_INCOME);
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
walletDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
walletDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
|
||||
});
|
||||
// 查询钱包批量扣减流水
|
||||
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletReduceFuture = CompletableFuture.supplyAsync(() -> {
|
||||
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
|
||||
walletDto.setDeptIds(deptIds);
|
||||
walletDto.setBizTypes(List.of(WalletBizEnum.BATCH.getCode()));
|
||||
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_EXPENSE);
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
walletDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
walletDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
|
||||
});
|
||||
// 查询钱包单次充值流水
|
||||
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletOnceBatchFuture = CompletableFuture.supplyAsync(() -> {
|
||||
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
|
||||
walletDto.setDeptIds(deptIds);
|
||||
walletDto.setBizTypes(List.of(WalletBizEnum.UPDATE.getCode()));
|
||||
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_INCOME);
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
walletDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
walletDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
|
||||
});
|
||||
// 查询钱包单次扣减流水
|
||||
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletOnceReduceFuture = CompletableFuture.supplyAsync(() -> {
|
||||
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
|
||||
walletDto.setDeptIds(deptIds);
|
||||
walletDto.setBizTypes(List.of(WalletBizEnum.UPDATE.getCode()));
|
||||
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_EXPENSE);
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
walletDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
walletDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
|
||||
});
|
||||
// 查询订单支付流水
|
||||
CompletableFuture<List<HardOrderSumAndCountVo>> payFuture = CompletableFuture.supplyAsync(() -> {
|
||||
HardOrderSumAndCountDto payDto = new HardOrderSumAndCountDto();
|
||||
payDto.setUserDeptIds(deptIds);
|
||||
payDto.setOrderStatusCodes(HardOrderStatusEnum.getPayPrice());
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
payDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
payDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return hardOrderMapper.sumAndCount(payDto);
|
||||
});
|
||||
// 查询订单退款流水
|
||||
CompletableFuture<List<HardOrderSumAndCountVo>> refundFuture = CompletableFuture.supplyAsync(() -> {
|
||||
HardOrderSumAndCountDto refundDto = new HardOrderSumAndCountDto();
|
||||
refundDto.setUserDeptIds(deptIds);
|
||||
refundDto.setOrderStatusCodes(HardOrderStatusEnum.getPayErrorCodes());
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
refundDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
refundDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return hardOrderMapper.sumAndCount(refundDto);
|
||||
});
|
||||
// 消费净次数
|
||||
CompletableFuture<List<HardOrderSumAndCountVo>> profitFuture = CompletableFuture.supplyAsync(() -> {
|
||||
HardOrderSumAndCountDto refundDto = new HardOrderSumAndCountDto();
|
||||
refundDto.setUserDeptIds(deptIds);
|
||||
refundDto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
refundDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
refundDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return hardOrderMapper.sumAndCount(refundDto);
|
||||
});
|
||||
CompletableFuture<Void> allFutures = CompletableFuture.allOf(walletBatchFuture, walletReduceFuture, payFuture, refundFuture, walletOnceBatchFuture, walletOnceReduceFuture, profitFuture);
|
||||
allFutures.join();
|
||||
List<WalletTransactionSumAndCountVo> walletBatchList = walletBatchFuture.join();
|
||||
List<WalletTransactionSumAndCountVo> walletReduceList = walletReduceFuture.join();
|
||||
List<WalletTransactionSumAndCountVo> walletOnceBatchList = walletOnceBatchFuture.join();
|
||||
List<WalletTransactionSumAndCountVo> walletOnceReduceList = walletOnceReduceFuture.join();
|
||||
List<HardOrderSumAndCountVo> payList = payFuture.join();
|
||||
List<HardOrderSumAndCountVo> refundList = refundFuture.join();
|
||||
List<HardOrderSumAndCountVo> profitList = profitFuture.join();
|
||||
// 聚合一下数据
|
||||
for (HardDeptTotalVo v : resultList) {
|
||||
if (ObjectUtil.isNotEmpty(walletBatchList)) {
|
||||
walletBatchList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setWalletPrice(i.getSum());
|
||||
v.setWalletCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(walletReduceList)) {
|
||||
walletReduceList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
// v.setWalletReducePrice(i.getSum());
|
||||
v.setWalletReducePrice(Math.abs(i.getSum()));
|
||||
v.setWalletReduceCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(walletOnceBatchList)) {
|
||||
walletOnceBatchList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setWalletOncePrice(i.getSum());
|
||||
v.setWalletOnceCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(walletOnceReduceList)) {
|
||||
walletOnceReduceList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
// v.setWalletOnceReducePrice(i.getSum());
|
||||
v.setWalletOnceReducePrice(Math.abs(i.getSum()));
|
||||
v.setWalletOnceReduceCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(payList)) {
|
||||
payList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setOrderPayPrice(i.getSum());
|
||||
v.setOrderPayCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(refundList)) {
|
||||
refundList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setOrderRefundPrice(i.getSum());
|
||||
v.setOrderRefundCont(i.getCount());
|
||||
});
|
||||
}
|
||||
// 查看盈利流水
|
||||
if (ObjectUtil.isNotEmpty(profitList)) {
|
||||
profitList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setOrderProfitPrice(i.getSum());
|
||||
v.setOrderProfitCont(i.getCount());
|
||||
});
|
||||
}
|
||||
// 查询钱包批量扣减流水
|
||||
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletReduceFuture = CompletableFuture.supplyAsync(() -> {
|
||||
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
|
||||
walletDto.setDeptIds(deptIds);
|
||||
walletDto.setBizTypes(List.of(WalletBizEnum.BATCH.getCode()));
|
||||
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_EXPENSE);
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
walletDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
return resultList;
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
walletDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
|
||||
});
|
||||
return resultListFuture.join();
|
||||
// 查询钱包单次充值流水
|
||||
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletOnceBatchFuture = CompletableFuture.supplyAsync(() -> {
|
||||
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
|
||||
walletDto.setDeptIds(deptIds);
|
||||
walletDto.setBizTypes(List.of(WalletBizEnum.UPDATE.getCode()));
|
||||
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_INCOME);
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
walletDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
walletDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
|
||||
});
|
||||
// 查询钱包单次扣减流水
|
||||
CompletableFuture<List<WalletTransactionSumAndCountVo>> walletOnceReduceFuture = CompletableFuture.supplyAsync(() -> {
|
||||
WalletTransactionSumAndCountDto walletDto = new WalletTransactionSumAndCountDto();
|
||||
walletDto.setDeptIds(deptIds);
|
||||
walletDto.setBizTypes(List.of(WalletBizEnum.UPDATE.getCode()));
|
||||
walletDto.setType(WalletTransactionSumAndCountDto.TYPE_EXPENSE);
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
walletDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
walletDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return remoteWalletTransactionService.sumAndCount(walletDto).getData();
|
||||
});
|
||||
// 查询订单支付流水
|
||||
CompletableFuture<List<HardOrderSumAndCountVo>> payFuture = CompletableFuture.supplyAsync(() -> {
|
||||
HardOrderSumAndCountDto payDto = new HardOrderSumAndCountDto();
|
||||
payDto.setUserDeptIds(deptIds);
|
||||
payDto.setOrderStatusCodes(HardOrderStatusEnum.getPayPrice());
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
payDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
payDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return hardOrderMapper.sumAndCount(payDto);
|
||||
});
|
||||
// 查询订单退款流水
|
||||
CompletableFuture<List<HardOrderSumAndCountVo>> refundFuture = CompletableFuture.supplyAsync(() -> {
|
||||
HardOrderSumAndCountDto refundDto = new HardOrderSumAndCountDto();
|
||||
refundDto.setUserDeptIds(deptIds);
|
||||
refundDto.setOrderStatusCodes(HardOrderStatusEnum.getPayErrorCodes());
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
refundDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
refundDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return hardOrderMapper.sumAndCount(refundDto);
|
||||
});
|
||||
// 消费净次数
|
||||
CompletableFuture<List<HardOrderSumAndCountVo>> profitFuture = CompletableFuture.supplyAsync(() -> {
|
||||
HardOrderSumAndCountDto refundDto = new HardOrderSumAndCountDto();
|
||||
refundDto.setUserDeptIds(deptIds);
|
||||
refundDto.setOrderStatusCodes(HardOrderStatusEnum.getPaySuccessCodes());
|
||||
if (ObjectUtil.isNotEmpty(dto.getCreateTimeList())) {
|
||||
refundDto.setCreateTimeList(dto.getCreateTimeList());
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(dto.getWalletTypeId())) {
|
||||
refundDto.setWalletTypeId(dto.getWalletTypeId());
|
||||
}
|
||||
return hardOrderMapper.sumAndCount(refundDto);
|
||||
});
|
||||
CompletableFuture<Void> allFutures = CompletableFuture.allOf(walletBatchFuture, walletReduceFuture, payFuture, refundFuture, walletOnceBatchFuture, walletOnceReduceFuture, profitFuture);
|
||||
allFutures.join();
|
||||
List<WalletTransactionSumAndCountVo> walletBatchList = walletBatchFuture.join();
|
||||
List<WalletTransactionSumAndCountVo> walletReduceList = walletReduceFuture.join();
|
||||
List<WalletTransactionSumAndCountVo> walletOnceBatchList = walletOnceBatchFuture.join();
|
||||
List<WalletTransactionSumAndCountVo> walletOnceReduceList = walletOnceReduceFuture.join();
|
||||
List<HardOrderSumAndCountVo> payList = payFuture.join();
|
||||
List<HardOrderSumAndCountVo> refundList = refundFuture.join();
|
||||
List<HardOrderSumAndCountVo> profitList = profitFuture.join();
|
||||
// 聚合一下数据
|
||||
for (HardDeptTotalVo v : resultList) {
|
||||
if (ObjectUtil.isNotEmpty(walletBatchList)) {
|
||||
walletBatchList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setWalletPrice(i.getSum());
|
||||
v.setWalletCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(walletReduceList)) {
|
||||
walletReduceList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
// v.setWalletReducePrice(i.getSum());
|
||||
v.setWalletReducePrice(Math.abs(i.getSum()));
|
||||
v.setWalletReduceCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(walletOnceBatchList)) {
|
||||
walletOnceBatchList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setWalletOncePrice(i.getSum());
|
||||
v.setWalletOnceCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(walletOnceReduceList)) {
|
||||
walletOnceReduceList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
// v.setWalletOnceReducePrice(i.getSum());
|
||||
v.setWalletOnceReducePrice(Math.abs(i.getSum()));
|
||||
v.setWalletOnceReduceCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(payList)) {
|
||||
payList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setOrderPayPrice(i.getSum());
|
||||
v.setOrderPayCount(i.getCount());
|
||||
});
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(refundList)) {
|
||||
refundList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setOrderRefundPrice(i.getSum());
|
||||
v.setOrderRefundCont(i.getCount());
|
||||
});
|
||||
}
|
||||
// 查看盈利流水
|
||||
if (ObjectUtil.isNotEmpty(profitList)) {
|
||||
profitList.stream().filter(i -> ObjectUtil.equals(i.getDeptId(), v.getDeptId())).findFirst().ifPresent(i -> {
|
||||
v.setOrderProfitPrice(i.getSum());
|
||||
v.setOrderProfitCont(i.getCount());
|
||||
});
|
||||
}
|
||||
}
|
||||
return resultList;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+3
-11
@@ -56,30 +56,22 @@ public interface RemoteUserService {
|
||||
|
||||
/**
|
||||
* 通过用户id查询用户、角色信息
|
||||
*
|
||||
* @param userId 用户名
|
||||
* @return R
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/user/inner/get-by-user-id")
|
||||
R<UserInfo> getInnerByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
@GetMapping("/user/get-by-user-id")
|
||||
R<UserInfo> getByUserId(@RequestParam("userId") Long userId);
|
||||
|
||||
/**
|
||||
* 通过姓名和手机号查询用户、角色信息
|
||||
*
|
||||
* @param name
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
@NoToken
|
||||
@GetMapping("/user/get-name-and-mobile")
|
||||
R<UserInfo> getUserByNameAndMobile(@RequestParam("name") String name, @RequestParam("mobile") String mobile);
|
||||
|
||||
/**
|
||||
* 根据用户ID获取用户
|
||||
*
|
||||
* @param userIds ID
|
||||
* @return SysUser
|
||||
*/
|
||||
@PostMapping("/user/list")
|
||||
R<List<SysUser>> getUserById(@RequestBody List<Long> userIds);
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ import com.bsd.pjcloud.admin.api.vo.DeptExcelVO;
|
||||
import com.bsd.pjcloud.admin.mapper.SysDeptMapper;
|
||||
import com.bsd.pjcloud.admin.service.SysDeptService;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
|
||||
import com.bsd.pjcloud.common.excel.annotation.RequestExcel;
|
||||
import com.bsd.pjcloud.common.excel.annotation.ResponseExcel;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
|
||||
+11
-9
@@ -101,7 +101,6 @@ public class SysUserController {
|
||||
return R.ok(userService.findUserInfo(user));
|
||||
}
|
||||
|
||||
@Inner
|
||||
@GetMapping("/get-name-and-mobile")
|
||||
public R<UserInfo> getUserByNameAndMobile(@RequestParam("name") String name, @RequestParam("mobile") String mobile) {
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getName, name).eq(SysUser::getPhone, mobile));
|
||||
@@ -113,16 +112,19 @@ public class SysUserController {
|
||||
|
||||
/**
|
||||
* 获取指定用户全部信息
|
||||
*
|
||||
* @return 用户信息
|
||||
*/
|
||||
@Inner
|
||||
@GetMapping("/inner/get-by-user-id")
|
||||
public R getInnerByUserId(@RequestParam Long userId) {
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUserId, userId));
|
||||
if (user == null) return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_USERINFO_EMPTY, userId));
|
||||
return R.ok(userService.findUserInfo(user));
|
||||
}
|
||||
|
||||
@GetMapping("/get-by-user-id")
|
||||
public R getByUserId(@RequestParam Long userId) {
|
||||
SysUser user = userService.getOne(Wrappers.<SysUser>query().lambda().eq(SysUser::getUserId, userId));
|
||||
if (user == null) {
|
||||
return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_USERINFO_EMPTY, userId));
|
||||
}
|
||||
if (user == null) return R.failed(MsgUtils.getMessage(ErrorCodes.SYS_USER_USERINFO_EMPTY, userId));
|
||||
return R.ok(userService.findUserInfo(user));
|
||||
}
|
||||
|
||||
@@ -405,8 +407,8 @@ public class SysUserController {
|
||||
*/
|
||||
@GetMapping("/getUserByMobileOrEmployeeCode")
|
||||
@Inner
|
||||
public R<List<SysUser>> getUserByMobileOrEmployeeCode(@RequestParam(value = "employeeCode",required = false) String employeeCode, @RequestParam("mobile") String mobile) {
|
||||
return R.ok(userService.list(Wrappers.<SysUser>lambdaQuery().eq(StringUtils.isNotBlank(employeeCode),SysUser::getDingtalkEmployeeCode, employeeCode).or().eq(SysUser::getPhone, mobile)));
|
||||
public R<List<SysUser>> getUserByMobileOrEmployeeCode(@RequestParam(value = "employeeCode", required = false) String employeeCode, @RequestParam("mobile") String mobile) {
|
||||
return R.ok(userService.list(Wrappers.<SysUser>lambdaQuery().eq(StringUtils.isNotBlank(employeeCode), SysUser::getDingtalkEmployeeCode, employeeCode).or().eq(SysUser::getPhone, mobile)));
|
||||
}
|
||||
|
||||
@GetMapping("/getUserByMobile")
|
||||
@@ -461,7 +463,7 @@ public class SysUserController {
|
||||
public R<Boolean> checkUsername(@RequestParam("username") String username) {
|
||||
List<SysUser> list = userService.list(Wrappers.<SysUser>lambdaQuery().like(SysUser::getUsername, username));
|
||||
if (!CollUtil.isEmpty(list)) {
|
||||
return R.ok(false);
|
||||
return R.ok(false);
|
||||
}
|
||||
return R.ok(true);
|
||||
}
|
||||
|
||||
+1
@@ -18,6 +18,7 @@ package com.bsd.pjcloud.admin.service.impl;
|
||||
|
||||
import cn.hutool.core.collection.CollUtil;
|
||||
import cn.hutool.core.util.CharUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.core.util.ReflectUtil;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
|
||||
+6
-8
@@ -199,9 +199,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
getSelf().applyFlow(sysUser);
|
||||
} else {
|
||||
// 创建用户默认钱包
|
||||
CompletableFuture.runAsync(() -> {
|
||||
remoteWalletService.createWallet(sysUser.getUserId());
|
||||
});
|
||||
remoteWalletService.createWallet(sysUser.getUserId());
|
||||
remoteWalletService.userChange(sysUser.getUserId(), Boolean.FALSE);
|
||||
}
|
||||
|
||||
@@ -407,9 +405,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
}
|
||||
|
||||
// 创建用户默认钱包
|
||||
CompletableFuture.runAsync(() -> {
|
||||
remoteWalletService.createWallet(userDto.getUserId());
|
||||
});
|
||||
remoteWalletService.createWallet(userDto.getUserId());
|
||||
remoteWalletService.userChange(userDto.getUserId(), Boolean.FALSE);
|
||||
return Boolean.TRUE;
|
||||
}
|
||||
@@ -870,8 +866,10 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
|
||||
updateUser.setProcessStatus(processStatus);
|
||||
updateUser.setProcessTime(LocalDateTime.now());
|
||||
baseMapper.updateById(updateUser);
|
||||
// 创建用户默认钱包
|
||||
remoteWalletService.createWallet(detail.getUserId());
|
||||
if (isConsent) {
|
||||
// 创建用户默认钱包
|
||||
remoteWalletService.createWallet(detail.getUserId());
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("|{}|审批回调意外的错误,dto:|{}|error:|{}|", TAG, JSON.toJSONString(dto), e.getMessage());
|
||||
|
||||
+2
@@ -2,6 +2,7 @@ package com.bsd.pjcloud.wallet.api.entity;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.*;
|
||||
import com.baomidou.mybatisplus.extension.activerecord.Model;
|
||||
import com.bsd.pjcloud.common.core.util.TenantTable;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -15,6 +16,7 @@ import java.time.LocalDateTime;
|
||||
* @date 2024-12-30 09:17:49
|
||||
*/
|
||||
@Data
|
||||
@TenantTable
|
||||
@TableName("wallet_transaction")
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "会员钱包流水表")
|
||||
|
||||
-1
@@ -36,7 +36,6 @@ public interface RemoteWalletService {
|
||||
@GetMapping("/wallet-manage/get-wallet-by-card-number")
|
||||
R<WalletManageEntity> getWalletByCardNumber(@RequestParam String cardNumber);
|
||||
|
||||
@NoToken
|
||||
@GetMapping("/wallet-manage/create-wallet")
|
||||
R<WalletManageEntity> createWallet(@RequestParam Long userId);
|
||||
|
||||
|
||||
-1
@@ -71,7 +71,6 @@ public class WalletManageController {
|
||||
return R.ok(wallet);
|
||||
}
|
||||
|
||||
@Inner
|
||||
@GetMapping("/create-wallet")
|
||||
public R getWallet(@RequestParam Long userId) {
|
||||
walletManageService.createWallet(userId);
|
||||
|
||||
+2
-2
@@ -43,8 +43,8 @@ public class WalletRechargeApplyController {
|
||||
/* ************************************* start callback start ************************************* */
|
||||
@Inner(value = false)
|
||||
@PostMapping("/apply-callback")
|
||||
public void applyCallback(@RequestBody ProcessNodeRecordAssignUserParamDto dto) {
|
||||
walletRechargeApplyService.applyCallback(dto);
|
||||
public void applyCallback(@RequestBody ProcessNodeRecordAssignUserParamDto dto, @RequestParam Long tenantId) {
|
||||
walletRechargeApplyService.applyCallback(dto, tenantId);
|
||||
}
|
||||
/* ************************************* start callback start ************************************* */
|
||||
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public interface WalletRechargeApplyService extends IService<WalletRechargeApply
|
||||
/**
|
||||
* 审批回调
|
||||
*/
|
||||
void applyCallback(ProcessNodeRecordAssignUserParamDto dto);
|
||||
void applyCallback(ProcessNodeRecordAssignUserParamDto dto, Long tenantId);
|
||||
|
||||
void updateBeforePrice(WalletRechargeApplyEntity detail);
|
||||
|
||||
|
||||
+1
-1
@@ -127,7 +127,7 @@ public class WalletCodeUseServiceImpl extends ServiceImpl<WalletCodeUseMapper, W
|
||||
}
|
||||
// 用户用户信息
|
||||
QRCodeExtraDto extraDto = new QRCodeExtraDto();
|
||||
UserInfo user = userService.getByUserId(wallet.getUserId()).getData();
|
||||
UserInfo user = userService.getInnerByUserId(wallet.getUserId()).getData();
|
||||
extraDto = BeanUtils.toBean(user, QRCodeExtraDto.class);
|
||||
extraDto.setWalletId(wallet.getId());
|
||||
extraDto.setWalletCardNumber(wallet.getCardNumber());
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ public class WalletForeignServiceImpl extends ServiceImpl<WalletForeignMapper, W
|
||||
@Override
|
||||
public Long create(WalletForeignDto dto) {
|
||||
// 查询发起人
|
||||
UserInfo userData = userService.getByUserId(dto.getUserId()).getData();
|
||||
UserInfo userData = userService.getInnerByUserId(dto.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userData)) throw new RuntimeException("发起人不存在");
|
||||
dto.setDeptId(userData.getSysUser().getDeptId());
|
||||
dto.setProcessStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
|
||||
+2
-2
@@ -122,7 +122,7 @@ public class WalletFreezeServiceImpl extends ServiceImpl<WalletFreezeMapper, Wal
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long create(WalletFreezeDto dto) {
|
||||
// 查询发起人
|
||||
UserInfo userData = userService.getByUserId(dto.getUserId()).getData();
|
||||
UserInfo userData = userService.getInnerByUserId(dto.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userData)) throw new RuntimeException("发起人不存在");
|
||||
// 判断之前有没有在审核的
|
||||
if (isCheckData(dto.getUserId())) throw new RuntimeException("已提交申请,请勿重复提交");
|
||||
@@ -178,7 +178,7 @@ public class WalletFreezeServiceImpl extends ServiceImpl<WalletFreezeMapper, Wal
|
||||
// 判断之前有没有在审核的
|
||||
if (isCheckData(dto.getUserId())) throw new RuntimeException("已提交申请,请勿重复提交");
|
||||
// 查询发起人
|
||||
UserInfo userData = userService.getByUserId(user.getId()).getData();
|
||||
UserInfo userData = userService.getInnerByUserId(user.getId()).getData();
|
||||
// 查询部门
|
||||
SysDept dept = deptService.getDeptByDeptId(user.getDeptId()).getData();
|
||||
if (ObjectUtil.isEmpty(dept)) throw new RuntimeException("用户部门不存在");
|
||||
|
||||
+5
-6
@@ -1,6 +1,5 @@
|
||||
package com.bsd.pjcloud.wallet.service.impl;
|
||||
|
||||
import cn.hutool.core.codec.Base64;
|
||||
import cn.hutool.core.date.DatePattern;
|
||||
import cn.hutool.core.date.LocalDateTimeUtil;
|
||||
import cn.hutool.core.io.resource.ResourceUtil;
|
||||
@@ -92,7 +91,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
public void createWallet(Long userId, Boolean checkPermission) {
|
||||
UserInfo user = null;
|
||||
if (checkPermission) {
|
||||
user = userService.getByUserId(userId).getData();
|
||||
user = userService.getInnerByUserId(userId).getData();
|
||||
String autoWalletRoleCode = ParamResolver.getStr(CommonRoleConstant.AUTO_CREATE_WALLET);
|
||||
if (ObjectUtil.isEmpty(autoWalletRoleCode)) {
|
||||
log.info("|{}|创建用户电子钱包失败,userId:{},WALLET_AUTO_CREATE参数未配置", TAG, userId);
|
||||
@@ -110,7 +109,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
}
|
||||
List<WalletTypeEntity> list = walletTypeMapper.selectList(new LambdaQueryWrapper<>());
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
if (ObjectUtil.isEmpty(user)) user = userService.getByUserId(userId).getData();
|
||||
if (ObjectUtil.isEmpty(user)) user = userService.getInnerByUserId(userId).getData();
|
||||
for (WalletTypeEntity v : list) {
|
||||
WalletManageEntity wallet = baseMapper.selectOne(new LambdaQueryWrapper<WalletManageEntity>()
|
||||
.eq(WalletManageEntity::getUserId, userId)
|
||||
@@ -218,7 +217,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
WalletManageVo detail = baseMapper.join(walletId);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
// 用户
|
||||
UserInfo userInfo = userService.getByUserId(detail.getUserId()).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(detail.getUserId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(userInfo)) {
|
||||
DataUtil.convertUser(detail, userInfo.getSysUser());
|
||||
}
|
||||
@@ -233,7 +232,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
WalletManageVo result = BeanUtils.toBean(detail, WalletManageVo.class);
|
||||
if (ObjectUtil.isNotEmpty(detail)) {
|
||||
// 用户
|
||||
UserInfo userInfo = userService.getByUserId(detail.getUserId()).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(detail.getUserId()).getData();
|
||||
if (ObjectUtil.isNotEmpty(userInfo)) {
|
||||
DataUtil.convertUser(result, userInfo.getSysUser());
|
||||
}
|
||||
@@ -401,7 +400,7 @@ public class WalletManageServiceImpl extends ServiceImpl<WalletManageMapper, Wal
|
||||
if (ObjectUtil.isEmpty(userId)) return;
|
||||
if (ObjectUtil.isEmpty(isDel)) return;
|
||||
if (!isDel) {
|
||||
UserInfo userInfo = userService.getByUserId(userId).getData();
|
||||
UserInfo userInfo = userService.getInnerByUserId(userId).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) return;
|
||||
SysUser sysUser = userInfo.getSysUser();
|
||||
// 修改钱包部门
|
||||
|
||||
+1
-1
@@ -69,7 +69,7 @@ public class WalletStrideServiceImpl extends ServiceImpl<WalletStrideMapper, Wal
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Long create(WalletStrideDto dto) {
|
||||
// 查询发起人
|
||||
UserInfo userData = userService.getByUserId(dto.getUserId()).getData();
|
||||
UserInfo userData = userService.getInnerByUserId(dto.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userData)) throw new RuntimeException("发起人不存在");
|
||||
dto.setDeptId(userData.getSysUser().getDeptId());
|
||||
dto.setProcessStatus(TaskCheckStatusEnum.PADDING.getCode());
|
||||
|
||||
+44
-43
@@ -17,11 +17,10 @@ import com.bsd.pjcloud.admin.api.feign.RemoteDeptService;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.admin.api.utils.DataUtil;
|
||||
import com.bsd.pjcloud.admin.api.vo.UserVO;
|
||||
import com.bsd.pjcloud.common.core.exception.ErrorCodes;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.CollectionUtils;
|
||||
import com.bsd.pjcloud.common.core.util.MsgUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.data.tenant.TenantContextHolder;
|
||||
import com.bsd.pjcloud.common.excel.vo.ErrorMessage;
|
||||
import com.bsd.pjcloud.common.security.service.PjcloudUser;
|
||||
import com.bsd.pjcloud.common.security.util.SecurityUtils;
|
||||
@@ -167,7 +166,7 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
throw new RuntimeException("最多提交3个申请,请勿重复提交");
|
||||
}
|
||||
// 查询用户
|
||||
UserInfo user = userService.getByUserId(detail.getUserId()).getData();
|
||||
UserInfo user = userService.getInnerByUserId(detail.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(user)) {
|
||||
throw new RuntimeException("发起人不存在");
|
||||
}
|
||||
@@ -292,10 +291,13 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void applyCallback(ProcessNodeRecordAssignUserParamDto dto) {
|
||||
public void applyCallback(ProcessNodeRecordAssignUserParamDto dto, Long tenantId) {
|
||||
if (!flowUtil.checkCallback(dto)) {
|
||||
return;
|
||||
}
|
||||
if (ObjectUtil.isNotEmpty(tenantId) && ObjectUtil.notEqual(tenantId, 1L)) {
|
||||
TenantContextHolder.setTenantId(tenantId);
|
||||
}
|
||||
String processId = dto.getProcessInstanceId();
|
||||
WalletRechargeApplyEntity detail = baseMapper.selectOne(new LambdaQueryWrapper<WalletRechargeApplyEntity>().eq(WalletRechargeApplyEntity::getProcessId, processId));
|
||||
if (ObjectUtil.isEmpty(detail)) {
|
||||
@@ -400,48 +402,47 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl<WalletRechargeAp
|
||||
}
|
||||
|
||||
private void disposeList(List<WalletRechargeApplyVo> list, WalletRechargeApplyDto dto) {
|
||||
if (ObjectUtil.isNotEmpty(list)) {
|
||||
// 用户
|
||||
List<Long> userIds = list.stream().map(WalletRechargeApplyVo::getUserId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
R<List<SysUser>> userList = userService.getUserById(new ArrayList<>(userIds));
|
||||
if (ObjectUtil.isNotEmpty(userList.getData())) {
|
||||
DataUtil.convertUserList(list, CollectionUtils.convertMap(userList.getData(), SysUser::getUserId));
|
||||
}
|
||||
if (ObjectUtil.isEmpty(list)) return;
|
||||
// 用户
|
||||
List<Long> userIds = list.stream().map(WalletRechargeApplyVo::getUserId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(userIds)) {
|
||||
List<SysUser> userList = userService.getUserById(new ArrayList<>(userIds)).getData();
|
||||
if (ObjectUtil.isNotEmpty(userList)) {
|
||||
DataUtil.convertUserList(list, CollectionUtils.convertMap(userList, SysUser::getUserId));
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.stream().map(WalletRechargeApplyVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
R<Map<Long, SysDept>> deptList = deptService.getDeptByDeptIds(deptIds);
|
||||
if (ObjectUtil.isNotEmpty(deptList.getData())) {
|
||||
DataUtil.convertDeptList(list, deptList.getData());
|
||||
}
|
||||
}
|
||||
// 部门
|
||||
List<Long> deptIds = list.stream().map(WalletRechargeApplyVo::getDeptId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(deptIds)) {
|
||||
Map<Long, SysDept> deptList = deptService.getDeptByDeptIds(deptIds).getData();
|
||||
if (ObjectUtil.isNotEmpty(deptList)) {
|
||||
DataUtil.convertDeptList(list, deptList);
|
||||
}
|
||||
// 饭卡类型
|
||||
List<Long> walletTypeIds = list.stream().map(WalletRechargeApplyVo::getWalletTypeId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(walletTypeIds)) {
|
||||
WalletTypeDto walletTypeDto = new WalletTypeDto();
|
||||
walletTypeDto.setWalletTypeIds(walletTypeIds);
|
||||
List<WalletTypeEntity> walletTypeList = walletTypeMapper.list(walletTypeDto);
|
||||
if (ObjectUtil.isNotEmpty(walletTypeList)) {
|
||||
WalletDataUtil.convertWalletTypeList(list, CollectionUtils.convertMap(walletTypeList, WalletTypeEntity::getId));
|
||||
}
|
||||
}
|
||||
// 饭卡类型
|
||||
List<Long> walletTypeIds = list.stream().map(WalletRechargeApplyVo::getWalletTypeId).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(walletTypeIds)) {
|
||||
WalletTypeDto walletTypeDto = new WalletTypeDto();
|
||||
walletTypeDto.setWalletTypeIds(walletTypeIds);
|
||||
List<WalletTypeEntity> walletTypeList = walletTypeMapper.list(walletTypeDto);
|
||||
if (ObjectUtil.isNotEmpty(walletTypeList)) {
|
||||
WalletDataUtil.convertWalletTypeList(list, CollectionUtils.convertMap(walletTypeList, WalletTypeEntity::getId));
|
||||
}
|
||||
// 审批流程
|
||||
if (dto.getIsFindCheckUser()) {
|
||||
List<String> processInstanceIds = list.stream().map(WalletRechargeApplyVo::getProcessId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(processInstanceIds)) {
|
||||
List<TaskDto> taskList = flowUtil.queryProcessInstanceList(SecurityUtils.getUser().getId().toString(), processInstanceIds);
|
||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||
Map<String, TaskDto> taskMap = CollectionUtils.convertMap(taskList, TaskDto::getProcessInstanceId);
|
||||
CollectionUtils.convertList(list, v -> {
|
||||
TaskDto task = taskMap.get(v.getProcessId());
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
v.setIsCheckUser(true);
|
||||
}
|
||||
return v;
|
||||
});
|
||||
}
|
||||
}
|
||||
// 审批流程
|
||||
if (dto.getIsFindCheckUser()) {
|
||||
List<String> processInstanceIds = list.stream().map(WalletRechargeApplyVo::getProcessId).filter(ObjectUtil::isNotEmpty).distinct().toList();
|
||||
if (ObjectUtil.isNotEmpty(processInstanceIds)) {
|
||||
List<TaskDto> taskList = flowUtil.queryProcessInstanceList(SecurityUtils.getUser().getId().toString(), processInstanceIds);
|
||||
if (ObjectUtil.isNotEmpty(taskList)) {
|
||||
Map<String, TaskDto> taskMap = CollectionUtils.convertMap(taskList, TaskDto::getProcessInstanceId);
|
||||
CollectionUtils.convertList(list, v -> {
|
||||
TaskDto task = taskMap.get(v.getProcessId());
|
||||
if (ObjectUtil.isNotEmpty(task)) {
|
||||
v.setIsCheckUser(true);
|
||||
}
|
||||
return v;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ public class WalletRuleJoinServiceImpl extends ServiceImpl<WalletRuleJoinMapper,
|
||||
configVo.setTotalTransferBalance(transferBalanceVo.getSum());
|
||||
}
|
||||
// 查询用户
|
||||
UserInfo userInfo = remoteUserService.getByUserId(sourceWallet.getUserId()).getData();
|
||||
UserInfo userInfo = remoteUserService.getInnerByUserId(sourceWallet.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) {
|
||||
throw new RuntimeException("用户不存在");
|
||||
}
|
||||
|
||||
+1
-1
@@ -254,7 +254,7 @@ public class WalletThirdZyServiceImpl implements WalletThirdZyService {
|
||||
String syncAllMchVersion = getSyncAllMchVersion();
|
||||
for (UserVO v : userVOList) {
|
||||
// 查询用户手机号
|
||||
UserInfo userInfo = remoteUserService.getByUserId(v.getUserId()).getData();
|
||||
UserInfo userInfo = remoteUserService.getInnerByUserId(v.getUserId()).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) {
|
||||
log.error("|{}|syncAllUserGroup用户不存在WalletManageVo|{}|", TAG, JSONUtil.toJsonStr(v));
|
||||
continue;
|
||||
|
||||
+2
-2
@@ -48,12 +48,12 @@ public class FlowUtil {
|
||||
log.error("|{}|请配置跨单位审批流程ID;userId:|{}|businessId:|{}|", TAG, user.getUserId(), businessId);
|
||||
throw new RuntimeException("请配置跨单位审批流程ID");
|
||||
}
|
||||
R<ProcessVO> detail = flowApiFlowService.getDetail(defaultRole);
|
||||
R<Process> detail = flowApiFlowService.getProcessByBusinessKey(defaultRole);
|
||||
if (Optional.of(detail.getData()).map(Process::getId).isEmpty()) {
|
||||
log.error("|{}|未查询到该审批流程;userId:|{}|businessId:|{}|", TAG, user.getUserId(), businessId);
|
||||
throw new RuntimeException("未查询到该审批流程");
|
||||
}
|
||||
ProcessVO processVo = detail.getData();
|
||||
Process processVo = detail.getData();
|
||||
ProcessInstanceParamDto processDto = new ProcessInstanceParamDto();
|
||||
Map<String, Object> dtoMap = null;
|
||||
if (ObjectUtil.isNotEmpty(dto)) {
|
||||
|
||||
Reference in new issue
Block a user