Compare commits

..

15 Commits

Author SHA1 Message Date
c7eee5aab3 Merge pull request '更新 .gitea/workflows/test.yml' (#18) from james-patch-10 into main
Some checks failed
Run Unit Tests / test (push) Has been cancelled
Reviewed-on: #18
2025-06-19 10:42:48 +08:00
1467b268c2 更新 .gitea/workflows/test.yml 2025-06-19 10:41:35 +08:00
be1b8723ee Merge pull request '更新 .gitea/workflows/test.yml' (#17) from james-patch-101 into main
Some checks failed
Run Unit Tests / test (push) Has been cancelled
Reviewed-on: #17
2025-06-19 10:40:47 +08:00
cb143f753e 更新 .gitea/workflows/test.yml 2025-06-19 10:39:59 +08:00
hui
a7f7fc6f9f Merge pull request ' feat(更新yml文件):' (#12) from feat/yml into main
All checks were successful
Run Unit Tests / test (push) Successful in 3s
Reviewed-on: #12
2025-06-16 11:01:37 +08:00
hui
88cc5aea80 feat(更新yml文件):
All checks were successful
Run Unit Tests / test (pull_request) Successful in 4s
2025-06-16 11:00:06 +08:00
hui
becd0a1a40 Merge pull request '🐎 ci(ci多文件提交检测):' (#11) from bug/tao_version into main
All checks were successful
Run Unit Tests / test (push) Successful in 5s
Reviewed-on: #11
2025-06-16 10:48:56 +08:00
hui
74d0818775 🐎 ci(更新测试):
All checks were successful
Run Unit Tests / test (pull_request) Successful in 5s
2025-06-16 10:48:33 +08:00
hui
33948a0bac 🐎 ci(ci多文件提交检测):
Some checks failed
Run Unit Tests / test (pull_request) Failing after 13s
2025-06-16 10:25:52 +08:00
7acea7ef56 Merge pull request '更新 .gitea/workflows/test.yml' (#9) from james-patch-yml-ai-code-reviewer-v1.2 into main
All checks were successful
Run Unit Tests / test (push) Successful in 3s
Reviewed-on: #9
2025-06-15 15:00:04 +08:00
74d953b425 更新 .gitea/workflows/test.yml
All checks were successful
Run Unit Tests / test (pull_request) Successful in 12s
2025-06-15 14:59:36 +08:00
hui
082a69eafe Merge pull request '🐎 ci(ci更新2):' (#6) from bug/tao_version into main
All checks were successful
Run Unit Tests / test (push) Successful in 6s
Reviewed-on: #6
2025-06-15 10:19:18 +08:00
hui
9fedd3ab6f 🐎 ci(ci更新2):
All checks were successful
Run Unit Tests / test (pull_request) Successful in 5s
2025-06-15 10:17:48 +08:00
hui
8fbcd0cc40 Merge pull request '🐎 ci(ci更新):' (#5) from bug/tao_version into main
All checks were successful
Run Unit Tests / test (push) Successful in 5s
Reviewed-on: #5
2025-06-15 10:16:49 +08:00
hui
4cac14d361 🐎 ci(ci更新):
All checks were successful
Run Unit Tests / test (pull_request) Successful in 5s
2025-06-15 10:08:38 +08:00
2 changed files with 23 additions and 16 deletions

View File

@ -6,14 +6,18 @@ on:
- main - main
- develop - develop
pull_request: pull_request:
branches:
- main
paths-ignore:
- '.gitea/**'
jobs: jobs:
test: test:
runs-on: phpunit_test runs-on: phpunit_test
container: docker.xuanyuan.me/xeden3/ai-code-reviewer-gitea-runner:v1 container: docker.xuanyuan.me/xeden3/ai-code-reviewer-gitea-runner:v1.2
steps: steps:
- name: Checkout code - name: Checkout code2
uses: http://119.91.43.128:3003/james/checkout@v4 uses: http://119.91.43.128:3003/james/checkout@v4
with: with:
fetch-depth: 2 # 至少获取最近两次提交 fetch-depth: 2 # 至少获取最近两次提交

View File

@ -123,15 +123,16 @@ class SetWipOutput
} }
$subbatch = $ret['subbatch']; $subbatch = $ret['subbatch'];
// 拿到工序编码 // 拿到工序编码
foreach (json_decode($ret['process'], true) as $key => $val) { $ret_process = json_decode($ret['process'], true);
// 拿到工序编码
foreach ($ret_process as $key => $val) {
if ($val[4] == $workingsubclass) { if ($val[4] == $workingsubclass) {
if (isset($process[$key + 1])) { if (isset($ret_process[$key + 1])) {
$next_process_code = $process[$key + 1][2]; $next_process_code = $ret_process[$key + 1][2];
} }
$process_code = $val[2]; $process_code = $val[2];
} }
} }
//4.通过以上关联信息查询物料编码 //4.通过以上关联信息查询物料编码
$sql = "SELECT a.flow_id,e.code as bom_source_code,e.name as bom_source_name,d.bom_source_id,d.bom_id,f.code as bom_source_category_code FROM hf_mes_production_planning_management_batch a $sql = "SELECT a.flow_id,e.code as bom_source_code,e.name as bom_source_name,d.bom_source_id,d.bom_id,f.code as bom_source_category_code FROM hf_mes_production_planning_management_batch a
INNER JOIN hf_mes_technology_flow b ON a.flow_id = b.id INNER JOIN hf_mes_technology_flow b ON a.flow_id = b.id
@ -321,24 +322,25 @@ class SetWipOutput
$uuid = json_encode(array_unique($uuid)); $uuid = json_encode(array_unique($uuid));
} }
//保证每个正向追溯的uuid都是唯一的 //保证每个正向追溯的uuid都是唯一的
$forward_tracing_uuid_only[] = generateUniqueId(); $forward_tracing_uuid = json_encode(array_unique(array_merge($forward_tracing_uuid, [generateUniqueId()])));
$forward_tracing_uuid_only = json_encode($forward_tracing_uuid_only);
$decoded_uuid = json_decode($forward_tracing_uuid_only, true);
if (is_array($decoded_uuid)) {
$forward_tracing_uuid = array_merge($forward_tracing_uuid, $decoded_uuid);
}
$forward_tracing_uuid = json_encode(array_unique($forward_tracing_uuid));
$wip_uuid = count($wip_uuid) <= 0 ? $uuid : json_encode(array_values(array_unique($wip_uuid))); $wip_uuid = count($wip_uuid) <= 0 ? $uuid : json_encode(array_values(array_unique($wip_uuid)));
$now_date = date('Y-m-d H:i:s'); $now_date = date('Y-m-d H:i:s');
$start_time = $last_time; //isset($param_out['START_TIME'])? $param_out['START_TIME'] : date('Y-m-d H:i:s'); $start_time = $last_time; //isset($param_out['START_TIME'])? $param_out['START_TIME'] : date('Y-m-d H:i:s');
$finish_time = isset($param_out['FINISH_TIME']) ? $param_out['FINISH_TIME'] : date('Y-m-d H:i:s'); $finish_time = isset($param_out['FINISH_TIME']) ? $param_out['FINISH_TIME'] : date('Y-m-d H:i:s');
$lot = strtotime($now_date); $lot = strtotime($now_date);
$wip_msg = generate_material_item_id_wip($workingsubclass, $device_code, $batch, $cut_list, $gun_count, $roller_press_batch); $wip_msg = generate_material_item_id_wip($workingsubclass, $device_code, $batch, $cut_list);
if (!$wip_msg[0]) { if (!$wip_msg[0]) {
throw new Exception("获取物料批次条码失败!" . $wip_msg[1]); throw new Exception("获取物料批次条码失败!" . $wip_msg[1]);
} else { } else {
$battery_id = $wip_msg[1]; $battery_id = $wip_msg[1];
} }
//判断物料批次条码是否已经存在于生产批次中如果存在则提示失败
$sql = 'SELECT id FROM "hf_mes_tmp_bkv_' . $subbatch . '" WHERE battery_id = \'' . $wip_msg[1] . '\' AND active = 1';
$ret = Db::fetch($sql);
if (!empty($ret)) {
throw new Exception("产出批次【$wip_msg[1]】已经激活了,不要重复产出!");
}
// 新增数据到process_log表 // 新增数据到process_log表
//返回需要使用的数据 //返回需要使用的数据
$data_list = array_merge($data_list, [$battery_id, $bom_relationship_array['bom_source_code'], $bom_relationship_array['bom_source_name'], $batch, $device_code]); $data_list = array_merge($data_list, [$battery_id, $bom_relationship_array['bom_source_code'], $bom_relationship_array['bom_source_name'], $batch, $device_code]);
@ -401,14 +403,15 @@ class SetWipOutput
} }
// 新增数据到bkv表 // 新增数据到bkv表
$wip_bkv_sql_head = 'INSERT INTO "hf_mes_tmp_bkv_' . $subbatch . '" (battery_id, tray, lot, active, process_code, item_code, item_name, item_batch, item_quantity, item_batch_start_time, pid, uuid, bom_source_id, bom_id, ' . implode(',', $sql_key_out_result_param) . ') VALUES '; $wip_bkv_sql_head = 'INSERT INTO "hf_mes_tmp_bkv_' . $subbatch . '" (battery_id, tray, lot, active, process_code, next_process_code, item_code, item_name, item_batch, item_quantity, item_batch_start_time, pid, uuid, bom_source_id, bom_id, ' . implode(',', $sql_key_out_result_param) . ') VALUES ';
$wip_bkv_sql_val = sprintf( $wip_bkv_sql_val = sprintf(
"('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s',%s)", "('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s',%s)",
$battery_id, $battery_id,
'-1', '-1',
$lot, $lot,
1, 1,
$process_code, $process_code,
$next_process_code,
$bom_relationship_array['bom_source_code'], $bom_relationship_array['bom_source_code'],
$bom_relationship_array['bom_source_name'], $bom_relationship_array['bom_source_name'],
$battery_id, $battery_id,