Compare commits
15 Commits
james-patc
...
main
Author | SHA1 | Date | |
---|---|---|---|
c7eee5aab3 | |||
1467b268c2 | |||
be1b8723ee | |||
cb143f753e | |||
a7f7fc6f9f | |||
88cc5aea80 | |||
becd0a1a40 | |||
74d0818775 | |||
33948a0bac | |||
7acea7ef56 | |||
74d953b425 | |||
082a69eafe | |||
9fedd3ab6f | |||
8fbcd0cc40 | |||
4cac14d361 |
@ -6,14 +6,18 @@ on:
|
||||
- main
|
||||
- develop
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths-ignore:
|
||||
- '.gitea/**'
|
||||
|
||||
jobs:
|
||||
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:
|
||||
- name: Checkout code
|
||||
- name: Checkout code2
|
||||
uses: http://119.91.43.128:3003/james/checkout@v4
|
||||
with:
|
||||
fetch-depth: 2 # 至少获取最近两次提交
|
||||
|
@ -25,7 +25,7 @@ class CheckBomInfo
|
||||
|
||||
//2.判断工序单元、设备编码是存在?
|
||||
$sql = "SELECT id FROM hf_mes_process_workingsubclass WHERE code='".$workingsubclass."'";
|
||||
$ret = Db::fetch($sql2);
|
||||
$ret = Db::fetch($sql);
|
||||
if(empty($ret)){
|
||||
throw new Exception("工序单元[$workingsubclass]不存在",4001);
|
||||
}
|
||||
|
@ -123,15 +123,16 @@ class SetWipOutput
|
||||
}
|
||||
$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 (isset($process[$key + 1])) {
|
||||
$next_process_code = $process[$key + 1][2];
|
||||
if (isset($ret_process[$key + 1])) {
|
||||
$next_process_code = $ret_process[$key + 1][2];
|
||||
}
|
||||
$process_code = $val[2];
|
||||
}
|
||||
}
|
||||
|
||||
//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
|
||||
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都是唯一的
|
||||
$forward_tracing_uuid_only[] = 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));
|
||||
$forward_tracing_uuid = json_encode(array_unique(array_merge($forward_tracing_uuid, [generateUniqueId()])));
|
||||
|
||||
$wip_uuid = count($wip_uuid) <= 0 ? $uuid : json_encode(array_values(array_unique($wip_uuid)));
|
||||
$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');
|
||||
$finish_time = isset($param_out['FINISH_TIME']) ? $param_out['FINISH_TIME'] : date('Y-m-d H:i:s');
|
||||
$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]) {
|
||||
throw new Exception("获取物料批次条码失败!" . $wip_msg[1]);
|
||||
} else {
|
||||
$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表
|
||||
//返回需要使用的数据
|
||||
$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表
|
||||
$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(
|
||||
"('%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,
|
||||
'-1',
|
||||
$lot,
|
||||
1,
|
||||
$process_code,
|
||||
$next_process_code,
|
||||
$bom_relationship_array['bom_source_code'],
|
||||
$bom_relationship_array['bom_source_name'],
|
||||
$battery_id,
|
||||
|
Loading…
x
Reference in New Issue
Block a user