|
@@ -1,18 +1,20 @@
|
|
|
package com.tour.module.service.impl;
|
|
|
|
|
|
import com.tour.module.domain.Agent;
|
|
|
+import com.tour.module.domain.Card;
|
|
|
import com.tour.module.service.IAgentService;
|
|
|
+import com.tour.module.service.ICardService;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
-import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
-import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.tour.module.mapper.MakeCardAllocationMapper;
|
|
|
import com.tour.module.domain.MakeCardAllocation;
|
|
|
import com.tour.module.service.IMakeCardAllocationService;
|
|
|
+import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
|
import java.util.Objects;
|
|
|
+import java.util.concurrent.atomic.AtomicBoolean;
|
|
|
|
|
|
/**
|
|
|
* 制卡分配情况Service业务层处理
|
|
@@ -25,7 +27,8 @@ public class MakeCardAllocationServiceImpl extends ServiceImpl<MakeCardAllocatio
|
|
|
|
|
|
@Resource
|
|
|
private IAgentService iAgentService;
|
|
|
-
|
|
|
+ @Resource
|
|
|
+ ICardService iCardService;
|
|
|
@Override
|
|
|
public List<MakeCardAllocation> queryList(MakeCardAllocation makeCardAllocation) {
|
|
|
List<MakeCardAllocation> list = baseMapper.queryList(makeCardAllocation);
|
|
@@ -39,7 +42,21 @@ public class MakeCardAllocationServiceImpl extends ServiceImpl<MakeCardAllocatio
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public void saveMakeCardAllocation(MakeCardAllocation MakeCardAllocation) {
|
|
|
-
|
|
|
+ public boolean saveMakeCardAllocation(List<MakeCardAllocation> list) {
|
|
|
+ AtomicBoolean result= new AtomicBoolean(false);
|
|
|
+ if(!CollectionUtils.isEmpty(list)){
|
|
|
+ this.saveBatch(list);
|
|
|
+ list.forEach(i-> {
|
|
|
+ List<Card> cards= iCardService.selectByNum(1L,i.getNum());
|
|
|
+ if(!CollectionUtils.isEmpty(cards)){
|
|
|
+ cards.forEach(item ->{
|
|
|
+ item.setAgentId(i.getAgentId());
|
|
|
+ });
|
|
|
+ result.set(iCardService.updateBatchById(cards));
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return result.get();
|
|
|
+ }
|
|
|
+ return false;
|
|
|
}
|
|
|
}
|