Files
huachuang/sql/mysql/system_kingdee_push_user.sql

27 lines
1.3 KiB
SQL
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- 金蝶推送标识用户,仅用于业务数据创建人/更新人展示,不允许登录。
-- 执行前需确认 ID=4 和 username=user4 均未被其他用户占用。
INSERT INTO system_users
(id, username, password, nickname, remark, dept_id, post_ids, email, mobile,
sex, avatar, status, login_ip, login_date, creator, create_time, updater,
update_time, deleted, tenant_id)
SELECT 4, 'user4', '!', '金蝶推送', '外部金蝶系统自动推送标识用户', NULL, '[]', '', '',
0, '', 1, '', NULL, '1', NOW(), '1', NOW(), b'0', 1
WHERE NOT EXISTS (
SELECT 1 FROM system_users WHERE id = 4 OR username = 'user4'
);
-- 修复历史金蝶自动入库单的创建人显示。
UPDATE wms_iostorinv
SET creator = '4',
updater = CASE WHEN updater IS NULL OR updater = '' OR updater = '0' THEN '4' ELSE updater END
WHERE io_type = '0'
AND source_type IS NOT NULL AND source_type != ''
AND source_name IS NOT NULL AND source_name != ''
AND (creator IS NULL OR creator = '' OR creator = '0');
-- 旧版本组盘记录曾使用非数字 user4,统一修正为系统用户 ID。
UPDATE wms_group_plate
SET creator = CASE WHEN creator = 'user4' THEN '4' ELSE creator END,
updater = CASE WHEN updater = 'user4' THEN '4' ELSE updater END
WHERE creator = 'user4' OR updater = 'user4';