|
@@ -10,8 +10,10 @@ import com.alipay.api.domain.OrderItem;
|
|
|
import me.zhengjie.config.rabbitmq.cuisine.CuisineProduce;
|
|
|
import me.zhengjie.config.rabbitmq.order.OrderProduce;
|
|
|
import me.zhengjie.modules.dm.daypc.domain.DmDayPc;
|
|
|
+import me.zhengjie.modules.dm.daypc.repository.DmDayPcRepository;
|
|
|
import me.zhengjie.modules.dm.daypc.service.DmDayPcService;
|
|
|
import me.zhengjie.modules.dm.food.domain.DmFood;
|
|
|
+import me.zhengjie.modules.dm.food.repository.DmFoodRepository;
|
|
|
import me.zhengjie.modules.dm.food.service.DmFoodService;
|
|
|
import me.zhengjie.modules.dm.foodCate.domain.DmFoodCate;
|
|
|
import me.zhengjie.modules.dm.order.domain.DmOrderItem;
|
|
@@ -32,9 +34,9 @@ import java.util.UUID;
|
|
|
@Component
|
|
|
public class ListenerTemplate {
|
|
|
@Autowired
|
|
|
- DmDayPcService dmDayPcService;
|
|
|
+ DmDayPcRepository dmDayPcRepository;
|
|
|
@Autowired
|
|
|
- DmFoodService dmFoodService;
|
|
|
+ DmFoodRepository dmFoodRepository;
|
|
|
// @Autowired
|
|
|
// DmOrderRecordService dmOrderRecordService;
|
|
|
// @Autowired
|
|
@@ -56,7 +58,6 @@ public class ListenerTemplate {
|
|
|
Snowflake snowflake = IdUtil.createSnowflake(1, 1);
|
|
|
JSONObject attendance = array.getJSONObject(i);
|
|
|
DmDayPc dmDayPc = new DmDayPc();
|
|
|
-
|
|
|
dmDayPc.setId(snowflake.nextId());
|
|
|
dmDayPc.setCpid(attendance.getLong("id"));
|
|
|
dmDayPc.setTimes(attendance.getString("times"));
|
|
@@ -80,7 +81,7 @@ public class ListenerTemplate {
|
|
|
dmDayPc.setSeq(seq);
|
|
|
dmDayPc.setDate(new Timestamp(System.currentTimeMillis()));
|
|
|
|
|
|
- dmDayPcService.create(dmDayPc);
|
|
|
+ dmDayPcRepository.save(dmDayPc);
|
|
|
System.out.println("新增dmDayPc===" + dmDayPc);
|
|
|
DmFood dmFood = new DmFood();
|
|
|
dmFood.setId(dmDayPc.getPid());
|
|
@@ -89,7 +90,7 @@ public class ListenerTemplate {
|
|
|
dmFood.setType(dmDayPc.getCate());//.toString()
|
|
|
// dmFood.setCateName(dmDayPc.getCateName());
|
|
|
dmFood.setPstate(dmDayPc.getPstate());
|
|
|
- dmFoodService.create(dmFood);
|
|
|
+ dmFoodRepository.save(dmFood);
|
|
|
}
|
|
|
}catch (Exception ex){
|
|
|
ex.printStackTrace();
|