|
|
@@ -9,6 +9,9 @@ import com.td.boss.game.comcntorder.vo.ComCntOrderVo;
|
|
|
import com.td.boss.game.comconfigland.pojo.ComConfigLand;
|
|
|
import com.td.boss.game.comconfigland.service.ComConfigLandService;
|
|
|
import com.td.boss.game.comconfigland.vo.ComConfigLandVo;
|
|
|
+import com.td.boss.game.commallother.pojo.ComMallOther;
|
|
|
+import com.td.boss.game.commallother.service.ComMallOtherService;
|
|
|
+import com.td.boss.game.commallother.vo.ComMallOtherVo;
|
|
|
import com.td.boss.game.commallseed.pojo.ComMallSeed;
|
|
|
import com.td.boss.game.commallseed.service.ComMallSeedService;
|
|
|
import com.td.boss.game.commallseed.vo.ComMallSeedVo;
|
|
|
@@ -85,6 +88,8 @@ public class ComSnbFreezeController extends CommonController<ComSnbFreezeVo, Com
|
|
|
@Autowired
|
|
|
private RedisLock redisLock;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ private ComMallOtherService comMallOtherService;
|
|
|
|
|
|
|
|
|
/**
|
|
|
@@ -367,6 +372,14 @@ public class ComSnbFreezeController extends CommonController<ComSnbFreezeVo, Com
|
|
|
comCntOrderVo.setItemType(item_type);
|
|
|
comCntOrderVo.setPayType(pay_type);
|
|
|
comCntOrderVo.setTxHash(tx_hash);
|
|
|
+
|
|
|
+ if (Double.parseDouble(pay_amount) <= 0) {
|
|
|
+ comCntOrderVo.setCntDescribe("非法操作pay_amount CNT:" + pay_amount);
|
|
|
+ comCntOrderService.save(comCntOrderVo);
|
|
|
+ result.put("msg", "非法操作!");
|
|
|
+ return Result.of(result);
|
|
|
+ }
|
|
|
+
|
|
|
if (comCntOrderVo.getPayType().equals(1) //3个月
|
|
|
) {
|
|
|
comCntOrderVo.setCntDescribe("购买土地租凭");
|
|
|
@@ -480,6 +493,20 @@ public class ComSnbFreezeController extends CommonController<ComSnbFreezeVo, Com
|
|
|
result.put("leaseLand", CopyUtil.copy(comPlayerLand, ComPlayerLandSimpleVo.class));
|
|
|
|
|
|
} else if (comCntOrderVo.getPayType().equals(2)) {
|
|
|
+ //获取当前防护包价格,判断
|
|
|
+ ComMallOther comMallOther = comMallOtherService.findByOtherType(2);
|
|
|
+ if(comMallOther == null){
|
|
|
+ comCntOrderVo.setCntDescribe("非法操作 comMallOther is null");
|
|
|
+ comCntOrderService.save(comCntOrderVo);
|
|
|
+ result.put("msg", "商品不存在!");
|
|
|
+ return Result.of(result);
|
|
|
+ }
|
|
|
+ if(!comMallOther.getPriceCnt().equals(pay_amount)){
|
|
|
+ comCntOrderVo.setCntDescribe("非法操作 pay_amount !");
|
|
|
+ comCntOrderService.save(comCntOrderVo);
|
|
|
+ result.put("msg", "pay_amount error!");
|
|
|
+ return Result.of(result);
|
|
|
+ }
|
|
|
comCntOrderVo.setCntDescribe("自然灾害防护");
|
|
|
// todo 每购买一次防护,插入一条记录 ?
|
|
|
ComPlayerDisasterProtectedVo comPlayerDisasterProtected = new ComPlayerDisasterProtectedVo();
|
|
|
@@ -491,6 +518,20 @@ public class ComSnbFreezeController extends CommonController<ComSnbFreezeVo, Com
|
|
|
comPlayerDisasterProtectedService.save(comPlayerDisasterProtected);
|
|
|
|
|
|
} else if (comCntOrderVo.getPayType().equals(3)) {
|
|
|
+ //获取当前防护包价格,判断
|
|
|
+ ComMallOther comMallOther = comMallOtherService.findByOtherType(3);
|
|
|
+ if(comMallOther == null){
|
|
|
+ comCntOrderVo.setCntDescribe("非法操作 comMallOther is null");
|
|
|
+ comCntOrderService.save(comCntOrderVo);
|
|
|
+ result.put("msg", "商品不存在!");
|
|
|
+ return Result.of(result);
|
|
|
+ }
|
|
|
+ if(!comMallOther.getPriceCnt().equals(pay_amount)){
|
|
|
+ comCntOrderVo.setCntDescribe("非法操作 pay_amount !");
|
|
|
+ comCntOrderService.save(comCntOrderVo);
|
|
|
+ result.put("msg", "pay_amount error!");
|
|
|
+ return Result.of(result);
|
|
|
+ }
|
|
|
comCntOrderVo.setCntDescribe("野兽防护");
|
|
|
// todo 每购买一次防护,插入一条记录 ?
|
|
|
ComPlayerDisasterProtectedVo comPlayerDisasterProtected = new ComPlayerDisasterProtectedVo();
|