【fix】修改为更改根据id修改记录状态

This commit is contained in:
nixj 2024-07-09 16:23:22 +08:00
parent 8a5eb3c098
commit d3dddf87af
6 changed files with 31 additions and 4 deletions

View File

@ -88,7 +88,7 @@ public class LYOrderRecordDomainService {
.map(it -> lyOrderRecordExtensionFactory.createFlightOrderRecord(it, collect.get(it.getOutApplayOrderNo()))) .map(it -> lyOrderRecordExtensionFactory.createFlightOrderRecord(it, collect.get(it.getOutApplayOrderNo())))
.toList(); .toList();
orderDetailDomainService.saveFlightOrderRecordBatch(orderFlightRecordList); orderDetailDomainService.saveFlightOrderRecordBatch(orderFlightRecordList);
jdbcLyOrderFlightRecord.updateStatusByNullStatus(); jdbcLyOrderFlightRecord.updateStatusByIds(orderFlightRecordList.stream().map(OrderFlightRecord::getId).toList());
count++; count++;
} while (count < LoopNum); } while (count < LoopNum);
//修改数据将状态为null的设置为1 //修改数据将状态为null的设置为1
@ -121,7 +121,7 @@ public class LYOrderRecordDomainService {
.map(it -> lyOrderRecordExtensionFactory.createHotelOrderRecord(it, collect.get(it.getOutApplayOrderNo()))) .map(it -> lyOrderRecordExtensionFactory.createHotelOrderRecord(it, collect.get(it.getOutApplayOrderNo())))
.toList(); .toList();
orderDetailDomainService.saveHotelOrderRecordBatch(orderHotelRecordList); orderDetailDomainService.saveHotelOrderRecordBatch(orderHotelRecordList);
jdbcLyOrderHotelRecord.updateStatusByNullStatus(); jdbcLyOrderHotelRecord.updateStatusByIds(orderHotelRecordList.stream().map(OrderHotelRecord::getId).toList());
count++; count++;
} while (count < LoopNum); } while (count < LoopNum);
//修改数据将状态为null的设置为1 //修改数据将状态为null的设置为1
@ -153,7 +153,7 @@ public class LYOrderRecordDomainService {
.map(it -> lyOrderRecordExtensionFactory.createTrainOrderRecord(it, collect.get(it.getOutApplayOrderNo()))) .map(it -> lyOrderRecordExtensionFactory.createTrainOrderRecord(it, collect.get(it.getOutApplayOrderNo())))
.toList(); .toList();
orderDetailDomainService.saveTrainOrderRecordBatch(orderTrainRecordList); orderDetailDomainService.saveTrainOrderRecordBatch(orderTrainRecordList);
jdbcLyOrderTrainRecord.updateStatusByNullStatus(); jdbcLyOrderTrainRecord.updateStatusByIds(orderTrainRecordList.stream().map(OrderTrainRecord::getId).toList());
count++; count++;
} while (count < LoopNum); } while (count < LoopNum);
//修改数据将状态为null的设置为1 //修改数据将状态为null的设置为1
@ -187,7 +187,7 @@ public class LYOrderRecordDomainService {
.map(it -> lyOrderRecordExtensionFactory.createCarOrderRecord(it, collect.get(it.getOutApplayOrderNo()))) .map(it -> lyOrderRecordExtensionFactory.createCarOrderRecord(it, collect.get(it.getOutApplayOrderNo())))
.toList(); .toList();
orderDetailDomainService.saveCarOrderRecordBatch(orderCarRecordList); orderDetailDomainService.saveCarOrderRecordBatch(orderCarRecordList);
jdbcLyOrderCarRecord.updateStatusByNullStatus(); jdbcLyOrderCarRecord.updateStatusByIds(orderCarRecordList.stream().map(OrderCarRecord::getId).toList());
count++; count++;
} while (count < LoopNum); } while (count < LoopNum);
//修改数据将状态为null的设置为1 //修改数据将状态为null的设置为1

View File

@ -23,4 +23,8 @@ public interface JdbcLyOrderCarRecord extends CrudRepository<LyOrderCarRecord, L
@Modifying @Modifying
@Query("UPDATE ly_order_car_record l SET l.status = 1 WHERE l.status IS NULL") @Query("UPDATE ly_order_car_record l SET l.status = 1 WHERE l.status IS NULL")
void updateStatusByNullStatus(); void updateStatusByNullStatus();
@Modifying
@Query("UPDATE ly_order_car_record SET status = 1 WHERE id IN (:#{#ids})")
void updateStatusByIds(@Param("ids") List<Long> ids);
} }

View File

@ -23,4 +23,8 @@ public interface JdbcLyOrderFlightRecord extends CrudRepository<LyOrderFlightRec
@Modifying @Modifying
@Query("UPDATE ly_order_flight_record l SET l.status = 1 WHERE l.status IS NULL") @Query("UPDATE ly_order_flight_record l SET l.status = 1 WHERE l.status IS NULL")
void updateStatusByNullStatus(); void updateStatusByNullStatus();
@Modifying
@Query("UPDATE ly_order_flight_record SET status = 1 WHERE id IN (:#{#ids})")
void updateStatusByIds(@Param("ids") List<Long> ids);
} }

View File

@ -24,4 +24,8 @@ public interface JdbcLyOrderHotelRecord extends CrudRepository<LyOrderHotelRecor
@Modifying @Modifying
@Query("UPDATE ly_order_hotel_record l SET l.status = 1 WHERE l.status IS NULL") @Query("UPDATE ly_order_hotel_record l SET l.status = 1 WHERE l.status IS NULL")
void updateStatusByNullStatus(); void updateStatusByNullStatus();
@Modifying
@Query("UPDATE ly_order_hotel_record SET status = 1 WHERE id IN (:#{#ids})")
void updateStatusByIds(@Param("ids") List<Long> ids);
} }

View File

@ -23,4 +23,8 @@ public interface JdbcLyOrderTrainRecord extends CrudRepository<LyOrderTrainRecor
@Modifying @Modifying
@Query("UPDATE ly_order_train_record l SET l.status = 1 WHERE l.status IS NULL") @Query("UPDATE ly_order_train_record l SET l.status = 1 WHERE l.status IS NULL")
void updateStatusByNullStatus(); void updateStatusByNullStatus();
@Modifying
@Query("UPDATE ly_order_train_record SET status = 1 WHERE id IN (:#{#ids})")
void updateStatusByIds(@Param("ids") List<Long> ids);
} }

View File

@ -59,6 +59,7 @@ import com.chint.interfaces.rest.ly.reconciliation.request.ReqStatement;
import com.google.gson.Gson; import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken; import com.google.gson.reflect.TypeToken;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContext;
@ -97,6 +98,16 @@ public class ExcelTest {
@Autowired @Autowired
private JdbcSystemLogRepository jdbcSystemLogRepository; private JdbcSystemLogRepository jdbcSystemLogRepository;
@Test
public void excelTest() {
List<Long> ids=new ArrayList<>();
ids.add(1L);
ids.add(2L);
jdbcLyOrderFlightRecord.updateStatusByIds(ids);
jdbcLyOrderHotelRecord.updateStatusByIds(ids);
jdbcLyOrderTrainRecord.updateStatusByIds(ids);
jdbcLyOrderCarRecord.updateStatusByIds(ids);
}
// @Test // @Test
// 集团员工数据导入 // 集团员工数据导入