Commit a8855b17 by 周君强

调整:

1.优化植物成熟掉落物品; 2.去除种子
parent fddc0927
...@@ -7,21 +7,17 @@ public class Constants { ...@@ -7,21 +7,17 @@ public class Constants {
*/ */
public static final int ITEM_TYPE_MONEY = 1; public static final int ITEM_TYPE_MONEY = 1;
/** /**
* 种子-2
*/
public static final int ITEM_TYPE_SEED = 2;
/**
* 果实-3 * 果实-3
*/ */
public static final int ITEM_TYPE_FRUIT = 3; public static final int ITEM_TYPE_FRUIT = 2;
/** /**
* 材料-4 * 材料-4
*/ */
public static final int ITEM_TYPE_MATERIAL = 4; public static final int ITEM_TYPE_MATERIAL = 3;
/** /**
* 其他-5 * 其他-5
*/ */
public static final int ITEM_TYPE_OTHER = 5; public static final int ITEM_TYPE_OTHER = 4;
/** /**
...@@ -89,6 +85,10 @@ public class Constants { ...@@ -89,6 +85,10 @@ public class Constants {
* 请求的名称不存在 * 请求的名称不存在
*/ */
public static final int REQ_NON = -1; public static final int REQ_NON = -1;
/**
* 请求的名称随机
*/
public static final int REQ_RANDOM = -2;
......
...@@ -179,6 +179,7 @@ public class InitSysServlet implements InitializingBean { ...@@ -179,6 +179,7 @@ public class InitSysServlet implements InitializingBean {
PlantPeriodDto period = new PlantPeriodDto(); PlantPeriodDto period = new PlantPeriodDto();
period.setStartTime(plantPeriod.getStartTime().multiply(BigDecimal.valueOf(plantPojo.getFruitMatureTime())).longValue()); period.setStartTime(plantPeriod.getStartTime().multiply(BigDecimal.valueOf(plantPojo.getFruitMatureTime())).longValue());
period.setEndTime(plantPeriod.getEndTime().multiply(BigDecimal.valueOf(plantPojo.getFruitMatureTime())).longValue()); period.setEndTime(plantPeriod.getEndTime().multiply(BigDecimal.valueOf(plantPojo.getFruitMatureTime())).longValue());
period.setSubTime(period.getEndTime() - period.getStartTime());
periodMap.put(plantPeriod.getId(), period); periodMap.put(plantPeriod.getId(), period);
} }
periodTempMap.put(plantPojo.getId(), periodMap); periodTempMap.put(plantPojo.getId(), periodMap);
...@@ -187,7 +188,7 @@ public class InitSysServlet implements InitializingBean { ...@@ -187,7 +188,7 @@ public class InitSysServlet implements InitializingBean {
log.info("缓存中植物生长周期信息:" + TimingAcquisition.plantMap); log.info("缓存中植物生长周期信息:" + TimingAcquisition.plantMap);
log.info("植物生长周期缓存完成"); log.info("植物生长周期缓存完成");
//缓存附加/掉落物品母集 /* //缓存附加/掉落物品母集
Map<Integer, AddItemSetDto> addItemSetMap = new ConcurrentHashMap<>(); Map<Integer, AddItemSetDto> addItemSetMap = new ConcurrentHashMap<>();
List<AddItemSetDto> addItemSetPojoList = addItemSetMapper.searchIds(); List<AddItemSetDto> addItemSetPojoList = addItemSetMapper.searchIds();
for (AddItemSetDto addItemSet : addItemSetPojoList) { for (AddItemSetDto addItemSet : addItemSetPojoList) {
...@@ -205,7 +206,7 @@ public class InitSysServlet implements InitializingBean { ...@@ -205,7 +206,7 @@ public class InitSysServlet implements InitializingBean {
} }
TimingAcquisition.addItemMap.putAll(addItemMap); TimingAcquisition.addItemMap.putAll(addItemMap);
log.info("缓存中物品子集的信息" + TimingAcquisition.addItemMap); log.info("缓存中物品子集的信息" + TimingAcquisition.addItemMap);
log.info("物品子集的信息缓存完成"); log.info("物品子集的信息缓存完成");*/
//缓存物品配置信息 //缓存物品配置信息
Map<Integer, ItemPojo> itemMap = new ConcurrentHashMap<>(); Map<Integer, ItemPojo> itemMap = new ConcurrentHashMap<>();
......
...@@ -158,7 +158,6 @@ public class TimingAcquisition { ...@@ -158,7 +158,6 @@ public class TimingAcquisition {
//初始化背包,后期删除 //初始化背包,后期删除
BackPackDto backPack= new BackPackDto(); //定义背包 BackPackDto backPack= new BackPackDto(); //定义背包
ItemBagDto moneyBag = new ItemBagDto(); //定义背包里的货币袋 ItemBagDto moneyBag = new ItemBagDto(); //定义背包里的货币袋
ItemBagDto seedBag = new ItemBagDto(); //定义背包里的种子袋
ItemBagDto materialBag = new ItemBagDto(); //定义背包里的材料袋 ItemBagDto materialBag = new ItemBagDto(); //定义背包里的材料袋
ItemDto money = new ItemDto(); ItemDto money = new ItemDto();
...@@ -166,13 +165,6 @@ public class TimingAcquisition { ...@@ -166,13 +165,6 @@ public class TimingAcquisition {
money.setItemNum(1000); money.setItemNum(1000);
moneyBag.add(1, money); moneyBag.add(1, money);
for (int i = 3; i < 12; i++) {
ItemDto seed = new ItemDto();
seed.setItemId(i);
seed.setItemNum(800+i);
seedBag.add(i, seed);
}
ItemDto material = new ItemDto(); ItemDto material = new ItemDto();
material.setItemId(12); material.setItemId(12);
material.setItemNum(20); material.setItemNum(20);
...@@ -182,8 +174,7 @@ public class TimingAcquisition { ...@@ -182,8 +174,7 @@ public class TimingAcquisition {
backPack.setCreateTime(DateUtil.getCurrentTime()); backPack.setCreateTime(DateUtil.getCurrentTime());
backPack.setUpdateTime(DateUtil.getCurrentTime()); backPack.setUpdateTime(DateUtil.getCurrentTime());
backPack.add(1, moneyBag); backPack.add(1, moneyBag);
backPack.add(2, seedBag); backPack.add(3, materialBag);
backPack.add(4, materialBag);
backpackMap.put("test", backPack); backpackMap.put("test", backPack);
//初始化花园 //初始化花园
...@@ -277,22 +268,6 @@ public class TimingAcquisition { ...@@ -277,22 +268,6 @@ public class TimingAcquisition {
} }
/** /**
* 根据种子id获取植物信息
*/
public static PlantPojo getPlantInfoBySeedId(Integer seedId) {
Iterator<Map.Entry<Integer, PlantPojo>> iterator = plantMap.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Integer, PlantPojo> entry = iterator.next();
PlantPojo plant = entry.getValue();
if (seedId.equals(plant.getSeedId())) {
return plant;
}
}
return null;
}
/**
* 根据果实id获取植物信息 * 根据果实id获取植物信息
*/ */
public static PlantPojo getPlantInfoByFruitId(Integer fruitId) { public static PlantPojo getPlantInfoByFruitId(Integer fruitId) {
......
...@@ -24,7 +24,7 @@ import java.util.*; ...@@ -24,7 +24,7 @@ import java.util.*;
public class PlantGrowSchedule { public class PlantGrowSchedule {
private Logger log = LoggerFactory.getLogger(PlantGrowSchedule.class); private Logger log = LoggerFactory.getLogger(PlantGrowSchedule.class);
@Scheduled(cron = "0/5 * * * * ?") // @Scheduled(cron = "0/5 * * * * ?")
public void PlantGrow() { public void PlantGrow() {
log.info("开始进行植物生长!"); log.info("开始进行植物生长!");
Iterator<Map.Entry<String, GardenerDto>> iterator = TimingAcquisition.gardenerMap.entrySet().iterator(); Iterator<Map.Entry<String, GardenerDto>> iterator = TimingAcquisition.gardenerMap.entrySet().iterator();
...@@ -104,14 +104,14 @@ public class PlantGrowSchedule { ...@@ -104,14 +104,14 @@ public class PlantGrowSchedule {
ItemDto fruit = new ItemDto(); ItemDto fruit = new ItemDto();
//产生的果实数量,不同等级的花圃能提供不同的收获加成 //产生的果实数量,不同等级的花圃能提供不同的收获加成
//花圃中植物能产生的果实数量 //花圃中植物能产生的果实数量
Integer fruitNum = TimingAcquisition.plantMap.get(nurseryInfo.getPlantId()).getFruitNum() * nurseryInfo.getNumber(); int fruitNum = TimingAcquisition.plantMap.get(nurseryInfo.getPlantId()).getFruitNum() * nurseryInfo.getNumber();
//花圃收获加成 //花圃收获加成
Integer totalNum = nurseryConfig.getAddHarvest().add(new BigDecimal(1)).multiply(new BigDecimal(fruitNum)).intValue(); Integer totalNum = nurseryConfig.getAddHarvest().add(new BigDecimal(1)).multiply(new BigDecimal(fruitNum)).intValue();
fruit.setItemId(TimingAcquisition.plantMap.get(nurseryInfo.getPlantId()).getFruitId()); fruit.setItemId(TimingAcquisition.plantMap.get(nurseryInfo.getPlantId()).getFruitId());
fruit.setItemNum(totalNum); fruit.setItemNum(totalNum);
log.info("收获的果实:" + fruit); log.info("收获的果实:" + fruit);
Integer addItemSetId = TimingAcquisition.plantMap.get(nurseryInfo.getPlantId()).getAddItemSetId(); PlantPojo plant = TimingAcquisition.plantMap.get(nurseryInfo.getPlantId());
List<ItemDto> dropItems = RandomDropUtil.dropItem(addItemSetId); List<ItemDto> dropItems = RandomDropUtil.plantDropItem(plant);
nurseryInfo.setHarvestFruit(fruit); nurseryInfo.setHarvestFruit(fruit);
nurseryInfo.setDropItems(dropItems); nurseryInfo.setDropItems(dropItems);
log.info("所有掉落物品:" + dropItems); log.info("所有掉落物品:" + dropItems);
......
package com.qiwuai.garden.common.schedule; package com.qiwuai.garden.common.schedule;
import com.qiwuai.garden.common.Constants;
import com.qiwuai.garden.common.TimingAcquisition;
import com.qiwuai.garden.dto.BackPackDto;
import com.qiwuai.garden.dto.ItemBagDto;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
import org.springframework.util.StringUtils;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;
import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledExecutorService;
import java.util.concurrent.TimeUnit; import java.util.concurrent.TimeUnit;
@Slf4j @Component
@EnableScheduling //启用多线程定时任务 @EnableScheduling //启用多线程定时任务
@EnableAsync //启用异步执行 @EnableAsync //启用异步执行
public class ScheduleTask { public class ScheduleTask {
private volatile int sec; Logger log = LoggerFactory.getLogger(ScheduleTask.class);
private volatile int curSec;
//定时投喂宠物,消耗物品
public ScheduleTask(int sec) throws InterruptedException { // @Scheduled(cron = "0/5 * * * * ?")
this.sec = sec; public void petFeeding() {
this.curSec = sec; log.info("开始投喂所有宠物");
System.out.println("开始倒计时" + sec + "秒"); //遍历所有玩家
ScheduledExecutorService exec = Executors.newScheduledThreadPool(2); for (String uid : TimingAcquisition.gardenerMap.keySet()) {
exec.scheduleAtFixedRate(new task(), 0, 1, TimeUnit.SECONDS); //优先投喂宠物栏中的宠物
// TimeUnit.SECONDS.sleep(sec); //获取当前玩家的背包
if (curSec == 0) { BackPackDto backPack = TimingAcquisition.gardenerMap.get(uid).getBackPack();
exec.shutdown(); //获取果实袋
} ItemBagDto fruitBag = backPack.getItemBags().get(Constants.ITEM_TYPE_FRUIT);
System.out.println("over!"); //获取材料袋
} ItemBagDto materialBag = backPack.getItemBags().get(Constants.ITEM_TYPE_MATERIAL);
//获取其他袋
public class task implements Runnable { ItemBagDto otherBag = backPack.getItemBags().get(Constants.ITEM_TYPE_OTHER);
@Override
public void run() {
System.out.println("倒计时:" + curSec + "秒");
curSec = curSec - 1;
} }
} }
public static void main(String[] args) throws InterruptedException {
new ScheduleTask(10);
}
} }
package com.qiwuai.garden.common.utils; package com.qiwuai.garden.common.utils;
import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.time.DayOfWeek; import java.time.DayOfWeek;
import java.time.LocalDate; import java.time.LocalDate;
...@@ -18,7 +19,7 @@ import java.util.List; ...@@ -18,7 +19,7 @@ import java.util.List;
public class DateUtil { public class DateUtil {
/** /**
* 获取当前时间 * 获取当前时间
* @return * @return String
*/ */
public static String currentTimes(){ public static String currentTimes(){
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
...@@ -35,6 +36,21 @@ public class DateUtil { ...@@ -35,6 +36,21 @@ public class DateUtil {
String format = df.format(new Date());// new Date()为获取当前系统时间 String format = df.format(new Date());// new Date()为获取当前系统时间
return format; return format;
} }
/**
* 当前时间加上毫秒
* @return String
*/
public static String addTime(String time, int sub) throws ParseException {
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");//设置日期格式
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式
Date dt = sdf.parse(time);
Calendar newTime = Calendar.getInstance();
newTime.setTime(dt);
newTime.add(Calendar.SECOND, sub);
Date newDt = newTime.getTime();
return sdf.format(newDt);
}
/** /**
* 获取今天的时间范围 * 获取今天的时间范围
...@@ -327,9 +343,9 @@ public class DateUtil { ...@@ -327,9 +343,9 @@ public class DateUtil {
return dataList; return dataList;
} }
public static void main(String[] args) { public static void main(String[] args) throws ParseException {
List<String> thisYear = getTheYearBeforeLast(); String time = addTime("20220525165212", 76);
System.out.println(thisYear.toString()); System.out.println(time);
} }
......
...@@ -48,6 +48,9 @@ public class RequestConversionUtil { ...@@ -48,6 +48,9 @@ public class RequestConversionUtil {
if (!StringUtils.isEmpty(nurseryId)) { if (!StringUtils.isEmpty(nurseryId)) {
operationRequest.setNurseryId(nurseryId); operationRequest.setNurseryId(nurseryId);
} }
if (nurseryName.equals("随机")) {
operationRequest.setNurseryId(Constants.REQ_RANDOM);
}
} }
//存在植物名称 //存在植物名称
String plantName = callRequest.get植物名称(); String plantName = callRequest.get植物名称();
...@@ -56,6 +59,9 @@ public class RequestConversionUtil { ...@@ -56,6 +59,9 @@ public class RequestConversionUtil {
if (!StringUtils.isEmpty(plantId)) { if (!StringUtils.isEmpty(plantId)) {
operationRequest.setPlantId(plantId); operationRequest.setPlantId(plantId);
} }
if (plantName.equals("随机")) {
operationRequest.setPlantId(Constants.REQ_RANDOM);
}
} }
//存在技能名称 //存在技能名称
String skillName = callRequest.get技能名称(); String skillName = callRequest.get技能名称();
......
package com.qiwuai.garden.common.utils; package com.qiwuai.garden.common.utils;
import com.qiwuai.garden.common.Constants; import com.qiwuai.garden.common.Constants;
import com.qiwuai.garden.dto.DropItemNumDto;
import com.qiwuai.garden.dto.ItemDto; import com.qiwuai.garden.dto.ItemDto;
import com.qiwuai.garden.dto.PlantDto; import com.qiwuai.garden.dto.PlantDto;
...@@ -17,9 +18,9 @@ public class TypeConvertUtil { ...@@ -17,9 +18,9 @@ public class TypeConvertUtil {
*/ */
public static List<ItemDto> itemString2List(String param) { public static List<ItemDto> itemString2List(String param) {
List<ItemDto> itemDtoList = new ArrayList<>(); List<ItemDto> itemDtoList = new ArrayList<>();
String[] itemIdNums = param.split(","); String[] itemIdNums = param.split(";");
for (String s : itemIdNums) { for (String s : itemIdNums) {
String[] itemIdNum = s.split("/"); String[] itemIdNum = s.split("\\|");
ItemDto itemDto = new ItemDto(); ItemDto itemDto = new ItemDto();
itemDto.setItemId(Integer.valueOf(itemIdNum[0])); itemDto.setItemId(Integer.valueOf(itemIdNum[0]));
itemDto.setItemNum(Integer.valueOf(itemIdNum[1])); itemDto.setItemNum(Integer.valueOf(itemIdNum[1]));
...@@ -29,15 +30,15 @@ public class TypeConvertUtil { ...@@ -29,15 +30,15 @@ public class TypeConvertUtil {
} }
/** /**
* 将植物“1003/100,1567/20”转成“{}” * 将植物“1003|100;1567|20”转成“{}”
* @param param * @param param
* @return List<PlantDto> * @return List<PlantDto>
*/ */
public static List<PlantDto> plantString2List(String param) { public static List<PlantDto> plantString2List(String param) {
List<PlantDto> plantDtoList = new ArrayList<>(); List<PlantDto> plantDtoList = new ArrayList<>();
String[] itemIdNums = param.split(","); String[] itemIdNums = param.split(";");
for (String s : itemIdNums) { for (String s : itemIdNums) {
String[] itemIdNum = s.split("/"); String[] itemIdNum = s.split("\\|");
PlantDto plantDto = new PlantDto(); PlantDto plantDto = new PlantDto();
plantDto.setPlantId(Integer.valueOf(itemIdNum[0])); plantDto.setPlantId(Integer.valueOf(itemIdNum[0]));
plantDto.setNumber(Integer.valueOf(itemIdNum[1])); plantDto.setNumber(Integer.valueOf(itemIdNum[1]));
...@@ -47,11 +48,32 @@ public class TypeConvertUtil { ...@@ -47,11 +48,32 @@ public class TypeConvertUtil {
} }
/** /**
* 将掉落物品数量“1003|100;1567|20”转成“{}”
* @param param
* @return List<PlantDto>
*/
public static List<DropItemNumDto> dropItemNum2List(String param) {
List<DropItemNumDto> dropItemNumList = new ArrayList<>();
String[] itemIdNums = param.split(";");
for (String s : itemIdNums) {
String[] itemIdNum = s.split("\\|");
DropItemNumDto dropItemNum = new DropItemNumDto();
dropItemNum.setDropMin(Integer.valueOf(itemIdNum[0]));
dropItemNum.setDropMax(Integer.valueOf(itemIdNum[1]));
dropItemNumList.add(dropItemNum);
}
return dropItemNumList;
}
/**
* 将中文的{'一','二',...}转成数字{1,2,...} * 将中文的{'一','二',...}转成数字{1,2,...}
* @param param * @param param
* @return Integer * @return Integer
*/ */
public static Integer change2Integer(String param) { public static Integer change2Integer(String param) {
if (param.equals("随机")) {
return Constants.REQ_RANDOM;
}
int i = 0; int i = 0;
char[] chNum = new char[]{'一','二','三','四','五','六','七','八','九','十'}; char[] chNum = new char[]{'一','二','三','四','五','六','七','八','九','十'};
char[] chars = param.toCharArray(); char[] chars = param.toCharArray();
...@@ -87,8 +109,39 @@ public class TypeConvertUtil { ...@@ -87,8 +109,39 @@ public class TypeConvertUtil {
return i; return i;
} }
public static void main(String[] args) { /**
String s = "1003/100,1567/20,1389/120"; * 合并两个list数组,元素为对象
System.out.println(s + "转换后的结果:" + itemString2List(s)); * @param list1
* @param list2
* @return List<ItemDto>
*/
public static List<ItemDto> listMerge(List<ItemDto> list1, List<ItemDto> list2) {
List<ItemDto> totalList = new ArrayList<>();
boolean[] found = new boolean[list2.size()];
//合并两个list数组
for (ItemDto plantItem : list1) {
boolean sign = false;
for (int i = 0; i < list2.size(); i++) {
if (plantItem.getItemId().equals(list2.get(i).getItemId()) && !found[i]) {
ItemDto item = new ItemDto();
item.setItemId(plantItem.getItemId());
item.setItemNum(plantItem.getItemNum() + list2.get(i).getItemNum());
totalList.add(item);
found[i] = true; //标记list2的该元素已经访问过
sign = true; //标记list1的该元素已经访问过
break;
}
}
if (!sign) {
totalList.add(plantItem);
}
}
//添加剩余元素
for (int j = 0; j < found.length; j++) {
if (!found[j]) {
totalList.add(list2.get(j));
}
}
return totalList;
} }
} }
...@@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody; ...@@ -18,6 +18,8 @@ import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.text.ParseException;
@RestController @RestController
@RequestMapping("/secretGarden") @RequestMapping("/secretGarden")
public class CommonController { public class CommonController {
...@@ -35,7 +37,7 @@ public class CommonController { ...@@ -35,7 +37,7 @@ public class CommonController {
private MarketService marketService; private MarketService marketService;
@PostMapping(value = "/call", produces = "application/json;charset=UTF-8") @PostMapping(value = "/call", produces = "application/json;charset=UTF-8")
public CommonResponse createGardener(@RequestBody CommonRequest commonRequest) { public CommonResponse createGardener(@RequestBody CommonRequest commonRequest) throws ParseException {
OperationRequest operationReq = RequestConversionUtil.request2Operation(commonRequest); OperationRequest operationReq = RequestConversionUtil.request2Operation(commonRequest);
CommonResponse result = new CommonResponse(); CommonResponse result = new CommonResponse();
switch (commonRequest.getVars().get操作名()) { switch (commonRequest.getVars().get操作名()) {
...@@ -48,6 +50,9 @@ public class CommonController { ...@@ -48,6 +50,9 @@ public class CommonController {
case "取消种植": case "取消种植":
result = plantService.seedCancel(operationReq); result = plantService.seedCancel(operationReq);
break; break;
case "收取":
result = plantService.harvest(operationReq);
break;
case "铲除植物": case "铲除植物":
result = plantService.clearPlantCheck(operationReq); result = plantService.clearPlantCheck(operationReq);
break; break;
...@@ -60,6 +65,15 @@ public class CommonController { ...@@ -60,6 +65,15 @@ public class CommonController {
case "取消铲除植物": case "取消铲除植物":
result = plantService.clearPlantCancel(operationReq); result = plantService.clearPlantCancel(operationReq);
break; break;
case "查看花圃":
result = nurseryService.checkAllNursery(operationReq);
break;
case "查看指定花圃":
result = nurseryService.checkNurseryByNum(operationReq);
break;
case "查看花圃等级":
result = nurseryService.checkNurseryLevel(operationReq);
break;
case "查看花圃升级类型": case "查看花圃升级类型":
result = nurseryService.searchNurseryToType(operationReq); result = nurseryService.searchNurseryToType(operationReq);
break; break;
...@@ -156,6 +170,15 @@ public class CommonController { ...@@ -156,6 +170,15 @@ public class CommonController {
case "取消购买指令": case "取消购买指令":
result = marketService.buyCancel(operationReq); result = marketService.buyCancel(operationReq);
break; break;
case "出售指令":
result = marketService.sellCheck(operationReq);
break;
case "确认出售指令":
result = marketService.sell(operationReq);
break;
case "取消出售指令":
result = marketService.sellCancel(operationReq);
break;
} }
return result; return result;
} }
......
...@@ -15,6 +15,8 @@ import com.qiwuai.garden.service.plantService.PlantService; ...@@ -15,6 +15,8 @@ import com.qiwuai.garden.service.plantService.PlantService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import java.text.ParseException;
@RestController @RestController
@RequestMapping("/gardener") @RequestMapping("/gardener")
public class GardenerController { public class GardenerController {
...@@ -108,8 +110,8 @@ public class GardenerController { ...@@ -108,8 +110,8 @@ public class GardenerController {
} }
@PostMapping(value = "/harvest", produces = "application/json;charset=UTF-8") @PostMapping(value = "/harvest", produces = "application/json;charset=UTF-8")
public CommonResponse harvest(@RequestBody HarvestRequest harvestRequest) { public CommonResponse harvest(@RequestBody OperationRequest operationReq) throws ParseException {
CommonResponse result = plantService.harvest(harvestRequest); CommonResponse result = plantService.harvest(operationReq);
return result; return result;
} }
...@@ -126,7 +128,7 @@ public class GardenerController { ...@@ -126,7 +128,7 @@ public class GardenerController {
} }
@PostMapping(value = "/clearAfterHarvest", produces = "application/json;charset=UTF-8") @PostMapping(value = "/clearAfterHarvest", produces = "application/json;charset=UTF-8")
public CommonResponse clearAfterHarvest(@RequestBody OperationRequest operationReq) { public CommonResponse clearAfterHarvest(@RequestBody OperationRequest operationReq) throws ParseException {
CommonResponse result = plantService.clearAfterHarvest(operationReq); CommonResponse result = plantService.clearAfterHarvest(operationReq);
return result; return result;
} }
......
package com.qiwuai.garden.dto;
import lombok.Data;
@Data
public class DropItemNumDto {
/**
* 物品掉落最小数量
*/
private Integer dropMin;
/**
* 物品掉落最大数量
*/
private Integer dropMax;
}
...@@ -24,6 +24,10 @@ public class NurseryInfoDto { ...@@ -24,6 +24,10 @@ public class NurseryInfoDto {
*/ */
private String seedingTime; private String seedingTime;
/** /**
* 植物生长时间
*/
private PlantTimeDto plantTime;
/**
* 植物种植数量 * 植物种植数量
*/ */
private Integer Number; private Integer Number;
......
...@@ -14,4 +14,8 @@ public class PlantPeriodDto { ...@@ -14,4 +14,8 @@ public class PlantPeriodDto {
* 结束时间 * 结束时间
*/ */
private long endTime; private long endTime;
/**
* 时间差
*/
private long subTime;
} }
package com.qiwuai.garden.dto;
import lombok.Data;
@Data
public class PlantTimeDto {
/**
* 1-播种期的最后时间
*/
public String seedingTime;
/**
* 2-幼苗期的最后时间
*/
public String sowingTime;
/**
* 3-成长期的最后时间
*/
public String growingTime;
/**
* 4-开花期的最后时间
*/
public String bloomingTime;
/**
* 5-成熟期的最后时间
*/
public String matureTime;
}
...@@ -27,10 +27,6 @@ public class PlantConfigReq { ...@@ -27,10 +27,6 @@ public class PlantConfigReq {
*/ */
private Integer plantAttributeId; private Integer plantAttributeId;
/** /**
* 对应种子id即item_id
*/
private Integer seedId;
/**
* 植物占用面积 * 植物占用面积
*/ */
private BigDecimal occupyArea; private BigDecimal occupyArea;
......
...@@ -9,7 +9,7 @@ public class ItemTypePojo { ...@@ -9,7 +9,7 @@ public class ItemTypePojo {
*/ */
private Integer id; private Integer id;
/** /**
* 种类描述:种子、果实、货币等 * 种类描述:果实、材料、货币等
*/ */
private String description; private String description;
/** /**
......
...@@ -47,6 +47,18 @@ public class PetPojo { ...@@ -47,6 +47,18 @@ public class PetPojo {
*/ */
private Integer fc; private Integer fc;
/** /**
* 掉落物品id集合:1|3
*/
private String dropItems;
/**
* 掉落物品数量范围集合:1|5;2|10
*/
private String dropNums;
/**
* 物品掉落概率集合:0.25|0.65
*/
private String dropProbs;
/**
* 掉落物品集合id * 掉落物品集合id
*/ */
private String addItemSetId; private String addItemSetId;
......
...@@ -27,10 +27,6 @@ public class PlantPojo { ...@@ -27,10 +27,6 @@ public class PlantPojo {
*/ */
private Integer plantAttributeId; private Integer plantAttributeId;
/** /**
* 对应种子id即item_id
*/
private Integer seedId;
/**
* 植物占用面积 * 植物占用面积
*/ */
private Integer occupyArea; private Integer occupyArea;
...@@ -71,6 +67,10 @@ public class PlantPojo { ...@@ -71,6 +67,10 @@ public class PlantPojo {
*/ */
private Integer fruitNum; private Integer fruitNum;
/** /**
* 果实对应种子数量
*/
private Integer fruitSeedNum;
/**
* 植物结果次数 * 植物结果次数
*/ */
private Integer fruitTimes; private Integer fruitTimes;
...@@ -79,6 +79,18 @@ public class PlantPojo { ...@@ -79,6 +79,18 @@ public class PlantPojo {
*/ */
private Long fruitMatureTime; private Long fruitMatureTime;
/** /**
* 掉落物品id集合:1|3
*/
private String dropItems;
/**
* 掉落物品数量范围集合:1|5;2|10
*/
private String dropNums;
/**
* 物品掉落概率集合:0.25|0.65
*/
private String dropProbs;
/**
* 附加/掉落物品母集id * 附加/掉落物品母集id
*/ */
private Integer addItemSetId; private Integer addItemSetId;
......
...@@ -45,8 +45,6 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -45,8 +45,6 @@ public class BackPackServiceImpl implements BackPackService {
int otherCount = 0; //其他物品数量统计 int otherCount = 0; //其他物品数量统计
text.append("当前背包有物品类").append(itemTypeCount).append("种,其中"); text.append("当前背包有物品类").append(itemTypeCount).append("种,其中");
//取出背包里的种子袋
Map<Integer, ItemDto> seedBag = itemBags.get(Constants.ITEM_TYPE_SEED).getItemBag();
//取出背包里的果实袋 //取出背包里的果实袋
Map<Integer, ItemDto> fruitBag = itemBags.get(Constants.ITEM_TYPE_FRUIT).getItemBag(); Map<Integer, ItemDto> fruitBag = itemBags.get(Constants.ITEM_TYPE_FRUIT).getItemBag();
//取出背包里的材料袋 //取出背包里的材料袋
...@@ -54,10 +52,6 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -54,10 +52,6 @@ public class BackPackServiceImpl implements BackPackService {
//取出背包里的其他袋 //取出背包里的其他袋
Map<Integer, ItemDto> otherBag = itemBags.get(Constants.ITEM_TYPE_OTHER).getItemBag(); Map<Integer, ItemDto> otherBag = itemBags.get(Constants.ITEM_TYPE_OTHER).getItemBag();
for (ItemDto item : seedBag.values()) {
seedCount += item.getItemNum();
}
text.append("种子").append(seedCount).append("颗,");
for (ItemDto item : fruitBag.values()) { for (ItemDto item : fruitBag.values()) {
fruitCount += item.getItemNum(); fruitCount += item.getItemNum();
} }
...@@ -160,8 +154,10 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -160,8 +154,10 @@ public class BackPackServiceImpl implements BackPackService {
Map<Integer, ItemPojo> itemConfigMap = TimingAcquisition.itemConfigMap; Map<Integer, ItemPojo> itemConfigMap = TimingAcquisition.itemConfigMap;
//获取背包中的所有袋子 //获取背包中的所有袋子
Map<Integer, ItemBagDto> itemBags = TimingAcquisition.gardenerMap.get(uid).getBackPack().getItemBags(); Map<Integer, ItemBagDto> itemBags = TimingAcquisition.gardenerMap.get(uid).getBackPack().getItemBags();
//货币配置信息
Integer moneyId = Integer.parseInt(TimingAcquisition.systemConfigMap.get("money").getValue());
//根据种类id取出背包里的钱袋 //根据种类id取出背包里的钱袋
ItemDto money = itemBags.get(Constants.ITEM_TYPE_MONEY).getItems(Constants.MONEY); ItemDto money = itemBags.get(Constants.ITEM_TYPE_MONEY).getItems(moneyId);
text.append("您现在有").append(money.getItemNum()).append("个").append(itemConfigMap.get(money.getItemId()).getName()); text.append("您现在有").append(money.getItemNum()).append("个").append(itemConfigMap.get(money.getItemId()).getName());
log.info("货币查询结果:" + text.toString()); log.info("货币查询结果:" + text.toString());
...@@ -185,10 +181,6 @@ public class BackPackServiceImpl implements BackPackService { ...@@ -185,10 +181,6 @@ public class BackPackServiceImpl implements BackPackService {
Integer itemTypeId = operationReq.getItemTypeId(); Integer itemTypeId = operationReq.getItemTypeId();
PlantPojo plant = null; PlantPojo plant = null;
if (itemTypeId.equals(Constants.ITEM_TYPE_SEED)) {
//根据种子id即itemId找到植物配置信息
plant = TimingAcquisition.getPlantInfoBySeedId(itemId);
}
if (itemTypeId.equals(Constants.ITEM_TYPE_FRUIT)) { if (itemTypeId.equals(Constants.ITEM_TYPE_FRUIT)) {
//根据果实id即itemId找到植物配置信息 //根据果实id即itemId找到植物配置信息
plant = TimingAcquisition.getPlantInfoByFruitId(itemId); plant = TimingAcquisition.getPlantInfoByFruitId(itemId);
......
...@@ -98,12 +98,6 @@ public interface GardenerService { ...@@ -98,12 +98,6 @@ public interface GardenerService {
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse buy(OperationRequest operationReq); CommonResponse buy(OperationRequest operationReq);
/**
* 出售果实
* @param
* @param
*/
void sell();
/** /**
* 园丁浇水 * 园丁浇水
......
...@@ -170,7 +170,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -170,7 +170,7 @@ public class GardenerServiceImpl implements GardenerService {
StringBuilder text = new StringBuilder(); StringBuilder text = new StringBuilder();
text.append("我现在").append(gardenerInfo.getLevel()).append("级"); text.append("我现在").append(gardenerInfo.getLevel()).append("级");
text.append(",升到下个等级需要完成"); text.append(",升到下个等级需要完成");
String[] taskIdList = gardenerLevelConfig.getTaskIds().split(","); String[] taskIdList = gardenerLevelConfig.getTaskIds().split("\\|");
for (String taskId : taskIdList) { for (String taskId : taskIdList) {
//园丁升级所需完成任务配置信息 //园丁升级所需完成任务配置信息
TaskPojo task = TimingAcquisition.taskMap.get(Integer.parseInt(taskId)); TaskPojo task = TimingAcquisition.taskMap.get(Integer.parseInt(taskId));
...@@ -233,7 +233,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -233,7 +233,7 @@ public class GardenerServiceImpl implements GardenerService {
boolean taskSign = true; boolean taskSign = true;
boolean success = true; boolean success = true;
String[] taskIdList = gardenerLevelConfig.getTaskIds().split(","); String[] taskIdList = gardenerLevelConfig.getTaskIds().split("\\|");
for (String taskId : taskIdList) { for (String taskId : taskIdList) {
//园丁升级所需完成任务配置信息 //园丁升级所需完成任务配置信息
TaskPojo task = TimingAcquisition.taskMap.get(Integer.parseInt(taskId)); TaskPojo task = TimingAcquisition.taskMap.get(Integer.parseInt(taskId));
...@@ -288,7 +288,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -288,7 +288,7 @@ public class GardenerServiceImpl implements GardenerService {
Map<Integer, GardenerSkillPojo> gardenerSkillMap = TimingAcquisition.gardenerSkillMap; Map<Integer, GardenerSkillPojo> gardenerSkillMap = TimingAcquisition.gardenerSkillMap;
text.append("升级成功!现在可以选一个技能学习,"); text.append("升级成功!现在可以选一个技能学习,");
String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split(","); String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split("\\|");
for (String skillId : skillIdList) { for (String skillId : skillIdList) {
text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、"); text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、");
} }
...@@ -298,7 +298,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -298,7 +298,7 @@ public class GardenerServiceImpl implements GardenerService {
} }
} }
//保存玩家这轮的请求信息,用于下一步的确认购买操作 //保存玩家这轮的请求信息,用于下一步的确认操作
operationReq.setLevel(gardenerInfo.getLevel()); operationReq.setLevel(gardenerInfo.getLevel());
CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime())); CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime()));
...@@ -356,7 +356,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -356,7 +356,7 @@ public class GardenerServiceImpl implements GardenerService {
StringBuilder text = new StringBuilder(); StringBuilder text = new StringBuilder();
text.append("好的,"); text.append("好的,");
String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split(","); String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split("\\|");
for (String skillId : skillIdList) { for (String skillId : skillIdList) {
text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、"); text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、");
} }
...@@ -410,7 +410,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -410,7 +410,7 @@ public class GardenerServiceImpl implements GardenerService {
GardenerLevelPojo gardenerLevelConfig = TimingAcquisition.gardenerLevelMap.get(level); GardenerLevelPojo gardenerLevelConfig = TimingAcquisition.gardenerLevelMap.get(level);
//获取技能配置信息 //获取技能配置信息
Map<Integer, GardenerSkillPojo> gardenerSkillMap = TimingAcquisition.gardenerSkillMap; Map<Integer, GardenerSkillPojo> gardenerSkillMap = TimingAcquisition.gardenerSkillMap;
String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split(","); String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split("\\|");
for (String skill : skillIdList) { for (String skill : skillIdList) {
text.append(gardenerSkillMap.get(Integer.parseInt(skill)).getName()).append("、"); text.append(gardenerSkillMap.get(Integer.parseInt(skill)).getName()).append("、");
} }
...@@ -442,7 +442,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -442,7 +442,7 @@ public class GardenerServiceImpl implements GardenerService {
} }
log.info("技能信息:" + gardenerSkill); log.info("技能信息:" + gardenerSkill);
//保存玩家这轮的请求信息,用于下一步的确认购买操作 //保存玩家这轮的请求信息,用于下一步的确认操作
operationReq.setLevel(level); operationReq.setLevel(level);
CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime())); CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime()));
...@@ -517,7 +517,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -517,7 +517,7 @@ public class GardenerServiceImpl implements GardenerService {
feedbackId = result.get反馈ID(); feedbackId = result.get反馈ID();
text.append(",").append(result.get反馈文本()); text.append(",").append(result.get反馈文本());
resultResponse.set后台附加返回(result.get后台附加返回()); resultResponse.set后台附加返回(result.get后台附加返回());
//保存玩家这轮的请求信息,用于下一步的确认购买操作 //保存玩家这轮的请求信息,用于下一步的确认操作
operationReq.setLevel(maxLevel[0]); operationReq.setLevel(maxLevel[0]);
CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime())); CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime()));
} }
...@@ -558,7 +558,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -558,7 +558,7 @@ public class GardenerServiceImpl implements GardenerService {
StringBuilder text = new StringBuilder(); StringBuilder text = new StringBuilder();
text.append("好的,"); text.append("好的,");
String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split(","); String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split("\\|");
for (String skillId : skillIdList) { for (String skillId : skillIdList) {
text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、"); text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、");
} }
...@@ -567,7 +567,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -567,7 +567,7 @@ public class GardenerServiceImpl implements GardenerService {
log.info("当前等级的所有技能信息:" + Arrays.toString(skillIdList)); log.info("当前等级的所有技能信息:" + Arrays.toString(skillIdList));
//保存玩家这轮的请求信息,用于下一步的确认购买操作 //保存玩家这轮的请求信息,用于下一步的确认操作
operationReq.setLevel(level); operationReq.setLevel(level);
CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime())); CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime()));
...@@ -693,14 +693,14 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -693,14 +693,14 @@ public class GardenerServiceImpl implements GardenerService {
GardenerLevelPojo gardenerLevelConfig = TimingAcquisition.gardenerLevelMap.get(level); GardenerLevelPojo gardenerLevelConfig = TimingAcquisition.gardenerLevelMap.get(level);
//获取技能配置信息 //获取技能配置信息
Map<Integer, GardenerSkillPojo> gardenerSkillMap = TimingAcquisition.gardenerSkillMap; Map<Integer, GardenerSkillPojo> gardenerSkillMap = TimingAcquisition.gardenerSkillMap;
String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split(","); String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split("\\|");
for (String skillId : skillIdList) { for (String skillId : skillIdList) {
text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、"); text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、");
} }
text.deleteCharAt(text.length() - 1); text.deleteCharAt(text.length() - 1);
text.append(",您要选择哪个呢?"); text.append(",您要选择哪个呢?");
//保存玩家这轮的请求信息,用于下一步的确认购买操作 //保存玩家这轮的请求信息,用于下一步的确认操作
operationReq.setLevel(level); operationReq.setLevel(level);
CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime())); CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime()));
...@@ -775,7 +775,7 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -775,7 +775,7 @@ public class GardenerServiceImpl implements GardenerService {
text.append("等级").append(maxLevel + 1).append("技能:"); text.append("等级").append(maxLevel + 1).append("技能:");
//园丁等级配置信息 //园丁等级配置信息
GardenerLevelPojo gardenerLevelConfig = TimingAcquisition.gardenerLevelMap.get(maxLevel + 1); GardenerLevelPojo gardenerLevelConfig = TimingAcquisition.gardenerLevelMap.get(maxLevel + 1);
String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split(","); String[] skillIdList = gardenerLevelConfig.getGardenerSkillIds().split("\\|");
for (String skillId : skillIdList) { for (String skillId : skillIdList) {
text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、"); text.append(gardenerSkillMap.get(Integer.parseInt(skillId)).getName()).append("、");
} }
...@@ -1080,11 +1080,6 @@ public class GardenerServiceImpl implements GardenerService { ...@@ -1080,11 +1080,6 @@ public class GardenerServiceImpl implements GardenerService {
} }
@Override @Override
public void sell() {
}
@Override
public void watering() { public void watering() {
} }
......
...@@ -22,4 +22,22 @@ public interface MarketService { ...@@ -22,4 +22,22 @@ public interface MarketService {
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse buyCancel(OperationRequest operationReq); CommonResponse buyCancel(OperationRequest operationReq);
/**
* 出售指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse sellCheck(OperationRequest operationReq);
/**
* 确认出售指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse sell(OperationRequest operationReq);
/**
* 取消出售指令
* @param operationReq
* @return CommonResponse
*/
CommonResponse sellCancel(OperationRequest operationReq);
} }
...@@ -234,7 +234,8 @@ public class MarketServiceImpl implements MarketService { ...@@ -234,7 +234,8 @@ public class MarketServiceImpl implements MarketService {
Integer number = operationReq.getNumber(); //物品数量 Integer number = operationReq.getNumber(); //物品数量
log.info(uid + "开始取消本轮购买"); log.info(uid + "开始取消本轮购买");
//清除缓存,本轮对话结束
CacheGlobal.concurrentMap.remove(uid);
log.info(uid + "取消本轮购买完成"); log.info(uid + "取消本轮购买完成");
commonResponse.setCode(1); commonResponse.setCode(1);
...@@ -245,4 +246,142 @@ public class MarketServiceImpl implements MarketService { ...@@ -245,4 +246,142 @@ public class MarketServiceImpl implements MarketService {
commonResponse.setData(resultVarsResponse); commonResponse.setData(resultVarsResponse);
return commonResponse; return commonResponse;
} }
@Override
public CommonResponse sellCheck(OperationRequest operationReq) {
CommonResponse commonResponse = new CommonResponse();
ResultVarsResponse resultVarsResponse = new ResultVarsResponse();
ResultResponse resultResponse = new ResultResponse();
String uid = operationReq.getUid();
Integer itemId = operationReq.getItemId();
Integer itemTypeId = operationReq.getItemTypeId();
Integer number = operationReq.getNumber(); //物品数量
//当前玩家上一轮的请求信息
OperationRequest lastReq = (OperationRequest) CacheUtil.get(uid);
//存在上一轮对话
if (!StringUtils.isEmpty(lastReq)) {
itemId = lastReq.getItemId(); //需要出售的物品id
number = lastReq.getNumber(); //需要出售的物品数量
itemTypeId = lastReq.getItemTypeId(); //物品类型
}
//玩家没有提供物品名称
if (StringUtils.isEmpty(itemId)) {
log.info(uid + "玩家没提供出售的物品名称");
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(400205);
resultResponse.set反馈文本("您想卖点什么呢?可以告诉我想要出售的物品名称,或者选择一次出售");
resultResponse.set后台附加返回("出售物品回复3");
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
//物品配置信息
ItemPojo itemConfig = TimingAcquisition.itemConfigMap.get(itemId);
//获取背包中的所有袋子
Map<Integer, ItemBagDto> itemBags = TimingAcquisition.gardenerMap.get(uid).getBackPack().getItemBags();
//货币配置信息
Integer moneyId = Integer.parseInt(TimingAcquisition.systemConfigMap.get("money").getValue());
//货币的配置信息
ItemPojo money = TimingAcquisition.itemConfigMap.get(moneyId);
//根据种类id取出背包里的袋子中的物品
ItemDto item = itemBags.get(itemTypeId).getItems(itemId);
//玩家还没有提供数量
if (StringUtils.isEmpty(number)) {
log.info(uid + "玩家没提供出售的物品数量");
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(400206);
resultResponse.set反馈文本("出售" + itemConfig.getName() + "吗?要卖掉多少个呢?当前" + itemConfig.getName() + "有" + item.getItemNum() + "个");
resultResponse.set后台附加返回("出售物品回复4");
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
//已经有物品id和数量的情况下,返回货币数量
//玩家出售数量大于背包有的数量
if (number > item.getItemNum()) {
log.info(uid + "玩家出售物品数量大于背包有的数量");
operationReq.setNumber(item.getItemNum()); //保存最大数量,提供给下一步操作
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(400201);
resultResponse.set反馈文本("现在没有这么多" + itemConfig.getName() + ",要全部出售吗?");
resultResponse.set后台附加返回("出售物品回复1");
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
int price = number * itemConfig.getPrice();
//保存玩家这轮的请求信息,用于下一步的确认操作
CacheUtil.put(uid, operationReq, Long.parseLong(yamlUtil.getExpireTime()));
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(400201);
resultResponse.set反馈文本("出售" + number + "个" + itemConfig.getName() + ",可以获得" + price + "个" + money.getName() + ",确定要出售吗?");
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
@Override
public CommonResponse sell(OperationRequest operationReq) {
CommonResponse commonResponse = new CommonResponse();
ResultVarsResponse resultVarsResponse = new ResultVarsResponse();
ResultResponse resultResponse = new ResultResponse();
String uid = operationReq.getUid();
//当前玩家上一轮的请求信息
OperationRequest lastReq = (OperationRequest) CacheUtil.get(uid);
if (StringUtils.isEmpty(lastReq)) {
commonResponse.setCode(0);
commonResponse.setMsg("失败,对话已结束");
return commonResponse;
}
//需要出售的物品id
Integer itemId = lastReq.getItemId();
Integer number = lastReq.getNumber();
//获取背包中的所有袋子
Map<Integer, ItemBagDto> itemBags = TimingAcquisition.gardenerMap.get(uid).getBackPack().getItemBags();
//货币配置信息
Integer moneyId = Integer.parseInt(TimingAcquisition.systemConfigMap.get("money").getValue());
//根据种类id取出背包里的钱袋
ItemDto money = itemBags.get(Constants.ITEM_TYPE_MONEY).getItems(moneyId);
return null;
}
@Override
public CommonResponse sellCancel(OperationRequest operationReq) {
CommonResponse commonResponse = new CommonResponse();
ResultVarsResponse resultVarsResponse = new ResultVarsResponse();
ResultResponse resultResponse = new ResultResponse();
String uid = operationReq.getUid();
log.info(uid + "开始取消出售物品操作");
//当前玩家上一轮的请求信息
OperationRequest lastReq = (OperationRequest) CacheUtil.get(uid);
if (StringUtils.isEmpty(lastReq)) {
commonResponse.setCode(0);
commonResponse.setMsg("失败,对话已结束");
return commonResponse;
}
Integer itemId = lastReq.getItemId();
//物品配置信息
ItemPojo itemConfig = TimingAcquisition.itemConfigMap.get(itemId);
//清除缓存,本轮对话结束
CacheGlobal.concurrentMap.remove(uid);
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(400204);
resultResponse.set反馈文本("好的,已取消出售" + itemConfig.getName());
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
} }
...@@ -50,32 +50,55 @@ public class NurseryServiceImpl implements NurseryService { ...@@ -50,32 +50,55 @@ public class NurseryServiceImpl implements NurseryService {
String uid = operationReq.getUid(); String uid = operationReq.getUid();
Integer nurseryNum = operationReq.getNurseryNum(); Integer nurseryNum = operationReq.getNurseryNum();
if (StringUtils.isEmpty(nurseryNum)) {
log.info(uid + "玩家没提供花圃编号");
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(100112);
resultResponse.set反馈文本("查看哪个花圃呢?");
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
//获取当前花圃的信息 //获取当前花圃的信息
NurseryInfoDto nurseryInfo = TimingAcquisition.gardenerMap.get(uid).getGarden().getNurseryInfos().get(nurseryNum); NurseryInfoDto nurseryInfo = TimingAcquisition.gardenerMap.get(uid).getGarden().getNurseryInfos().get(nurseryNum);
if (StringUtils.isEmpty(nurseryInfo)) {
log.info(uid + "玩家没有花圃编号" + nurseryNum);
commonResponse.setCode(1);
commonResponse.setMsg("成功");
resultResponse.set反馈ID(100112);
resultResponse.set反馈文本("没有这个花圃哦");
resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse);
return commonResponse;
}
PlantPojo plant = new PlantPojo();
if (!StringUtils.isEmpty(nurseryInfo.getPlantId())) {
//花圃中植物的信息 //花圃中植物的信息
PlantPojo plant = TimingAcquisition.plantMap.get(nurseryInfo.getPlantId()); plant = TimingAcquisition.plantMap.get(nurseryInfo.getPlantId());
//种子信息 }
ItemPojo seed = TimingAcquisition.itemConfigMap.get(plant.getSeedId());
StringBuilder text = new StringBuilder(); StringBuilder text = new StringBuilder();
if (nurseryInfo.getStatus() == Constants.PLANT_NO) { if (nurseryInfo.getStatus() == Constants.PLANT_NO) {
text.append("花圃还未种植哦,可以先种点什么吧!"); text.append("花圃还未种植哦,可以先种点什么吧!");
} } else {
if (nurseryInfo.getStatus() == Constants.PLANT_SEEDING) { //当前时间大于开花期的最后时间,即已进入成熟期
text.append("花圃中的").append(seed.getName()).append("还没有发芽哦!"); if (DateUtil.getCurrentTime().compareTo(nurseryInfo.getPlantTime().getBloomingTime()) > 0) {
} text.append("花圃中的").append(plant.getName()).append("已经成熟!");
if (nurseryInfo.getStatus() == Constants.PLANT_SOWING) { nurseryInfo.setStatus(Constants.PLANT_MATURE); //花圃中植物状态改为成熟期
text.append("花圃中的").append(plant.getName()).append("刚刚发出嫩芽!"); } else if (DateUtil.getCurrentTime().compareTo(nurseryInfo.getPlantTime().getGrowingTime()) > 0) {
}
if (nurseryInfo.getStatus() == Constants.PLANT_GROWING) {
text.append("花圃中的").append(plant.getName()).append("正在茁壮成长!");
}
if (nurseryInfo.getStatus() == Constants.PLANT_BLOOMING) {
text.append("花圃中的").append(plant.getName()).append("已经开花啦!"); text.append("花圃中的").append(plant.getName()).append("已经开花啦!");
nurseryInfo.setStatus(Constants.PLANT_BLOOMING); //花圃中植物状态改为开花期
} else if (DateUtil.getCurrentTime().compareTo(nurseryInfo.getPlantTime().getSowingTime()) > 0) {
text.append("花圃中的").append(plant.getName()).append("正在茁壮成长!");
nurseryInfo.setStatus(Constants.PLANT_GROWING); //花圃中植物状态改为成长期
} else if (DateUtil.getCurrentTime().compareTo(nurseryInfo.getPlantTime().getSeedingTime()) > 0) {
text.append("花圃中的").append(plant.getName()).append("刚刚发出嫩芽!");
nurseryInfo.setStatus(Constants.PLANT_SOWING); //花圃中植物状态改为幼苗期
} else {
text.append("花圃中的").append(plant.getName()).append("还没有发芽哦!");
} }
if (nurseryInfo.getStatus() == Constants.PLANT_MATURE) {
text.append("花圃中的").append(plant.getName()).append("已经成熟!");
} }
if (nurseryInfo.getPetCheck() == Constants.PET_UNCHECK && !StringUtils.isEmpty(nurseryInfo.getPetField())) { if (nurseryInfo.getPetCheck() == Constants.PET_UNCHECK && !StringUtils.isEmpty(nurseryInfo.getPetField())) {
...@@ -88,7 +111,7 @@ public class NurseryServiceImpl implements NurseryService { ...@@ -88,7 +111,7 @@ public class NurseryServiceImpl implements NurseryService {
commonResponse.setCode(1); commonResponse.setCode(1);
commonResponse.setMsg("成功"); commonResponse.setMsg("成功");
resultResponse.set反馈ID(100301); resultResponse.set反馈ID(100302);
resultResponse.set反馈文本(text.toString()); resultResponse.set反馈文本(text.toString());
resultVarsResponse.setVars(resultResponse); resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse); commonResponse.setData(resultVarsResponse);
...@@ -121,22 +144,23 @@ public class NurseryServiceImpl implements NurseryService { ...@@ -121,22 +144,23 @@ public class NurseryServiceImpl implements NurseryService {
while(iterator.hasNext()) { while(iterator.hasNext()) {
Map.Entry<Integer, NurseryInfoDto> entry = iterator.next(); Map.Entry<Integer, NurseryInfoDto> entry = iterator.next();
NurseryInfoDto nurseryInfo = entry.getValue(); NurseryInfoDto nurseryInfo = entry.getValue();
//植物生长期判断
//根据生长阶段时间越长出现的概率越大来排序,而不是按生长期来排序 if (nurseryInfo.getStatus() != Constants.PLANT_NO) {
if (nurseryInfo.getStatus() == Constants.PLANT_GROWING) { //当前时间大于开花期的最后时间,即已进入成熟期
growingCount++; if (DateUtil.getCurrentTime().compareTo(nurseryInfo.getPlantTime().getBloomingTime()) > 0) {
} else if (nurseryInfo.getStatus() == Constants.PLANT_MATURE) {
matureCount++; matureCount++;
} else if (nurseryInfo.getStatus() == Constants.PLANT_SOWING) { } else if (DateUtil.getCurrentTime().compareTo(nurseryInfo.getPlantTime().getGrowingTime()) > 0) {
sowingCount++;
} else if (nurseryInfo.getStatus() == Constants.PLANT_BLOOMING) {
bloomingCount++; bloomingCount++;
} else if(nurseryInfo.getStatus() == Constants.PLANT_SEEDING) { } else if (DateUtil.getCurrentTime().compareTo(nurseryInfo.getPlantTime().getSowingTime()) > 0) {
growingCount++;
} else if (DateUtil.getCurrentTime().compareTo(nurseryInfo.getPlantTime().getSeedingTime()) > 0) {
sowingCount++;
} else {
seedingCount++; seedingCount++;
} }
}
if (nurseryInfo.getPetCheck() == Constants.PET_UNCHECK && !StringUtils.isEmpty(nurseryInfo.getPetField())) {
//有新来宠物的花圃统计 //有新来宠物的花圃统计
if (nurseryInfo.getPetCheck() == Constants.PET_UNCHECK && !StringUtils.isEmpty(nurseryInfo.getPetField())) {
nurseryNumList.add(entry.getKey()); nurseryNumList.add(entry.getKey());
} }
} }
...@@ -164,7 +188,7 @@ public class NurseryServiceImpl implements NurseryService { ...@@ -164,7 +188,7 @@ public class NurseryServiceImpl implements NurseryService {
commonResponse.setCode(1); commonResponse.setCode(1);
commonResponse.setMsg("成功"); commonResponse.setMsg("成功");
resultResponse.set反馈ID(100603); resultResponse.set反馈ID(100301);
resultResponse.set反馈文本(text.toString()); resultResponse.set反馈文本(text.toString());
resultVarsResponse.setVars(resultResponse); resultVarsResponse.setVars(resultResponse);
commonResponse.setData(resultVarsResponse); commonResponse.setData(resultVarsResponse);
...@@ -436,6 +460,8 @@ public class NurseryServiceImpl implements NurseryService { ...@@ -436,6 +460,8 @@ public class NurseryServiceImpl implements NurseryService {
} }
} }
//货币配置信息
Integer moneyId = Integer.parseInt(TimingAcquisition.systemConfigMap.get("money").getValue());
//升级到目标花圃所需要的材料 //升级到目标花圃所需要的材料
List<ItemDto> itemList = TypeConvertUtil.itemString2List(targetNursery.getItemIdNums()); List<ItemDto> itemList = TypeConvertUtil.itemString2List(targetNursery.getItemIdNums());
//获取玩家背包中各类物品袋的信息 //获取玩家背包中各类物品袋的信息
...@@ -443,7 +469,7 @@ public class NurseryServiceImpl implements NurseryService { ...@@ -443,7 +469,7 @@ public class NurseryServiceImpl implements NurseryService {
//获取背包中材料袋 //获取背包中材料袋
Map<Integer, ItemDto> materialBag = itemBags.get(Constants.ITEM_TYPE_MATERIAL).getItemBag(); Map<Integer, ItemDto> materialBag = itemBags.get(Constants.ITEM_TYPE_MATERIAL).getItemBag();
//获取背包的钱袋 //获取背包的钱袋
ItemDto money = itemBags.get(Constants.ITEM_TYPE_MONEY).getItems(Constants.MONEY); ItemDto money = itemBags.get(Constants.ITEM_TYPE_MONEY).getItems(moneyId);
//物品配置信息 //物品配置信息
Map<Integer, ItemPojo> itemConfigMap = TimingAcquisition.itemConfigMap; Map<Integer, ItemPojo> itemConfigMap = TimingAcquisition.itemConfigMap;
......
...@@ -106,7 +106,7 @@ public class PetServiceImpl implements PetService { ...@@ -106,7 +106,7 @@ public class PetServiceImpl implements PetService {
//宠物获取方式 //宠物获取方式
StringBuilder plantNames = new StringBuilder(); StringBuilder plantNames = new StringBuilder();
String plantIds = petConfig.getFavoritePlantId(); String plantIds = petConfig.getFavoritePlantId();
String[] plantIdList = plantIds.split(","); String[] plantIdList = plantIds.split("\\|");
for (String plantId : plantIdList) { for (String plantId : plantIdList) {
plantNames.append(plantMap.get(Integer.parseInt(plantId)).getName()).append("、"); plantNames.append(plantMap.get(Integer.parseInt(plantId)).getName()).append("、");
} }
......
...@@ -6,6 +6,7 @@ import com.qiwuai.garden.pojo.PlantAttributePojo; ...@@ -6,6 +6,7 @@ import com.qiwuai.garden.pojo.PlantAttributePojo;
import com.qiwuai.garden.pojo.PlantPeriodPojo; import com.qiwuai.garden.pojo.PlantPeriodPojo;
import com.qiwuai.garden.pojo.PlantPojo; import com.qiwuai.garden.pojo.PlantPojo;
import java.text.ParseException;
import java.util.List; import java.util.List;
public interface PlantService { public interface PlantService {
...@@ -32,7 +33,7 @@ public interface PlantService { ...@@ -32,7 +33,7 @@ public interface PlantService {
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse seed(OperationRequest operationReq); CommonResponse seed(OperationRequest operationReq) throws ParseException;
/** /**
* 取消园丁播种 * 取消园丁播种
* @param operationReq * @param operationReq
...@@ -40,11 +41,11 @@ public interface PlantService { ...@@ -40,11 +41,11 @@ public interface PlantService {
*/ */
CommonResponse seedCancel(OperationRequest operationReq); CommonResponse seedCancel(OperationRequest operationReq);
/** /**
* 园丁收获 * 收取,园丁收获
* @param harvestRequest * @param harvestRequest
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse harvest(HarvestRequest harvestRequest); CommonResponse harvest(OperationRequest operationReq) throws ParseException;
/** /**
* 铲除植物,即检查花圃种植情况 * 铲除植物,即检查花圃种植情况
* @param operationReq * @param operationReq
...@@ -62,7 +63,7 @@ public interface PlantService { ...@@ -62,7 +63,7 @@ public interface PlantService {
* @param operationReq * @param operationReq
* @return CommonResponse * @return CommonResponse
*/ */
CommonResponse clearAfterHarvest(OperationRequest operationReq); CommonResponse clearAfterHarvest(OperationRequest operationReq) throws ParseException;
/** /**
* 取消铲除植物 * 取消铲除植物
* @param operationReq * @param operationReq
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<select id="findAll" resultType="com.qiwuai.garden.pojo.PetPojo"> <select id="findAll" resultType="com.qiwuai.garden.pojo.PetPojo">
select select
id, name, type_id, description, rarity_id, favorite_plant_id, appear_prob, pet_attribute_id, id, name, type_id, description, rarity_id, favorite_plant_id, appear_prob, pet_attribute_id,
hp, fc, add_item_set_id, feed_cost, level, price, create_time, update_time hp, fc, drop_items, drop_nums, drop_probs, add_item_set_id, feed_cost, level, price, create_time, update_time
from from
pet pet
</select> </select>
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.PlantMapper"> <mapper namespace="com.qiwuai.garden.dao.PlantMapper">
<sql id="plant"> <sql id="plant">
id, name, description, plant_type_id, plant_attribute_id, seed_id, id, name, description, plant_type_id, plant_attribute_id,
occupy_area, nursery_level, nursery_id, gardener_level, gardener_skill_id, occupy_area, nursery_level, nursery_id, gardener_level, gardener_skill_id,
near_plant_id, pet_id, cost_item_nums, fruit_id, fruit_num, near_plant_id, pet_id, cost_item_nums, fruit_id, fruit_num, fruit_seed_num,
fruit_times, fruit_mature_time, add_item_set_id, rarity_id, price, fruit_times, fruit_mature_time, drop_items, drop_nums, drop_probs, add_item_set_id, rarity_id, price,
spout_condition, fruit_condition, mature_condition, create_time, update_time spout_condition, fruit_condition, mature_condition, create_time, update_time
</sql> </sql>
<select id="searchAll" resultType="com.qiwuai.garden.pojo.PlantPojo"> <select id="searchAll" resultType="com.qiwuai.garden.pojo.PlantPojo">
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
<insert id="add"> <insert id="add">
insert into plant ( insert into plant (
name, description, plant_type_id, plant_attribute_id, seed_id, name, description, plant_type_id, plant_attribute_id,
occupy_area, nursery_level, nursery_id, gardener_level, gardener_skill_id, occupy_area, nursery_level, nursery_id, gardener_level, gardener_skill_id,
near_plant_id, pet_id, cost_item_nums, fruit_id, fruit_num, near_plant_id, pet_id, cost_item_nums, fruit_id, fruit_num, fruit_seed_num,
fruit_times, fruit_mature_time, add_item_set_id, rarity_id, price, fruit_times, fruit_mature_time, drop_items, drop_nums, drop_probs, add_item_set_id, rarity_id, price,
spout_condition, fruit_condition, mature_condition, create_time, update_time spout_condition, fruit_condition, mature_condition, create_time, update_time
) values ( ) values (
#{name},#{description},#{plantTypeId},#{plantAttributeId}, #{seedId}, #{name},#{description},#{plantTypeId},#{plantAttributeId},
#{occupyArea},#{nurseryLevel},#{nurseryId}, #{gardenerLevel}, #{gardenerSkillId}, #{occupyArea},#{nurseryLevel},#{nurseryId}, #{gardenerLevel}, #{gardenerSkillId},
#{nearPlantId},#{petId},#{costItemNums},#{fruitId},#{fruitNum}, #{nearPlantId},#{petId},#{costItemNums},#{fruitId},#{fruitNum}, {fruitSeedNum},
#{fruitTimes}, #{fruitMatureTime},#{addItemSetId},#{rarityId},#{price}, #{fruitTimes},#{fruitMatureTime},#{dropItems},#{dropNums},#{dropProbs},#{addItemSetId},#{rarityId},#{price},
#{spoutCondition},#{fruitCondition},#{matureCondition},#{createTime},#{updateTime} #{spoutCondition},#{fruitCondition},#{matureCondition},#{createTime},#{updateTime}
) )
</insert> </insert>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
<select id="findAll" resultType="com.qiwuai.garden.pojo.PetPojo"> <select id="findAll" resultType="com.qiwuai.garden.pojo.PetPojo">
select select
id, name, type_id, description, rarity_id, favorite_plant_id, appear_prob, pet_attribute_id, id, name, type_id, description, rarity_id, favorite_plant_id, appear_prob, pet_attribute_id,
hp, fc, add_item_set_id, feed_cost, level, price, create_time, update_time hp, fc, drop_items, drop_nums, drop_probs, add_item_set_id, feed_cost, level, price, create_time, update_time
from from
pet pet
</select> </select>
......
...@@ -4,10 +4,10 @@ ...@@ -4,10 +4,10 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.qiwuai.garden.dao.PlantMapper"> <mapper namespace="com.qiwuai.garden.dao.PlantMapper">
<sql id="plant"> <sql id="plant">
id, name, description, plant_type_id, plant_attribute_id, seed_id, id, name, description, plant_type_id, plant_attribute_id,
occupy_area, nursery_level, nursery_id, gardener_level, gardener_skill_id, occupy_area, nursery_level, nursery_id, gardener_level, gardener_skill_id,
near_plant_id, pet_id, cost_item_nums, fruit_id, fruit_num, near_plant_id, pet_id, cost_item_nums, fruit_id, fruit_num, fruit_seed_num,
fruit_times, fruit_mature_time, add_item_set_id, rarity_id, price, fruit_times, fruit_mature_time, drop_items, drop_nums, drop_probs, add_item_set_id, rarity_id, price,
spout_condition, fruit_condition, mature_condition, create_time, update_time spout_condition, fruit_condition, mature_condition, create_time, update_time
</sql> </sql>
<select id="searchAll" resultType="com.qiwuai.garden.pojo.PlantPojo"> <select id="searchAll" resultType="com.qiwuai.garden.pojo.PlantPojo">
...@@ -19,16 +19,16 @@ ...@@ -19,16 +19,16 @@
<insert id="add"> <insert id="add">
insert into plant ( insert into plant (
name, description, plant_type_id, plant_attribute_id, seed_id, name, description, plant_type_id, plant_attribute_id,
occupy_area, nursery_level, nursery_id, gardener_level, gardener_skill_id, occupy_area, nursery_level, nursery_id, gardener_level, gardener_skill_id,
near_plant_id, pet_id, cost_item_nums, fruit_id, fruit_num, near_plant_id, pet_id, cost_item_nums, fruit_id, fruit_num, fruit_seed_num,
fruit_times, fruit_mature_time, add_item_set_id, rarity_id, price, fruit_times, fruit_mature_time, drop_items, drop_nums, drop_probs, add_item_set_id, rarity_id, price,
spout_condition, fruit_condition, mature_condition, create_time, update_time spout_condition, fruit_condition, mature_condition, create_time, update_time
) values ( ) values (
#{name},#{description},#{plantTypeId},#{plantAttributeId}, #{seedId}, #{name},#{description},#{plantTypeId},#{plantAttributeId},
#{occupyArea},#{nurseryLevel},#{nurseryId}, #{gardenerLevel}, #{gardenerSkillId}, #{occupyArea},#{nurseryLevel},#{nurseryId}, #{gardenerLevel}, #{gardenerSkillId},
#{nearPlantId},#{petId},#{costItemNums},#{fruitId},#{fruitNum}, #{nearPlantId},#{petId},#{costItemNums},#{fruitId},#{fruitNum}, {fruitSeedNum},
#{fruitTimes}, #{fruitMatureTime},#{addItemSetId},#{rarityId},#{price}, #{fruitTimes},#{fruitMatureTime},#{dropItems},#{dropNums},#{dropProbs},#{addItemSetId},#{rarityId},#{price},
#{spoutCondition},#{fruitCondition},#{matureCondition},#{createTime},#{updateTime} #{spoutCondition},#{fruitCondition},#{matureCondition},#{createTime},#{updateTime}
) )
</insert> </insert>
......
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