Commit ef68f6f4 by chamberone

fix: 处理orderid重复问题

1 parent 7ea6b402
...@@ -19,4 +19,6 @@ public interface OrderInfoRepository extends CrudRepository<OrderInfo, Long> { ...@@ -19,4 +19,6 @@ public interface OrderInfoRepository extends CrudRepository<OrderInfo, Long> {
List<OrderInfo> findByOrgTeamIdAndDt(String teamId, LocalDate dt); List<OrderInfo> findByOrgTeamIdAndDt(String teamId, LocalDate dt);
List<OrderInfo> findByOrgGroupIdAndDt(String groupId, LocalDate dt);
} }
...@@ -86,7 +86,7 @@ public class BatchServiceImpl implements BatchService { ...@@ -86,7 +86,7 @@ public class BatchServiceImpl implements BatchService {
// FIXME 因为系统暂时没有订单,每次固定拉取2023-08-13号订单数据生成新订单 // FIXME 因为系统暂时没有订单,每次固定拉取2023-08-13号订单数据生成新订单
LocalDate localDt = LocalDate.parse(batchDay, DateTimeFormatter.ofPattern("yyyy-MM-dd")); LocalDate localDt = LocalDate.parse(batchDay, DateTimeFormatter.ofPattern("yyyy-MM-dd"));
List<OrderInfo> orders = orderInfoRepository.findByOrgTeamIdAndDt(groupId, localDt); List<OrderInfo> orders = orderInfoRepository.findByOrgGroupIdAndDt(groupId, localDt);
if (CollectionUtils.isEmpty(orders)) { if (CollectionUtils.isEmpty(orders)) {
String tempDay = "2023-08-13"; String tempDay = "2023-08-13";
String createOrder = "INSERT INTO order_info (\r\n" + " order_id,\r\n" + " dt,\r\n" + " sub_id,\r\n" String createOrder = "INSERT INTO order_info (\r\n" + " order_id,\r\n" + " dt,\r\n" + " sub_id,\r\n"
...@@ -102,7 +102,7 @@ public class BatchServiceImpl implements BatchService { ...@@ -102,7 +102,7 @@ public class BatchServiceImpl implements BatchService {
+ " engineer_phone,\r\n" + " engineer_code_sub,\r\n" + " plan_start_time,\r\n" + " engineer_phone,\r\n" + " engineer_code_sub,\r\n" + " plan_start_time,\r\n"
+ " plan_end_time,\r\n" + " arrive_elapsed,\r\n" + " arrive_distance,\r\n" + " plan_end_time,\r\n" + " arrive_elapsed,\r\n" + " arrive_distance,\r\n"
+ " actual_start_time,\r\n" + " actual_end_time,\r\n" + " description,\r\n" + " extra_info,\r\n" + " actual_start_time,\r\n" + " actual_end_time,\r\n" + " description,\r\n" + " extra_info,\r\n"
+ " create_time,\r\n" + " update_time\r\n" + ") \r\n" + "SELECT \r\n" + " order_id,\r\n" + " '" + " create_time,\r\n" + " update_time\r\n" + ") \r\n" + "SELECT \r\n" + " CONCAT(order_id,'" + batchDay + "') order_id,\r\n" + " '"
+ batchDay + "',\r\n" + " sub_id,\r\n" + " NAME,\r\n" + " phone,\r\n" + " province,\r\n" + batchDay + "',\r\n" + " sub_id,\r\n" + " NAME,\r\n" + " phone,\r\n" + " province,\r\n"
+ " city,\r\n" + " county,\r\n" + " address,\r\n" + " X,\r\n" + " Y,\r\n" + " bean_brand,\r\n" + " city,\r\n" + " county,\r\n" + " address,\r\n" + " X,\r\n" + " Y,\r\n" + " bean_brand,\r\n"
+ " brand,\r\n" + " TYPE,\r\n" + " skill,\r\n" + " take_time,\r\n" + " is_workshop,\r\n" + " brand,\r\n" + " TYPE,\r\n" + " skill,\r\n" + " take_time,\r\n" + " is_workshop,\r\n"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!