Commit 038fa185 by chamberone

feat: 去掉自动生成订单逻辑

1 parent c9e208f8
...@@ -84,45 +84,44 @@ public class BatchServiceImpl implements BatchService { ...@@ -84,45 +84,44 @@ public class BatchServiceImpl implements BatchService {
batchDay = optional.get().getBatchDate(); batchDay = optional.get().getBatchDate();
} }
// 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.findByOrgGroupIdAndDt(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" // + " NAME,\r\n" + " phone,\r\n" + " province,\r\n" + " city,\r\n" + " county,\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" + " brand,\r\n" + " TYPE,\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" + " fault_describe,\r\n"
+ " skill,\r\n" + " take_time,\r\n" + " is_workshop,\r\n" + " fault_describe,\r\n" // + " apply_note,\r\n" + " expect_time_begin,\r\n" + " expect_time_end,\r\n"
+ " apply_note,\r\n" + " expect_time_begin,\r\n" + " expect_time_end,\r\n" // + " expect_time_desc,\r\n" + " source,\r\n" + " bean_priority,\r\n" + " bean_tags,\r\n"
+ " expect_time_desc,\r\n" + " source,\r\n" + " bean_priority,\r\n" + " bean_tags,\r\n" // + " bean_status,\r\n" + " bean_sub_status,\r\n" + " area_id,\r\n" + " org_cluster_id,\r\n"
+ " bean_status,\r\n" + " bean_sub_status,\r\n" + " area_id,\r\n" + " org_cluster_id,\r\n" // + " org_branch_id,\r\n" + " org_group_id,\r\n" + " org_team_id,\r\n" + " priority,\r\n"
+ " org_branch_id,\r\n" + " org_group_id,\r\n" + " org_team_id,\r\n" + " priority,\r\n" // + " tags,\r\n" + " appointment_method,\r\n" + " appointment_status,\r\n" + " dispatcher,\r\n"
+ " tags,\r\n" + " appointment_method,\r\n" + " appointment_status,\r\n" + " dispatcher,\r\n" // + " order_status,\r\n" + " service_status,\r\n" + " engineer_code,\r\n" + " engineer_name,\r\n"
+ " order_status,\r\n" + " service_status,\r\n" + " engineer_code,\r\n" + " engineer_name,\r\n" // + " 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" + " CONCAT(order_id,'" + batchDay + "') 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" // + " fault_describe,\r\n" + " apply_note,\r\n" + " '" + batchDay + " 08:00:00' expect_time_begin,\r\n"
+ " fault_describe,\r\n" + " apply_note,\r\n" + " expect_time_begin,\r\n" // + " '" + batchDay + " 18:00:00' expect_time_end,\r\n" + " expect_time_desc,\r\n" + " source,\r\n" + " bean_priority,\r\n"
+ " expect_time_end,\r\n" + " expect_time_desc,\r\n" + " source,\r\n" + " bean_priority,\r\n" // + " bean_tags,\r\n" + " bean_status,\r\n" + " bean_sub_status,\r\n" + " area_id,\r\n"
+ " bean_tags,\r\n" + " bean_status,\r\n" + " bean_sub_status,\r\n" + " area_id,\r\n" // + " org_cluster_id,\r\n" + " org_branch_id,\r\n" + " org_group_id,\r\n" + " org_team_id,\r\n"
+ " org_cluster_id,\r\n" + " org_branch_id,\r\n" + " org_group_id,\r\n" + " org_team_id,\r\n" // + " priority,\r\n" + " tags,\r\n" + " appointment_method,\r\n" + " appointment_status,\r\n"
+ " priority,\r\n" + " tags,\r\n" + " appointment_method,\r\n" + " appointment_status,\r\n" // + " dispatcher,\r\n" + " order_status,\r\n" + " service_status,\r\n" + " null engineer_code,\r\n"
+ " dispatcher,\r\n" + " order_status,\r\n" + " service_status,\r\n" + " engineer_code,\r\n" // + " null engineer_name,\r\n" + " null engineer_phone,\r\n" + " null engineer_code_sub,\r\n"
+ " engineer_name,\r\n" + " engineer_phone,\r\n" + " engineer_code_sub,\r\n" // + " null plan_start_time,\r\n" + " null plan_end_time,\r\n" + " arrive_elapsed,\r\n"
+ " plan_start_time,\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"
+ " arrive_distance,\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"
+ " description,\r\n" + " extra_info,\r\n" + " create_time,\r\n" + " update_time \r\n" // + "FROM\r\n" + " order_info a \r\n" + "WHERE a.org_group_id = 'gsuzhou' \r\n" + " AND a.dt = '"
+ "FROM\r\n" + " order_info a \r\n" + "WHERE a.org_group_id = 'gsuzhou' \r\n" + " AND a.dt = '" // + tempDay + "' \r\n" + " AND bean_status = 'OPEN' \r\n"
+ tempDay + "' \r\n" + " AND bean_status = 'OPEN' \r\n" // + " AND appointment_method LIKE 'AUTO%' \r\n"
+ " AND appointment_method LIKE 'AUTO%' \r\n" // + " AND a.appointment_status IN ('INIT', 'PRE') \r\n" + " AND order_status = 'NORMAL' \r\n"
+ " AND a.appointment_status IN ('INIT', 'PRE') \r\n" + " AND order_status = 'NORMAL' \r\n" // + " AND service_status = 'INIT' \r\n" + "";
+ " AND service_status = 'INIT' \r\n" + ""; // int createCount = jdbcTemplate.update(createOrder);
int createCount = jdbcTemplate.update(createOrder); // }
}
log.info("清理原批次数据, groupId:{}, day:{}, batchNo:{}", groupId, batchDay, batchNo); log.info("清理原批次数据, groupId:{}, day:{}, batchNo:{}", groupId, batchDay, batchNo);
jdbcTemplate.update("delete from dispatch_engineer where group_id=? and batch_no=?", groupId, batchNo); jdbcTemplate.update("delete from dispatch_engineer where group_id=? and batch_no=?", groupId, batchNo);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!