|
@@ -12,7 +12,6 @@ import com.ruoyi.demo.entity.vo.*;
|
|
|
import com.ruoyi.demo.mapper.*;
|
|
|
import com.ruoyi.demo.service.PlanService;
|
|
|
import com.ruoyi.demo.utils.SignUtil;
|
|
|
-import com.ruoyi.demo.utils.StateUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
@@ -45,6 +44,8 @@ public class PlanServiceImpl implements PlanService {
|
|
|
AddrCategoryMapper addrCategoryMapper;
|
|
|
@Autowired
|
|
|
EquipmentMapper equipmentMapper;
|
|
|
+ @Autowired
|
|
|
+ GoodsMapper goodsMapper;
|
|
|
|
|
|
@Override
|
|
|
public int addPlan(PlanAddBo bo) {
|
|
@@ -77,6 +78,15 @@ public class PlanServiceImpl implements PlanService {
|
|
|
PlanItem item = new PlanItem(plan.getPlanId(), itemAddBo);
|
|
|
planItemMapper.insert(item);
|
|
|
}
|
|
|
+ // 插入商品信息
|
|
|
+ QueryWrapper<Goods> goodsQueryWrapper = new QueryWrapper<>();
|
|
|
+ goodsQueryWrapper.eq("appkey",bo.getAppkey());
|
|
|
+ goodsQueryWrapper.eq("goods_id",bo.getGoodsId());
|
|
|
+ Goods query = goodsMapper.selectOne(goodsQueryWrapper);
|
|
|
+ if (query == null){
|
|
|
+ Goods goods = new Goods(plan);
|
|
|
+ goodsMapper.insert(goods);
|
|
|
+ }
|
|
|
return 1;
|
|
|
}
|
|
|
|