feat:离线订单处理
This commit is contained in:
1 parent
2186f0991a
commit
fc1b8bcfcd
1 file changed
+15
-3
+15
-3
@@ -4,6 +4,8 @@ import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.hutool.extra.spring.SpringUtil;
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.bsd.pjcloud.admin.api.dto.UserInfo;
|
||||
import com.bsd.pjcloud.admin.api.feign.RemoteUserService;
|
||||
import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.hard.api.constant.HardTypeEnum;
|
||||
@@ -57,6 +59,7 @@ public class HardOrderSyncServiceImpl implements HardOrderSyncService {
|
||||
private final RemoteMchService remoteMchService;
|
||||
private final RemoteWalletSettingService walletSettingService;
|
||||
private final RemoteWalletService walletService;
|
||||
private final RemoteUserService userService;
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@@ -84,7 +87,13 @@ public class HardOrderSyncServiceImpl implements HardOrderSyncService {
|
||||
createIdList.add(findOrder.getAndroidOrderCode());
|
||||
continue;
|
||||
}
|
||||
HardOrderEntity order = parseOrder(i, body.getHardwareId(), body.getMerchantId(), merchant.getDeptId());
|
||||
// 查询用户
|
||||
UserInfo userInfo = userService.getByUserId(i.getUserCode()).getData();
|
||||
if (ObjectUtil.isEmpty(userInfo)) {
|
||||
log.error("|{}|同步安卓机离线订单,用户不存在:{}", TAG, JSON.toJSONString(i));
|
||||
continue;
|
||||
}
|
||||
HardOrderEntity order = parseOrder(i, body.getHardwareId(), merchant, merchant.getDeptId(), userInfo);
|
||||
HardParentCarEntity parentCar = parseParentCar(i, body.getMerchantId());
|
||||
List<HardCarEntity> carList = i.getCarList().stream().map(this::parseCar).toList();
|
||||
|
||||
@@ -168,12 +177,15 @@ public class HardOrderSyncServiceImpl implements HardOrderSyncService {
|
||||
return false;
|
||||
}
|
||||
|
||||
public HardOrderEntity parseOrder(OfflineOrder order, Long hardwareId, Long merchantId, Long merchantDeptId) {
|
||||
public HardOrderEntity parseOrder(OfflineOrder order, Long hardwareId, MchManageVo mchDetail, Long merchantDeptId, UserInfo userInfo) {
|
||||
HardOrderEntity res = new HardOrderEntity();
|
||||
res.setAndroidOrderCode(order.getUniqueCode());
|
||||
res.setUserId(order.getUserCode());
|
||||
res.setUserDeptId(userInfo.getSysUser().getDeptId());
|
||||
res.setHardId(hardwareId);
|
||||
res.setMerchantId(merchantId);
|
||||
res.setMerchantId(mchDetail.getId());
|
||||
res.setMerchantDeptId(mchDetail.getDeptId());
|
||||
res.setMerchantType(mchDetail.getTypes());
|
||||
res.setDeptId(merchantDeptId);
|
||||
res.setSysType(order.getSysType().getType());
|
||||
res.setWalletId(order.getWalletId());
|
||||
|
||||
Reference in new issue
Block a user