Commit 5e7ba8fb by 吕明尚

房间套餐增加时长和使用时长匹配

parent 558ce6db
...@@ -78,7 +78,7 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, SPack> implements I ...@@ -78,7 +78,7 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, SPack> implements I
public int insertPack(SPack sPack) { public int insertPack(SPack sPack) {
sPack.setCreateTime(DateUtils.getNowDate()); sPack.setCreateTime(DateUtils.getNowDate());
if (sPack.getType().equals(YesNoEnum.yes.getIndex())) { if (sPack.getType().equals(YesNoEnum.yes.getIndex())) {
if ((Integer.parseInt(sPack.getPackaEndPeriod()) - Integer.parseInt(sPack.getPackaStartPeriod())) != Integer.parseInt(sPack.getDuration())) { if ((Double.parseDouble(sPack.getPackaEndPeriod()) - Double.parseDouble(sPack.getPackaStartPeriod())) != Double.parseDouble(sPack.getDuration())) {
throw new BaseException("套餐时长和使用时长不匹配!"); throw new BaseException("套餐时长和使用时长不匹配!");
} }
} }
...@@ -95,7 +95,7 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, SPack> implements I ...@@ -95,7 +95,7 @@ public class PackServiceImpl extends ServiceImpl<PackMapper, SPack> implements I
public int updatePack(SPack SPack) { public int updatePack(SPack SPack) {
SPack.setUpdateTime(DateUtils.getNowDate()); SPack.setUpdateTime(DateUtils.getNowDate());
if (SPack.getType().equals(YesNoEnum.yes.getIndex())) { if (SPack.getType().equals(YesNoEnum.yes.getIndex())) {
if ((Integer.parseInt(SPack.getPackaEndPeriod()) - Integer.parseInt(SPack.getPackaStartPeriod())) != Integer.parseInt(SPack.getDuration())) { if ((Double.parseDouble(SPack.getPackaEndPeriod()) - Double.parseDouble(SPack.getPackaStartPeriod())) != Double.parseDouble(SPack.getDuration())) {
throw new BaseException("套餐时长和使用时长不匹配!"); throw new BaseException("套餐时长和使用时长不匹配!");
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment