新增套餐bug修改,太米支付修正

This commit is contained in:
SjS 2025-05-20 15:10:39 +08:00
parent e0c8100eee
commit 6b7eae8354
6 changed files with 23 additions and 29 deletions

View File

@ -9,7 +9,7 @@ public class TmTradeInfo {
/**
* 太米系统流水Id
*/
private Integer id;
private String id;
/**
* 第三方内部流水号

View File

@ -195,20 +195,13 @@ public class BoothServiceImpl implements BoothService {
query.setUserId(userId);
query.setTime(LocalDateTime.now());
List<BoothVO> list = boothMapper.selectBoothList(query);
if (list != null && !list.isEmpty()){
return CollectionUtils.firstElement(list);
};
for (BoothVO vo : list) {
vo.setUserId(null);
boothMapper.updateBooth(vo);
}
BoothVO booth = boothMapper.selectBoothByBoothNo(boothNo);
ServiceUtil.assertion(booth == null, "当前卡座不存在");
if (booth.getUserId() != null && booth.getExpiredTime() != null && booth.getExpiredTime().isAfter(LocalDateTime.now())) {
// 卡座未过期被其他用户绑定
ServiceUtil.assertion(!booth.getUserId().equals(userId), "卡座已被绑定");
// 卡座未过期被当前用户绑定
ServiceUtil.assertion(booth.getUserId().equals(userId), "请勿重复绑定该设备");
} else {
booth.setExpiredTime(LocalDateTime.now().plusMinutes(30));
booth.setUserId(userId);
}
booth.setUserId(userId);
int i = boothMapper.updateBooth(booth);
ServiceUtil.assertion(i == 0, "操作失败");
return booth;
@ -286,14 +279,14 @@ public class BoothServiceImpl implements BoothService {
deviceQuery.setBoothNo(booth.getBoothNo());
List<DeviceVO> deviceVOList = deviceMapper.selectDeviceList(deviceQuery);
ServiceUtil.assertion(deviceVOList.isEmpty(), "当前卡座下无设备");
// 设备相关校验
if (deviceVOList != null && !deviceVOList.isEmpty()) {
deviceVOList.forEach(deviceVO -> {
ServiceUtil.assertion(deviceVO == null || deviceVO.getDeviceId() == null, "设备不存在");
ServiceUtil.assertion(StringUtils.isAllBlank(deviceVO.getMac(), deviceVO.getMac2()), "设备MAC号为空");
ServiceUtil.assertion(deviceVO.getDuration() == null, "设备编号为%s的设备暂未设置开启时长", deviceVO.getDeviceNo());
});
}
deviceVOList.forEach(deviceVO -> {
ServiceUtil.assertion(deviceVO == null || deviceVO.getDeviceId() == null, "设备不存在");
ServiceUtil.assertion(StringUtils.isAllBlank(deviceVO.getMac(), deviceVO.getMac2()), "设备MAC号为空");
ServiceUtil.assertion(deviceVO.getDuration() == null, "设备编号为%s的设备暂未设置开启时长", deviceVO.getDeviceNo());
});
// 新建IotVO 返回数据库操作与物联网操作结果
DeviceIotVO iotVO = new DeviceIotVO();

View File

@ -8,6 +8,7 @@ import org.springframework.stereotype.Service;
@Service
public class SuitConverterImpl implements SuitConverter {
@Override
public Suit toPoByCreate(Suit data) {
if (data == null) {
@ -15,7 +16,6 @@ public class SuitConverterImpl implements SuitConverter {
}
Suit po = new Suit();
// 设置基本信息
po.setUserId(data.getUserId());
po.setStoreId(data.getStoreId());
po.setOrderNum(data.getOrderNum());
po.setLightingNums(data.getLightingNums());

View File

@ -65,6 +65,8 @@ public class SuitServiceImpl implements SuitService
@Override
public int insertSuit(Suit suit)
{
StoreVO store = storeService.selectStoreById(suit.getStoreId());
suit.setUserId(store.getUserId());
suit.setCreateTime(DateUtils.getNowDate());
return suitMapper.insertSuit(suit);
}
@ -78,9 +80,9 @@ public class SuitServiceImpl implements SuitService
@Override
public int updateSuit(Suit suit)
{
StoreVO StoreVO = storeService.selectStoreById(suit.getStoreId());
ServiceUtil.assertion(StoreVO==null,"当前店铺不存在");
suit.setUserId(StoreVO.getUserId());
StoreVO store = storeService.selectStoreById(suit.getStoreId());
ServiceUtil.assertion(store==null,"当前店铺不存在");
suit.setUserId(store.getUserId());
return suitMapper.updateSuit(suit);
}

View File

@ -32,12 +32,12 @@ public class AppBoothController extends BaseController {
private BoothService boothService;
@ApiOperation("爆灯")
@PutMapping("/{boothNo}/lighting")
public AjaxResult lighting(@PathVariable @ApiParam("设备id") String boothNo,boolean requiredIot) {
if (boothNo == null) {
@PutMapping("/{boothId}/lighting")
public AjaxResult lighting(@PathVariable @ApiParam("设备id") Long boothId,boolean requiredIot) {
if (boothId == null) {
return error("卡座编号不能为空");
}
BoothVO booth = boothService.selectBoothByBoothNo(boothNo);
BoothVO booth = boothService.selectBoothByBoothId(boothId);
if (booth == null) {
return error("当前卡座信息不存在");
}

View File

@ -98,7 +98,6 @@ public class SuitController extends BaseController
if (!userValidator.canView(suit.getUserId())) {
suit.setUserId(getUserId());
}
suit.setUserId(getUserId());
suitConverter.toPoByCreate(suit);
return toAjax(suitService.insertSuit(suit));
}