|
|
@@ -19,14 +19,12 @@ import com.cyksj.mapper.*;
|
|
|
import com.cyksj.mapper.manage.exchange.ExchangeCodeMapper;
|
|
|
import com.cyksj.model.entity.*;
|
|
|
import com.cyksj.model.excel.ExcelExchangeCodeData;
|
|
|
-import com.cyksj.model.manage.views.AccountView;
|
|
|
import com.cyksj.model.request.ExchangeCodeReq;
|
|
|
import com.cyksj.model.request.ExchangeCodeTicket;
|
|
|
import com.cyksj.redis.RedisService;
|
|
|
import com.cyksj.service.exchange.ExchangeCodeService;
|
|
|
import com.cyksj.service.relation.GroupRelationFrontService;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
-import com.ejlchina.searcher.util.MapUtils;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
@@ -328,50 +326,4 @@ public class ExchangeCodeServiceImpl extends ServiceImpl<ExchangeCodeMapper, Exc
|
|
|
throw BusinessRuntimeException.getInstance(I18nMessageUtil.getI18nMsg("sys_busy_error"));
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增新车位并关联车位
|
|
|
- */
|
|
|
- private GroupsRelation createNewGroupTripsAndRelation(GoodsDonSku sku, GroupsTrips groups, GroupsRelation relation) {
|
|
|
- //通过兑换码兑换车票 新增车位
|
|
|
- if (groups == null) {
|
|
|
- groups = new GroupsTrips();
|
|
|
- }
|
|
|
- //补充占位
|
|
|
- if (relation == null) {
|
|
|
- relation = new GroupsRelation();
|
|
|
- }
|
|
|
- groups.setSkuId(sku.getId());
|
|
|
- groups.setNum(sku.getNum());
|
|
|
- groups.setAvailableNum(sku.getNum());
|
|
|
- if (sku.getGoodsId() == 23) {
|
|
|
- AccountView accountView = beanSearcher.searchFirst(AccountView.class, MapUtils.builder().field(AccountView::getGoodsId, 23).onlySelect(AccountView::getId).build());
|
|
|
- if (accountView != null) {
|
|
|
- groups.setAccountId(accountView.getId());
|
|
|
- groups.setStatus(GroupsTrips.Status.validity);
|
|
|
- groups.setRemark("已设置唯一账号");
|
|
|
- }else {
|
|
|
- groups.setStatus(GroupsTrips.Status.waiting);
|
|
|
- groups.setRemark("等待设置账号");
|
|
|
- }
|
|
|
- } else {
|
|
|
- groups.setStatus(GroupsTrips.Status.waiting);
|
|
|
- groups.setRemark("等待设置账号");
|
|
|
- }
|
|
|
- groupsMapper.insert(groups);
|
|
|
- relation.setGroupsId(groups.getId());
|
|
|
- relation.setNum(1);
|
|
|
- relation.setStatus(GroupsRelation.Status.none);
|
|
|
- relation.setGroupsId(groups.getId());
|
|
|
- groupsRelationMapper.insert(relation);
|
|
|
- //补充其他占位
|
|
|
- for (int i = 2; i <= groups.getNum(); i++) {
|
|
|
- GroupsRelation groupsRelation = new GroupsRelation();
|
|
|
- groupsRelation.setGroupsId(groups.getId());
|
|
|
- groupsRelation.setNum(i);
|
|
|
- groupsRelation.setStatus(GroupsRelation.Status.none);
|
|
|
- groupsRelationMapper.insert(groupsRelation);
|
|
|
- }
|
|
|
- return relation;
|
|
|
- }
|
|
|
}
|